@stellar/stellar-sdk 14.0.0 → 14.1.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/dist/stellar-sdk-minimal.js +166 -137
  3. package/dist/stellar-sdk-minimal.min.js +1 -1
  4. package/dist/stellar-sdk-no-axios.js +166 -137
  5. package/dist/stellar-sdk-no-axios.min.js +1 -1
  6. package/dist/stellar-sdk-no-eventsource.js +166 -137
  7. package/dist/stellar-sdk-no-eventsource.min.js +1 -1
  8. package/dist/stellar-sdk.js +166 -137
  9. package/dist/stellar-sdk.min.js +1 -1
  10. package/lib/contract/client.js +16 -107
  11. package/lib/contract/spec.d.ts +20 -1
  12. package/lib/contract/spec.js +41 -9
  13. package/lib/contract/utils.d.ts +1 -0
  14. package/lib/contract/utils.js +94 -6
  15. package/lib/horizon/horizon_axios_client.js +1 -1
  16. package/lib/minimal/contract/client.js +16 -107
  17. package/lib/minimal/contract/spec.d.ts +20 -1
  18. package/lib/minimal/contract/spec.js +41 -9
  19. package/lib/minimal/contract/utils.d.ts +1 -0
  20. package/lib/minimal/contract/utils.js +94 -6
  21. package/lib/minimal/horizon/horizon_axios_client.js +1 -1
  22. package/lib/minimal/rpc/axios.js +1 -1
  23. package/lib/no-axios/contract/client.js +16 -107
  24. package/lib/no-axios/contract/spec.d.ts +20 -1
  25. package/lib/no-axios/contract/spec.js +41 -9
  26. package/lib/no-axios/contract/utils.d.ts +1 -0
  27. package/lib/no-axios/contract/utils.js +94 -6
  28. package/lib/no-axios/horizon/horizon_axios_client.js +1 -1
  29. package/lib/no-axios/rpc/axios.js +1 -1
  30. package/lib/no-eventsource/contract/client.js +16 -107
  31. package/lib/no-eventsource/contract/spec.d.ts +20 -1
  32. package/lib/no-eventsource/contract/spec.js +41 -9
  33. package/lib/no-eventsource/contract/utils.d.ts +1 -0
  34. package/lib/no-eventsource/contract/utils.js +94 -6
  35. package/lib/no-eventsource/horizon/horizon_axios_client.js +1 -1
  36. package/lib/no-eventsource/rpc/axios.js +1 -1
  37. package/lib/rpc/axios.js +1 -1
  38. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see stellar-sdk-minimal.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("StellarSdk",[],t):"object"==typeof exports?exports.StellarSdk=t():e.StellarSdk=t()}(self,()=>(()=>{var e={76:(e,t,r)=>{"use strict";var n;r.d(t,{j:()=>n}),function(e){var t=function(e){return e.SUCCESS="SUCCESS",e.NOT_FOUND="NOT_FOUND",e.FAILED="FAILED",e}({});function r(e){return"transactionData"in e}e.GetTransactionStatus=t,e.isSimulationError=function(e){return"error"in e},e.isSimulationSuccess=r,e.isSimulationRestore=function(e){return r(e)&&"restorePreamble"in e&&!!e.restorePreamble.transactionData},e.isSimulationRaw=function(e){return!e._parsed}}(n||(n={}))},121:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}r.d(t,{A:()=>c});var a,s,u,c=(a=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},u=[{key:"validateTimebounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e.timeBounds)return!1;var r=Math.floor(Date.now()/1e3),n=e.timeBounds,o=n.minTime,i=n.maxTime;return r>=Number.parseInt(o,10)-t&&r<=Number.parseInt(i,10)+t}},{key:"sleep",value:function(e){return new Promise(function(t){return setTimeout(t,e)})}}],(s=null)&&o(a.prototype,s),u&&o(a,u),Object.defineProperty(a,"prototype",{writable:!1}),a)},127:function(e,t,r){var n,o,i;!function(a,s){"use strict";e.exports?e.exports=s(r(193)):(o=[r(193)],void 0===(i="function"==typeof(n=s)?n.apply(t,o):n)||(e.exports=i))}(0,function(e,t){"use strict";var r=t&&t.URITemplate,n=Object.prototype.hasOwnProperty;function o(e){return o._cache[e]?o._cache[e]:this instanceof o?(this.expression=e,o._cache[e]=this,this):new o(e)}function i(e){this.data=e,this.cache={}}var a=o.prototype,s={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encode"},"+":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},"#":{prefix:"#",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},".":{prefix:".",separator:".",named:!1,empty_name_separator:!1,encode:"encode"},"/":{prefix:"/",separator:"/",named:!1,empty_name_separator:!1,encode:"encode"},";":{prefix:";",separator:";",named:!0,empty_name_separator:!1,encode:"encode"},"?":{prefix:"?",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"},"&":{prefix:"&",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};return o._cache={},o.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g,o.VARIABLE_PATTERN=/^([^*:.](?:\.?[^*:.])*)((\*)|:(\d+))?$/,o.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_.]/,o.LITERAL_PATTERN=/[<>{}"`^| \\]/,o.expand=function(e,t,r){var n,i,a,u=s[e.operator],c=u.named?"Named":"Unnamed",l=e.variables,f=[];for(a=0;i=l[a];a++){if(0===(n=t.get(i.name)).type&&r&&r.strict)throw new Error('Missing expansion value for variable "'+i.name+'"');if(n.val.length){if(n.type>1&&i.maxlength)throw new Error('Invalid expression: Prefix modifier not applicable to variable "'+i.name+'"');f.push(o["expand"+c](n,u,i.explode,i.explode&&u.separator||",",i.maxlength,i.name))}else n.type&&f.push("")}return f.length?u.prefix+f.join(u.separator):""},o.expandNamed=function(t,r,n,o,i,a){var s,u,c,l="",f=r.encode,p=r.empty_name_separator,d=!t[f].length,h=2===t.type?"":e[f](a);for(u=0,c=t.val.length;u<c;u++)i?(s=e[f](t.val[u][1].substring(0,i)),2===t.type&&(h=e[f](t.val[u][0].substring(0,i)))):d?(s=e[f](t.val[u][1]),2===t.type?(h=e[f](t.val[u][0]),t[f].push([h,s])):t[f].push([void 0,s])):(s=t[f][u][1],2===t.type&&(h=t[f][u][0])),l&&(l+=o),n?l+=h+(p||s?"=":"")+s:(u||(l+=e[f](a)+(p||s?"=":"")),2===t.type&&(l+=h+","),l+=s);return l},o.expandUnnamed=function(t,r,n,o,i){var a,s,u,c="",l=r.encode,f=r.empty_name_separator,p=!t[l].length;for(s=0,u=t.val.length;s<u;s++)i?a=e[l](t.val[s][1].substring(0,i)):p?(a=e[l](t.val[s][1]),t[l].push([2===t.type?e[l](t.val[s][0]):void 0,a])):a=t[l][s][1],c&&(c+=o),2===t.type&&(c+=i?e[l](t.val[s][0].substring(0,i)):t[l][s][0],c+=n?f||a?"=":"":","),c+=a;return c},o.noConflict=function(){return t.URITemplate===o&&(t.URITemplate=r),o},a.expand=function(e,t){var r="";this.parts&&this.parts.length||this.parse(),e instanceof i||(e=new i(e));for(var n=0,a=this.parts.length;n<a;n++)r+="string"==typeof this.parts[n]?this.parts[n]:o.expand(this.parts[n],e,t);return r},a.parse=function(){var e,t,r,n=this.expression,i=o.EXPRESSION_PATTERN,a=o.VARIABLE_PATTERN,u=o.VARIABLE_NAME_PATTERN,c=o.LITERAL_PATTERN,l=[],f=0,p=function(e){if(e.match(c))throw new Error('Invalid Literal "'+e+'"');return e};for(i.lastIndex=0;;){if(null===(t=i.exec(n))){l.push(p(n.substring(f)));break}if(l.push(p(n.substring(f,t.index))),f=t.index+t[0].length,!s[t[1]])throw new Error('Unknown Operator "'+t[1]+'" in "'+t[0]+'"');if(!t[3])throw new Error('Unclosed Expression "'+t[0]+'"');for(var d=0,h=(e=t[2].split(",")).length;d<h;d++){if(null===(r=e[d].match(a)))throw new Error('Invalid Variable "'+e[d]+'" in "'+t[0]+'"');if(r[1].match(u))throw new Error('Invalid Variable Name "'+r[1]+'" in "'+t[0]+'"');e[d]={name:r[1],explode:!!r[3],maxlength:r[4]&&parseInt(r[4],10)}}if(!e.length)throw new Error('Expression Missing Variable(s) "'+t[0]+'"');l.push({expression:t[0],operator:t[1],variables:e})}return l.length||l.push(p(n)),this.parts=l,this},i.prototype.get=function(e){var t,r,o,i=this.data,a={type:0,val:[],encode:[],encodeReserved:[]};if(void 0!==this.cache[e])return this.cache[e];if(this.cache[e]=a,null==(o="[object Function]"===String(Object.prototype.toString.call(i))?i(e):"[object Function]"===String(Object.prototype.toString.call(i[e]))?i[e](e):i[e]))return a;if("[object Array]"===String(Object.prototype.toString.call(o))){for(t=0,r=o.length;t<r;t++)void 0!==o[t]&&null!==o[t]&&a.val.push([void 0,String(o[t])]);a.val.length&&(a.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(o))){for(t in o)n.call(o,t)&&void 0!==o[t]&&null!==o[t]&&a.val.push([t,String(o[t])]);a.val.length&&(a.type=2)}else a.type=1,a.val.push([void 0,String(o)]);return a},e.expand=function(t,r){var n=new o(t).expand(r);return new e(n)},o})},193:function(e,t,r){var n,o,i;!function(a,s){"use strict";e.exports?e.exports=s(r(340),r(430),r(704)):(o=[r(340),r(430),r(704)],void 0===(i="function"==typeof(n=s)?n.apply(t,o):n)||(e.exports=i))}(0,function(e,t,r,n){"use strict";var o=n&&n.URI;function i(e,t){var r=arguments.length>=1;if(!(this instanceof i))return r?arguments.length>=2?new i(e,t):new i(e):new i;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.11";var a=i.prototype,s=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function f(e,t){var r,n,o={};if("RegExp"===c(t))o=null;else if(l(t))for(r=0,n=t.length;r<n;r++)o[t[r]]=!0;else o[t]=!0;for(r=0,n=e.length;r<n;r++){(o&&void 0!==o[e[r]]||!o&&t.test(e[r]))&&(e.splice(r,1),n--,r--)}return e}function p(e,t){var r,n;if(l(t)){for(r=0,n=t.length;r<n;r++)if(!p(e,t[r]))return!1;return!0}var o=c(t);for(r=0,n=e.length;r<n;r++)if("RegExp"===o){if("string"==typeof e[r]&&e[r].match(t))return!0}else if(e[r]===t)return!0;return!1}function d(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function h(e){return e.replace(/^\/+|\/+$/g,"")}function y(e){return escape(e)}function m(e){return encodeURIComponent(e).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=m,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=m,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var r=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var g,v={encode:"encode",decode:"decode"},b=function(e,t){return function(r){try{return i[t](r+"").replace(i.characters[e][t].expression,function(r){return i.characters[e][t].map[r]})}catch(e){return r}}};for(g in v)i[g+"PathSegment"]=b("pathname",v[g]),i[g+"UrnPathSegment"]=b("urnpath",v[g]);var w=function(e,t,r){return function(n){var o;o=r?function(e){return i[t](i[r](e))}:i[t];for(var a=(n+"").split(e),s=0,u=a.length;s<u;s++)a[s]=o(a[s]);return a.join(e)}};function S(e){return function(t,r){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!r),this)}}function E(e,t){return function(r,n){return void 0===r?this._parts[e]||"":(null!==r&&(r+="").charAt(0)===t&&(r=r.substring(1)),this._parts[e]=r,this.build(!n),this)}}i.decodePath=w("/","decodePathSegment"),i.decodeUrnPath=w(":","decodeUrnPathSegment"),i.recodePath=w("/","encodePathSegment","decode"),i.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),i.encodeReserved=b("reserved","encode"),i.parse=function(e,t){var r;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),(r=(e=(e=e.replace(i.leading_whitespace_expression,"")).replace(i.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=i.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var r,n,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,o)||null,"/"===t.port&&(t.port=null);else{var a=e.indexOf(":"),s=e.indexOf("/"),u=e.indexOf(":",a+1);-1!==u&&(-1===s||u<s)?(t.hostname=e.substring(0,o)||null,t.port=null):(n=e.substring(0,o).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var r=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var n,o=e.indexOf("/"),a=e.lastIndexOf("@",o>-1?o:e.length-1);return a>-1&&(-1===o||a<o)?(n=e.substring(0,a).split(":"),t.username=n[0]?i.decode(n[0]):null,n.shift(),t.password=n[0]?i.decode(n.join(":")):null,e=r.substring(a+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,o,a={},u=e.split("&"),c=u.length,l=0;l<c;l++)r=u[l].split("="),n=i.decodeQuery(r.shift(),t),o=r.length?i.decodeQuery(r.join("="),t):null,"__proto__"!==n&&(s.call(a,n)?("string"!=typeof a[n]&&null!==a[n]||(a[n]=[a[n]]),a[n].push(o)):a[n]=o);return a},i.build=function(e){var t="",r=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",r=!0),t+=i.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&r&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){var t="";return e.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t="";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,r){var n,o,a,u,c="";for(o in e)if("__proto__"!==o&&s.call(e,o))if(l(e[o]))for(n={},a=0,u=e[o].length;a<u;a++)void 0!==e[o][a]&&void 0===n[e[o][a]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][a],r),!0!==t&&(n[e[o][a]+""]=!0));else void 0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],r));return c.substring(1)},i.buildQueryParameter=function(e,t,r){return i.encodeQuery(e,r)+(null!==t?"="+i.encodeQuery(t,r):"")},i.addQuery=function(e,t,r){if("object"==typeof t)for(var n in t)s.call(t,n)&&i.addQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=r);"string"==typeof e[t]&&(e[t]=[e[t]]),l(r)||(r=[r]),e[t]=(e[t]||[]).concat(r)}},i.setQuery=function(e,t,r){if("object"==typeof t)for(var n in t)s.call(t,n)&&i.setQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===r?null:r}},i.removeQuery=function(e,t,r){var n,o,a;if(l(t))for(n=0,o=t.length;n<o;n++)e[t[n]]=void 0;else if("RegExp"===c(t))for(a in e)t.test(a)&&(e[a]=void 0);else if("object"==typeof t)for(a in t)s.call(t,a)&&i.removeQuery(e,a,t[a]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===c(r)?!l(e[t])&&r.test(e[t])?e[t]=void 0:e[t]=f(e[t],r):e[t]!==String(r)||l(r)&&1!==r.length?l(e[t])&&(e[t]=f(e[t],r)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,r,n){switch(c(t)){case"String":break;case"RegExp":for(var o in e)if(s.call(e,o)&&t.test(o)&&(void 0===r||i.hasQuery(e,o,r)))return!0;return!1;case"Object":for(var a in t)if(s.call(t,a)&&!i.hasQuery(e,a,t[a]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(r)){case"Undefined":return t in e;case"Boolean":return r===Boolean(l(e[t])?e[t].length:e[t]);case"Function":return!!r(e[t],t,e);case"Array":return!!l(e[t])&&(n?p:d)(e[t],r);case"RegExp":return l(e[t])?!!n&&p(e[t],r):Boolean(e[t]&&e[t].match(r));case"Number":r=String(r);case"String":return l(e[t])?!!n&&p(e[t],r):e[t]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var e=[],t=[],r=0,n=0;n<arguments.length;n++){var o=new i(arguments[n]);e.push(o);for(var a=o.segment(),s=0;s<a.length;s++)"string"==typeof a[s]&&t.push(a[s]),a[s]&&r++}if(!t.length||!r)return new i("");var u=new i("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r)){r--;break}return r<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(r)&&"/"===t.charAt(r)||(r=e.substring(0,r).lastIndexOf("/")),e.substring(0,r+1))},i.withinString=function(e,t,r){r||(r={});var n=r.start||i.findUri.start,o=r.end||i.findUri.end,a=r.trim||i.findUri.trim,s=r.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var c=n.exec(e);if(!c)break;var l=c.index;if(r.ignoreHtml){var f=e.slice(Math.max(l-3,0),l);if(f&&u.test(f))continue}for(var p=l+e.slice(l).search(o),d=e.slice(l,p),h=-1;;){var y=s.exec(d);if(!y)break;var m=y.index+y[0].length;h=Math.max(h,m)}if(!((d=h>-1?d.slice(0,h)+d.slice(h).replace(a,""):d.replace(a,"")).length<=c[0].length||r.ignore&&r.ignore.test(d))){var g=t(d,l,p=l+d.length,e);void 0!==g?(g=String(g),e=e.slice(0,l)+g+e.slice(p),n.lastIndex=l+g.length):n.lastIndex=p}}return n.lastIndex=0,e},i.ensureValidHostname=function(t,r){var n=!!t,o=!1;if(!!r&&(o=p(i.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=o),this},a.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new i(this)},a.valueOf=a.toString=function(){return this.build(!1)._string},a.protocol=S("protocol"),a.username=S("username"),a.password=S("password"),a.hostname=S("hostname"),a.port=S("port"),a.query=E("query","?"),a.fragment=E("fragment","#"),a.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},a.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},a.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},a.path=a.pathname,a.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var n=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1);if(!n&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var a=n?e._parts:e;for(r in a)"query"!==r&&s.call(this._parts,r)&&(this._parts[r]=a[r]);a.query&&this.query(a.query,!1)}return this.build(!t),this},a.is=function(e){var t=!1,n=!1,o=!1,a=!1,s=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,n=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),s=(a=!(t=n||o))&&r&&r.has(this._parts.hostname),u=a&&i.idn_expression.test(this._parts.hostname),c=a&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return a;case"sld":return s;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var T=a.protocol,k=a.port,O=a.hostname;a.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return T.call(this,e,t)},a.scheme=a.protocol,a.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),k.call(this,e,t))},a.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return O.call(this,e,t)},a.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=i(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},a.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=i.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},a.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=i.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},a.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,n),a=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,e),this.build(!t),this},a.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},a.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},a.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return e?i.decodePath(n):n}var o=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,o),s=new RegExp("^"+u(a));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),this.build(!t),this},a.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return e?i.decodePathSegment(n):n}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var a=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),o?this.normalizePath(t):this.build(!t),this},a.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,o=this.filename(),a=o.lastIndexOf(".");return-1===a?"":(r=o.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?i.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var s,c=this.suffix();if(c)s=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return s&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e)),this.build(!t),this},a.segment=function(e,t,r){var n=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),a=o.split(n);if(void 0!==e&&"number"!=typeof e&&(r=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&a.shift(),e<0&&(e=Math.max(a.length+e,0)),void 0===t)return void 0===e?a:a[e];if(null===e||void 0===a[e])if(l(t)){a=[];for(var s=0,u=t.length;s<u;s++)(t[s].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(h(t[s])))}else(t||"string"==typeof t)&&(t=h(t),""===a[a.length-1]?a[a.length-1]=t:a.push(t));else t?a[e]=h(t):a.splice(e,1);return i&&a.unshift(""),this.path(a.join(n),r)},a.segmentCoded=function(e,t,r){var n,o,a;if("number"!=typeof e&&(r=t,t=e,e=void 0),void 0===t){if(l(n=this.segment(e,t,r)))for(o=0,a=n.length;o<a;o++)n[o]=i.decode(n[o]);else n=void 0!==n?i.decode(n):void 0;return n}if(l(t))for(o=0,a=t.length;o<a;o++)t[o]=i.encode(t[o]);else t="string"==typeof t||t instanceof String?i.encode(t):t;return this.segment(e,t,r)};var A=a.query;return a.query=function(e,t){if(!0===e)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=e.call(this,r);return this._parts.query=i.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):A.call(this,e,t)},a.setQuery=function(e,t,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)n[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in e)s.call(e,o)&&(n[o]=e[o])}return this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},a.addQuery=function(e,t,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(n,e,void 0===t?null:t),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},a.removeQuery=function(e,t,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(n,e,t),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},a.hasQuery=function(e,t,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(n,e,t,r)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},a.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},a.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},a.normalizePath=function(e){var t,r=this._parts.path;if(!r)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var n,o,a="";for("/"!==(r=i.recodePath(r)).charAt(0)&&(t=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(a=r.substring(1).match(/^(\.\.\/)+/)||"")&&(a=a[0]);-1!==(n=r.search(/\/\.\.(\/|$)/));)0!==n?(-1===(o=r.substring(0,n).lastIndexOf("/"))&&(o=n),r=r.substring(0,o)+r.substring(n+3)):r=r.substring(3);return t&&this.is("relative")&&(r=a+r.substring(1)),this._parts.path=r,this.build(!e),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},a.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var e=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},a.unicode=function(){var e=i.encode,t=i.decode;i.encode=m,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},a.readable=function(){var t=this.clone();t.username("").password("").normalize();var r="";if(t._parts.protocol&&(r+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(r+=e.toUnicode(t._parts.hostname),t._parts.port&&(r+=":"+t._parts.port)):r+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(r+="/"),r+=t.path(!0),t._parts.query){for(var n="",o=0,a=t._parts.query.split("&"),s=a.length;o<s;o++){var u=(a[o]||"").split("=");n+="&"+i.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==u[1]&&(n+="="+i.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}r+="?"+n.substring(1)}return r+=i.decodeQuery(t.hash(),!0)},a.absoluteTo=function(e){var t,r,n,o=this.clone(),a=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof i||(e=new i(e)),o._parts.protocol)return o;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)return o;for(r=0;n=a[r];r++)o._parts[n]=e._parts[n];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},a.relativeTo=function(e){var t,r,n,o,a,s=this.clone().normalize();if(s._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new i(e).normalize(),t=s._parts,r=e._parts,o=s.path(),a=e.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==a.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===r.protocol&&(t.protocol=null),t.username!==r.username||t.password!==r.password)return s.build();if(null!==t.protocol||null!==t.username||null!==t.password)return s.build();if(t.hostname!==r.hostname||t.port!==r.port)return s.build();if(t.hostname=null,t.port=null,o===a)return t.path="",s.build();if(!(n=i.commonPath(o,a)))return s.build();var u=r.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=u+t.path.substring(n.length)||"./",s.build()},a.equals=function(e){var t,r,n,o,a,u=this.clone(),c=new i(e),f={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(n=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(n.length!==o.length)return!1;for(a in t=i.parseQuery(n,this._parts.escapeQuerySpace),r=i.parseQuery(o,this._parts.escapeQuerySpace),t)if(s.call(t,a)){if(l(t[a])){if(!d(t[a],r[a]))return!1}else if(t[a]!==r[a])return!1;f[a]=!0}for(a in r)if(s.call(r,a)&&!f[a])return!1;return!0},a.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},a.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},a.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},i})},209:(e,t,r)=>{"use strict";var n=65536,o=4294967295;var i=r(861).Buffer,a=r.g.crypto||r.g.msCrypto;a&&a.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>n)for(var s=0;s<e;s+=n)a.getRandomValues(r.slice(s,s+n));else a.getRandomValues(r);if("function"==typeof t)return process.nextTick(function(){t(null,r)});return r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},242:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>{}})},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*y}},287:(e,t,r)=>{"use strict";const n=r(526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Q(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|h(e))}function p(e){const t=e.length<0?0:0|h(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function h(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(o)return n?-1:X(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function w(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Q(n))return a;e[r+a]=n}return a}function S(e,t,r,n){return G(X(t,e.length-r),e,r,n)}function E(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function T(e,t,r,n){return G($(t),e,r,n)}function k(e,t,r,n){return G(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=_));return r}(n)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(W(t,Uint8Array))o+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==l[e]){i=c[e],a=l[e];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function x(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Z[e[n]];return o}function R(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function j(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function U(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function N(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),u.prototype.readBigUInt64BE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),u.prototype.readBigInt64BE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){C(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){C(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Y(function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Y(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Y(function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Y(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=u.isBuffer(e)?e:u.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const F={};function M(e,t,r){F[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function q(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),M("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=V(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=V(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const K=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Y(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},293:(e,t,r)=>{var n=r(546),o=r(708);e.exports={parse:function(e){var t=n.parse(e.toString());return o.compile(t)}}},299:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AssembledTransaction:()=>ve,Client:()=>lt,DEFAULT_TIMEOUT:()=>h,Err:()=>d,NULL_ACCOUNT:()=>y,Ok:()=>p,SentTransaction:()=>K,Spec:()=>Ve,Watcher:()=>X,basicNodeSigner:()=>ke});var n=r(950),o=r(496),i=r(76),a=r(680);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function l(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var p=l(function e(t){u(this,e),this.value=t},[{key:"unwrapErr",value:function(){throw new Error("No error")}},{key:"unwrap",value:function(){return this.value}},{key:"isOk",value:function(){return!0}},{key:"isErr",value:function(){return!1}}]),d=l(function e(t){u(this,e),this.error=t},[{key:"unwrapErr",value:function(){return this.error}},{key:"unwrap",value:function(){throw new Error(this.error.message)}},{key:"isOk",value:function(){return!1}},{key:"isErr",value:function(){return!0}}]),h=300,y="GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";function m(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return g(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(g(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,g(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,g(f,"constructor",c),g(c,"constructor",u),u.displayName="GeneratorFunction",g(c,o,"GeneratorFunction"),g(f),g(f,o,"Generator"),g(f,n,function(){return this}),g(f,"toString",function(){return"[object Generator]"}),(m=function(){return{w:i,m:p}})()}function g(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}g=function(e,t,r,n){function i(t,r){g(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},g(e,t,r,n)}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function b(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function w(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){b(i,n,o,a,s,"next",e)}function s(e){b(i,n,o,a,s,"throw",e)}a(void 0)})}}function S(e,t,r){return E.apply(this,arguments)}function E(){return E=w(m().m(function e(t,r,n){var o,i,a,s,u,c,l,f,p,d=arguments;return m().w(function(e){for(;;)switch(e.n){case 0:return o=d.length>3&&void 0!==d[3]?d[3]:1.5,i=d.length>4&&void 0!==d[4]&&d[4],s=0,f=a=[],e.n=1,t();case 1:if(f.push.call(f,e.v),r(a[a.length-1])){e.n=2;break}return e.a(2,a);case 2:u=new Date(Date.now()+1e3*n).valueOf(),l=c=1e3;case 3:if(!(Date.now()<u&&r(a[a.length-1]))){e.n=6;break}return s+=1,i&&console.info("Waiting ".concat(c,"ms before trying again (bringing the total wait time to ").concat(l,"ms so far, of total ").concat(1e3*n,"ms)")),e.n=4,new Promise(function(e){return setTimeout(e,c)});case 4:return c*=o,new Date(Date.now()+c).valueOf()>u&&(c=u-Date.now(),i&&console.info("was gonna wait too long; new waitTime: ".concat(c,"ms"))),l=c+l,p=a,e.n=5,t(a[a.length-1]);case 5:p.push.call(p,e.v),i&&r(a[a.length-1])&&console.info("".concat(s,". Called ").concat(t,"; ").concat(a.length," prev attempts. Most recent: ").concat(JSON.stringify(a[a.length-1],null,2))),e.n=3;break;case 6:return e.a(2,a)}},e)})),E.apply(this,arguments)}var T,k=/Error\(Contract, #(\d+)\)/;function O(e){for(var t=new n.cereal.XdrReader(e),r=[];!t.eof;)r.push(n.xdr.ScSpecEntry.read(t));return r}function A(e,t){return _.apply(this,arguments)}function _(){return(_=w(m().m(function e(t,r){return m().w(function(e){for(;;)if(0===e.n)return e.a(2,t.publicKey?r.getAccount(t.publicKey):new n.Account(y,"0"))},e)}))).apply(this,arguments)}function x(e,t,r){return t=C(t),function(e,t){if(t&&("object"==j(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,R()?Reflect.construct(t,r||[],C(e).constructor):t.apply(e,r))}function P(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return I=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(R())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&B(o,r.prototype),o}(e,arguments,C(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),B(r,e)},I(e)}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(R=function(){return!!e})()}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function U(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return N(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(N(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,N(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,N(f,"constructor",c),N(c,"constructor",u),u.displayName="GeneratorFunction",N(c,o,"GeneratorFunction"),N(f),N(f,o,"Generator"),N(f,n,function(){return this}),N(f,"toString",function(){return"[object Generator]"}),(U=function(){return{w:i,m:p}})()}function N(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}N=function(e,t,r,n){function i(t,r){N(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},N(e,t,r,n)}function L(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function D(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){L(i,n,o,a,s,"next",e)}function s(e){L(i,n,o,a,s,"throw",e)}a(void 0)})}}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,H(n.key),n)}}function V(e,t,r){return t&&M(e.prototype,t),r&&M(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function q(e,t,r){return(t=H(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H(e){var t=function(e,t){if("object"!=j(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==j(t)?t:t+""}var z,K=function(){function e(t){var r,n,a=this;F(this,e),q(this,"send",(n=D(U().m(function t(r){var n,o,s;return U().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,a.server.sendTransaction(a.assembled.signed);case 1:if(a.sendTransactionResponse=t.v,"PENDING"===a.sendTransactionResponse.status){t.n=2;break}throw new e.Errors.SendFailed("Sending the transaction to the network failed!\n".concat(JSON.stringify(a.sendTransactionResponse,null,2)));case 2:return null!=r&&r.onSubmitted&&r.onSubmitted(a.sendTransactionResponse),o=a.sendTransactionResponse.hash,s=null!==(n=a.assembled.options.timeoutInSeconds)&&void 0!==n?n:h,t.n=3,S(D(U().m(function e(){var t;return U().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.server.getTransaction(o);case 1:return t=e.v,null!=r&&r.onProgress&&r.onProgress(t),e.a(2,t)}},e)})),function(e){return e.status===i.j.GetTransactionStatus.NOT_FOUND},s);case 3:if(a.getTransactionResponseAll=t.v,a.getTransactionResponse=a.getTransactionResponseAll[a.getTransactionResponseAll.length-1],a.getTransactionResponse.status!==i.j.GetTransactionStatus.NOT_FOUND){t.n=4;break}throw new e.Errors.TransactionStillPending("Waited ".concat(s," seconds for transaction to complete, but it did not. ")+"Returning anyway. Check the transaction status manually. "+"Sent transaction: ".concat(JSON.stringify(a.sendTransactionResponse,null,2),"\n")+"All attempts to get the result: ".concat(JSON.stringify(a.getTransactionResponseAll,null,2)));case 4:return t.a(2,a)}},t)})),function(e){return n.apply(this,arguments)})),this.assembled=t,this.server=new o.Server(this.assembled.options.rpcUrl,{allowHttp:null!==(r=this.assembled.options.allowHttp)&&void 0!==r&&r})}return V(e,[{key:"result",get:function(){if("getTransactionResponse"in this&&this.getTransactionResponse){if("returnValue"in this.getTransactionResponse)return this.assembled.options.parseResultXdr(this.getTransactionResponse.returnValue);throw new Error("Transaction failed! Cannot parse result.")}if(this.sendTransactionResponse){var t,r=null===(t=this.sendTransactionResponse.errorResult)||void 0===t?void 0:t.result();if(r)throw new e.Errors.SendFailed("Transaction simulation looked correct, but attempting to send the transaction failed. Check `simulation` and `sendTransactionResponseAll` to troubleshoot. Decoded `sendTransactionResponse.errorResultXdr`: ".concat(r));throw new e.Errors.SendResultOnly("Transaction was sent to the network, but not yet awaited. No result to show. Await transaction completion with `getTransaction(sendTransactionResponse.hash)`")}throw new Error("Sending transaction failed: ".concat(JSON.stringify(this.assembled.signed)))}}])}();T=K,q(K,"Errors",{SendFailed:function(e){function t(){return F(this,t),x(this,t,arguments)}return P(t,e),V(t)}(I(Error)),SendResultOnly:function(e){function t(){return F(this,t),x(this,t,arguments)}return P(t,e),V(t)}(I(Error)),TransactionStillPending:function(e){function t(){return F(this,t),x(this,t,arguments)}return P(t,e),V(t)}(I(Error))}),q(K,"init",(z=D(U().m(function e(t,r){var n,o;return U().w(function(e){for(;;)switch(e.n){case 0:return n=new T(t),e.n=1,n.send(r);case 1:return o=e.v,e.a(2,o)}},e)})),function(e,t){return z.apply(this,arguments)}));var X=V(function e(){F(this,e)}),$=r(287).Buffer;function G(e,t,r){return t=J(t),function(e,t){if(t&&("object"==ee(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Z()?Reflect.construct(t,r||[],J(e).constructor):t.apply(e,r))}function W(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y(e,t)}function Q(e){var t="function"==typeof Map?new Map:void 0;return Q=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(Z())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&Y(o,r.prototype),o}(e,arguments,J(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Y(r,e)},Q(e)}function Z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Z=function(){return!!e})()}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}function J(e){return J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},J(e)}function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?te(Object(r),!0).forEach(function(t){me(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ne(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(ee(e)+" is not iterable")}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||ce(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ie(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ce(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ae(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return se(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(se(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,se(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,se(f,"constructor",c),se(c,"constructor",u),u.displayName="GeneratorFunction",se(c,o,"GeneratorFunction"),se(f),se(f,o,"Generator"),se(f,n,function(){return this}),se(f,"toString",function(){return"[object Generator]"}),(ae=function(){return{w:i,m:p}})()}function se(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}se=function(e,t,r,n){function i(t,r){se(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},se(e,t,r,n)}function ue(e){return function(e){if(Array.isArray(e))return le(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ce(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t){if(e){if("string"==typeof e)return le(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?le(e,t):void 0}}function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function fe(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function pe(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){fe(i,n,o,a,s,"next",e)}function s(e){fe(i,n,o,a,s,"throw",e)}a(void 0)})}}function de(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ge(n.key),n)}}function ye(e,t,r){return t&&he(e.prototype,t),r&&he(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function me(e,t,r){return(t=ge(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ge(e){var t=function(e,t){if("object"!=ee(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ee(t)?t:t+""}var ve=function(){function e(t){var r,s,u=this;de(this,e),me(this,"simulate",pe(ae().m(function t(){var r,o,s,c,l,f,p,d=arguments;return ae().w(function(t){for(;;)switch(t.n){case 0:if(r=(d.length>0&&void 0!==d[0]?d[0]:{}).restore,u.built){t.n=2;break}if(u.raw){t.n=1;break}throw new Error("Transaction has not yet been assembled; call `AssembledTransaction.build` first.");case 1:u.built=u.raw.build();case 2:return r=null!=r?r:u.options.restore,delete u.simulationResult,delete u.simulationTransactionData,t.n=3,u.server.simulateTransaction(u.built);case 3:if(u.simulation=t.v,!r||!i.j.isSimulationRestore(u.simulation)){t.n=8;break}return t.n=4,A(u.options,u.server);case 4:return o=t.v,t.n=5,u.restoreFootprint(u.simulation.restorePreamble,o);case 5:if((s=t.v).status!==i.j.GetTransactionStatus.SUCCESS){t.n=7;break}return p=new n.Contract(u.options.contractId),u.raw=new n.TransactionBuilder(o,{fee:null!==(c=u.options.fee)&&void 0!==c?c:n.BASE_FEE,networkPassphrase:u.options.networkPassphrase}).addOperation(p.call.apply(p,[u.options.method].concat(ue(null!==(l=u.options.args)&&void 0!==l?l:[])))).setTimeout(null!==(f=u.options.timeoutInSeconds)&&void 0!==f?f:h),t.n=6,u.simulate();case 6:return t.a(2,u);case 7:throw new e.Errors.RestorationFailure("Automatic restore failed! You set 'restore: true' but the attempted restore did not work. Result:\n".concat(JSON.stringify(s)));case 8:return i.j.isSimulationSuccess(u.simulation)&&(u.built=(0,a.X)(u.built,u.simulation).build()),t.a(2,u)}},t)}))),me(this,"sign",pe(ae().m(function t(){var r,o,i,a,s,c,l,f,p,d,y,m,g=arguments;return ae().w(function(t){for(;;)switch(t.n){case 0:if(i=(o=g.length>0&&void 0!==g[0]?g[0]:{}).force,a=void 0!==i&&i,s=o.signTransaction,c=void 0===s?u.options.signTransaction:s,u.built){t.n=1;break}throw new Error("Transaction has not yet been simulated");case 1:if(a||!u.isReadCall){t.n=2;break}throw new e.Errors.NoSignatureNeeded("This is a read call. It requires no signature or sending. Use `force: true` to sign and send anyway.");case 2:if(c){t.n=3;break}throw new e.Errors.NoSigner("You must provide a signTransaction function, either when calling `signAndSend` or when initializing your Client");case 3:if(!(l=u.needsNonInvokerSigningBy().filter(function(e){return!e.startsWith("C")})).length){t.n=4;break}throw new e.Errors.NeedsMoreSignatures("Transaction requires signatures from ".concat(l,". ")+"See `needsNonInvokerSigningBy` for details.");case 4:return f=null!==(r=u.options.timeoutInSeconds)&&void 0!==r?r:h,u.built=n.TransactionBuilder.cloneFrom(u.built,{fee:u.built.fee,timebounds:void 0,sorobanData:u.simulationData.transactionData}).setTimeout(f).build(),p={networkPassphrase:u.options.networkPassphrase},u.options.address&&(p.address=u.options.address),void 0!==u.options.submit&&(p.submit=u.options.submit),u.options.submitUrl&&(p.submitUrl=u.options.submitUrl),t.n=5,c(u.built.toXDR(),p);case 5:d=t.v,y=d.signedTxXdr,m=d.error,u.handleWalletError(m),u.signed=n.TransactionBuilder.fromXDR(y,u.options.networkPassphrase);case 6:return t.a(2)}},t)}))),me(this,"signAndSend",pe(ae().m(function e(){var t,r,n,o,i,a,s,c=arguments;return ae().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=(t=c.length>0&&void 0!==c[0]?c[0]:{}).force,n=void 0!==r&&r,o=t.signTransaction,i=void 0===o?u.options.signTransaction:o,a=t.watcher,u.signed){e.n=3;break}return s=u.options.submit,u.options.submit&&(u.options.submit=!1),e.p=1,e.n=2,u.sign({force:n,signTransaction:i});case 2:return e.p=2,u.options.submit=s,e.f(2);case 3:return e.a(2,u.send(a))}},e,null,[[1,,2,3]])}))),me(this,"needsNonInvokerSigningBy",function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeAlreadySigned,r=void 0!==t&&t;if(!u.built)throw new Error("Transaction has not yet been simulated");if(!("operations"in u.built))throw new Error("Unexpected Transaction type; no operations: ".concat(JSON.stringify(u.built)));var o=u.built.operations[0];return ue(new Set((null!==(e=o.auth)&&void 0!==e?e:[]).filter(function(e){return e.credentials().switch()===n.xdr.SorobanCredentialsType.sorobanCredentialsAddress()&&(r||"scvVoid"===e.credentials().address().signature().switch().name)}).map(function(e){return n.Address.fromScAddress(e.credentials().address().address()).toString()})))}),me(this,"signAuthEntries",pe(ae().m(function t(){var r,o,i,a,s,c,l,f,p,d,h,y,m,g,v,b,w,S=arguments;return ae().w(function(t){for(;;)switch(t.p=t.n){case 0:if(i=(o=S.length>0&&void 0!==S[0]?S[0]:{}).expiration,a=void 0===i?pe(ae().m(function e(){var t;return ae().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.server.getLatestLedger();case 1:return t=e.v.sequence,e.a(2,t+100)}},e)}))():i,s=o.signAuthEntry,c=void 0===s?u.options.signAuthEntry:s,l=o.address,f=void 0===l?u.options.publicKey:l,p=o.authorizeEntry,d=void 0===p?n.authorizeEntry:p,u.built){t.n=1;break}throw new Error("Transaction has not yet been assembled or simulated");case 1:if(d!==n.authorizeEntry){t.n=4;break}if(0!==(h=u.needsNonInvokerSigningBy()).length){t.n=2;break}throw new e.Errors.NoUnsignedNonInvokerAuthEntries("No unsigned non-invoker auth entries; maybe you already signed?");case 2:if(-1!==h.indexOf(null!=f?f:"")){t.n=3;break}throw new e.Errors.NoSignatureNeeded('No auth entries for public key "'.concat(f,'"'));case 3:if(c){t.n=4;break}throw new e.Errors.NoSigner("You must provide `signAuthEntry` or a custom `authorizeEntry`");case 4:y=u.built.operations[0],m=null!==(r=y.auth)&&void 0!==r?r:[],g=ie(m.entries()),t.p=5,b=ae().m(function e(){var t,r,o,i,s,l,p,h;return ae().w(function(e){for(;;)switch(e.n){case 0:if(t=oe(v.value,2),r=t[0],o=t[1],(i=n.xdr.SorobanCredentials.fromXDR(o.credentials().toXDR())).switch()===n.xdr.SorobanCredentialsType.sorobanCredentialsAddress()){e.n=1;break}return e.a(2,0);case 1:if(n.Address.fromScAddress(i.address().address()).toString()===f){e.n=2;break}return e.a(2,0);case 2:return s=null!=c?c:Promise.resolve,l=d,p=o,h=function(){var e=pe(ae().m(function e(t){var r,n,o;return ae().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,s(t.toXDR("base64"),{address:f});case 1:return r=e.v,n=r.signedAuthEntry,o=r.error,u.handleWalletError(o),e.a(2,$.from(n,"base64"))}},e)}));return function(t){return e.apply(this,arguments)}}(),e.n=3,a;case 3:return e.n=4,l(p,h,e.v,u.options.networkPassphrase);case 4:m[r]=e.v;case 5:return e.a(2)}},e)}),g.s();case 6:if((v=g.n()).done){t.n=9;break}return t.d(ne(b()),7);case 7:if(0!==t.v){t.n=8;break}return t.a(3,8);case 8:t.n=6;break;case 9:t.n=11;break;case 10:t.p=10,w=t.v,g.e(w);case 11:return t.p=11,g.f(),t.f(11);case 12:return t.a(2)}},t,null,[[5,10,11,12]])}))),this.options=t,this.options.simulate=null===(r=this.options.simulate)||void 0===r||r,this.server=new o.Server(this.options.rpcUrl,{allowHttp:null!==(s=this.options.allowHttp)&&void 0!==s&&s})}return ye(e,[{key:"toJSON",value:function(){var e;return JSON.stringify({method:this.options.method,tx:null===(e=this.built)||void 0===e?void 0:e.toXDR(),simulationResult:{auth:this.simulationData.result.auth.map(function(e){return e.toXDR("base64")}),retval:this.simulationData.result.retval.toXDR("base64")},simulationTransactionData:this.simulationData.transactionData.toXDR("base64")})}},{key:"toXDR",value:function(){var e;if(!this.built)throw new Error("Transaction has not yet been simulated; call `AssembledTransaction.simulate` first.");return null===(e=this.built)||void 0===e?void 0:e.toEnvelope().toXDR("base64")}},{key:"handleWalletError",value:function(t){if(t){var r=t.message,n=t.code,o="".concat(r).concat(t.ext?" (".concat(t.ext.join(", "),")"):"");switch(n){case-1:throw new e.Errors.InternalWalletError(o);case-2:throw new e.Errors.ExternalServiceError(o);case-3:throw new e.Errors.InvalidClientRequest(o);case-4:throw new e.Errors.UserRejected(o);default:throw new Error("Unhandled error: ".concat(o))}}}},{key:"simulationData",get:function(){var t;if(this.simulationResult&&this.simulationTransactionData)return{result:this.simulationResult,transactionData:this.simulationTransactionData};var r=this.simulation;if(!r)throw new e.Errors.NotYetSimulated("Transaction has not yet been simulated");if(i.j.isSimulationError(r))throw new e.Errors.SimulationFailed('Transaction simulation failed: "'.concat(r.error,'"'));if(i.j.isSimulationRestore(r))throw new e.Errors.ExpiredState("You need to restore some contract state before you can invoke this method.\nYou can set `restore` to true in the method options in order to automatically restore the contract state when needed.");return this.simulationResult=null!==(t=r.result)&&void 0!==t?t:{auth:[],retval:n.xdr.ScVal.scvVoid()},this.simulationTransactionData=r.transactionData.build(),{result:this.simulationResult,transactionData:this.simulationTransactionData}}},{key:"result",get:function(){try{if(!this.simulationData.result)throw new Error("No simulation result!");return this.options.parseResultXdr(this.simulationData.result.retval)}catch(r){if("object"!==v(t=r)||null===t||!("toString"in t))throw r;var e=this.parseError(r.toString());if(e)return e;throw r}var t}},{key:"parseError",value:function(e){if(this.options.errorTypes){var t=e.match(k);if(t){var r=parseInt(t[1],10),n=this.options.errorTypes[r];if(n)return new d(n)}}}},{key:"send",value:(u=pe(ae().m(function e(t){var r;return ae().w(function(e){for(;;)switch(e.n){case 0:if(this.signed){e.n=1;break}throw new Error("The transaction has not yet been signed. Run `sign` first, or use `signAndSend` instead.");case 1:return e.n=2,K.init(this,t);case 2:return r=e.v,e.a(2,r)}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"isReadCall",get:function(){var e=this.simulationData.result.auth.length,t=this.simulationData.transactionData.resources().footprint().readWrite().length;return 0===e&&0===t}},{key:"restoreFootprint",value:(s=pe(ae().m(function t(r,n){var o,i,a;return ae().w(function(t){for(;;)switch(t.n){case 0:if(this.options.signTransaction){t.n=1;break}throw new Error("For automatic restore to work you must provide a signTransaction function when initializing your Client");case 1:if(null==n){t.n=2;break}a=n,t.n=4;break;case 2:return t.n=3,A(this.options,this.server);case 3:a=t.v;case 4:return n=a,t.n=5,e.buildFootprintRestoreTransaction(re({},this.options),r.transactionData,n,r.minResourceFee);case 5:return o=t.v,t.n=6,o.signAndSend();case 6:if((i=t.v).getTransactionResponse){t.n=7;break}throw new e.Errors.RestorationFailure("The attempt at automatic restore failed. \n".concat(JSON.stringify(i)));case 7:return t.a(2,i.getTransactionResponse)}},t,this)})),function(e,t){return s.apply(this,arguments)})}],[{key:"fromJSON",value:function(t,r){var o=r.tx,i=r.simulationResult,a=r.simulationTransactionData,s=new e(t);return s.built=n.TransactionBuilder.fromXDR(o,t.networkPassphrase),s.simulationResult={auth:i.auth.map(function(e){return n.xdr.SorobanAuthorizationEntry.fromXDR(e,"base64")}),retval:n.xdr.ScVal.fromXDR(i.retval,"base64")},s.simulationTransactionData=n.xdr.SorobanTransactionData.fromXDR(a,"base64"),s}},{key:"fromXDR",value:function(t,r,o){var i,a=n.xdr.TransactionEnvelope.fromXDR(r,"base64"),s=n.TransactionBuilder.fromXDR(a,t.networkPassphrase),u=s.operations[0];if(null==u||null===(i=u.func)||void 0===i||!i.value||"function"!=typeof u.func.value)throw new Error("Could not extract the method from the transaction envelope.");var c=u.func.value();if(null==c||!c.functionName)throw new Error("Could not extract the method name from the transaction envelope.");var l=c.functionName().toString("utf-8"),f=new e(re(re({},t),{},{method:l,parseResultXdr:function(e){return o.funcResToNative(l,e)}}));return f.built=s,f}},{key:"build",value:function(t){var r,o=new n.Contract(t.contractId);return e.buildWithOp(o.call.apply(o,[t.method].concat(ue(null!==(r=t.args)&&void 0!==r?r:[]))),t)}},{key:"buildWithOp",value:(r=pe(ae().m(function t(r,o){var i,a,s,u;return ae().w(function(t){for(;;)switch(t.n){case 0:return s=new e(o),t.n=1,A(o,s.server);case 1:if(u=t.v,s.raw=new n.TransactionBuilder(u,{fee:null!==(i=o.fee)&&void 0!==i?i:n.BASE_FEE,networkPassphrase:o.networkPassphrase}).setTimeout(null!==(a=o.timeoutInSeconds)&&void 0!==a?a:h).addOperation(r),!o.simulate){t.n=2;break}return t.n=2,s.simulate();case 2:return t.a(2,s)}},t)})),function(e,t){return r.apply(this,arguments)})},{key:"buildFootprintRestoreTransaction",value:(t=pe(ae().m(function t(r,o,i,a){var s,u;return ae().w(function(t){for(;;)switch(t.n){case 0:return(u=new e(r)).raw=new n.TransactionBuilder(i,{fee:a,networkPassphrase:r.networkPassphrase}).setSorobanData(o instanceof n.SorobanDataBuilder?o.build():o).addOperation(n.Operation.restoreFootprint({})).setTimeout(null!==(s=r.timeoutInSeconds)&&void 0!==s?s:h),t.n=1,u.simulate({restore:!1});case 1:return t.a(2,u)}},t)})),function(e,r,n,o){return t.apply(this,arguments)})}]);var t,r,s,u}();me(ve,"Errors",{ExpiredState:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),RestorationFailure:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),NeedsMoreSignatures:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),NoSignatureNeeded:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),NoUnsignedNonInvokerAuthEntries:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),NoSigner:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),NotYetSimulated:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),FakeAccount:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),SimulationFailed:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),InternalWalletError:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),ExternalServiceError:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),InvalidClientRequest:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error)),UserRejected:function(e){function t(){return de(this,t),G(this,t,arguments)}return W(t,e),ye(t)}(Q(Error))});var be=r(287).Buffer;function we(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return Se(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Se(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Se(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Se(f,"constructor",c),Se(c,"constructor",u),u.displayName="GeneratorFunction",Se(c,o,"GeneratorFunction"),Se(f),Se(f,o,"Generator"),Se(f,n,function(){return this}),Se(f,"toString",function(){return"[object Generator]"}),(we=function(){return{w:i,m:p}})()}function Se(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Se=function(e,t,r,n){function i(t,r){Se(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Se(e,t,r,n)}function Ee(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Te(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Ee(i,n,o,a,s,"next",e)}function s(e){Ee(i,n,o,a,s,"throw",e)}a(void 0)})}}var ke=function(e,t){return{signTransaction:(o=Te(we().m(function r(o,i){var a;return we().w(function(r){for(;;)if(0===r.n)return(a=n.TransactionBuilder.fromXDR(o,(null==i?void 0:i.networkPassphrase)||t)).sign(e),r.a(2,{signedTxXdr:a.toXDR(),signerAddress:e.publicKey()})},r)})),function(e,t){return o.apply(this,arguments)}),signAuthEntry:(r=Te(we().m(function t(r){var o;return we().w(function(t){for(;;)if(0===t.n)return o=e.sign((0,n.hash)(be.from(r,"base64"))).toString("base64"),t.a(2,{signedAuthEntry:o,signerAddress:e.publicKey()})},t)})),function(e){return r.apply(this,arguments)})};var r,o},Oe=r(287).Buffer;function Ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(r),!0).forEach(function(t){Ie(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ae(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function xe(e){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xe(e)}function Pe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Re(n.key),n)}}function Ie(e,t,r){return(t=Re(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Re(e){var t=function(e,t){if("object"!=xe(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xe(t)?t:t+""}function Be(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ce(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ce(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function je(e){return/^\d+$/.test(e.name().toString())}var Ue={U32:{type:"integer",minimum:0,maximum:4294967295},I32:{type:"integer",minimum:-2147483648,maximum:2147483647},U64:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:20},I64:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:21},U128:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:39},I128:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:40},U256:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:78},I256:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:79},Address:{type:"string",format:"address",description:"Address can be a public key or contract id"},ScString:{type:"string",description:"ScString is a string"},ScSymbol:{type:"string",description:"ScSymbol is a string"},DataUrl:{type:"string",pattern:"^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$"}};function Ne(e){var t;switch(e.switch().value){case n.xdr.ScSpecType.scSpecTypeVal().value:t="Val";break;case n.xdr.ScSpecType.scSpecTypeBool().value:return{type:"boolean"};case n.xdr.ScSpecType.scSpecTypeVoid().value:return{type:"null"};case n.xdr.ScSpecType.scSpecTypeError().value:t="Error";break;case n.xdr.ScSpecType.scSpecTypeU32().value:t="U32";break;case n.xdr.ScSpecType.scSpecTypeI32().value:t="I32";break;case n.xdr.ScSpecType.scSpecTypeU64().value:t="U64";break;case n.xdr.ScSpecType.scSpecTypeI64().value:t="I64";break;case n.xdr.ScSpecType.scSpecTypeTimepoint().value:throw new Error("Timepoint type not supported");case n.xdr.ScSpecType.scSpecTypeDuration().value:throw new Error("Duration not supported");case n.xdr.ScSpecType.scSpecTypeU128().value:t="U128";break;case n.xdr.ScSpecType.scSpecTypeI128().value:t="I128";break;case n.xdr.ScSpecType.scSpecTypeU256().value:t="U256";break;case n.xdr.ScSpecType.scSpecTypeI256().value:t="I256";break;case n.xdr.ScSpecType.scSpecTypeBytes().value:t="DataUrl";break;case n.xdr.ScSpecType.scSpecTypeString().value:t="ScString";break;case n.xdr.ScSpecType.scSpecTypeSymbol().value:t="ScSymbol";break;case n.xdr.ScSpecType.scSpecTypeAddress().value:t="Address";break;case n.xdr.ScSpecType.scSpecTypeOption().value:return Ne(e.option().valueType());case n.xdr.ScSpecType.scSpecTypeResult().value:break;case n.xdr.ScSpecType.scSpecTypeVec().value:return{type:"array",items:Ne(e.vec().elementType())};case n.xdr.ScSpecType.scSpecTypeMap().value:var r=e.map();return{type:"array",items:{type:"array",items:[Ne(r.keyType()),Ne(r.valueType())],minItems:2,maxItems:2}};case n.xdr.ScSpecType.scSpecTypeTuple().value:var o=e.tuple(),i=o.valueTypes().length,a=i;return{type:"array",items:o.valueTypes().map(Ne),minItems:i,maxItems:a};case n.xdr.ScSpecType.scSpecTypeBytesN().value:return{$ref:"#/definitions/DataUrl",maxLength:e.bytesN().n()};case n.xdr.ScSpecType.scSpecTypeUdt().value:t=e.udt().name().toString()}return{$ref:"#/definitions/".concat(t)}}function Le(e){var t={},r=[];e.forEach(function(e){var o=e.type(),i=e.name().toString();t[i]=Ne(o),o.switch().value!==n.xdr.ScSpecType.scSpecTypeOption().value&&r.push(i)});var o={properties:t};return r.length>0&&(o.required=r),o}var De,Fe,Me,Ve=(De=function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ie(this,"entries",[]),0===t.length)throw new Error("Contract spec must have at least one entry");var r=t[0];this.entries="string"==typeof r?t.map(function(e){return n.xdr.ScSpecEntry.fromXDR(e,"base64")}):t},Fe=[{key:"funcs",value:function(){return this.entries.filter(function(e){return e.switch().value===n.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value}).map(function(e){return e.functionV0()})}},{key:"getFunc",value:function(e){var t=this.findEntry(e);if(t.switch().value!==n.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value)throw new Error("".concat(e," is not a function"));return t.functionV0()}},{key:"funcArgsToScVals",value:function(e,t){var r=this;return this.getFunc(e).inputs().map(function(e){return r.nativeToScVal(function(e,t){var r=t.name().toString(),n=Object.entries(e).find(function(e){return Be(e,1)[0]===r});if(!n)throw new Error("Missing field ".concat(r));return n[1]}(t,e),e.type())})}},{key:"funcResToNative",value:function(e,t){var r="string"==typeof t?n.xdr.ScVal.fromXDR(t,"base64"):t,o=this.getFunc(e).outputs();if(0===o.length){var i=r.switch();if(i.value!==n.xdr.ScValType.scvVoid().value)throw new Error("Expected void, got ".concat(i.name));return null}if(o.length>1)throw new Error("Multiple outputs not supported");var a=o[0];return a.switch().value===n.xdr.ScSpecType.scSpecTypeResult().value?new p(this.scValToNative(r,a.result().okType())):this.scValToNative(r,a)}},{key:"findEntry",value:function(e){var t=this.entries.find(function(t){return t.value().name().toString()===e});if(!t)throw new Error("no such entry: ".concat(e));return t}},{key:"nativeToScVal",value:function(e,t){var r=this,o=t.switch(),i=o.value;if(o.value===n.xdr.ScSpecType.scSpecTypeUdt().value){var a=t.udt();return this.nativeToUdt(e,a.name().toString())}if(i===n.xdr.ScSpecType.scSpecTypeOption().value){var s=t.option();return void 0===e?n.xdr.ScVal.scvVoid():this.nativeToScVal(e,s.valueType())}switch(xe(e)){case"object":var u,c,l;if(null===e){if(i===n.xdr.ScSpecType.scSpecTypeVoid().value)return n.xdr.ScVal.scvVoid();throw new TypeError("Type ".concat(t," was not void, but value was null"))}if(e instanceof n.xdr.ScVal)return e;if(e instanceof n.Address){if(t.switch().value!==n.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError("Type ".concat(t," was not address, but value was Address"));return e.toScVal()}if(e instanceof n.Contract){if(t.switch().value!==n.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError("Type ".concat(t," was not address, but value was Address"));return e.address().toScVal()}if(e instanceof Uint8Array||Oe.isBuffer(e)){var f=Uint8Array.from(e);switch(i){case n.xdr.ScSpecType.scSpecTypeBytesN().value:var p=t.bytesN();if(f.length!==p.n())throw new TypeError("expected ".concat(p.n()," bytes, but got ").concat(f.length));return n.xdr.ScVal.scvBytes(f);case n.xdr.ScSpecType.scSpecTypeBytes().value:return n.xdr.ScVal.scvBytes(f);default:throw new TypeError("invalid type (".concat(t,") specified for Bytes and BytesN"))}}if(Array.isArray(e))switch(i){case n.xdr.ScSpecType.scSpecTypeVec().value:var d=t.vec().elementType();return n.xdr.ScVal.scvVec(e.map(function(e){return r.nativeToScVal(e,d)}));case n.xdr.ScSpecType.scSpecTypeTuple().value:var h=t.tuple().valueTypes();if(e.length!==h.length)throw new TypeError("Tuple expects ".concat(h.length," values, but ").concat(e.length," were provided"));return n.xdr.ScVal.scvVec(e.map(function(e,t){return r.nativeToScVal(e,h[t])}));case n.xdr.ScSpecType.scSpecTypeMap().value:var y=t.map(),m=y.keyType(),g=y.valueType();return n.xdr.ScVal.scvMap(e.map(function(e){var t=r.nativeToScVal(e[0],m),o=r.nativeToScVal(e[1],g);return new n.xdr.ScMapEntry({key:t,val:o})}));default:throw new TypeError("Type ".concat(t," was not vec, but value was Array"))}if(e.constructor===Map){if(i!==n.xdr.ScSpecType.scSpecTypeMap().value)throw new TypeError("Type ".concat(t," was not map, but value was Map"));for(var v=t.map(),b=[],w=e.entries(),S=w.next();!S.done;){var E=Be(S.value,2),T=E[0],k=E[1],O=this.nativeToScVal(T,v.keyType()),A=this.nativeToScVal(k,v.valueType());b.push(new n.xdr.ScMapEntry({key:O,val:A})),S=w.next()}return n.xdr.ScVal.scvMap(b)}if("Object"!==(null!==(u=null===(c=e.constructor)||void 0===c?void 0:c.name)&&void 0!==u?u:""))throw new TypeError("cannot interpret ".concat(null===(l=e.constructor)||void 0===l?void 0:l.name," value as ScVal (").concat(JSON.stringify(e),")"));throw new TypeError("Received object ".concat(e," did not match the provided type ").concat(t));case"number":case"bigint":switch(i){case n.xdr.ScSpecType.scSpecTypeU32().value:return n.xdr.ScVal.scvU32(e);case n.xdr.ScSpecType.scSpecTypeI32().value:return n.xdr.ScVal.scvI32(e);case n.xdr.ScSpecType.scSpecTypeU64().value:case n.xdr.ScSpecType.scSpecTypeI64().value:case n.xdr.ScSpecType.scSpecTypeU128().value:case n.xdr.ScSpecType.scSpecTypeI128().value:case n.xdr.ScSpecType.scSpecTypeU256().value:case n.xdr.ScSpecType.scSpecTypeI256().value:var _=o.name.substring(10).toLowerCase();return new n.XdrLargeInt(_,e).toScVal();default:throw new TypeError("invalid type (".concat(t,") specified for integer"))}case"string":return function(e,t){switch(t.value){case n.xdr.ScSpecType.scSpecTypeString().value:return n.xdr.ScVal.scvString(e);case n.xdr.ScSpecType.scSpecTypeSymbol().value:return n.xdr.ScVal.scvSymbol(e);case n.xdr.ScSpecType.scSpecTypeAddress().value:return n.Address.fromString(e).toScVal();case n.xdr.ScSpecType.scSpecTypeU64().value:return new n.XdrLargeInt("u64",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI64().value:return new n.XdrLargeInt("i64",e).toScVal();case n.xdr.ScSpecType.scSpecTypeU128().value:return new n.XdrLargeInt("u128",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI128().value:return new n.XdrLargeInt("i128",e).toScVal();case n.xdr.ScSpecType.scSpecTypeU256().value:return new n.XdrLargeInt("u256",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI256().value:return new n.XdrLargeInt("i256",e).toScVal();case n.xdr.ScSpecType.scSpecTypeBytes().value:case n.xdr.ScSpecType.scSpecTypeBytesN().value:return n.xdr.ScVal.scvBytes(Oe.from(e,"base64"));default:throw new TypeError("invalid type ".concat(t.name," specified for string value"))}}(e,o);case"boolean":if(i!==n.xdr.ScSpecType.scSpecTypeBool().value)throw TypeError("Type ".concat(t," was not bool, but value was bool"));return n.xdr.ScVal.scvBool(e);case"undefined":if(!t)return n.xdr.ScVal.scvVoid();switch(i){case n.xdr.ScSpecType.scSpecTypeVoid().value:case n.xdr.ScSpecType.scSpecTypeOption().value:return n.xdr.ScVal.scvVoid();default:throw new TypeError("Type ".concat(t," was not void, but value was undefined"))}case"function":return this.nativeToScVal(e(),t);default:throw new TypeError("failed to convert typeof ".concat(xe(e)," (").concat(e,")"))}}},{key:"nativeToUdt",value:function(e,t){var r=this.findEntry(t);switch(r.switch()){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():if("number"!=typeof e)throw new TypeError("expected number for enum ".concat(t,", but got ").concat(xe(e)));return this.nativeToEnum(e,r.udtEnumV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.nativeToStruct(e,r.udtStructV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.nativeToUnion(e,r.udtUnionV0());default:throw new Error("failed to parse udt ".concat(t))}}},{key:"nativeToUnion",value:function(e,t){var r=this,o=e.tag,i=t.cases().find(function(e){return e.value().name().toString()===o});if(!i)throw new TypeError("no such enum entry: ".concat(o," in ").concat(t));var a=n.xdr.ScVal.scvSymbol(o);switch(i.switch()){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0():return n.xdr.ScVal.scvVec([a]);case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0():var s=i.tupleCase().type();if(Array.isArray(e.values)){if(e.values.length!==s.length)throw new TypeError("union ".concat(t," expects ").concat(s.length," values, but got ").concat(e.values.length));var u=e.values.map(function(e,t){return r.nativeToScVal(e,s[t])});return u.unshift(a),n.xdr.ScVal.scvVec(u)}throw new Error("failed to parse union case ".concat(i," with ").concat(e));default:throw new Error("failed to parse union ".concat(t," with ").concat(e))}}},{key:"nativeToStruct",value:function(e,t){var r=this,o=t.fields();if(o.some(je)){if(!o.every(je))throw new Error("mixed numeric and non-numeric field names are not allowed");return n.xdr.ScVal.scvVec(o.map(function(t,n){return r.nativeToScVal(e[n],o[n].type())}))}return n.xdr.ScVal.scvMap(o.map(function(t){var o=t.name().toString();return new n.xdr.ScMapEntry({key:r.nativeToScVal(o,n.xdr.ScSpecTypeDef.scSpecTypeSymbol()),val:r.nativeToScVal(e[o],t.type())})}))}},{key:"nativeToEnum",value:function(e,t){if(t.cases().some(function(t){return t.value()===e}))return n.xdr.ScVal.scvU32(e);throw new TypeError("no such enum entry: ".concat(e," in ").concat(t))}},{key:"scValStrToNative",value:function(e,t){return this.scValToNative(n.xdr.ScVal.fromXDR(e,"base64"),t)}},{key:"scValToNative",value:function(e,t){var r=this,o=t.switch(),i=o.value;if(i===n.xdr.ScSpecType.scSpecTypeUdt().value)return this.scValUdtToNative(e,t.udt());switch(e.switch().value){case n.xdr.ScValType.scvVoid().value:return;case n.xdr.ScValType.scvU64().value:case n.xdr.ScValType.scvI64().value:case n.xdr.ScValType.scvU128().value:case n.xdr.ScValType.scvI128().value:case n.xdr.ScValType.scvU256().value:case n.xdr.ScValType.scvI256().value:return(0,n.scValToBigInt)(e);case n.xdr.ScValType.scvVec().value:if(i===n.xdr.ScSpecType.scSpecTypeVec().value){var a,s=t.vec();return(null!==(a=e.vec())&&void 0!==a?a:[]).map(function(e){return r.scValToNative(e,s.elementType())})}if(i===n.xdr.ScSpecType.scSpecTypeTuple().value){var u,c=t.tuple().valueTypes();return(null!==(u=e.vec())&&void 0!==u?u:[]).map(function(e,t){return r.scValToNative(e,c[t])})}throw new TypeError("Type ".concat(t," was not vec, but ").concat(e," is"));case n.xdr.ScValType.scvAddress().value:return n.Address.fromScVal(e).toString();case n.xdr.ScValType.scvMap().value:var l,f=null!==(l=e.map())&&void 0!==l?l:[];if(i===n.xdr.ScSpecType.scSpecTypeMap().value){var p=t.map(),d=p.keyType(),h=p.valueType();return f.map(function(e){return[r.scValToNative(e.key(),d),r.scValToNative(e.val(),h)]})}throw new TypeError("ScSpecType ".concat(o.name," was not map, but ").concat(JSON.stringify(e,null,2)," is"));case n.xdr.ScValType.scvBool().value:case n.xdr.ScValType.scvU32().value:case n.xdr.ScValType.scvI32().value:case n.xdr.ScValType.scvBytes().value:return e.value();case n.xdr.ScValType.scvString().value:case n.xdr.ScValType.scvSymbol().value:var y;if(i!==n.xdr.ScSpecType.scSpecTypeString().value&&i!==n.xdr.ScSpecType.scSpecTypeSymbol().value)throw new Error("ScSpecType ".concat(o.name," was not string or symbol, but ").concat(JSON.stringify(e,null,2)," is"));return null===(y=e.value())||void 0===y?void 0:y.toString();case n.xdr.ScValType.scvTimepoint().value:case n.xdr.ScValType.scvDuration().value:return(0,n.scValToBigInt)(n.xdr.ScVal.scvU64(e.u64()));default:throw new TypeError("failed to convert ".concat(JSON.stringify(e,null,2)," to native type from type ").concat(o.name))}}},{key:"scValUdtToNative",value:function(e,t){var r=this.findEntry(t.name().toString());switch(r.switch()){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():return this.enumToNative(e);case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.structToNative(e,r.udtStructV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.unionToNative(e,r.udtUnionV0());default:throw new Error("failed to parse udt ".concat(t.name().toString(),": ").concat(r))}}},{key:"unionToNative",value:function(e,t){var r=this,o=e.vec();if(!o)throw new Error("".concat(JSON.stringify(e,null,2)," is not a vec"));if(0===o.length&&0!==t.cases.length)throw new Error("".concat(e," has length 0, but the there are at least one case in the union"));var i=o[0].sym().toString();if(o[0].switch().value!==n.xdr.ScValType.scvSymbol().value)throw new Error("{vec[0]} is not a symbol");var a=t.cases().find(function(e){return function(t){switch(t.switch().value){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:return t.tupleCase().name().toString()===e;case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:return t.voidCase().name().toString()===e;default:return!1}}}(i));if(!a)throw new Error("failed to find entry ".concat(i," in union {udt.name().toString()}"));var s={tag:i};if(a.switch().value===n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value){var u=a.tupleCase().type().map(function(e,t){return r.scValToNative(o[t+1],e)});s.values=u}return s}},{key:"structToNative",value:function(e,t){var r,n,o=this,i={},a=t.fields();return a.some(je)?null===(n=e.vec())||void 0===n?void 0:n.map(function(e,t){return o.scValToNative(e,a[t].type())}):(null===(r=e.map())||void 0===r||r.forEach(function(e,t){var r=a[t];i[r.name().toString()]=o.scValToNative(e.val(),r.type())}),i)}},{key:"enumToNative",value:function(e){if(e.switch().value!==n.xdr.ScValType.scvU32().value)throw new Error("Enum must have a u32 value");return e.u32()}},{key:"errorCases",value:function(){return this.entries.filter(function(e){return e.switch().value===n.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value}).flatMap(function(e){return e.value().cases()})}},{key:"jsonSchema",value:function(e){var t={};this.entries.forEach(function(e){switch(e.switch().value){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0().value:var r=e.udtEnumV0();t[r.name().toString()]=function(e){var t=e.doc().toString(),r=e.cases(),n=[];r.forEach(function(e){var t=e.name().toString(),r=e.doc().toString();n.push({description:r,title:t,enum:[e.value()],type:"number"})});var o={oneOf:n};return t.length>0&&(o.description=t),o}(r);break;case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0().value:var o=e.udtStructV0();t[o.name().toString()]=function(e){var t=e.fields();if(t.some(je)){if(!t.every(je))throw new Error("mixed numeric and non-numeric field names are not allowed");return{type:"array",items:t.map(function(e,r){return Ne(t[r].type())}),minItems:t.length,maxItems:t.length}}var r=e.doc().toString(),n=Le(t),o=n.properties,i=n.required;return o.additionalProperties=!1,{description:r,properties:o,required:i,type:"object"}}(o);break;case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0().value:var i=e.udtUnionV0();t[i.name().toString()]=function(e){var t=e.doc().toString(),r=e.cases(),o=[];r.forEach(function(e){switch(e.switch().value){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:var t=e.voidCase().name().toString();o.push({type:"object",title:t,properties:{tag:t},additionalProperties:!1,required:["tag"]});break;case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:var r=e.tupleCase(),i=r.name().toString();o.push({type:"object",title:i,properties:{tag:i,values:{type:"array",items:r.type().map(Ne)}},required:["tag","values"],additionalProperties:!1})}});var i={oneOf:o};return t.length>0&&(i.description=t),i}(i);break;case n.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value:var a=e.functionV0(),s=a.name().toString(),u=function(e){var t=Le(e.inputs()),r=t.properties,o=t.required,i={additionalProperties:!1,properties:r,type:"object"};(null==o?void 0:o.length)>0&&(i.required=o);var a={properties:{args:i}},s=e.outputs(),u=s.length>0?Ne(s[0]):Ne(n.xdr.ScSpecTypeDef.scSpecTypeVoid()),c=e.doc().toString();return c.length>0&&(a.description=c),a.additionalProperties=!1,u.additionalProperties=!1,{input:a,output:u}}(a),c=u.input;t[s]=c;case n.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value:}});var r={$schema:"http://json-schema.org/draft-07/schema#",definitions:_e(_e({},Ue),t)};return e&&(r.$ref="#/definitions/".concat(e)),r}}],Fe&&Pe(De.prototype,Fe),Me&&Pe(De,Me),Object.defineProperty(De,"prototype",{writable:!1}),De),qe=r(287).Buffer;function He(e){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(e)}var ze=["method"],Ke=["wasmHash","salt","format","fee","timeoutInSeconds","simulate"];function Xe(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return $e(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):($e(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,$e(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,$e(f,"constructor",c),$e(c,"constructor",u),u.displayName="GeneratorFunction",$e(c,o,"GeneratorFunction"),$e(f),$e(f,o,"Generator"),$e(f,n,function(){return this}),$e(f,"toString",function(){return"[object Generator]"}),(Xe=function(){return{w:i,m:p}})()}function $e(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}$e=function(e,t,r,n){function i(t,r){$e(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},$e(e,t,r,n)}function Ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(r),!0).forEach(function(t){Ye(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Qe(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ze(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Je(n.key),n)}}function Ye(e,t,r){return(t=Je(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Je(e){var t=function(e,t){if("object"!=He(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=He(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==He(t)?t:t+""}function et(e){return function(e){if(Array.isArray(e))return tt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return tt(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function rt(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function nt(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){rt(i,n,o,a,s,"next",e)}function s(e){rt(i,n,o,a,s,"throw",e)}a(void 0)})}}var ot="__constructor";function it(e){return at.apply(this,arguments)}function at(){return(at=nt(Xe().m(function e(t){var r,n,o,i,a,s;return Xe().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,WebAssembly.compile(t);case 1:n=e.v,r=WebAssembly.Module.customSections(n,"contractspecv0"),e.n=3;break;case 2:e.p=2,e.v,o=st(t),r=o.get("contractspecv0");case 3:if(r&&0!==r.length){e.n=4;break}throw new Error("Could not obtain contract spec from wasm");case 4:return i=qe.from(r[0]),a=O(i),s=new Ve(a),e.a(2,s)}},e,null,[[0,2]])}))).apply(this,arguments)}function st(e){var t=new Map,r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),n=0,o=function(t){if(n+t>e.byteLength)throw new Error("Buffer overflow");var o=new Uint8Array(r,n,t);return n+=t,o};if("0,97,115,109"!==et(o(4)).join())throw new Error("Invalid WASM magic");if("1,0,0,0"!==et(o(4)).join())throw new Error("Invalid WASM version");for(;n<e.byteLength;){var i=o(1)[0],a=p(),s=n;if(0===i){var u=p();if(0===u||n+u>s+a)continue;var c=o(u),l=o(a-(n-s));try{var f=new TextDecoder("utf-8",{fatal:!0}).decode(c);l.length>0&&t.set(f,(t.get(f)||[]).concat(l))}catch(e){}}else n+=a}function p(){for(var e=0,t=0;;){var r=o(1)[0];if(e|=(127&r)<<t,!(128&r))break;if((t+=7)>=32)throw new Error("Invalid WASM value")}return e>>>0}return t}function ut(e,t){return ct.apply(this,arguments)}function ct(){return ct=nt(Xe().m(function e(t,r){var n,i,a,s,u,c,l=arguments;return Xe().w(function(e){for(;;)switch(e.n){case 0:if(n=l.length>2&&void 0!==l[2]?l[2]:"hex",r&&r.rpcUrl){e.n=1;break}throw new TypeError("options must contain rpcUrl");case 1:return i=r.rpcUrl,a=r.allowHttp,s={allowHttp:a},u=new o.Server(i,s),e.n=2,u.getContractWasmByHash(t,n);case 2:return c=e.v,e.a(2,it(c))}},e)})),ct.apply(this,arguments)}var lt=function(){function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ye(this,"txFromJSON",function(e){var t=JSON.parse(e),r=t.method,o=Qe(t,ze);return ve.fromJSON(We(We({},n.options),{},{method:r,parseResultXdr:function(e){return n.spec.funcResToNative(r,e)}}),o)}),Ye(this,"txFromXDR",function(e){return ve.fromXDR(n.options,e,n.spec)}),this.spec=t,this.options=r,this.spec.funcs().forEach(function(e){var o=e.name().toString();if(o!==ot){var i=function(e,n){return ve.build(We(We(We({method:o,args:e&&t.funcArgsToScVals(o,e)},r),n),{},{errorTypes:t.errorCases().reduce(function(e,t){return We(We({},e),{},Ye({},t.value(),{message:t.doc().toString()}))},{}),parseResultXdr:function(e){return t.funcResToNative(o,e)}}))};n[o]=0===t.getFunc(o).inputs().length?function(e){return i(void 0,e)}:i}})}return function(e,t,r){return t&&Ze(e.prototype,t),r&&Ze(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,null,[{key:"deploy",value:(a=nt(Xe().m(function t(r,o){var i,a,s,u,c,l,f,p,d;return Xe().w(function(t){for(;;)switch(t.n){case 0:return i=o.wasmHash,a=o.salt,s=o.format,u=o.fee,c=o.timeoutInSeconds,l=o.simulate,f=Qe(o,Ke),t.n=1,ut(i,f,s);case 1:return p=t.v,d=n.Operation.createCustomContract({address:new n.Address(o.address||o.publicKey),wasmHash:"string"==typeof i?qe.from(i,null!=s?s:"hex"):i,salt:a,constructorArgs:r?p.funcArgsToScVals(ot,r):[]}),t.a(2,ve.buildWithOp(d,We(We({fee:u,timeoutInSeconds:c,simulate:l},f),{},{contractId:"ignored",method:ot,parseResultXdr:function(t){return new e(p,We(We({},f),{},{contractId:n.Address.fromScVal(t).toString()}))}})))}},t)})),function(e,t){return a.apply(this,arguments)})},{key:"fromWasmHash",value:(i=nt(Xe().m(function t(r,n){var i,a,s,u,c,l,f=arguments;return Xe().w(function(t){for(;;)switch(t.n){case 0:if(i=f.length>2&&void 0!==f[2]?f[2]:"hex",n&&n.rpcUrl){t.n=1;break}throw new TypeError("options must contain rpcUrl");case 1:return a=n.rpcUrl,s=n.allowHttp,u={allowHttp:s},c=new o.Server(a,u),t.n=2,c.getContractWasmByHash(r,i);case 2:return l=t.v,t.a(2,e.fromWasm(l,n))}},t)})),function(e,t){return i.apply(this,arguments)})},{key:"fromWasm",value:(r=nt(Xe().m(function t(r,n){var o;return Xe().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,it(r);case 1:return o=t.v,t.a(2,new e(o,n))}},t)})),function(e,t){return r.apply(this,arguments)})},{key:"from",value:(t=nt(Xe().m(function t(r){var n,i,a,s,u,c;return Xe().w(function(t){for(;;)switch(t.n){case 0:if(r&&r.rpcUrl&&r.contractId){t.n=1;break}throw new TypeError("options must contain rpcUrl and contractId");case 1:return n=r.rpcUrl,i=r.contractId,a=r.allowHttp,s={allowHttp:a},u=new o.Server(n,s),t.n=2,u.getContractWasmByContractId(i);case 2:return c=t.v,t.a(2,e.fromWasm(c,r))}},t)})),function(e){return t.apply(this,arguments)})}]);var t,r,i,a}()},340:function(e,t,r){var n;e=r.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var i,a=2147483647,s=36,u=/^xn--/,c=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function h(e){throw new RangeError(f[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function m(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(l,".")).split("."),t).join(".")}function g(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function v(e){return y(e,function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)}).join("")}function b(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:s}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,r){var n=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;n+=s)e=p(e/35);return p(n+36*e/(e+38))}function E(e){var t,r,n,o,i,u,c,l,f,d,y=[],m=e.length,g=0,w=128,E=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&h("not-basic"),y.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<m;){for(i=g,u=1,c=s;o>=m&&h("invalid-input"),((l=b(e.charCodeAt(o++)))>=s||l>p((a-g)/u))&&h("overflow"),g+=l*u,!(l<(f=c<=E?1:c>=E+26?26:c-E));c+=s)u>p(a/(d=s-f))&&h("overflow"),u*=d;E=S(g-i,t=y.length+1,0==i),p(g/t)>a-w&&h("overflow"),w+=p(g/t),g%=t,y.splice(g++,0,w)}return v(y)}function T(e){var t,r,n,o,i,u,c,l,f,y,m,v,b,E,T,k=[];for(v=(e=g(e)).length,t=128,r=0,i=72,u=0;u<v;++u)(m=e[u])<128&&k.push(d(m));for(n=o=k.length,o&&k.push("-");n<v;){for(c=a,u=0;u<v;++u)(m=e[u])>=t&&m<c&&(c=m);for(c-t>p((a-r)/(b=n+1))&&h("overflow"),r+=(c-t)*b,t=c,u=0;u<v;++u)if((m=e[u])<t&&++r>a&&h("overflow"),m==t){for(l=r,f=s;!(l<(y=f<=i?1:f>=i+26?26:f-i));f+=s)T=l-y,E=s-y,k.push(d(w(y+T%E,0))),l=p(T/E);k.push(d(w(l,0))),i=S(r,b,n==o),r=0,++n}++r,++t}return k.join("")}i={version:"1.3.2",ucs2:{decode:g,encode:v},decode:E,encode:T,toASCII:function(e){return m(e,function(e){return c.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return m(e,function(e){return u.test(e)?E(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},356:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AccountRequiresMemoError:()=>n.Cu,BadRequestError:()=>n.v7,BadResponseError:()=>n.nS,Config:()=>o.T,Federation:()=>s,Friendbot:()=>c,Horizon:()=>l,NetworkError:()=>n.Dr,NotFoundError:()=>n.m_,StellarToml:()=>a,Utils:()=>i.A,WebAuth:()=>u,contract:()=>p,default:()=>y,rpc:()=>f});var n=r(976),o=r(732),i=r(121),a=r(898),s=r(600),u=r(479),c=r(242),l=r(733),f=r(496),p=r(299),d=r(950),h={};for(const e in d)["default","Config","Utils","StellarToml","Federation","WebAuth","Friendbot","Horizon","rpc","contract","AccountRequiresMemoError","BadRequestError","BadResponseError","NetworkError","NotFoundError"].indexOf(e)<0&&(h[e]=()=>d[e]);r.d(t,h);const y=(e=r.hmd(e)).exports;void 0===r.g.__USE_AXIOS__&&(r.g.__USE_AXIOS__=!0),void 0===r.g.__USE_EVENTSOURCE__&&(r.g.__USE_EVENTSOURCE__=!1)},371:(e,t,r)=>{"use strict";r.d(t,{ok:()=>n,vt:()=>o});r(798);var n,o,i=r(920);n=i.fetchClient,o=i.create},430:function(e,t,r){var n,o;!function(i,a){"use strict";e.exports?e.exports=a():void 0===(o="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=o)}(0,function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),o=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[o-1]&&""===n[o-2]&&n.pop(),-1!==n[(o=n.length)-1].indexOf(".")&&(i=7),t=0;t<o&&""!==n[t];t++);if(t<i)for(n.splice(t,1,"0000");n.length<i;)n.splice(t,0,"0000");for(var a=0;a<i;a++){r=n[a].split("");for(var s=0;s<3&&("0"===r[0]&&r.length>1);s++)r.splice(0,1);n[a]=r.join("")}var u=-1,c=0,l=0,f=-1,p=!1;for(a=0;a<i;a++)p?"0"===n[a]?l+=1:(p=!1,l>c&&(u=f,c=l)):"0"===n[a]&&(p=!0,f=a,l=1);l>c&&(u=f,c=l),c>1&&n.splice(u,c,""),o=n.length;var d="";for(""===n[0]&&(d=":"),a=0;a<o&&(d+=n[a],a!==o-1);a++)d+=":";return""===n[o-1]&&(d+=":"),d},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}})},479:(e,t,r)=>{"use strict";r.r(t),r.d(t,{InvalidChallengeError:()=>y,buildChallengeTx:()=>k,gatherTxSigners:()=>P,readChallengeTx:()=>O,verifyChallengeTxSigners:()=>_,verifyChallengeTxThreshold:()=>A,verifyTxSignedBy:()=>x});var n=r(209),o=r.n(n),i=r(950),a=r(121);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function c(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function l(e,t,r){return t=h(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(p())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&d(o,r.prototype),o}(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),d(r,e)},f(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}var y=function(e){function t(e){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=(this instanceof t?this.constructor:void 0).prototype;return(r=l(this,t,[e])).__proto__=n,r.constructor=t,r.name="InvalidChallengeError",r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(t,e),r=t,n&&u(r.prototype,n),o&&u(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(f(Error)),m=r(287).Buffer;function g(e){return function(e){if(Array.isArray(e))return E(e)}(e)||T(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=S(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function w(e){return function(e){if(Array.isArray(e))return e}(e)||T(e)||S(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return E(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function T(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:300,a=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;if(t.startsWith("M")&&u)throw Error("memo cannot be used if clientAccountID is a muxed account");var f=new i.Account(e.publicKey(),"-1"),p=Math.floor(Date.now()/1e3),d=o()(48).toString("base64"),h=new i.TransactionBuilder(f,{fee:i.BASE_FEE,networkPassphrase:a,timebounds:{minTime:p,maxTime:p+n}}).addOperation(i.Operation.manageData({name:"".concat(r," auth"),value:d,source:t})).addOperation(i.Operation.manageData({name:"web_auth_domain",value:s,source:f.accountId()}));if(c){if(!l)throw Error("clientSigningKey is required if clientDomain is provided");h.addOperation(i.Operation.manageData({name:"client_domain",value:c,source:l}))}u&&h.addMemo(i.Memo.id(u));var y=h.build();return y.sign(e),y.toEnvelope().toXDR("base64").toString()}function O(e,t,r,n,o){var s,u;if(t.startsWith("M"))throw Error("Invalid serverAccountID: multiplexed accounts are not supported.");try{u=new i.Transaction(e,r)}catch(t){try{u=new i.FeeBumpTransaction(e,r)}catch(e){throw new y("Invalid challenge: unable to deserialize challengeTx transaction string")}throw new y("Invalid challenge: expected a Transaction but received a FeeBumpTransaction")}if(0!==Number.parseInt(u.sequence,10))throw new y("The transaction sequence number should be zero");if(u.source!==t)throw new y("The transaction source account is not equal to the server's account");if(u.operations.length<1)throw new y("The transaction should contain at least one operation");var c=w(u.operations),l=c[0],f=c.slice(1);if(!l.source)throw new y("The transaction's operation should contain a source account");var p,d=l.source,h=null;if(u.memo.type!==i.MemoNone){if(d.startsWith("M"))throw new y("The transaction has a memo but the client account ID is a muxed account");if(u.memo.type!==i.MemoID)throw new y("The transaction's memo must be of type `id`");h=u.memo.value}if("manageData"!==l.type)throw new y("The transaction's operation type should be 'manageData'");if(u.timeBounds&&Number.parseInt(null===(s=u.timeBounds)||void 0===s?void 0:s.maxTime,10)===i.TimeoutInfinite)throw new y("The transaction requires non-infinite timebounds");if(!a.A.validateTimebounds(u,300))throw new y("The transaction has expired");if(void 0===l.value)throw new y("The transaction's operation values should not be null");if(!l.value)throw new y("The transaction's operation value should not be null");if(48!==m.from(l.value.toString(),"base64").length)throw new y("The transaction's operation value should be a 64 bytes base64 random string");if(!n)throw new y("Invalid homeDomains: a home domain must be provided for verification");if("string"==typeof n)"".concat(n," auth")===l.name&&(p=n);else{if(!Array.isArray(n))throw new y("Invalid homeDomains: homeDomains type is ".concat(b(n)," but should be a string or an array"));p=n.find(function(e){return"".concat(e," auth")===l.name})}if(!p)throw new y("Invalid homeDomains: the transaction's operation key name does not match the expected home domain");var g,S=v(f);try{for(S.s();!(g=S.n()).done;){var E=g.value;if("manageData"!==E.type)throw new y("The transaction has operations that are not of type 'manageData'");if(E.source!==t&&"client_domain"!==E.name)throw new y("The transaction has operations that are unrecognized");if("web_auth_domain"===E.name){if(void 0===E.value)throw new y("'web_auth_domain' operation value should not be null");if(E.value.compare(m.from(o)))throw new y("'web_auth_domain' operation value does not match ".concat(o))}}}catch(e){S.e(e)}finally{S.f()}if(!x(u,t))throw new y("Transaction not signed by server: '".concat(t,"'"));return{tx:u,clientAccountID:d,matchedHomeDomain:p,memo:h}}function A(e,t,r,n,o,i,a){for(var s=_(e,t,r,o.map(function(e){return e.key}),i,a),u=0,c=function(){var e,t=f[l],r=(null===(e=o.find(function(e){return e.key===t}))||void 0===e?void 0:e.weight)||0;u+=r},l=0,f=s;l<f.length;l++)c();if(u<n)throw new y("signers with weight ".concat(u," do not meet threshold ").concat(n,'"'));return s}function _(e,t,r,n,o,a){var s,u=O(e,t,r,o,a).tx;try{s=i.Keypair.fromPublicKey(t)}catch(e){throw new Error("Couldn't infer keypair from the provided 'serverAccountID': ".concat(e.message))}var c,l,f=new Set,p=v(n);try{for(p.s();!(c=p.n()).done;){var d=c.value;d!==s.publicKey()&&("G"===d.charAt(0)&&f.add(d))}}catch(e){p.e(e)}finally{p.f()}if(0===f.size)throw new y("No verifiable client signers provided, at least one G... address must be provided");var h,m=v(u.operations);try{for(m.s();!(h=m.n()).done;){var b=h.value;if("manageData"===b.type&&"client_domain"===b.name){if(l)throw new y("Found more than one client_domain operation");l=b.source}}}catch(e){m.e(e)}finally{m.f()}var w=[s.publicKey()].concat(g(Array.from(f)));l&&w.push(l);for(var S=P(u,w),E=!1,T=!1,k=0,A=S;k<A.length;k++){var _=A[k];_===s.publicKey()&&(E=!0),_===l&&(T=!0)}if(!E)throw new y("Transaction not signed by server: '".concat(s.publicKey(),"'"));if(l&&!T)throw new y("Transaction not signed by the source account of the 'client_domain' ManageData operation");if(1===S.length)throw new y("None of the given signers match the transaction signatures");if(S.length!==u.signatures.length)throw new y("Transaction has unrecognized signatures");return S.splice(S.indexOf(s.publicKey()),1),l&&S.splice(S.indexOf(l),1),S}function x(e,t){return 0!==P(e,[t]).length}function P(e,t){var r,n=e.hash(),o=g(e.signatures),a=new Set,s=v(t);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(0===o.length)break;var c=void 0;try{c=i.Keypair.fromPublicKey(u)}catch(e){throw new y("Signer is not a valid address: ".concat(e.message))}for(var l=0;l<o.length;l++){var f=o[l];if(f.hint().equals(c.signatureHint())&&c.verify(n,f.signature())){a.add(u),o.splice(l,1);break}}}}catch(e){s.e(e)}finally{s.f()}return Array.from(a)}},496:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>n.j,AxiosClient:()=>s,BasicSleepStrategy:()=>P,Durability:()=>x,LinearSleepStrategy:()=>I,Server:()=>ae,assembleTransaction:()=>h.X,default:()=>se,parseRawEvents:()=>y.fG,parseRawSimulation:()=>y.jr});var n=r(76),o=r(193),i=r.n(o),a=r(950);const s=(0,r(371).vt)({headers:{"X-Client-Name":"js-soroban-client","X-Client-Version":"14.0.0"}});function u(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return c(l,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),l}var a={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(c(t={},n,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,c(d,"constructor",f),c(f,"constructor",l),l.displayName="GeneratorFunction",c(f,o,"GeneratorFunction"),c(d),c(d,o,"Generator"),c(d,n,function(){return this}),c(d,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function c(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}c=function(e,t,r,n){function i(t,r){c(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},c(e,t,r,n)}function l(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function f(e,t){return e.hasOwnProperty(t)}function p(e,t){return d.apply(this,arguments)}function d(){var e;return e=u().m(function e(t,r){var n,o,i,a=arguments;return u().w(function(e){for(;;)switch(e.n){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:null,e.n=1,s.post(t,{jsonrpc:"2.0",id:1,method:r,params:n});case 1:if(!f((o=e.v).data,"error")){e.n=2;break}throw o.data.error;case 2:return e.a(2,null===(i=o.data)||void 0===i?void 0:i.result);case 3:return e.a(2)}},e)}),d=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){l(i,n,o,a,s,"next",e)}function s(e){l(i,n,o,a,s,"throw",e)}a(void 0)})},d.apply(this,arguments)}var h=r(680),y=r(784),m=r(121),g=r(287).Buffer;function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function S(e,t,r){return(t=_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return T(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(T(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,T(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,T(f,"constructor",c),T(c,"constructor",u),u.displayName="GeneratorFunction",T(c,o,"GeneratorFunction"),T(f),T(f,o,"Generator"),T(f,n,function(){return this}),T(f,"toString",function(){return"[object Generator]"}),(E=function(){return{w:i,m:p}})()}function T(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}T=function(e,t,r,n){function i(t,r){T(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},T(e,t,r,n)}function k(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function O(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){k(i,n,o,a,s,"next",e)}function s(e){k(i,n,o,a,s,"throw",e)}a(void 0)})}}function A(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_(n.key),n)}}function _(e){var t=function(e,t){if("object"!=v(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==v(t)?t:t+""}var x=function(e){return e.Temporary="temporary",e.Persistent="persistent",e}({}),P=function(e){return 1e3},I=function(e){return 1e3*e};function R(e){var t,r=[];switch(e.switch()){case 0:r=e.operations();break;case 1:case 2:case 3:case 4:r=e.value().operations();break;default:throw new Error("Unexpected transaction meta switch value")}var n=null===(t=r.flatMap(function(e){return e.changes()}).find(function(e){return e.switch()===a.xdr.LedgerEntryChangeType.ledgerEntryCreated()&&e.created().data().switch()===a.xdr.LedgerEntryType.account()}))||void 0===t||null===(t=t.created())||void 0===t||null===(t=t.data())||void 0===t||null===(t=t.account())||void 0===t||null===(t=t.seqNum())||void 0===t?void 0:t.toString();if(n)return n;throw new Error("No account created in transaction")}var B,C,j,U,N,L,D,F,M,V,q,H,z,K,X,$,G,W,Q,Z,Y,J,ee,te,re,ne,oe,ie,ae=(B=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=i()(t),r.headers&&0!==Object.keys(r.headers).length&&s.interceptors.request.use(function(e){return e.headers=Object.assign(e.headers,r.headers),e}),"https"!==this.serverURL.protocol()&&!r.allowHttp)throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set")},C=[{key:"getAccount",value:(ie=O(E().m(function e(t){var r,n,o;return E().w(function(e){for(;;)switch(e.n){case 0:return r=a.xdr.LedgerKey.account(new a.xdr.LedgerKeyAccount({accountId:a.Keypair.fromPublicKey(t).xdrPublicKey()})),e.n=1,this.getLedgerEntries(r);case 1:if(0!==(n=e.v).entries.length){e.n=2;break}return e.a(2,Promise.reject({code:404,message:"Account not found: ".concat(t)}));case 2:return o=n.entries[0].val.account(),e.a(2,new a.Account(t,o.seqNum().toString()))}},e,this)})),function(e){return ie.apply(this,arguments)})},{key:"getHealth",value:(oe=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getHealth"))},e,this)})),function(){return oe.apply(this,arguments)})},{key:"getContractData",value:(ne=O(E().m(function e(t,r){var n,o,i,s,u,c=arguments;return E().w(function(e){for(;;)switch(e.n){case 0:if(n=c.length>2&&void 0!==c[2]?c[2]:x.Persistent,"string"!=typeof t){e.n=1;break}o=new a.Contract(t).address().toScAddress(),e.n=4;break;case 1:if(!(t instanceof a.Address)){e.n=2;break}o=t.toScAddress(),e.n=4;break;case 2:if(!(t instanceof a.Contract)){e.n=3;break}o=t.address().toScAddress(),e.n=4;break;case 3:throw new TypeError("unknown contract type: ".concat(t));case 4:u=n,e.n=u===x.Temporary?5:u===x.Persistent?6:7;break;case 5:return i=a.xdr.ContractDataDurability.temporary(),e.a(3,8);case 6:return i=a.xdr.ContractDataDurability.persistent(),e.a(3,8);case 7:throw new TypeError("invalid durability: ".concat(n));case 8:return s=a.xdr.LedgerKey.contractData(new a.xdr.LedgerKeyContractData({key:r,contract:o,durability:i})),e.a(2,this.getLedgerEntries(s).then(function(e){return 0===e.entries.length?Promise.reject({code:404,message:"Contract data not found. Contract: ".concat(a.Address.fromScAddress(o).toString(),", Key: ").concat(r.toXDR("base64"),", Durability: ").concat(n)}):e.entries[0]}))}},e,this)})),function(e,t){return ne.apply(this,arguments)})},{key:"getContractWasmByContractId",value:(re=O(E().m(function e(t){var r,n,o,i;return E().w(function(e){for(;;)switch(e.n){case 0:return n=new a.Contract(t).getFootprint(),e.n=1,this.getLedgerEntries(n);case 1:if((o=e.v).entries.length&&null!==(r=o.entries[0])&&void 0!==r&&r.val){e.n=2;break}return e.a(2,Promise.reject({code:404,message:"Could not obtain contract hash from server"}));case 2:return i=o.entries[0].val.contractData().val().instance().executable().wasmHash(),e.a(2,this.getContractWasmByHash(i))}},e,this)})),function(e){return re.apply(this,arguments)})},{key:"getContractWasmByHash",value:(te=O(E().m(function e(t){var r,n,o,i,s,u,c=arguments;return E().w(function(e){for(;;)switch(e.n){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:void 0,o="string"==typeof t?g.from(t,n):t,i=a.xdr.LedgerKey.contractCode(new a.xdr.LedgerKeyContractCode({hash:o})),e.n=1,this.getLedgerEntries(i);case 1:if((s=e.v).entries.length&&null!==(r=s.entries[0])&&void 0!==r&&r.val){e.n=2;break}return e.a(2,Promise.reject({code:404,message:"Could not obtain contract wasm from server"}));case 2:return u=s.entries[0].val.contractCode().code(),e.a(2,u)}},e,this)})),function(e){return te.apply(this,arguments)})},{key:"getLedgerEntries",value:(ee=O(E().m(function e(){var t=arguments;return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getLedgerEntries.apply(this,t).then(y.$D))},e,this)})),function(){return ee.apply(this,arguments)})},{key:"_getLedgerEntries",value:(J=O(E().m(function e(){var t,r,n,o=arguments;return E().w(function(e){for(;;)if(0===e.n){for(t=o.length,r=new Array(t),n=0;n<t;n++)r[n]=o[n];return e.a(2,p(this.serverURL.toString(),"getLedgerEntries",{keys:r.map(function(e){return e.toXDR("base64")})}))}},e,this)})),function(){return J.apply(this,arguments)})},{key:"pollTransaction",value:(Y=O(E().m(function e(t,r){var o,i,a,s,u,c;return E().w(function(e){for(;;)switch(e.n){case 0:a=(null!==(o=null==r?void 0:r.attempts)&&void 0!==o?o:0)<1?30:null!==(i=null==r?void 0:r.attempts)&&void 0!==i?i:30,u=1;case 1:if(!(u<a)){e.n=5;break}return e.n=2,this.getTransaction(t);case 2:if((s=e.v).status===n.j.GetTransactionStatus.NOT_FOUND){e.n=3;break}return e.a(2,s);case 3:return e.n=4,m.A.sleep((null!==(c=null==r?void 0:r.sleepStrategy)&&void 0!==c?c:P)(u));case 4:u++,e.n=1;break;case 5:return e.a(2,s)}},e,this)})),function(e,t){return Y.apply(this,arguments)})},{key:"getTransaction",value:(Z=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getTransaction(t).then(function(e){var r={};return e.status!==n.j.GetTransactionStatus.NOT_FOUND&&Object.assign(r,(0,y.WC)(e)),w({status:e.status,txHash:t,latestLedger:e.latestLedger,latestLedgerCloseTime:e.latestLedgerCloseTime,oldestLedger:e.oldestLedger,oldestLedgerCloseTime:e.oldestLedgerCloseTime},r)}))},e,this)})),function(e){return Z.apply(this,arguments)})},{key:"_getTransaction",value:(Q=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getTransaction",{hash:t}))},e,this)})),function(e){return Q.apply(this,arguments)})},{key:"getTransactions",value:(W=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getTransactions(t).then(function(e){return{transactions:(e.transactions||[]).map(y.tR),latestLedger:e.latestLedger,latestLedgerCloseTimestamp:e.latestLedgerCloseTimestamp,oldestLedger:e.oldestLedger,oldestLedgerCloseTimestamp:e.oldestLedgerCloseTimestamp,cursor:e.cursor}}))},e,this)})),function(e){return W.apply(this,arguments)})},{key:"_getTransactions",value:(G=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getTransactions",t))},e,this)})),function(e){return G.apply(this,arguments)})},{key:"getEvents",value:($=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getEvents(t).then(y.fG))},e,this)})),function(e){return $.apply(this,arguments)})},{key:"_getEvents",value:(X=O(E().m(function e(t){var r;return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getEvents",w(w({filters:null!==(r=t.filters)&&void 0!==r?r:[],pagination:w(w({},t.cursor&&{cursor:t.cursor}),t.limit&&{limit:t.limit})},t.startLedger&&{startLedger:t.startLedger}),t.endLedger&&{endLedger:t.endLedger})))},e,this)})),function(e){return X.apply(this,arguments)})},{key:"getNetwork",value:(K=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getNetwork"))},e,this)})),function(){return K.apply(this,arguments)})},{key:"getLatestLedger",value:(z=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getLatestLedger"))},e,this)})),function(){return z.apply(this,arguments)})},{key:"simulateTransaction",value:(H=O(E().m(function e(t,r,n){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._simulateTransaction(t,r,n).then(y.jr))},e,this)})),function(e,t,r){return H.apply(this,arguments)})},{key:"_simulateTransaction",value:(q=O(E().m(function e(t,r,n){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"simulateTransaction",w({transaction:t.toXDR(),authMode:n},void 0!==r&&{resourceConfig:{instructionLeeway:r.cpuInstructions}})))},e,this)})),function(e,t,r){return q.apply(this,arguments)})},{key:"prepareTransaction",value:(V=O(E().m(function e(t){var r;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.simulateTransaction(t);case 1:if(r=e.v,!n.j.isSimulationError(r)){e.n=2;break}throw new Error(r.error);case 2:return e.a(2,(0,h.X)(t,r).build())}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"sendTransaction",value:(M=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._sendTransaction(t).then(y.Af))},e,this)})),function(e){return M.apply(this,arguments)})},{key:"_sendTransaction",value:(F=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"sendTransaction",{transaction:t.toXDR()}))},e,this)})),function(e){return F.apply(this,arguments)})},{key:"requestAirdrop",value:(D=O(E().m(function e(t,r){var o,i,u,c,l,f,p,d,h;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o="string"==typeof t?t:t.accountId(),d=r){e.n=2;break}return e.n=1,this.getNetwork();case 1:d=e.v.friendbotUrl;case 2:if(r=d){e.n=3;break}throw new Error("No friendbot URL configured for current network");case 3:return e.p=3,e.n=4,s.post("".concat(r,"?addr=").concat(encodeURIComponent(o)));case 4:if((i=e.v).data.result_meta_xdr){e.n=7;break}return e.n=5,this.getTransaction(i.data.hash);case 5:if((c=e.v).status===n.j.GetTransactionStatus.SUCCESS){e.n=6;break}throw new Error("Funding account ".concat(t," failed"));case 6:u=c.resultMetaXdr,e.n=8;break;case 7:u=a.xdr.TransactionMeta.fromXDR(i.data.result_meta_xdr,"base64");case 8:return l=R(u),e.a(2,new a.Account(o,l));case 9:if(e.p=9,h=e.v,400!==(null===(f=h.response)||void 0===f?void 0:f.status)){e.n=10;break}if(null===(p=h.response.detail)||void 0===p||!p.includes("createAccountAlreadyExist")){e.n=10;break}return e.a(2,this.getAccount(o));case 10:throw h;case 11:return e.a(2)}},e,this,[[3,9]])})),function(e,t){return D.apply(this,arguments)})},{key:"getFeeStats",value:(L=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getFeeStats"))},e,this)})),function(){return L.apply(this,arguments)})},{key:"getVersionInfo",value:(N=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getVersionInfo"))},e,this)})),function(){return N.apply(this,arguments)})},{key:"getSACBalance",value:(U=O(E().m(function e(t,r,n){var o,i,s,u,c,l,f,p,d,h,y;return E().w(function(e){for(;;)switch(e.n){case 0:if(a.StrKey.isValidContract(t)){e.n=1;break}throw new TypeError("expected contract ID, got ".concat(t));case 1:if(null==n){e.n=2;break}y=n,e.n=4;break;case 2:return e.n=3,this.getNetwork().then(function(e){return e.passphrase});case 3:y=e.v;case 4:return o=y,i=r.contractId(o),s=(0,a.nativeToScVal)(["Balance",t],{type:["symbol","address"]}),u=a.xdr.LedgerKey.contractData(new a.xdr.LedgerKeyContractData({contract:new a.Address(i).toScAddress(),durability:a.xdr.ContractDataDurability.persistent(),key:s})),e.n=5,this.getLedgerEntries(u);case 5:if(0!==(c=e.v).entries.length){e.n=6;break}return e.a(2,{latestLedger:c.latestLedger});case 6:if(l=c.entries[0],f=l.lastModifiedLedgerSeq,p=l.liveUntilLedgerSeq,(d=l.val).switch().value===a.xdr.LedgerEntryType.contractData().value){e.n=7;break}return e.a(2,{latestLedger:c.latestLedger});case 7:return h=(0,a.scValToNative)(d.contractData().val()),e.a(2,{latestLedger:c.latestLedger,balanceEntry:{liveUntilLedgerSeq:p,lastModifiedLedgerSeq:f,amount:h.amount.toString(),authorized:h.authorized,clawback:h.clawback}})}},e,this)})),function(e,t,r){return U.apply(this,arguments)})}],C&&A(B.prototype,C),j&&A(B,j),Object.defineProperty(B,"prototype",{writable:!1}),B);const se=(e=r.hmd(e)).exports},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(u(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},546:e=>{e.exports=function(){function e(e,t,r,n,o,i){this.message=e,this.expected=t,this.found=r,this.offset=n,this.line=o,this.column=i,this.name="SyntaxError"}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),{SyntaxError:e,parse:function(t){var r,n=arguments.length>1?arguments[1]:{},o={},i={start:jt},a=jt,s=function(){return pr},u=o,c="#",l={type:"literal",value:"#",description:'"#"'},f=void 0,p={type:"any",description:"any character"},d="[",h={type:"literal",value:"[",description:'"["'},y="]",m={type:"literal",value:"]",description:'"]"'},g=function(e){dr(hr("ObjectPath",e,Pt,It))},v=function(e){dr(hr("ArrayPath",e,Pt,It))},b=function(e,t){return e.concat(t)},w=function(e){return[e]},S=function(e){return e},E=".",T={type:"literal",value:".",description:'"."'},k="=",O={type:"literal",value:"=",description:'"="'},A=function(e,t){dr(hr("Assign",t,Pt,It,e))},_=function(e){return e.join("")},x=function(e){return e.value},P='"""',I={type:"literal",value:'"""',description:'"\\"\\"\\""'},R=null,B=function(e){return hr("String",e.join(""),Pt,It)},C='"',j={type:"literal",value:'"',description:'"\\""'},U="'''",N={type:"literal",value:"'''",description:"\"'''\""},L="'",D={type:"literal",value:"'",description:'"\'"'},F=function(e){return e},M=function(e){return e},V="\\",q={type:"literal",value:"\\",description:'"\\\\"'},H=function(){return""},z="e",K={type:"literal",value:"e",description:'"e"'},X="E",$={type:"literal",value:"E",description:'"E"'},G=function(e,t){return hr("Float",parseFloat(e+"e"+t),Pt,It)},W=function(e){return hr("Float",parseFloat(e),Pt,It)},Q="+",Z={type:"literal",value:"+",description:'"+"'},Y=function(e){return e.join("")},J="-",ee={type:"literal",value:"-",description:'"-"'},te=function(e){return"-"+e.join("")},re=function(e){return hr("Integer",parseInt(e,10),Pt,It)},ne="true",oe={type:"literal",value:"true",description:'"true"'},ie=function(){return hr("Boolean",!0,Pt,It)},ae="false",se={type:"literal",value:"false",description:'"false"'},ue=function(){return hr("Boolean",!1,Pt,It)},ce=function(){return hr("Array",[],Pt,It)},le=function(e){return hr("Array",e?[e]:[],Pt,It)},fe=function(e){return hr("Array",e,Pt,It)},pe=function(e,t){return hr("Array",e.concat(t),Pt,It)},de=function(e){return e},he=",",ye={type:"literal",value:",",description:'","'},me="{",ge={type:"literal",value:"{",description:'"{"'},ve="}",be={type:"literal",value:"}",description:'"}"'},we=function(e){return hr("InlineTable",e,Pt,It)},Se=function(e,t){return hr("InlineTableValue",t,Pt,It,e)},Ee=function(e){return"."+e},Te=function(e){return e.join("")},ke=":",Oe={type:"literal",value:":",description:'":"'},Ae=function(e){return e.join("")},_e="T",xe={type:"literal",value:"T",description:'"T"'},Pe="Z",Ie={type:"literal",value:"Z",description:'"Z"'},Re=function(e,t){return hr("Date",new Date(e+"T"+t+"Z"),Pt,It)},Be=function(e,t){return hr("Date",new Date(e+"T"+t),Pt,It)},Ce=/^[ \t]/,je={type:"class",value:"[ \\t]",description:"[ \\t]"},Ue="\n",Ne={type:"literal",value:"\n",description:'"\\n"'},Le="\r",De={type:"literal",value:"\r",description:'"\\r"'},Fe=/^[0-9a-f]/i,Me={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},Ve=/^[0-9]/,qe={type:"class",value:"[0-9]",description:"[0-9]"},He="_",ze={type:"literal",value:"_",description:'"_"'},Ke=function(){return""},Xe=/^[A-Za-z0-9_\-]/,$e={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},Ge=function(e){return e.join("")},We='\\"',Qe={type:"literal",value:'\\"',description:'"\\\\\\""'},Ze=function(){return'"'},Ye="\\\\",Je={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},et=function(){return"\\"},tt="\\b",rt={type:"literal",value:"\\b",description:'"\\\\b"'},nt=function(){return"\b"},ot="\\t",it={type:"literal",value:"\\t",description:'"\\\\t"'},at=function(){return"\t"},st="\\n",ut={type:"literal",value:"\\n",description:'"\\\\n"'},ct=function(){return"\n"},lt="\\f",ft={type:"literal",value:"\\f",description:'"\\\\f"'},pt=function(){return"\f"},dt="\\r",ht={type:"literal",value:"\\r",description:'"\\\\r"'},yt=function(){return"\r"},mt="\\U",gt={type:"literal",value:"\\U",description:'"\\\\U"'},vt=function(e){return function(e,t,r){var n=parseInt("0x"+e);if(!(!isFinite(n)||Math.floor(n)!=n||n<0||n>1114111||n>55295&&n<57344))return function(){var e,t,r=16384,n=[],o=-1,i=arguments.length;if(!i)return"";var a="";for(;++o<i;){var s=Number(arguments[o]);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(o+1==i||n.length>r)&&(a+=String.fromCharCode.apply(null,n),n.length=0)}return a}(n);!function(e,t,r){var n=new Error(e);throw n.line=t,n.column=r,n}("Invalid Unicode escape code: "+e,t,r)}(e.join(""))},bt="\\u",wt={type:"literal",value:"\\u",description:'"\\\\u"'},St=0,Et=0,Tt=0,kt={line:1,column:1,seenCR:!1},Ot=0,At=[],_t=0,xt={};if("startRule"in n){if(!(n.startRule in i))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=i[n.startRule]}function Pt(){return Rt(Et).line}function It(){return Rt(Et).column}function Rt(e){return Tt!==e&&(Tt>e&&(Tt=0,kt={line:1,column:1,seenCR:!1}),function(e,r,n){var o,i;for(o=r;o<n;o++)"\n"===(i=t.charAt(o))?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===i||"\u2028"===i||"\u2029"===i?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}(kt,Tt,e),Tt=e),kt}function Bt(e){St<Ot||(St>Ot&&(Ot=St,At=[]),At.push(e))}function Ct(r,n,o){var i=Rt(o),a=o<t.length?t.charAt(o):null;return null!==n&&function(e){var t=1;for(e.sort(function(e,t){return e.description<t.description?-1:e.description>t.description?1:0});t<e.length;)e[t-1]===e[t]?e.splice(t,1):t++}(n),new e(null!==r?r:function(e,t){var r,n=new Array(e.length);for(r=0;r<e.length;r++)n[r]=e[r].description;return"Expected "+(e.length>1?n.slice(0,-1).join(", ")+" or "+n[e.length-1]:n[0])+" but "+(t?'"'+function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}(t)+'"':"end of input")+" found."}(n,a),n,a,o,i.line,i.column)}function jt(){var e,t,r,n=49*St+0,i=xt[n];if(i)return St=i.nextPos,i.result;for(e=St,t=[],r=Ut();r!==o;)t.push(r),r=Ut();return t!==o&&(Et=e,t=s()),e=t,xt[n]={nextPos:St,result:e},e}function Ut(){var e,r,n,i,a,s,c,l=49*St+1,f=xt[l];if(f)return St=f.nextPos,f.result;for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if(n=function(){var e,r=49*St+2,n=xt[r];if(n)return St=n.nextPos,n.result;e=Nt(),e===o&&(e=function(){var e,r,n,i,a,s,c=49*St+4,l=xt[c];if(l)return St=l.nextPos,l.result;e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h));if(r!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();if(n!==o)if((i=Lt())!==o){for(a=[],s=nr();s!==o;)a.push(s),s=nr();a!==o?(93===t.charCodeAt(St)?(s=y,St++):(s=o,0===_t&&Bt(m)),s!==o?(Et=e,e=r=g(i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;return xt[c]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c,l,f=49*St+5,p=xt[f];if(p)return St=p.nextPos,p.result;e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h));if(r!==o)if(91===t.charCodeAt(St)?(n=d,St++):(n=o,0===_t&&Bt(h)),n!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if((a=Lt())!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();s!==o?(93===t.charCodeAt(St)?(c=y,St++):(c=o,0===_t&&Bt(m)),c!==o?(93===t.charCodeAt(St)?(l=y,St++):(l=o,0===_t&&Bt(m)),l!==o?(Et=e,e=r=v(a)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u;return xt[f]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c=49*St+9,l=xt[c];if(l)return St=l.nextPos,l.result;if(e=St,r=Mt(),r!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();if(n!==o)if(61===t.charCodeAt(St)?(i=k,St++):(i=o,0===_t&&Bt(O)),i!==o){for(a=[],s=nr();s!==o;)a.push(s),s=nr();a!==o&&(s=qt())!==o?(Et=e,e=r=A(r,s)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;if(e===o)if(e=St,(r=Vt())!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();if(n!==o)if(61===t.charCodeAt(St)?(i=k,St++):(i=o,0===_t&&Bt(O)),i!==o){for(a=[],s=nr();s!==o;)a.push(s),s=nr();a!==o&&(s=qt())!==o?(Et=e,e=r=A(r,s)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;return xt[c]={nextPos:St,result:e},e}())));return xt[r]={nextPos:St,result:e},e}(),n!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o){for(a=[],s=Nt();s!==o;)a.push(s),s=Nt();if(a!==o){if(s=[],(c=or())!==o)for(;c!==o;)s.push(c),c=or();else s=u;s===o&&(s=ar()),s!==o?e=r=[r,n,i,a,s]:(St=e,e=u)}else St=e,e=u}else St=e,e=u}else St=e,e=u;else St=e,e=u;if(e===o){if(e=St,r=[],(n=nr())!==o)for(;n!==o;)r.push(n),n=nr();else r=u;if(r!==o){if(n=[],(i=or())!==o)for(;i!==o;)n.push(i),i=or();else n=u;n===o&&(n=ar()),n!==o?e=r=[r,n]:(St=e,e=u)}else St=e,e=u;e===o&&(e=or())}return xt[l]={nextPos:St,result:e},e}function Nt(){var e,r,n,i,a,s,d=49*St+3,h=xt[d];if(h)return St=h.nextPos,h.result;if(e=St,35===t.charCodeAt(St)?(r=c,St++):(r=o,0===_t&&Bt(l)),r!==o){for(n=[],i=St,a=St,_t++,(s=or())===o&&(s=ar()),_t--,s===o?a=f:(St=a,a=u),a!==o?(t.length>St?(s=t.charAt(St),St++):(s=o,0===_t&&Bt(p)),s!==o?i=a=[a,s]:(St=i,i=u)):(St=i,i=u);i!==o;)n.push(i),i=St,a=St,_t++,(s=or())===o&&(s=ar()),_t--,s===o?a=f:(St=a,a=u),a!==o?(t.length>St?(s=t.charAt(St),St++):(s=o,0===_t&&Bt(p)),s!==o?i=a=[a,s]:(St=i,i=u)):(St=i,i=u);n!==o?e=r=[r,n]:(St=e,e=u)}else St=e,e=u;return xt[d]={nextPos:St,result:e},e}function Lt(){var e,t,r,n=49*St+6,i=xt[n];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(r=Ft())!==o)for(;r!==o;)t.push(r),r=Ft();else t=u;return t!==o&&(r=Dt())!==o?(Et=e,e=t=b(t,r)):(St=e,e=u),e===o&&(e=St,(t=Dt())!==o&&(Et=e,t=w(t)),e=t),xt[n]={nextPos:St,result:e},e}function Dt(){var e,t,r,n,i,a=49*St+7,s=xt[a];if(s)return St=s.nextPos,s.result;for(e=St,t=[],r=nr();r!==o;)t.push(r),r=nr();if(t!==o)if((r=Mt())!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();n!==o?(Et=e,e=t=S(r)):(St=e,e=u)}else St=e,e=u;else St=e,e=u;if(e===o){for(e=St,t=[],r=nr();r!==o;)t.push(r),r=nr();if(t!==o)if((r=Vt())!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();n!==o?(Et=e,e=t=S(r)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}return xt[a]={nextPos:St,result:e},e}function Ft(){var e,r,n,i,a,s,c,l=49*St+8,f=xt[l];if(f)return St=f.nextPos,f.result;for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if((n=Mt())!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if(46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),a!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();s!==o?(Et=e,e=r=S(n)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u;if(e===o){for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if((n=Vt())!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if(46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),a!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();s!==o?(Et=e,e=r=S(n)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u}return xt[l]={nextPos:St,result:e},e}function Mt(){var e,t,r,n=49*St+10,i=xt[n];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(r=cr())!==o)for(;r!==o;)t.push(r),r=cr();else t=u;return t!==o&&(Et=e,t=_(t)),e=t,xt[n]={nextPos:St,result:e},e}function Vt(){var e,t,r=49*St+11,n=xt[r];return n?(St=n.nextPos,n.result):(e=St,(t=Ht())!==o&&(Et=e,t=x(t)),(e=t)===o&&(e=St,(t=zt())!==o&&(Et=e,t=x(t)),e=t),xt[r]={nextPos:St,result:e},e)}function qt(){var e,r=49*St+12,n=xt[r];return n?(St=n.nextPos,n.result):(e=function(){var e,r=49*St+13,n=xt[r];if(n)return St=n.nextPos,n.result;e=function(){var e,r,n,i,a,s=49*St+14,c=xt[s];if(c)return St=c.nextPos,c.result;e=St,t.substr(St,3)===P?(r=P,St+=3):(r=o,0===_t&&Bt(I));if(r!==o)if((n=or())===o&&(n=R),n!==o){for(i=[],a=$t();a!==o;)i.push(a),a=$t();i!==o?(t.substr(St,3)===P?(a=P,St+=3):(a=o,0===_t&&Bt(I)),a!==o?(Et=e,e=r=B(i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;else St=e,e=u;return xt[s]={nextPos:St,result:e},e}(),e===o&&(e=Ht())===o&&(e=function(){var e,r,n,i,a,s=49*St+16,c=xt[s];if(c)return St=c.nextPos,c.result;e=St,t.substr(St,3)===U?(r=U,St+=3):(r=o,0===_t&&Bt(N));if(r!==o)if((n=or())===o&&(n=R),n!==o){for(i=[],a=Gt();a!==o;)i.push(a),a=Gt();i!==o?(t.substr(St,3)===U?(a=U,St+=3):(a=o,0===_t&&Bt(N)),a!==o?(Et=e,e=r=B(i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;else St=e,e=u;return xt[s]={nextPos:St,result:e},e}(),e===o&&(e=zt()));return xt[r]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s=49*St+38,c=xt[s];if(c)return St=c.nextPos,c.result;e=St,(r=rr())!==o?(84===t.charCodeAt(St)?(n=_e,St++):(n=o,0===_t&&Bt(xe)),n!==o?(i=function(){var e,r,n,i,a,s,c,l,f,p,d,h=49*St+36,y=xt[h];if(y)return St=y.nextPos,y.result;e=St,r=St,n=ur(),n!==o&&(i=ur())!==o?(58===t.charCodeAt(St)?(a=ke,St++):(a=o,0===_t&&Bt(Oe)),a!==o&&(s=ur())!==o&&(c=ur())!==o?(58===t.charCodeAt(St)?(l=ke,St++):(l=o,0===_t&&Bt(Oe)),l!==o&&(f=ur())!==o&&(p=ur())!==o?((d=tr())===o&&(d=R),d!==o?r=n=[n,i,a,s,c,l,f,p,d]:(St=r,r=u)):(St=r,r=u)):(St=r,r=u)):(St=r,r=u);r!==o&&(Et=e,r=Ae(r));return e=r,xt[h]={nextPos:St,result:e},e}(),i!==o?(90===t.charCodeAt(St)?(a=Pe,St++):(a=o,0===_t&&Bt(Ie)),a!==o?(Et=e,e=r=Re(r,i)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u);e===o&&(e=St,(r=rr())!==o?(84===t.charCodeAt(St)?(n=_e,St++):(n=o,0===_t&&Bt(xe)),n!==o?(i=function(){var e,r,n,i,a,s,c,l,f,p,d,h,y,m,g,v,b,w=49*St+37,S=xt[w];if(S)return St=S.nextPos,S.result;e=St,r=St,n=ur(),n!==o&&(i=ur())!==o?(58===t.charCodeAt(St)?(a=ke,St++):(a=o,0===_t&&Bt(Oe)),a!==o&&(s=ur())!==o&&(c=ur())!==o?(58===t.charCodeAt(St)?(l=ke,St++):(l=o,0===_t&&Bt(Oe)),l!==o&&(f=ur())!==o&&(p=ur())!==o?((d=tr())===o&&(d=R),d!==o?(45===t.charCodeAt(St)?(h=J,St++):(h=o,0===_t&&Bt(ee)),h===o&&(43===t.charCodeAt(St)?(h=Q,St++):(h=o,0===_t&&Bt(Z))),h!==o&&(y=ur())!==o&&(m=ur())!==o?(58===t.charCodeAt(St)?(g=ke,St++):(g=o,0===_t&&Bt(Oe)),g!==o&&(v=ur())!==o&&(b=ur())!==o?r=n=[n,i,a,s,c,l,f,p,d,h,y,m,g,v,b]:(St=r,r=u)):(St=r,r=u)):(St=r,r=u)):(St=r,r=u)):(St=r,r=u)):(St=r,r=u);r!==o&&(Et=e,r=Ae(r));return e=r,xt[w]={nextPos:St,result:e},e}(),i!==o?(Et=e,e=r=Be(r,i)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u));return xt[s]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a=49*St+23,s=xt[a];if(s)return St=s.nextPos,s.result;e=St,(r=Wt())===o&&(r=Qt());r!==o?(101===t.charCodeAt(St)?(n=z,St++):(n=o,0===_t&&Bt(K)),n===o&&(69===t.charCodeAt(St)?(n=X,St++):(n=o,0===_t&&Bt($))),n!==o&&(i=Qt())!==o?(Et=e,e=r=G(r,i)):(St=e,e=u)):(St=e,e=u);e===o&&(e=St,(r=Wt())!==o&&(Et=e,r=W(r)),e=r);return xt[a]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,t,r=49*St+25,n=xt[r];if(n)return St=n.nextPos,n.result;e=St,(t=Qt())!==o&&(Et=e,t=re(t));return e=t,xt[r]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n=49*St+27,i=xt[n];if(i)return St=i.nextPos,i.result;e=St,t.substr(St,4)===ne?(r=ne,St+=4):(r=o,0===_t&&Bt(oe));r!==o&&(Et=e,r=ie());e=r,e===o&&(e=St,t.substr(St,5)===ae?(r=ae,St+=5):(r=o,0===_t&&Bt(se)),r!==o&&(Et=e,r=ue()),e=r);return xt[n]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s=49*St+28,c=xt[s];if(c)return St=c.nextPos,c.result;e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h));if(r!==o){for(n=[],i=Jt();i!==o;)n.push(i),i=Jt();n!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===_t&&Bt(m)),i!==o?(Et=e,e=r=ce()):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;if(e===o&&(e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h)),r!==o?((n=Zt())===o&&(n=R),n!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===_t&&Bt(m)),i!==o?(Et=e,e=r=le(n)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u),e===o)){if(e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h)),r!==o){if(n=[],(i=Yt())!==o)for(;i!==o;)n.push(i),i=Yt();else n=u;n!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===_t&&Bt(m)),i!==o?(Et=e,e=r=fe(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;if(e===o)if(e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h)),r!==o){if(n=[],(i=Yt())!==o)for(;i!==o;)n.push(i),i=Yt();else n=u;n!==o&&(i=Zt())!==o?(93===t.charCodeAt(St)?(a=y,St++):(a=o,0===_t&&Bt(m)),a!==o?(Et=e,e=r=pe(n,i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u}return xt[s]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c=49*St+32,l=xt[c];if(l)return St=l.nextPos,l.result;e=St,123===t.charCodeAt(St)?(r=me,St++):(r=o,0===_t&&Bt(ge));if(r!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();if(n!==o){for(i=[],a=er();a!==o;)i.push(a),a=er();if(i!==o){for(a=[],s=nr();s!==o;)a.push(s),s=nr();a!==o?(125===t.charCodeAt(St)?(s=ve,St++):(s=o,0===_t&&Bt(be)),s!==o?(Et=e,e=r=we(i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u}else St=e,e=u}else St=e,e=u;return xt[c]={nextPos:St,result:e},e}())))))),xt[r]={nextPos:St,result:e},e)}function Ht(){var e,r,n,i,a=49*St+15,s=xt[a];if(s)return St=s.nextPos,s.result;if(e=St,34===t.charCodeAt(St)?(r=C,St++):(r=o,0===_t&&Bt(j)),r!==o){for(n=[],i=Kt();i!==o;)n.push(i),i=Kt();n!==o?(34===t.charCodeAt(St)?(i=C,St++):(i=o,0===_t&&Bt(j)),i!==o?(Et=e,e=r=B(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;return xt[a]={nextPos:St,result:e},e}function zt(){var e,r,n,i,a=49*St+17,s=xt[a];if(s)return St=s.nextPos,s.result;if(e=St,39===t.charCodeAt(St)?(r=L,St++):(r=o,0===_t&&Bt(D)),r!==o){for(n=[],i=Xt();i!==o;)n.push(i),i=Xt();n!==o?(39===t.charCodeAt(St)?(i=L,St++):(i=o,0===_t&&Bt(D)),i!==o?(Et=e,e=r=B(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;return xt[a]={nextPos:St,result:e},e}function Kt(){var e,r,n,i=49*St+18,a=xt[i];return a?(St=a.nextPos,a.result):((e=fr())===o&&(e=St,r=St,_t++,34===t.charCodeAt(St)?(n=C,St++):(n=o,0===_t&&Bt(j)),_t--,n===o?r=f:(St=r,r=u),r!==o?(t.length>St?(n=t.charAt(St),St++):(n=o,0===_t&&Bt(p)),n!==o?(Et=e,e=r=F(n)):(St=e,e=u)):(St=e,e=u)),xt[i]={nextPos:St,result:e},e)}function Xt(){var e,r,n,i=49*St+19,a=xt[i];return a?(St=a.nextPos,a.result):(e=St,r=St,_t++,39===t.charCodeAt(St)?(n=L,St++):(n=o,0===_t&&Bt(D)),_t--,n===o?r=f:(St=r,r=u),r!==o?(t.length>St?(n=t.charAt(St),St++):(n=o,0===_t&&Bt(p)),n!==o?(Et=e,e=r=F(n)):(St=e,e=u)):(St=e,e=u),xt[i]={nextPos:St,result:e},e)}function $t(){var e,r,n,i=49*St+20,a=xt[i];return a?(St=a.nextPos,a.result):((e=fr())===o&&(e=function(){var e,r,n,i,a=49*St+21,s=xt[a];if(s)return St=s.nextPos,s.result;e=St,92===t.charCodeAt(St)?(r=V,St++):(r=o,0===_t&&Bt(q));if(r!==o)if(or()!==o){for(n=[],i=ir();i!==o;)n.push(i),i=ir();n!==o?(Et=e,e=r=H()):(St=e,e=u)}else St=e,e=u;else St=e,e=u;return xt[a]={nextPos:St,result:e},e}(),e===o&&(e=St,r=St,_t++,t.substr(St,3)===P?(n=P,St+=3):(n=o,0===_t&&Bt(I)),_t--,n===o?r=f:(St=r,r=u),r!==o?(t.length>St?(n=t.charAt(St),St++):(n=o,0===_t&&Bt(p)),n!==o?(Et=e,e=r=M(n)):(St=e,e=u)):(St=e,e=u))),xt[i]={nextPos:St,result:e},e)}function Gt(){var e,r,n,i=49*St+22,a=xt[i];return a?(St=a.nextPos,a.result):(e=St,r=St,_t++,t.substr(St,3)===U?(n=U,St+=3):(n=o,0===_t&&Bt(N)),_t--,n===o?r=f:(St=r,r=u),r!==o?(t.length>St?(n=t.charAt(St),St++):(n=o,0===_t&&Bt(p)),n!==o?(Et=e,e=r=F(n)):(St=e,e=u)):(St=e,e=u),xt[i]={nextPos:St,result:e},e)}function Wt(){var e,r,n,i,a,s,c=49*St+24,l=xt[c];return l?(St=l.nextPos,l.result):(e=St,43===t.charCodeAt(St)?(r=Q,St++):(r=o,0===_t&&Bt(Z)),r===o&&(r=R),r!==o?(n=St,(i=lr())!==o?(46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),a!==o&&(s=lr())!==o?n=i=[i,a,s]:(St=n,n=u)):(St=n,n=u),n!==o?(Et=e,e=r=Y(n)):(St=e,e=u)):(St=e,e=u),e===o&&(e=St,45===t.charCodeAt(St)?(r=J,St++):(r=o,0===_t&&Bt(ee)),r!==o?(n=St,(i=lr())!==o?(46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),a!==o&&(s=lr())!==o?n=i=[i,a,s]:(St=n,n=u)):(St=n,n=u),n!==o?(Et=e,e=r=te(n)):(St=e,e=u)):(St=e,e=u)),xt[c]={nextPos:St,result:e},e)}function Qt(){var e,r,n,i,a,s=49*St+26,c=xt[s];if(c)return St=c.nextPos,c.result;if(e=St,43===t.charCodeAt(St)?(r=Q,St++):(r=o,0===_t&&Bt(Z)),r===o&&(r=R),r!==o){if(n=[],(i=ur())!==o)for(;i!==o;)n.push(i),i=ur();else n=u;n!==o?(i=St,_t++,46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),_t--,a===o?i=f:(St=i,i=u),i!==o?(Et=e,e=r=Y(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;if(e===o)if(e=St,45===t.charCodeAt(St)?(r=J,St++):(r=o,0===_t&&Bt(ee)),r!==o){if(n=[],(i=ur())!==o)for(;i!==o;)n.push(i),i=ur();else n=u;n!==o?(i=St,_t++,46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),_t--,a===o?i=f:(St=i,i=u),i!==o?(Et=e,e=r=te(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;return xt[s]={nextPos:St,result:e},e}function Zt(){var e,t,r,n,i,a=49*St+29,s=xt[a];if(s)return St=s.nextPos,s.result;for(e=St,t=[],r=Jt();r!==o;)t.push(r),r=Jt();if(t!==o)if((r=qt())!==o){for(n=[],i=Jt();i!==o;)n.push(i),i=Jt();n!==o?(Et=e,e=t=de(r)):(St=e,e=u)}else St=e,e=u;else St=e,e=u;return xt[a]={nextPos:St,result:e},e}function Yt(){var e,r,n,i,a,s,c,l=49*St+30,f=xt[l];if(f)return St=f.nextPos,f.result;for(e=St,r=[],n=Jt();n!==o;)r.push(n),n=Jt();if(r!==o)if((n=qt())!==o){for(i=[],a=Jt();a!==o;)i.push(a),a=Jt();if(i!==o)if(44===t.charCodeAt(St)?(a=he,St++):(a=o,0===_t&&Bt(ye)),a!==o){for(s=[],c=Jt();c!==o;)s.push(c),c=Jt();s!==o?(Et=e,e=r=de(n)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u;return xt[l]={nextPos:St,result:e},e}function Jt(){var e,t=49*St+31,r=xt[t];return r?(St=r.nextPos,r.result):((e=nr())===o&&(e=or())===o&&(e=Nt()),xt[t]={nextPos:St,result:e},e)}function er(){var e,r,n,i,a,s,c,l,f,p,d,h=49*St+33,y=xt[h];if(y)return St=y.nextPos,y.result;for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if((n=Mt())!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if(61===t.charCodeAt(St)?(a=k,St++):(a=o,0===_t&&Bt(O)),a!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();if(s!==o)if((c=qt())!==o){for(l=[],f=nr();f!==o;)l.push(f),f=nr();if(l!==o)if(44===t.charCodeAt(St)?(f=he,St++):(f=o,0===_t&&Bt(ye)),f!==o){for(p=[],d=nr();d!==o;)p.push(d),d=nr();p!==o?(Et=e,e=r=Se(n,c)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u;if(e===o){for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if((n=Mt())!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if(61===t.charCodeAt(St)?(a=k,St++):(a=o,0===_t&&Bt(O)),a!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();s!==o&&(c=qt())!==o?(Et=e,e=r=Se(n,c)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u}return xt[h]={nextPos:St,result:e},e}function tr(){var e,r,n,i=49*St+34,a=xt[i];return a?(St=a.nextPos,a.result):(e=St,46===t.charCodeAt(St)?(r=E,St++):(r=o,0===_t&&Bt(T)),r!==o&&(n=lr())!==o?(Et=e,e=r=Ee(n)):(St=e,e=u),xt[i]={nextPos:St,result:e},e)}function rr(){var e,r,n,i,a,s,c,l,f,p,d,h,y=49*St+35,m=xt[y];return m?(St=m.nextPos,m.result):(e=St,r=St,(n=ur())!==o&&(i=ur())!==o&&(a=ur())!==o&&(s=ur())!==o?(45===t.charCodeAt(St)?(c=J,St++):(c=o,0===_t&&Bt(ee)),c!==o&&(l=ur())!==o&&(f=ur())!==o?(45===t.charCodeAt(St)?(p=J,St++):(p=o,0===_t&&Bt(ee)),p!==o&&(d=ur())!==o&&(h=ur())!==o?r=n=[n,i,a,s,c,l,f,p,d,h]:(St=r,r=u)):(St=r,r=u)):(St=r,r=u),r!==o&&(Et=e,r=Te(r)),e=r,xt[y]={nextPos:St,result:e},e)}function nr(){var e,r=49*St+39,n=xt[r];return n?(St=n.nextPos,n.result):(Ce.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===_t&&Bt(je)),xt[r]={nextPos:St,result:e},e)}function or(){var e,r,n,i=49*St+40,a=xt[i];return a?(St=a.nextPos,a.result):(10===t.charCodeAt(St)?(e=Ue,St++):(e=o,0===_t&&Bt(Ne)),e===o&&(e=St,13===t.charCodeAt(St)?(r=Le,St++):(r=o,0===_t&&Bt(De)),r!==o?(10===t.charCodeAt(St)?(n=Ue,St++):(n=o,0===_t&&Bt(Ne)),n!==o?e=r=[r,n]:(St=e,e=u)):(St=e,e=u)),xt[i]={nextPos:St,result:e},e)}function ir(){var e,t=49*St+41,r=xt[t];return r?(St=r.nextPos,r.result):((e=or())===o&&(e=nr()),xt[t]={nextPos:St,result:e},e)}function ar(){var e,r,n=49*St+42,i=xt[n];return i?(St=i.nextPos,i.result):(e=St,_t++,t.length>St?(r=t.charAt(St),St++):(r=o,0===_t&&Bt(p)),_t--,r===o?e=f:(St=e,e=u),xt[n]={nextPos:St,result:e},e)}function sr(){var e,r=49*St+43,n=xt[r];return n?(St=n.nextPos,n.result):(Fe.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===_t&&Bt(Me)),xt[r]={nextPos:St,result:e},e)}function ur(){var e,r,n=49*St+44,i=xt[n];return i?(St=i.nextPos,i.result):(Ve.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===_t&&Bt(qe)),e===o&&(e=St,95===t.charCodeAt(St)?(r=He,St++):(r=o,0===_t&&Bt(ze)),r!==o&&(Et=e,r=Ke()),e=r),xt[n]={nextPos:St,result:e},e)}function cr(){var e,r=49*St+45,n=xt[r];return n?(St=n.nextPos,n.result):(Xe.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===_t&&Bt($e)),xt[r]={nextPos:St,result:e},e)}function lr(){var e,t,r,n=49*St+46,i=xt[n];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(r=ur())!==o)for(;r!==o;)t.push(r),r=ur();else t=u;return t!==o&&(Et=e,t=Ge(t)),e=t,xt[n]={nextPos:St,result:e},e}function fr(){var e,r,n=49*St+47,i=xt[n];return i?(St=i.nextPos,i.result):(e=St,t.substr(St,2)===We?(r=We,St+=2):(r=o,0===_t&&Bt(Qe)),r!==o&&(Et=e,r=Ze()),(e=r)===o&&(e=St,t.substr(St,2)===Ye?(r=Ye,St+=2):(r=o,0===_t&&Bt(Je)),r!==o&&(Et=e,r=et()),(e=r)===o&&(e=St,t.substr(St,2)===tt?(r=tt,St+=2):(r=o,0===_t&&Bt(rt)),r!==o&&(Et=e,r=nt()),(e=r)===o&&(e=St,t.substr(St,2)===ot?(r=ot,St+=2):(r=o,0===_t&&Bt(it)),r!==o&&(Et=e,r=at()),(e=r)===o&&(e=St,t.substr(St,2)===st?(r=st,St+=2):(r=o,0===_t&&Bt(ut)),r!==o&&(Et=e,r=ct()),(e=r)===o&&(e=St,t.substr(St,2)===lt?(r=lt,St+=2):(r=o,0===_t&&Bt(ft)),r!==o&&(Et=e,r=pt()),(e=r)===o&&(e=St,t.substr(St,2)===dt?(r=dt,St+=2):(r=o,0===_t&&Bt(ht)),r!==o&&(Et=e,r=yt()),(e=r)===o&&(e=function(){var e,r,n,i,a,s,c,l,f,p,d,h=49*St+48,y=xt[h];if(y)return St=y.nextPos,y.result;e=St,t.substr(St,2)===mt?(r=mt,St+=2):(r=o,0===_t&&Bt(gt));r!==o?(n=St,(i=sr())!==o&&(a=sr())!==o&&(s=sr())!==o&&(c=sr())!==o&&(l=sr())!==o&&(f=sr())!==o&&(p=sr())!==o&&(d=sr())!==o?n=i=[i,a,s,c,l,f,p,d]:(St=n,n=u),n!==o?(Et=e,e=r=vt(n)):(St=e,e=u)):(St=e,e=u);e===o&&(e=St,t.substr(St,2)===bt?(r=bt,St+=2):(r=o,0===_t&&Bt(wt)),r!==o?(n=St,(i=sr())!==o&&(a=sr())!==o&&(s=sr())!==o&&(c=sr())!==o?n=i=[i,a,s,c]:(St=n,n=u),n!==o?(Et=e,e=r=vt(n)):(St=e,e=u)):(St=e,e=u));return xt[h]={nextPos:St,result:e},e}()))))))),xt[n]={nextPos:St,result:e},e)}var pr=[];function dr(e){pr.push(e)}function hr(e,t,r,n,o){var i={type:e,value:t,line:r(),column:n()};return o&&(i.key=o),i}if((r=a())!==o&&St===t.length)return r;throw r!==o&&St<t.length&&Bt({type:"end",description:"end of input"}),Ct(null,At,Ot)}}}()},600:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>{},FEDERATION_RESPONSE_MAX_SIZE:()=>b,Server:()=>w});var n=r(950),o=r(193),i=r.n(o),a=r(732),s=r(976),u=r(898),c=r(371);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function d(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return h(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(h(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,h(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,h(f,"constructor",c),h(c,"constructor",u),u.displayName="GeneratorFunction",h(c,o,"GeneratorFunction"),h(f),h(f,o,"Generator"),h(f,n,function(){return this}),h(f,"toString",function(){return"[object Generator]"}),(d=function(){return{w:i,m:p}})()}function h(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}h=function(e,t,r,n){function i(t,r){h(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},h(e,t,r,n)}function y(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function m(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){y(i,n,o,a,s,"next",e)}function s(e){y(i,n,o,a,s,"throw",e)}a(void 0)})}}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function v(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}var b=102400,w=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=i()(t),this.domain=r;var o=void 0===n.allowHttp?a.T.isAllowHttp():n.allowHttp;if(this.timeout=void 0===n.timeout?a.T.getTimeout():n.timeout,"https"!==this.serverURL.protocol()&&!o)throw new Error("Cannot connect to insecure federation server")}return t=e,r=[{key:"resolveAddress",value:(w=m(d().m(function e(t){var r,n;return d().w(function(e){for(;;)switch(e.n){case 0:if(r=t,!(t.indexOf("*")<0)){e.n=2;break}if(this.domain){e.n=1;break}return e.a(2,Promise.reject(new Error("Unknown domain. Make sure `address` contains a domain (ex. `bob*stellar.org`) or pass `domain` parameter when instantiating the server object.")));case 1:r="".concat(t,"*").concat(this.domain);case 2:return n=this.serverURL.query({type:"name",q:r}),e.a(2,this._sendRequest(n))}},e,this)})),function(e){return w.apply(this,arguments)})},{key:"resolveAccountId",value:(v=m(d().m(function e(t){var r;return d().w(function(e){for(;;)if(0===e.n)return r=this.serverURL.query({type:"id",q:t}),e.a(2,this._sendRequest(r))},e,this)})),function(e){return v.apply(this,arguments)})},{key:"resolveTransactionId",value:(y=m(d().m(function e(t){var r;return d().w(function(e){for(;;)if(0===e.n)return r=this.serverURL.query({type:"txid",q:t}),e.a(2,this._sendRequest(r))},e,this)})),function(e){return y.apply(this,arguments)})},{key:"_sendRequest",value:(h=m(d().m(function e(t){var r;return d().w(function(e){for(;;)if(0===e.n)return r=this.timeout,e.a(2,c.ok.get(t.toString(),{maxContentLength:b,timeout:r}).then(function(e){if(void 0!==e.data.memo&&"string"!=typeof e.data.memo)throw new Error("memo value should be of type string");return e.data}).catch(function(e){if(e instanceof Error){if(e.message.match(/^maxContentLength size/))throw new Error("federation response exceeds allowed size of ".concat(b));return Promise.reject(e)}return Promise.reject(new s.nS("Server query failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))}))},e,this)})),function(e){return h.apply(this,arguments)})}],o=[{key:"resolve",value:(p=m(d().m(function t(r){var o,i,a,s,u,c=arguments;return d().w(function(t){for(;;)switch(t.n){case 0:if(o=c.length>1&&void 0!==c[1]?c[1]:{},!(r.indexOf("*")<0)){t.n=2;break}if(n.StrKey.isValidEd25519PublicKey(r)){t.n=1;break}return t.a(2,Promise.reject(new Error("Invalid Account ID")));case 1:return t.a(2,Promise.resolve({account_id:r}));case 2:if(i=r.split("*"),a=f(i,2),s=a[1],2===i.length&&s){t.n=3;break}return t.a(2,Promise.reject(new Error("Invalid Stellar address")));case 3:return t.n=4,e.createForDomain(s,o);case 4:return u=t.v,t.a(2,u.resolveAddress(r))}},t)})),function(e){return p.apply(this,arguments)})},{key:"createForDomain",value:(l=m(d().m(function t(r){var n,o,i=arguments;return d().w(function(t){for(;;)switch(t.n){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.n=1,u.Resolver.resolve(r,n);case 1:if((o=t.v).FEDERATION_SERVER){t.n=2;break}return t.a(2,Promise.reject(new Error("stellar.toml does not contain FEDERATION_SERVER field")));case 2:return t.a(2,new e(o.FEDERATION_SERVER,r,n))}},t)})),function(e){return l.apply(this,arguments)})}],r&&g(t.prototype,r),o&&g(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,o,l,p,h,y,v,w}()},680:(e,t,r)=>{"use strict";r.d(t,{X:()=>a});var n=r(950),o=r(76),i=r(784);function a(e,t){if("innerTransaction"in e)return a(e.innerTransaction,t);if(!function(e){if(1!==e.operations.length)return!1;switch(e.operations[0].type){case"invokeHostFunction":case"extendFootprintTtl":case"restoreFootprint":return!0;default:return!1}}(e))throw new TypeError("unsupported transaction: must contain exactly one invokeHostFunction, extendFootprintTtl, or restoreFootprint operation");var r=(0,i.jr)(t);if(!o.j.isSimulationSuccess(r))throw new Error("simulation incorrect: ".concat(JSON.stringify(r)));var s=parseInt(e.fee)||0,u=parseInt(r.minResourceFee)||0,c=n.TransactionBuilder.cloneFrom(e,{fee:(s+u).toString(),sorobanData:r.transactionData.build(),networkPassphrase:e.networkPassphrase});if("invokeHostFunction"===e.operations[0].type){var l;c.clearOperations();var f=e.operations[0],p=null!==(l=f.auth)&&void 0!==l?l:[];c.addOperation(n.Operation.invokeHostFunction({source:f.source,func:f.func,auth:p.length>0?p:r.result.auth}))}return c}},704:function(e,t,r){var n,o;!function(i,a){"use strict";e.exports?e.exports=a():void 0===(o="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=o)}(0,function(e){"use strict";var t=e&&e.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var o=r.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var o=r.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r})},708:e=>{"use strict";e.exports={compile:function(e){var t=[],r=[],n="",o=Object.create(null),i=o;return function(e){for(var t,r=0;r<e.length;r++)switch((t=e[r]).type){case"Assign":s(t);break;case"ObjectPath":f(t);break;case"ArrayPath":p(t)}return o}(e);function a(e,t,r){var n=new Error(e);throw n.line=t,n.column=r,n}function s(e){var o,s=e.key,l=e.value,f=e.line,p=e.column;o=n?n+"."+s:s,void 0!==i[s]&&a("Cannot redefine existing key '"+o+"'.",f,p),i[s]=c(l),u(o)||(t.push(o),r.push(o))}function u(e){return-1!==t.indexOf(e)}function c(e){return"Array"===e.type?function(e){for(var t=null,r=0;r<e.length;r++){var n=e[r];null===t?t=n.type:n.type!==t&&a("Cannot add value of type "+n.type+" to array of type "+t+".",n.line,n.column)}return e.map(c)}(e.value):"InlineTable"===e.type?l(e.value):e.value}function l(e){for(var t=Object.create(null),r=0;r<e.length;r++){var n=e[r];"InlineTable"===n.value.type?t[n.key]=l(n.value.value):"InlineTableValue"===n.type&&(t[n.key]=c(n.value))}return t}function f(e){var r=e.value,s=r.map(h).join("."),c=e.line,l=e.column;u(s)&&a("Cannot redefine existing key '"+r+"'.",c,l),t.push(s),i=d(o,r,Object.create(null),c,l),n=r}function p(e){var r=e.value,s=r.map(h).join("."),c=e.line,l=e.column;if(u(s)||t.push(s),(t=t.filter(function(e){return 0!==e.indexOf(s)})).push(s),i=d(o,r,[],c,l),n=s,i instanceof Array){var f=Object.create(null);i.push(f),i=f}else a("Cannot redefine existing key '"+r+"'.",c,l)}function d(e,t,n,o,i){for(var s=[],u="",c=(t.join("."),e),l=0;l<t.length;l++){var f=t[l];s.push(f),u=s.join("."),void 0===c[f]?l===t.length-1?c[f]=n:c[f]=Object.create(null):l!==t.length-1&&r.indexOf(u)>-1&&a("Cannot redefine existing key '"+u+"'.",o,i),(c=c[f])instanceof Array&&c.length&&l<t.length-1&&(c=c[c.length-1])}return c}function h(e){return e.indexOf(".")>-1?'"'+e+'"':e}}}},732:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}r.d(t,{T:()=>h});var c,l,f,p={allowHttp:!1,timeout:0},d=a({},p),h=(c=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},f=[{key:"setAllowHttp",value:function(e){d.allowHttp=e}},{key:"setTimeout",value:function(e){d.timeout=e}},{key:"isAllowHttp",value:function(){return d.allowHttp}},{key:"getTimeout",value:function(){return d.timeout}},{key:"setDefault",value:function(){d=a({},p)}}],(l=null)&&o(c.prototype,l),f&&o(c,f),Object.defineProperty(c,"prototype",{writable:!1}),c)},733:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{AccountResponse:()=>m,AxiosClient:()=>G,HorizonApi:()=>n,SERVER_TIME_MAP:()=>K,Server:()=>Gr,ServerApi:()=>i,default:()=>Wr,getCurrentServerTime:()=>W}),function(e){var t=function(e){return e.constantProduct="constant_product",e}({});e.LiquidityPoolType=t;var r=function(e){return e.createAccount="create_account",e.payment="payment",e.pathPayment="path_payment_strict_receive",e.createPassiveOffer="create_passive_sell_offer",e.manageOffer="manage_sell_offer",e.setOptions="set_options",e.changeTrust="change_trust",e.allowTrust="allow_trust",e.accountMerge="account_merge",e.inflation="inflation",e.manageData="manage_data",e.bumpSequence="bump_sequence",e.manageBuyOffer="manage_buy_offer",e.pathPaymentStrictSend="path_payment_strict_send",e.createClaimableBalance="create_claimable_balance",e.claimClaimableBalance="claim_claimable_balance",e.beginSponsoringFutureReserves="begin_sponsoring_future_reserves",e.endSponsoringFutureReserves="end_sponsoring_future_reserves",e.revokeSponsorship="revoke_sponsorship",e.clawback="clawback",e.clawbackClaimableBalance="clawback_claimable_balance",e.setTrustLineFlags="set_trust_line_flags",e.liquidityPoolDeposit="liquidity_pool_deposit",e.liquidityPoolWithdraw="liquidity_pool_withdraw",e.invokeHostFunction="invoke_host_function",e.bumpFootprintExpiration="bump_footprint_expiration",e.restoreFootprint="restore_footprint",e}({});e.OperationResponseType=r;var n=function(e){return e[e.createAccount=0]="createAccount",e[e.payment=1]="payment",e[e.pathPayment=2]="pathPayment",e[e.createPassiveOffer=3]="createPassiveOffer",e[e.manageOffer=4]="manageOffer",e[e.setOptions=5]="setOptions",e[e.changeTrust=6]="changeTrust",e[e.allowTrust=7]="allowTrust",e[e.accountMerge=8]="accountMerge",e[e.inflation=9]="inflation",e[e.manageData=10]="manageData",e[e.bumpSequence=11]="bumpSequence",e[e.manageBuyOffer=12]="manageBuyOffer",e[e.pathPaymentStrictSend=13]="pathPaymentStrictSend",e[e.createClaimableBalance=14]="createClaimableBalance",e[e.claimClaimableBalance=15]="claimClaimableBalance",e[e.beginSponsoringFutureReserves=16]="beginSponsoringFutureReserves",e[e.endSponsoringFutureReserves=17]="endSponsoringFutureReserves",e[e.revokeSponsorship=18]="revokeSponsorship",e[e.clawback=19]="clawback",e[e.clawbackClaimableBalance=20]="clawbackClaimableBalance",e[e.setTrustLineFlags=21]="setTrustLineFlags",e[e.liquidityPoolDeposit=22]="liquidityPoolDeposit",e[e.liquidityPoolWithdraw=23]="liquidityPoolWithdraw",e[e.invokeHostFunction=24]="invokeHostFunction",e[e.bumpFootprintExpiration=25]="bumpFootprintExpiration",e[e.restoreFootprint=26]="restoreFootprint",e}({});e.OperationResponseTypeI=n;var o=function(e){return e.TX_FAILED="tx_failed",e.TX_BAD_SEQ="tx_bad_seq",e.TX_BAD_AUTH="tx_bad_auth",e.TX_BAD_AUTH_EXTRA="tx_bad_auth_extra",e.TX_FEE_BUMP_INNER_SUCCESS="tx_fee_bump_inner_success",e.TX_FEE_BUMP_INNER_FAILED="tx_fee_bump_inner_failed",e.TX_NOT_SUPPORTED="tx_not_supported",e.TX_SUCCESS="tx_success",e.TX_TOO_EARLY="tx_too_early",e.TX_TOO_LATE="tx_too_late",e.TX_MISSING_OPERATION="tx_missing_operation",e.TX_INSUFFICIENT_BALANCE="tx_insufficient_balance",e.TX_NO_SOURCE_ACCOUNT="tx_no_source_account",e.TX_INSUFFICIENT_FEE="tx_insufficient_fee",e.TX_INTERNAL_ERROR="tx_internal_error",e}({});e.TransactionFailedResultCodes=o}(n||(n={}));var o,i,a=((o={})[o.account_created=0]="account_created",o[o.account_removed=1]="account_removed",o[o.account_credited=2]="account_credited",o[o.account_debited=3]="account_debited",o[o.account_thresholds_updated=4]="account_thresholds_updated",o[o.account_home_domain_updated=5]="account_home_domain_updated",o[o.account_flags_updated=6]="account_flags_updated",o[o.account_inflation_destination_updated=7]="account_inflation_destination_updated",o[o.signer_created=10]="signer_created",o[o.signer_removed=11]="signer_removed",o[o.signer_updated=12]="signer_updated",o[o.trustline_created=20]="trustline_created",o[o.trustline_removed=21]="trustline_removed",o[o.trustline_updated=22]="trustline_updated",o[o.trustline_authorized=23]="trustline_authorized",o[o.trustline_deauthorized=24]="trustline_deauthorized",o[o.trustline_authorized_to_maintain_liabilities=25]="trustline_authorized_to_maintain_liabilities",o[o.trustline_flags_updated=26]="trustline_flags_updated",o[o.offer_created=30]="offer_created",o[o.offer_removed=31]="offer_removed",o[o.offer_updated=32]="offer_updated",o[o.trade=33]="trade",o[o.data_created=40]="data_created",o[o.data_removed=41]="data_removed",o[o.data_updated=42]="data_updated",o[o.sequence_bumped=43]="sequence_bumped",o[o.claimable_balance_created=50]="claimable_balance_created",o[o.claimable_balance_claimant_created=51]="claimable_balance_claimant_created",o[o.claimable_balance_claimed=52]="claimable_balance_claimed",o[o.account_sponsorship_created=60]="account_sponsorship_created",o[o.account_sponsorship_updated=61]="account_sponsorship_updated",o[o.account_sponsorship_removed=62]="account_sponsorship_removed",o[o.trustline_sponsorship_created=63]="trustline_sponsorship_created",o[o.trustline_sponsorship_updated=64]="trustline_sponsorship_updated",o[o.trustline_sponsorship_removed=65]="trustline_sponsorship_removed",o[o.data_sponsorship_created=66]="data_sponsorship_created",o[o.data_sponsorship_updated=67]="data_sponsorship_updated",o[o.data_sponsorship_removed=68]="data_sponsorship_removed",o[o.claimable_balance_sponsorship_created=69]="claimable_balance_sponsorship_created",o[o.claimable_balance_sponsorship_updated=70]="claimable_balance_sponsorship_updated",o[o.claimable_balance_sponsorship_removed=71]="claimable_balance_sponsorship_removed",o[o.signer_sponsorship_created=72]="signer_sponsorship_created",o[o.signer_sponsorship_updated=73]="signer_sponsorship_updated",o[o.signer_sponsorship_removed=74]="signer_sponsorship_removed",o[o.claimable_balance_clawed_back=80]="claimable_balance_clawed_back",o[o.liquidity_pool_deposited=90]="liquidity_pool_deposited",o[o.liquidity_pool_withdrew=91]="liquidity_pool_withdrew",o[o.liquidity_pool_trade=92]="liquidity_pool_trade",o[o.liquidity_pool_created=93]="liquidity_pool_created",o[o.liquidity_pool_removed=94]="liquidity_pool_removed",o[o.liquidity_pool_revoked=95]="liquidity_pool_revoked",o[o.contract_credited=96]="contract_credited",o[o.contract_debited=97]="contract_debited",o);!function(e){e.EffectType=a;var t=function(e){return e.all="all",e.liquidityPools="liquidity_pool",e.orderbook="orderbook",e}({});e.TradeType=t;n.OperationResponseType,n.OperationResponseTypeI}(i||(i={}));var s=r(950);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function p(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}var d,h,y,m=(d=function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._baseAccount=new s.Account(t.account_id,t.sequence),Object.entries(t).forEach(function(e){var t=c(e,2),n=t[0],o=t[1];r[n]=o})},(h=[{key:"accountId",value:function(){return this._baseAccount.accountId()}},{key:"sequenceNumber",value:function(){return this._baseAccount.sequenceNumber()}},{key:"incrementSequenceNumber",value:function(){this._baseAccount.incrementSequenceNumber(),this.sequence=this._baseAccount.sequenceNumber()}}])&&f(d.prototype,h),y&&f(d,y),Object.defineProperty(d,"prototype",{writable:!1}),d),g=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,v=Math.ceil,b=Math.floor,w="[BigNumber Error] ",S=w+"Number primitive has more than 15 significant digits: ",E=1e14,T=14,k=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],A=1e7,_=1e9;function x(e){var t=0|e;return e>0||e===t?t:t-1}function P(e){for(var t,r,n=1,o=e.length,i=e[0]+"";n<o;){for(t=e[n++]+"",r=T-t.length;r--;t="0"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function I(e,t){var r,n,o=e.c,i=t.c,a=e.s,s=t.s,u=e.e,c=t.e;if(!a||!s)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function R(e,t,r,n){if(e<t||e>r||e!==b(e))throw Error(w+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function B(e){var t=e.c.length-1;return x(e.e/T)==t&&e.c[t]%2!=0}function C(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function j(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var U=function e(t){var r,n,o,i,a,s,u,c,l,f,p=z.prototype={constructor:z,toString:null,valueOf:null},d=new z(1),h=20,y=4,m=-7,U=21,N=-1e7,L=1e7,D=!1,F=1,M=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},q="0123456789abcdefghijklmnopqrstuvwxyz",H=!0;function z(e,t){var r,i,a,s,u,c,l,f,p=this;if(!(p instanceof z))return new z(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>L?p.c=p.e=null:e.e<N?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,u=e;u>=10;u/=10,s++);return void(s>L?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!g.test(f=String(e)))return o(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(s<0&&(s=u),s+=+f.slice(u+1),f=f.substring(0,u)):s<0&&(s=f.length)}else{if(R(t,2,q.length,"Base"),10==t&&H)return G(p=new z(e),h+p.e+1,y);if(f=String(e),c="number"==typeof e){if(0*e!=0)return o(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,z.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(S+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=q.slice(0,t),s=u=0,l=f.length;u<l;u++)if(r.indexOf(i=f.charAt(u))<0){if("."==i){if(u>s){s=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,u=-1,s=0;continue}return o(p,String(e),c,t)}c=!1,(s=(f=n(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(u=0;48===f.charCodeAt(u);u++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(u,++l)){if(l-=u,c&&z.DEBUG&&l>15&&(e>k||e!==b(e)))throw Error(S+p.s*e);if((s=s-u-1)>L)p.c=p.e=null;else if(s<N)p.c=[p.e=0];else{if(p.e=s,p.c=[],u=(s+1)%T,s<0&&(u+=T),u<l){for(u&&p.c.push(+f.slice(0,u)),l-=T;u<l;)p.c.push(+f.slice(u,u+=T));u=T-(f=f.slice(u)).length}else u-=l;for(;u--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function K(e,t,r,n){var o,i,a,s,u;if(null==r?r=y:R(r,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)u=P(e.c),u=1==n||2==n&&(a<=m||a>=U)?C(u,a):j(u,a,"0");else if(i=(e=G(new z(e),t,r)).e,s=(u=P(e.c)).length,1==n||2==n&&(t<=i||i<=m)){for(;s<t;u+="0",s++);u=C(u,i)}else if(t-=a+(2===n&&i>a),u=j(u,i,"0"),i+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function X(e,t){for(var r,n,o=1,i=new z(e[0]);o<e.length;o++)(!(n=new z(e[o])).s||(r=I(i,n))===t||0===r&&i.s===t)&&(i=n);return i}function $(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*T-1)>L?e.c=e.e=null:r<N?e.c=[e.e=0]:(e.e=r,e.c=t),e}function G(e,t,r,n){var o,i,a,s,u,c,l,f=e.c,p=O;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=T,a=t,u=f[c=0],l=b(u/p[o-a-1]%10);else if((c=v((i+1)/T))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));u=l=0,o=1,a=(i%=T)-T+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);l=(a=(i%=T)-T+o)<0?0:b(u/p[o-a-1]%10)}if(n=n||t<0||null!=f[c+1]||(a<0?u:u%p[o-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(T-t%T)%T],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[T-i],f[c]=a>0?b(u/p[o-a]%p[a])*s:0),n)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==E&&(f[0]=1));break}if(f[c]+=s,f[c]!=E)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>L?e.c=e.e=null:e.e<N&&(e.c=[e.e=0])}return e}function W(e){var t,r=e.e;return null===r?e.toString():(t=P(e.c),t=r<=m||r>=U?C(t,r):j(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(w+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(R(r=e[t],0,_,t),h=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(R(r=e[t],0,8,t),y=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(R(r[0],-_,0,t),R(r[1],0,_,t),m=r[0],U=r[1]):(R(r,-_,_,t),m=-(U=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)R(r[0],-_,-1,t),R(r[1],1,_,t),N=r[0],L=r[1];else{if(R(r,-_,_,t),!r)throw Error(w+t+" cannot be zero: "+r);N=-(L=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(w+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw D=!r,Error(w+"crypto unavailable");D=r}else D=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(R(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(R(r=e[t],0,_,t),M=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(w+t+" not an object: "+r);V=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(w+t+" invalid: "+r);H="0123456789"==r.slice(0,10),q=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:y,EXPONENTIAL_AT:[m,U],RANGE:[N,L],CRYPTO:D,MODULO_MODE:F,POW_PRECISION:M,FORMAT:V,ALPHABET:q}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-_&&o<=_&&o===b(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%T)<1&&(t+=T),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=E||r!==b(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(w+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return X(arguments,-1)},z.minimum=z.min=function(){return X(arguments,1)},z.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return b(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,u=[],c=new z(d);if(null==e?e=h:R(e,0,_),o=v(e/T),D)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(u.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw D=!1,Error(w+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(u.push(i%1e14),s+=7);s=o/7}if(!D)for(;s<o;)(i=a())<9e15&&(u[s++]=i%1e14);for(o=u[--s],e%=T,o&&e&&(i=O[T-e],u[s]=b(o/i)*i);0===u[s];u.pop(),s--);if(s<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=T);for(s=1,i=u[0];i>=10;i/=10,s++);s<T&&(n-=T-s)}return c.e=n,c.c=u,c}),z.sum=function(){for(var e=1,t=arguments,r=new z(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var o,i,a=[0],s=0,u=e.length;s<u;){for(i=a.length;i--;a[i]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>r-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,p,d,m,g,v=n.indexOf("."),b=h,w=y;for(v>=0&&(f=M,M=0,n=n.replace(".",""),d=(g=new z(o)).pow(n.length-v),M=f,g.c=t(j(P(d.c),d.e,"0"),10,i,e),g.e=g.c.length),l=f=(m=t(n,o,i,s?(u=q,e):(u=e,q))).length;0==m[--f];m.pop());if(!m[0])return u.charAt(0);if(v<0?--l:(d.c=m,d.e=l,d.s=a,m=(d=r(d,g,b,w,i)).c,p=d.r,l=d.e),v=m[c=l+b+1],f=i/2,p=p||c<0||null!=m[c+1],p=w<4?(null!=v||p)&&(0==w||w==(d.s<0?3:2)):v>f||v==f&&(4==w||p||6==w&&1&m[c-1]||w==(d.s<0?8:7)),c<1||!m[0])n=p?j(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(m.length=c,p)for(--i;++m[--c]>i;)m[c]=0,c||(++l,m=[1].concat(m));for(f=m.length;!m[--f];);for(v=0,n="";v<=f;n+=u.charAt(m[v++]));n=j(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%A,l=t/A|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%A)+(n=l*i+(a=e[u]/A|0)*c)%A*A+s)/r|0)+(n/A|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,i,a,s){var u,c,l,f,p,d,h,y,m,g,v,w,S,k,O,A,_,P=n.s==o.s?1:-1,I=n.c,R=o.c;if(!(I&&I[0]&&R&&R[0]))return new z(n.s&&o.s&&(I?!R||I[0]!=R[0]:R)?I&&0==I[0]||!R?0*P:P/0:NaN);for(m=(y=new z(P)).c=[],P=i+(c=n.e-o.e)+1,s||(s=E,c=x(n.e/T)-x(o.e/T),P=P/T|0),l=0;R[l]==(I[l]||0);l++);if(R[l]>(I[l]||0)&&c--,P<0)m.push(1),f=!0;else{for(k=I.length,A=R.length,l=0,P+=2,(p=b(s/(R[0]+1)))>1&&(R=e(R,p,s),I=e(I,p,s),A=R.length,k=I.length),S=A,v=(g=I.slice(0,A)).length;v<A;g[v++]=0);_=R.slice(),_=[0].concat(_),O=R[0],R[1]>=s/2&&O++;do{if(p=0,(u=t(R,g,A,v))<0){if(w=g[0],A!=v&&(w=w*s+(g[1]||0)),(p=b(w/O))>1)for(p>=s&&(p=s-1),h=(d=e(R,p,s)).length,v=g.length;1==t(d,g,h,v);)p--,r(d,A<h?_:R,h,s),h=d.length,u=1;else 0==p&&(u=p=1),h=(d=R.slice()).length;if(h<v&&(d=[0].concat(d)),r(g,d,v,s),v=g.length,-1==u)for(;t(R,g,A,v)<1;)p++,r(g,A<v?_:R,v,s),v=g.length}else 0===u&&(p++,g=[0]);m[l++]=p,g[0]?g[v++]=I[S]||0:(g=[I[S]],v=1)}while((S++<k||null!=g[0])&&P--);f=null!=g[0],m[0]||m.splice(0,1)}if(s==E){for(l=1,P=m[0];P>=10;P/=10,l++);G(y,i+(y.e=l+c*T-1)+1,a,f)}else y.e=c,y.r=+f;return y}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(f,"");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(s,function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t}),n&&(o=n,i=i.replace(u,"$1").replace(c,"0.$1")),t!=i))return new z(i,o);if(z.DEBUG)throw Error(w+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},p.absoluteValue=p.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},p.comparedTo=function(e,t){return I(this,new z(e,t))},p.decimalPlaces=p.dp=function(e,t){var r,n,o,i=this;if(null!=e)return R(e,0,_),null==t?t=y:R(t,0,8),G(new z(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-x(this.e/T))*T,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},p.dividedBy=p.div=function(e,t){return r(this,new z(e,t),h,y)},p.dividedToIntegerBy=p.idiv=function(e,t){return r(this,new z(e,t),0,1)},p.exponentiatedBy=p.pow=function(e,t){var r,n,o,i,a,s,u,c,l=this;if((e=new z(e)).c&&!e.isInteger())throw Error(w+"Exponent not an integer: "+W(e));if(null!=t&&(t=new z(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new z(Math.pow(+W(l),a?e.s*(2-B(e)):+W(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&B(e)?-0:0,l.e>-1&&(i=1/i),new z(s?1/i:i);M&&(i=v(M/T+2))}for(a?(r=new z(.5),s&&(e.s=1),u=B(e)):u=(o=Math.abs(+W(e)))%2,c=new z(d);;){if(u){if(!(c=c.times(l)).c)break;i?c.c.length>i&&(c.c.length=i):n&&(c=c.mod(t))}if(o){if(0===(o=b(o/2)))break;u=o%2}else if(G(e=e.times(r),e.e+1,1),e.e>14)u=B(e);else{if(0===(o=+W(e)))break;u=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}return n?c:(s&&(c=d.div(c)),t?c.mod(t):i?G(c,M,y,undefined):c)},p.integerValue=function(e){var t=new z(this);return null==e?e=y:R(e,0,8),G(t,t.e+1,e)},p.isEqualTo=p.eq=function(e,t){return 0===I(this,new z(e,t))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(e,t){return I(this,new z(e,t))>0},p.isGreaterThanOrEqualTo=p.gte=function(e,t){return 1===(t=I(this,new z(e,t)))||0===t},p.isInteger=function(){return!!this.c&&x(this.e/T)>this.c.length-2},p.isLessThan=p.lt=function(e,t){return I(this,new z(e,t))<0},p.isLessThanOrEqualTo=p.lte=function(e,t){return-1===(t=I(this,new z(e,t)))||0===t},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new z(e,t)).s,!s||!t)return new z(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/T,c=e.e/T,l=a.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new z(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new z(l[0]?a:3==y?-0:0)}if(u=x(u),c=x(c),l=l.slice(),s=u-c){for((i=s<0)?(s=-s,o=l):(c=u,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(l[t]!=f[t]){i=l[t]<f[t];break}if(i&&(o=l,l=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=E-1;n>s;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=E}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?$(e,l,c):(e.s=3==y?-1:1,e.c=[e.e=0],e)},p.modulo=p.mod=function(e,t){var n,o,i=this;return e=new z(e,t),!i.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||i.c&&!i.c[0]?new z(i):(9==F?(o=e.s,e.s=1,n=r(i,e,0,3),e.s=o,n.s*=o):n=r(i,e,0,F),(e=i.minus(n.times(e))).c[0]||1!=F||(e.s=i.s),e)},p.multipliedBy=p.times=function(e,t){var r,n,o,i,a,s,u,c,l,f,p,d,h,y,m,g=this,v=g.c,b=(e=new z(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!g.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=g.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=x(g.e/T)+x(e.e/T),e.s*=g.s,(u=v.length)<(f=b.length)&&(h=v,v=b,b=h,o=u,u=f,f=o),o=u+f,h=[];o--;h.push(0));for(y=E,m=A,o=f;--o>=0;){for(r=0,p=b[o]%m,d=b[o]/m|0,i=o+(a=u);i>o;)r=((c=p*(c=v[--a]%m)+(s=d*c+(l=v[a]/m|0)*p)%m*m+h[i]+r)/y|0)+(s/m|0)+d*l,h[i--]=c%y;h[i]=r}return r?++n:h.splice(0,1),$(e,h,n)},p.negated=function(){var e=new z(this);return e.s=-e.s||null,e},p.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new z(e,t)).s,!o||!t)return new z(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/T,a=e.e/T,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new z(o/0);if(!s[0]||!u[0])return u[0]?e:new z(s[0]?n:0*o)}if(i=x(i),a=x(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/E|0,s[t]=E===s[t]?0:s[t]%E;return o&&(s=[o].concat(s),++a),$(e,s,a)},p.precision=p.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return R(e,1,_),null==t?t=y:R(t,0,8),G(new z(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*T+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},p.shiftedBy=function(e){return R(e,-9007199254740991,k),this.times("1e"+e)},p.squareRoot=p.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=h+4,f=new z("0.5");if(1!==u||!s||!s[0])return new z(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+W(a)))||u==1/0?(((t=P(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=x((c+1)/2)-(c<0||c%2),n=new z(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new z(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),P(i.c).slice(0,u)===(t=P(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(n,n.e+h+2,1),e=!n.times(n).eq(a));break}if(!o&&(G(i,i.e+h+2,0),i.times(i).eq(a))){n=i;break}l+=4,u+=4,o=1}return G(n,n.e+h+1,y,e)},p.toExponential=function(e,t){return null!=e&&(R(e,0,_),e++),K(this,e,t,1)},p.toFixed=function(e,t){return null!=e&&(R(e,0,_),e=e+this.e+1),K(this,e,t)},p.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=V;else if("object"!=typeof r)throw Error(w+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var i,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],f=a[1],p=o.s<0,d=p?l.slice(1):l,h=d.length;if(u&&(i=s,s=u,u=i,h-=i),s>0&&h>0){for(i=h%s||s,l=d.substr(0,i);i<h;i+=s)l+=c+d.substr(i,s);u>0&&(l+=c+d.slice(i)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},p.toFraction=function(e){var t,n,o,i,a,s,u,c,l,f,p,h,m=this,g=m.c;if(null!=e&&(!(u=new z(e)).isInteger()&&(u.c||1!==u.s)||u.lt(d)))throw Error(w+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+W(u));if(!g)return new z(m);for(t=new z(d),l=n=new z(d),o=c=new z(d),h=P(g),a=t.e=h.length-m.e-1,t.c[0]=O[(s=a%T)<0?T+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=L,L=1/0,u=new z(h),c.c[0]=0;f=r(u,t,0,1),1!=(i=n.plus(f.times(o))).comparedTo(e);)n=o,o=i,l=c.plus(f.times(i=l)),c=i,t=u.minus(f.times(i=t)),u=i;return i=r(e.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=m.s,p=r(l,o,a*=2,y).minus(m).abs().comparedTo(r(c,n,a,y).minus(m).abs())<1?[l,o]:[c,n],L=s,p},p.toNumber=function(){return+W(this)},p.toPrecision=function(e,t){return null!=e&&R(e,1,_),K(this,e,t,2)},p.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=m||i>=U?C(P(r.c),i):j(P(r.c),i,"0"):10===e&&H?t=j(P((r=G(new z(r),h+i+1,y)).c),r.e,"0"):(R(e,2,q.length,"Base"),t=n(j(P(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},p.valueOf=p.toJSON=function(){return W(this)},p._isBigNumber=!0,p[Symbol.toStringTag]="BigNumber",p[Symbol.for("nodejs.util.inspect.custom")]=p.valueOf,null!=t&&z.set(t),z}();const N=U;var L=r(193),D=r.n(L),F=r(127),M=r.n(F),V=r(976),q=r(371);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}var z="14.0.0",K={},X=(0,q.vt)({headers:{"X-Client-Name":"js-stellar-sdk","X-Client-Version":z}});function $(e){return Math.floor(e/1e3)}X.interceptors.response.use(function(e){var t=D()(e.config.url).hostname(),r=0;if(e.headers instanceof Headers){var n=e.headers.get("date");n&&(r=$(Date.parse(n)))}else if("object"===H(e.headers)&&"date"in e.headers){var o=e.headers;"string"==typeof o.date&&(r=$(Date.parse(o.date)))}var i=$((new Date).getTime());return Number.isNaN(r)||(K[t]={serverTime:r,localTimeRecorded:i}),e});const G=X;function W(e){var t=K[e];if(!t||!t.localTimeRecorded||!t.serverTime)return null;var r=t.serverTime,n=t.localTimeRecorded,o=$((new Date).getTime());return o-n>300?null:o-n+r}function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}function Z(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return Y(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Y(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Y(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Y(f,"constructor",c),Y(c,"constructor",u),u.displayName="GeneratorFunction",Y(c,o,"GeneratorFunction"),Y(f),Y(f,o,"Generator"),Y(f,n,function(){return this}),Y(f,"toString",function(){return"[object Generator]"}),(Z=function(){return{w:i,m:p}})()}function Y(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Y=function(e,t,r,n){function i(t,r){Y(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Y(e,t,r,n)}function J(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function ee(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){J(i,n,o,a,s,"next",e)}function s(e){J(i,n,o,a,s,"throw",e)}a(void 0)})}}function te(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,re(n.key),n)}}function re(e){var t=function(e,t){if("object"!=Q(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Q(t)?t:t+""}var ne,oe,ie=["transaction"],ae=function(e,t,r){return t&&te(e.prototype,t),r&&te(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t.clone(),this.filter=[],this.originalSegments=this.url.segment()||[],this.neighborRoot=r},[{key:"call",value:function(){var e=this;return this.checkFilter(),this._sendNormalRequest(this.url).then(function(t){return e._parseResponse(t)})}},{key:"stream",value:function(){throw new Error("Streaming requires eventsource to be enabled. If you need this functionality, compile with USE_EVENTSOURCE=true.")}},{key:"cursor",value:function(e){return this.url.setQuery("cursor",e),this}},{key:"limit",value:function(e){return this.url.setQuery("limit",e.toString()),this}},{key:"order",value:function(e){return this.url.setQuery("order",e),this}},{key:"join",value:function(e){return this.url.setQuery("join",e),this}},{key:"forEndpoint",value:function(e,t){if(""===this.neighborRoot)throw new Error("Invalid usage: neighborRoot not set in constructor");return this.filter.push([e,t,this.neighborRoot]),this}},{key:"checkFilter",value:function(){if(this.filter.length>=2)throw new V.v7("Too many filters specified",this.filter);if(1===this.filter.length){var e=this.originalSegments.concat(this.filter[0]);this.url.segment(e)}}},{key:"_requestFnForLink",value:function(e){var t=this;return ee(Z().m(function r(){var n,o,i,a,s=arguments;return Z().w(function(r){for(;;)switch(r.n){case 0:return n=s.length>0&&void 0!==s[0]?s[0]:{},e.templated?(i=M()(e.href),o=D()(i.expand(n))):o=D()(e.href),r.n=1,t._sendNormalRequest(o);case 1:return a=r.v,r.a(2,t._parseResponse(a))}},r)}))}},{key:"_parseRecord",value:function(e){var t=this;return e._links?(Object.keys(e._links).forEach(function(r){var n=e._links[r],o=!1;if(void 0!==e[r]&&(e["".concat(r,"_attr")]=e[r],o=!0),o&&ie.indexOf(r)>=0){var i=t._parseRecord(e[r]);e[r]=ee(Z().m(function e(){return Z().w(function(e){for(;;)if(0===e.n)return e.a(2,i)},e)}))}else e[r]=t._requestFnForLink(n)}),e):e}},{key:"_sendNormalRequest",value:(oe=ee(Z().m(function e(t){var r;return Z().w(function(e){for(;;)if(0===e.n)return""===(r=t).authority()&&(r=r.authority(this.url.authority())),""===r.protocol()&&(r=r.protocol(this.url.protocol())),e.a(2,X.get(r.toString()).then(function(e){return e.data}).catch(this._handleNetworkError))},e,this)})),function(e){return oe.apply(this,arguments)})},{key:"_parseResponse",value:function(e){return e._embedded&&e._embedded.records?this._toCollectionPage(e):this._parseRecord(e)}},{key:"_toCollectionPage",value:function(e){for(var t,r,n=this,o=0;o<e._embedded.records.length;o+=1)e._embedded.records[o]=this._parseRecord(e._embedded.records[o]);return{records:e._embedded.records,next:(r=ee(Z().m(function t(){var r;return Z().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,n._sendNormalRequest(D()(e._links.next.href));case 1:return r=t.v,t.a(2,n._toCollectionPage(r))}},t)})),function(){return r.apply(this,arguments)}),prev:(t=ee(Z().m(function t(){var r;return Z().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,n._sendNormalRequest(D()(e._links.prev.href));case 1:return r=t.v,t.a(2,n._toCollectionPage(r))}},t)})),function(){return t.apply(this,arguments)})}}},{key:"_handleNetworkError",value:(ne=ee(Z().m(function e(t){var r,n,o;return Z().w(function(e){for(;;)switch(e.n){case 0:if(!t.response||!t.response.status){e.n=4;break}o=t.response.status,e.n=404===o?1:2;break;case 1:return e.a(2,Promise.reject(new V.m_(null!==(r=t.response.statusText)&&void 0!==r?r:"Not Found",t.response.data)));case 2:return e.a(2,Promise.reject(new V.Dr(null!==(n=t.response.statusText)&&void 0!==n?n:"Unknown",t.response.data)));case 3:e.n=5;break;case 4:return e.a(2,Promise.reject(new Error(t.message)));case 5:return e.a(2)}},e)})),function(e){return ne.apply(this,arguments)})}]),se=r(732);function ue(e){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(e)}function ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,le(n.key),n)}}function le(e){var t=function(e,t){if("object"!=ue(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ue(t)?t:t+""}function fe(e,t,r){return t=de(t),function(e,t){if(t&&("object"==ue(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,pe()?Reflect.construct(t,r||[],de(e).constructor):t.apply(e,r))}function pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(pe=function(){return!!e})()}function de(e){return de=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},de(e)}function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},he(e,t)}var ye=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=fe(this,t,[e])).url.segment("accounts"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&he(e,t)}(t,e),function(e,t,r){return t&&ce(e.prototype,t),r&&ce(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"accountId",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"forSigner",value:function(e){return this.url.setQuery("signer",e),this}},{key:"forAsset",value:function(e){return this.url.setQuery("asset","".concat(e)),this}},{key:"sponsor",value:function(e){return this.url.setQuery("sponsor",e),this}},{key:"forLiquidityPool",value:function(e){return this.url.setQuery("liquidity_pool",e),this}}])}(ae);function me(e){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(e)}function ge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ve(n.key),n)}}function ve(e){var t=function(e,t){if("object"!=me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==me(t)?t:t+""}function be(e,t,r){return t=Se(t),function(e,t){if(t&&("object"==me(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,we()?Reflect.construct(t,r||[],Se(e).constructor):t.apply(e,r))}function we(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(we=function(){return!!e})()}function Se(e){return Se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Se(e)}function Ee(e,t){return Ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ee(e,t)}var Te=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=be(this,t,[e])).url.segment("assets"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ee(e,t)}(t,e),function(e,t,r){return t&&ge(e.prototype,t),r&&ge(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forCode",value:function(e){return this.url.setQuery("asset_code",e),this}},{key:"forIssuer",value:function(e){return this.url.setQuery("asset_issuer",e),this}}])}(ae);function ke(e){return ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(e)}function Oe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ae(n.key),n)}}function Ae(e){var t=function(e,t){if("object"!=ke(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ke(t)?t:t+""}function _e(e,t,r){return t=Pe(t),function(e,t){if(t&&("object"==ke(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xe()?Reflect.construct(t,r||[],Pe(e).constructor):t.apply(e,r))}function xe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xe=function(){return!!e})()}function Pe(e){return Pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pe(e)}function Ie(e,t){return Ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ie(e,t)}var Re=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=_e(this,t,[e])).url.segment("claimable_balances"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ie(e,t)}(t,e),function(e,t,r){return t&&Oe(e.prototype,t),r&&Oe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"claimableBalance",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"sponsor",value:function(e){return this.url.setQuery("sponsor",e),this}},{key:"claimant",value:function(e){return this.url.setQuery("claimant",e),this}},{key:"asset",value:function(e){return this.url.setQuery("asset",e.toString()),this}}])}(ae);function Be(e){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Be(e)}function Ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,je(n.key),n)}}function je(e){var t=function(e,t){if("object"!=Be(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Be(t)?t:t+""}function Ue(e,t,r){return t=Le(t),function(e,t){if(t&&("object"==Be(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ne()?Reflect.construct(t,r||[],Le(e).constructor):t.apply(e,r))}function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ne=function(){return!!e})()}function Le(e){return Le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Le(e)}function De(e,t){return De=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},De(e,t)}var Fe=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Ue(this,t,[e,"effects"])).url.segment("effects"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&De(e,t)}(t,e),function(e,t,r){return t&&Ce(e.prototype,t),r&&Ce(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forLedger",value:function(e){return this.forEndpoint("ledgers",e.toString())}},{key:"forTransaction",value:function(e){return this.forEndpoint("transactions",e)}},{key:"forOperation",value:function(e){return this.forEndpoint("operations",e)}},{key:"forLiquidityPool",value:function(e){return this.forEndpoint("liquidity_pools",e)}}])}(ae);function Me(e){return Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(e)}function Ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qe(n.key),n)}}function qe(e){var t=function(e,t){if("object"!=Me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Me(t)?t:t+""}function He(e,t,r){return t=Ke(t),function(e,t){if(t&&("object"==Me(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ze()?Reflect.construct(t,r||[],Ke(e).constructor):t.apply(e,r))}function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ze=function(){return!!e})()}function Ke(e){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ke(e)}function Xe(e,t){return Xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xe(e,t)}var $e=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=He(this,t,[e])).url.segment("friendbot"),n.url.setQuery("addr",r),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xe(e,t)}(t,e),function(e,t,r){return t&&Ve(e.prototype,t),r&&Ve(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ae);function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function We(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qe(n.key),n)}}function Qe(e){var t=function(e,t){if("object"!=Ge(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ge(t)?t:t+""}function Ze(e,t,r){return t=Je(t),function(e,t){if(t&&("object"==Ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ye()?Reflect.construct(t,r||[],Je(e).constructor):t.apply(e,r))}function Ye(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ye=function(){return!!e})()}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Je(e)}function et(e,t){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},et(e,t)}var tt=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Ze(this,t,[e])).url.segment("ledgers"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&et(e,t)}(t,e),function(e,t,r){return t&&We(e.prototype,t),r&&We(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"ledger",value:function(e){return this.filter.push(["ledgers",e.toString()]),this}}])}(ae);function rt(e){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rt(e)}function nt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ot(n.key),n)}}function ot(e){var t=function(e,t){if("object"!=rt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rt(t)?t:t+""}function it(e,t,r){return t=st(t),function(e,t){if(t&&("object"==rt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,at()?Reflect.construct(t,r||[],st(e).constructor):t.apply(e,r))}function at(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(at=function(){return!!e})()}function st(e){return st=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},st(e)}function ut(e,t){return ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ut(e,t)}var ct=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=it(this,t,[e])).url.segment("liquidity_pools"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ut(e,t)}(t,e),function(e,t,r){return t&&nt(e.prototype,t),r&&nt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forAssets",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map(function(e){return e.toString()}).join(",");return this.url.setQuery("reserves",n),this}},{key:"forAccount",value:function(e){return this.url.setQuery("account",e),this}},{key:"liquidityPoolId",value:function(e){if(!e.match(/[a-fA-F0-9]{64}/))throw new TypeError("".concat(e," does not look like a liquidity pool ID"));var t=new ae(this.url.clone());return t.filter.push([e.toLowerCase()]),t}}])}(ae);function lt(e){return lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lt(e)}function ft(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pt(n.key),n)}}function pt(e){var t=function(e,t){if("object"!=lt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lt(t)?t:t+""}function dt(e,t,r){return t=yt(t),function(e,t){if(t&&("object"==lt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ht()?Reflect.construct(t,r||[],yt(e).constructor):t.apply(e,r))}function ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ht=function(){return!!e})()}function yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yt(e)}function mt(e,t){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mt(e,t)}var gt=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=dt(this,t,[e,"offers"])).url.segment("offers"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mt(e,t)}(t,e),function(e,t,r){return t&&ft(e.prototype,t),r&&ft(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"offer",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"buying",value:function(e){return e.isNative()?this.url.setQuery("buying_asset_type","native"):(this.url.setQuery("buying_asset_type",e.getAssetType()),this.url.setQuery("buying_asset_code",e.getCode()),this.url.setQuery("buying_asset_issuer",e.getIssuer())),this}},{key:"selling",value:function(e){return e.isNative()?this.url.setQuery("selling_asset_type","native"):(this.url.setQuery("selling_asset_type",e.getAssetType()),this.url.setQuery("selling_asset_code",e.getCode()),this.url.setQuery("selling_asset_issuer",e.getIssuer())),this}},{key:"sponsor",value:function(e){return this.url.setQuery("sponsor",e),this}},{key:"seller",value:function(e){return this.url.setQuery("seller",e),this}}])}(ae);function vt(e){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vt(e)}function bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wt(n.key),n)}}function wt(e){var t=function(e,t){if("object"!=vt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vt(t)?t:t+""}function St(e,t,r){return t=Tt(t),function(e,t){if(t&&("object"==vt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Et()?Reflect.construct(t,r||[],Tt(e).constructor):t.apply(e,r))}function Et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Et=function(){return!!e})()}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tt(e)}function kt(e,t){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kt(e,t)}var Ot=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=St(this,t,[e,"operations"])).url.segment("operations"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kt(e,t)}(t,e),function(e,t,r){return t&&bt(e.prototype,t),r&&bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"operation",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forClaimableBalance",value:function(e){return this.forEndpoint("claimable_balances",e)}},{key:"forLedger",value:function(e){return this.forEndpoint("ledgers",e.toString())}},{key:"forTransaction",value:function(e){return this.forEndpoint("transactions",e)}},{key:"forLiquidityPool",value:function(e){return this.forEndpoint("liquidity_pools",e)}},{key:"includeFailed",value:function(e){return this.url.setQuery("include_failed",e.toString()),this}}])}(ae);function At(e){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(e)}function _t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xt(n.key),n)}}function xt(e){var t=function(e,t){if("object"!=At(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==At(t)?t:t+""}function Pt(e,t,r){return t=Rt(t),function(e,t){if(t&&("object"==At(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,It()?Reflect.construct(t,r||[],Rt(e).constructor):t.apply(e,r))}function It(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(It=function(){return!!e})()}function Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rt(e)}function Bt(e,t){return Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bt(e,t)}var Ct=function(e){function t(e,r,n){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=Pt(this,t,[e])).url.segment("order_book"),r.isNative()?o.url.setQuery("selling_asset_type","native"):(o.url.setQuery("selling_asset_type",r.getAssetType()),o.url.setQuery("selling_asset_code",r.getCode()),o.url.setQuery("selling_asset_issuer",r.getIssuer())),n.isNative()?o.url.setQuery("buying_asset_type","native"):(o.url.setQuery("buying_asset_type",n.getAssetType()),o.url.setQuery("buying_asset_code",n.getCode()),o.url.setQuery("buying_asset_issuer",n.getIssuer())),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bt(e,t)}(t,e),function(e,t,r){return t&&_t(e.prototype,t),r&&_t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ae);function jt(e){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jt(e)}function Ut(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nt(n.key),n)}}function Nt(e){var t=function(e,t){if("object"!=jt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jt(t)?t:t+""}function Lt(e,t,r){return t=Ft(t),function(e,t){if(t&&("object"==jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dt()?Reflect.construct(t,r||[],Ft(e).constructor):t.apply(e,r))}function Dt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Dt=function(){return!!e})()}function Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ft(e)}function Mt(e,t){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mt(e,t)}var Vt=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Lt(this,t,[e,"payments"])).url.segment("payments"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mt(e,t)}(t,e),function(e,t,r){return t&&Ut(e.prototype,t),r&&Ut(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forLedger",value:function(e){return this.forEndpoint("ledgers",e.toString())}},{key:"forTransaction",value:function(e){return this.forEndpoint("transactions",e)}},{key:"includeFailed",value:function(e){return this.url.setQuery("include_failed",e.toString()),this}}])}(ae);function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}function Ht(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zt(n.key),n)}}function zt(e){var t=function(e,t){if("object"!=qt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qt(t)?t:t+""}function Kt(e,t,r){return t=$t(t),function(e,t){if(t&&("object"==qt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Xt()?Reflect.construct(t,r||[],$t(e).constructor):t.apply(e,r))}function Xt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Xt=function(){return!!e})()}function $t(e){return $t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$t(e)}function Gt(e,t){return Gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gt(e,t)}var Wt=function(e){function t(e,r,n,o){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=Kt(this,t,[e])).url.segment("paths/strict-receive"),"string"==typeof r)i.url.setQuery("source_account",r);else{var a=r.map(function(e){return e.isNative()?"native":"".concat(e.getCode(),":").concat(e.getIssuer())}).join(",");i.url.setQuery("source_assets",a)}return i.url.setQuery("destination_amount",o),n.isNative()?i.url.setQuery("destination_asset_type","native"):(i.url.setQuery("destination_asset_type",n.getAssetType()),i.url.setQuery("destination_asset_code",n.getCode()),i.url.setQuery("destination_asset_issuer",n.getIssuer())),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gt(e,t)}(t,e),function(e,t,r){return t&&Ht(e.prototype,t),r&&Ht(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ae);function Qt(e){return Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qt(e)}function Zt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yt(n.key),n)}}function Yt(e){var t=function(e,t){if("object"!=Qt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qt(t)?t:t+""}function Jt(e,t,r){return t=tr(t),function(e,t){if(t&&("object"==Qt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,er()?Reflect.construct(t,r||[],tr(e).constructor):t.apply(e,r))}function er(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(er=function(){return!!e})()}function tr(e){return tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tr(e)}function rr(e,t){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rr(e,t)}var nr=function(e){function t(e,r,n,o){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=Jt(this,t,[e])).url.segment("paths/strict-send"),r.isNative()?i.url.setQuery("source_asset_type","native"):(i.url.setQuery("source_asset_type",r.getAssetType()),i.url.setQuery("source_asset_code",r.getCode()),i.url.setQuery("source_asset_issuer",r.getIssuer())),i.url.setQuery("source_amount",n),"string"==typeof o)i.url.setQuery("destination_account",o);else{var a=o.map(function(e){return e.isNative()?"native":"".concat(e.getCode(),":").concat(e.getIssuer())}).join(",");i.url.setQuery("destination_assets",a)}return i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rr(e,t)}(t,e),function(e,t,r){return t&&Zt(e.prototype,t),r&&Zt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ae);function or(e){return or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},or(e)}function ir(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ar(n.key),n)}}function ar(e){var t=function(e,t){if("object"!=or(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==or(t)?t:t+""}function sr(e,t,r){return t=cr(t),function(e,t){if(t&&("object"==or(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ur()?Reflect.construct(t,r||[],cr(e).constructor):t.apply(e,r))}function ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ur=function(){return!!e})()}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cr(e)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lr(e,t)}var fr=[6e4,3e5,9e5,36e5,864e5,6048e5],pr=function(e){function t(e,r,n,o,i,a,s){var u;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(u=sr(this,t,[e])).url.segment("trade_aggregations"),r.isNative()?u.url.setQuery("base_asset_type","native"):(u.url.setQuery("base_asset_type",r.getAssetType()),u.url.setQuery("base_asset_code",r.getCode()),u.url.setQuery("base_asset_issuer",r.getIssuer())),n.isNative()?u.url.setQuery("counter_asset_type","native"):(u.url.setQuery("counter_asset_type",n.getAssetType()),u.url.setQuery("counter_asset_code",n.getCode()),u.url.setQuery("counter_asset_issuer",n.getIssuer())),"number"!=typeof o||"number"!=typeof i)throw new V.v7("Invalid time bounds",[o,i]);if(u.url.setQuery("start_time",o.toString()),u.url.setQuery("end_time",i.toString()),!u.isValidResolution(a))throw new V.v7("Invalid resolution",a);if(u.url.setQuery("resolution",a.toString()),!u.isValidOffset(s,a))throw new V.v7("Invalid offset",s);return u.url.setQuery("offset",s.toString()),u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lr(e,t)}(t,e),function(e,t,r){return t&&ir(e.prototype,t),r&&ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"isValidResolution",value:function(e){return fr.some(function(t){return t===e})}},{key:"isValidOffset",value:function(e,t){var r=36e5;return!(e>t||e>=24*r||e%r!==0)}}])}(ae);function dr(e){return dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dr(e)}function hr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yr(n.key),n)}}function yr(e){var t=function(e,t){if("object"!=dr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dr(t)?t:t+""}function mr(e,t,r){return t=vr(t),function(e,t){if(t&&("object"==dr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,gr()?Reflect.construct(t,r||[],vr(e).constructor):t.apply(e,r))}function gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gr=function(){return!!e})()}function vr(e){return vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vr(e)}function br(e,t){return br=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},br(e,t)}var wr=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=mr(this,t,[e,"trades"])).url.segment("trades"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&br(e,t)}(t,e),function(e,t,r){return t&&hr(e.prototype,t),r&&hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forAssetPair",value:function(e,t){return e.isNative()?this.url.setQuery("base_asset_type","native"):(this.url.setQuery("base_asset_type",e.getAssetType()),this.url.setQuery("base_asset_code",e.getCode()),this.url.setQuery("base_asset_issuer",e.getIssuer())),t.isNative()?this.url.setQuery("counter_asset_type","native"):(this.url.setQuery("counter_asset_type",t.getAssetType()),this.url.setQuery("counter_asset_code",t.getCode()),this.url.setQuery("counter_asset_issuer",t.getIssuer())),this}},{key:"forOffer",value:function(e){return this.url.setQuery("offer_id",e),this}},{key:"forType",value:function(e){return this.url.setQuery("trade_type",e),this}},{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forLiquidityPool",value:function(e){return this.forEndpoint("liquidity_pools",e)}}])}(ae);function Sr(e){return Sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sr(e)}function Er(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tr(n.key),n)}}function Tr(e){var t=function(e,t){if("object"!=Sr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Sr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Sr(t)?t:t+""}function kr(e,t,r){return t=Ar(t),function(e,t){if(t&&("object"==Sr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Or()?Reflect.construct(t,r||[],Ar(e).constructor):t.apply(e,r))}function Or(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Or=function(){return!!e})()}function Ar(e){return Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ar(e)}function _r(e,t){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_r(e,t)}var xr=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=kr(this,t,[e,"transactions"])).url.segment("transactions"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_r(e,t)}(t,e),function(e,t,r){return t&&Er(e.prototype,t),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"transaction",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forClaimableBalance",value:function(e){return this.forEndpoint("claimable_balances",e)}},{key:"forLedger",value:function(e){return this.forEndpoint("ledgers",e.toString())}},{key:"forLiquidityPool",value:function(e){return this.forEndpoint("liquidity_pools",e)}},{key:"includeFailed",value:function(e){return this.url.setQuery("include_failed",e.toString()),this}}])}(ae);function Pr(e){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pr(e)}function Ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ir(Object(r),!0).forEach(function(t){Br(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ir(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Br(e,t,r){return(t=Dr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cr(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return jr(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(jr(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,jr(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,jr(f,"constructor",c),jr(c,"constructor",u),u.displayName="GeneratorFunction",jr(c,o,"GeneratorFunction"),jr(f),jr(f,o,"Generator"),jr(f,n,function(){return this}),jr(f,"toString",function(){return"[object Generator]"}),(Cr=function(){return{w:i,m:p}})()}function jr(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}jr=function(e,t,r,n){function i(t,r){jr(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},jr(e,t,r,n)}function Ur(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Nr(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Ur(i,n,o,a,s,"next",e)}function s(e){Ur(i,n,o,a,s,"throw",e)}a(void 0)})}}function Lr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Dr(n.key),n)}}function Dr(e){var t=function(e,t){if("object"!=Pr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pr(t)?t:t+""}function Fr(e){return new N(e).div(1e7).toString()}var Mr,Vr,qr,Hr,zr,Kr,Xr,$r,Gr=function(e,t,r){return t&&Lr(e.prototype,t),r&&Lr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=D()(t);var n=void 0===r.allowHttp?se.T.isAllowHttp():r.allowHttp,o={};if(r.appName&&(o["X-App-Name"]=r.appName),r.appVersion&&(o["X-App-Version"]=r.appVersion),r.authToken&&(o["X-Auth-Token"]=r.authToken),r.headers&&Object.assign(o,r.headers),Object.keys(o).length>0&&G.interceptors.request.use(function(e){return e.headers=e.headers||{},e.headers=Object.assign(e.headers,o),e}),"https"!==this.serverURL.protocol()&&!n)throw new Error("Cannot connect to insecure horizon server")},[{key:"fetchTimebounds",value:($r=Nr(Cr().m(function e(t){var r,n,o=arguments;return Cr().w(function(e){for(;;)switch(e.n){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1],!(n=W(this.serverURL.hostname()))){e.n=1;break}return e.a(2,{minTime:0,maxTime:n+t});case 1:if(!r){e.n=2;break}return e.a(2,{minTime:0,maxTime:Math.floor((new Date).getTime()/1e3)+t});case 2:return e.n=3,G.get(D()(this.serverURL).toString());case 3:return e.a(2,this.fetchTimebounds(t,!0))}},e,this)})),function(e){return $r.apply(this,arguments)})},{key:"fetchBaseFee",value:(Xr=Nr(Cr().m(function e(){var t;return Cr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.feeStats();case 1:return t=e.v,e.a(2,parseInt(t.last_ledger_base_fee,10)||100)}},e,this)})),function(){return Xr.apply(this,arguments)})},{key:"feeStats",value:(Kr=Nr(Cr().m(function e(){var t;return Cr().w(function(e){for(;;)if(0===e.n)return(t=new ae(D()(this.serverURL))).filter.push(["fee_stats"]),e.a(2,t.call())},e,this)})),function(){return Kr.apply(this,arguments)})},{key:"root",value:(zr=Nr(Cr().m(function e(){var t;return Cr().w(function(e){for(;;)if(0===e.n)return t=new ae(D()(this.serverURL)),e.a(2,t.call())},e,this)})),function(){return zr.apply(this,arguments)})},{key:"submitTransaction",value:(Hr=Nr(Cr().m(function e(t){var r,n=arguments;return Cr().w(function(e){for(;;)switch(e.n){case 0:if((n.length>1&&void 0!==n[1]?n[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.n=1;break}return e.n=1,this.checkMemoRequired(t);case 1:return r=encodeURIComponent(t.toEnvelope().toXDR().toString("base64")),e.a(2,G.post(D()(this.serverURL).segment("transactions").toString(),"tx=".concat(r),{timeout:6e4,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(e){if(!e.data.result_xdr)return e.data;var t,r,n=s.xdr.TransactionResult.fromXDR(e.data.result_xdr,"base64").result().value();return n.length&&(t=n.map(function(e,t){if("manageBuyOffer"!==e.value().switch().name&&"manageSellOffer"!==e.value().switch().name)return null;r=!0;var n,o=new N(0),i=new N(0),a=e.value().value().success(),u=a.offersClaimed().map(function(e){var t=e.value(),r="";switch(e.switch()){case s.xdr.ClaimAtomType.claimAtomTypeV0():r=s.StrKey.encodeEd25519PublicKey(t.sellerEd25519());break;case s.xdr.ClaimAtomType.claimAtomTypeOrderBook():r=s.StrKey.encodeEd25519PublicKey(t.sellerId().ed25519());break;default:throw new Error("Invalid offer result type: ".concat(e.switch()))}var n=new N(t.amountBought().toString()),a=new N(t.amountSold().toString());o=o.plus(a),i=i.plus(n);var u=s.Asset.fromOperation(t.assetSold()),c=s.Asset.fromOperation(t.assetBought()),l={type:u.getAssetType(),assetCode:u.getCode(),issuer:u.getIssuer()},f={type:c.getAssetType(),assetCode:c.getCode(),issuer:c.getIssuer()};return{sellerId:r,offerId:t.offerId().toString(),assetSold:l,amountSold:Fr(a),assetBought:f,amountBought:Fr(n)}}),c=a.offer().switch().name;if("function"==typeof a.offer().value&&a.offer().value()){var l=a.offer().value();n={offerId:l.offerId().toString(),selling:{},buying:{},amount:Fr(l.amount().toString()),price:{n:l.price().n(),d:l.price().d()}};var f=s.Asset.fromOperation(l.selling());n.selling={type:f.getAssetType(),assetCode:f.getCode(),issuer:f.getIssuer()};var p=s.Asset.fromOperation(l.buying());n.buying={type:p.getAssetType(),assetCode:p.getCode(),issuer:p.getIssuer()}}return{offersClaimed:u,effect:c,operationIndex:t,currentOffer:n,amountBought:Fr(o),amountSold:Fr(i),isFullyOpen:!u.length&&"manageOfferDeleted"!==c,wasPartiallyFilled:!!u.length&&"manageOfferDeleted"!==c,wasImmediatelyFilled:!!u.length&&"manageOfferDeleted"===c,wasImmediatelyDeleted:!u.length&&"manageOfferDeleted"===c}}).filter(function(e){return!!e})),Rr(Rr({},e.data),{},{offerResults:r?t:void 0})}).catch(function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new V.nS("Transaction submission failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))}))}},e,this)})),function(e){return Hr.apply(this,arguments)})},{key:"submitAsyncTransaction",value:(qr=Nr(Cr().m(function e(t){var r,n=arguments;return Cr().w(function(e){for(;;)switch(e.n){case 0:if((n.length>1&&void 0!==n[1]?n[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.n=1;break}return e.n=1,this.checkMemoRequired(t);case 1:return r=encodeURIComponent(t.toEnvelope().toXDR().toString("base64")),e.a(2,G.post(D()(this.serverURL).segment("transactions_async").toString(),"tx=".concat(r),{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(e){return e.data}).catch(function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new V.nS("Transaction submission failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))}))}},e,this)})),function(e){return qr.apply(this,arguments)})},{key:"accounts",value:function(){return new ye(D()(this.serverURL))}},{key:"claimableBalances",value:function(){return new Re(D()(this.serverURL))}},{key:"ledgers",value:function(){return new tt(D()(this.serverURL))}},{key:"transactions",value:function(){return new xr(D()(this.serverURL))}},{key:"offers",value:function(){return new gt(D()(this.serverURL))}},{key:"orderbook",value:function(e,t){return new Ct(D()(this.serverURL),e,t)}},{key:"trades",value:function(){return new wr(D()(this.serverURL))}},{key:"operations",value:function(){return new Ot(D()(this.serverURL))}},{key:"liquidityPools",value:function(){return new ct(D()(this.serverURL))}},{key:"strictReceivePaths",value:function(e,t,r){return new Wt(D()(this.serverURL),e,t,r)}},{key:"strictSendPaths",value:function(e,t,r){return new nr(D()(this.serverURL),e,t,r)}},{key:"payments",value:function(){return new Vt(D()(this.serverURL))}},{key:"effects",value:function(){return new Fe(D()(this.serverURL))}},{key:"friendbot",value:function(e){return new $e(D()(this.serverURL),e)}},{key:"assets",value:function(){return new Te(D()(this.serverURL))}},{key:"loadAccount",value:(Vr=Nr(Cr().m(function e(t){var r;return Cr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.accounts().accountId(t).call();case 1:return r=e.v,e.a(2,new m(r))}},e,this)})),function(e){return Vr.apply(this,arguments)})},{key:"tradeAggregation",value:function(e,t,r,n,o,i){return new pr(D()(this.serverURL),e,t,r,n,o,i)}},{key:"checkMemoRequired",value:(Mr=Nr(Cr().m(function e(t){var r,n,o,i,a,u;return Cr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t instanceof s.FeeBumpTransaction&&(t=t.innerTransaction),"none"===t.memo.type){e.n=1;break}return e.a(2);case 1:r=new Set,n=0;case 2:if(!(n<t.operations.length)){e.n=14;break}o=t.operations[n],a=o.type,e.n="payment"===a||"pathPaymentStrictReceive"===a||"pathPaymentStrictSend"===a||"accountMerge"===a?3:4;break;case 3:return e.a(3,5);case 4:return e.a(3,13);case 5:if(i=o.destination,!r.has(i)){e.n=6;break}return e.a(3,13);case 6:if(r.add(i),!i.startsWith("M")){e.n=7;break}return e.a(3,13);case 7:return e.p=7,e.n=8,this.loadAccount(i);case 8:if("MQ=="!==e.v.data_attr["config.memo_required"]){e.n=9;break}throw new V.Cu("account requires memo",i,n);case 9:e.n=13;break;case 10:if(e.p=10,!((u=e.v)instanceof V.Cu)){e.n=11;break}throw u;case 11:if(u instanceof V.m_){e.n=12;break}throw u;case 12:return e.a(3,13);case 13:n+=1,e.n=2;break;case 14:return e.a(2)}},e,this,[[7,10]])})),function(e){return Mr.apply(this,arguments)})}]);const Wr=(e=r.hmd(e)).exports},784:(e,t,r)=>{"use strict";r.d(t,{$D:()=>d,Af:()=>c,WC:()=>l,fG:()=>p,jr:()=>h,tR:()=>f});var n=r(950),o=r(76);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){var t=e.errorResultXdr,r=e.diagnosticEventsXdr;return delete e.errorResultXdr,delete e.diagnosticEventsXdr,t?s(s(s({},e),void 0!==r&&r.length>0&&{diagnosticEvents:r.map(function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")})}),{},{errorResult:n.xdr.TransactionResult.fromXDR(t,"base64")}):s({},e)}function l(e){var t,r,o,i,a=n.xdr.TransactionMeta.fromXDR(e.resultMetaXdr,"base64"),s={ledger:e.ledger,createdAt:e.createdAt,applicationOrder:e.applicationOrder,feeBump:e.feeBump,envelopeXdr:n.xdr.TransactionEnvelope.fromXDR(e.envelopeXdr,"base64"),resultXdr:n.xdr.TransactionResult.fromXDR(e.resultXdr,"base64"),resultMetaXdr:a,events:{contractEventsXdr:(null!==(t=null===(r=e.events)||void 0===r?void 0:r.contractEventsXdr)&&void 0!==t?t:[]).map(function(e){return e.map(function(e){return n.xdr.ContractEvent.fromXDR(e,"base64")})}),transactionEventsXdr:(null!==(o=null===(i=e.events)||void 0===i?void 0:i.transactionEventsXdr)&&void 0!==o?o:[]).map(function(e){return n.xdr.TransactionEvent.fromXDR(e,"base64")})}};switch(a.switch()){case 3:case 4:var u,c,l=a.value();if(null!==l.sorobanMeta())s.returnValue=null!==(u=null===(c=l.sorobanMeta())||void 0===c?void 0:c.returnValue())&&void 0!==u?u:void 0}return e.diagnosticEventsXdr&&(s.diagnosticEventsXdr=e.diagnosticEventsXdr.map(function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")})),s}function f(e){return s({status:e.status,txHash:e.txHash},l(e))}function p(e){var t;return{latestLedger:e.latestLedger,oldestLedger:e.oldestLedger,latestLedgerCloseTime:e.latestLedgerCloseTime,oldestLedgerCloseTime:e.oldestLedgerCloseTime,cursor:e.cursor,events:(null!==(t=e.events)&&void 0!==t?t:[]).map(function(e){var t=s({},e);return delete t.contractId,s(s(s({},t),""!==e.contractId&&{contractId:new n.Contract(e.contractId)}),{},{topic:e.topic.map(function(e){return n.xdr.ScVal.fromXDR(e,"base64")}),value:n.xdr.ScVal.fromXDR(e.value,"base64")})})}}function d(e){var t;return{latestLedger:e.latestLedger,entries:(null!==(t=e.entries)&&void 0!==t?t:[]).map(function(e){if(!e.key||!e.xdr)throw new TypeError("invalid ledger entry: ".concat(JSON.stringify(e)));return s({lastModifiedLedgerSeq:e.lastModifiedLedgerSeq,key:n.xdr.LedgerKey.fromXDR(e.key,"base64"),val:n.xdr.LedgerEntryData.fromXDR(e.xdr,"base64")},void 0!==e.liveUntilLedgerSeq&&{liveUntilLedgerSeq:e.liveUntilLedgerSeq})})}}function h(e){var t,r;if(!o.j.isSimulationRaw(e))return e;var i={_parsed:!0,id:e.id,latestLedger:e.latestLedger,events:null!==(t=null===(r=e.events)||void 0===r?void 0:r.map(function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")}))&&void 0!==t?t:[]};return"string"==typeof e.error?s(s({},i),{},{error:e.error}):function(e,t){var r,o,i,a,u,c=s(s(s({},t),{},{transactionData:new n.SorobanDataBuilder(e.transactionData),minResourceFee:e.minResourceFee},null!==(r=null===(o=e.results)||void 0===o?void 0:o.length)&&void 0!==r&&r&&{result:e.results.map(function(e){var t;return{auth:(null!==(t=e.auth)&&void 0!==t?t:[]).map(function(e){return n.xdr.SorobanAuthorizationEntry.fromXDR(e,"base64")}),retval:e.xdr?n.xdr.ScVal.fromXDR(e.xdr,"base64"):n.xdr.ScVal.scvVoid()}})[0]}),null!==(i=null===(a=e.stateChanges)||void 0===a?void 0:a.length)&&void 0!==i&&i&&{stateChanges:null===(u=e.stateChanges)||void 0===u?void 0:u.map(function(e){return{type:e.type,key:n.xdr.LedgerKey.fromXDR(e.key,"base64"),before:e.before?n.xdr.LedgerEntry.fromXDR(e.before,"base64"):null,after:e.after?n.xdr.LedgerEntry.fromXDR(e.after,"base64"):null}})});return e.restorePreamble&&""!==e.restorePreamble.transactionData?s(s({},c),{},{restorePreamble:{minResourceFee:e.restorePreamble.minResourceFee,transactionData:new n.SorobanDataBuilder(e.restorePreamble.transactionData)}}):c}(e,i)}},798:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}r.d(t,{q:()=>c});var a,s,u,c=(a=function e(t){var r,n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promise=new Promise(function(e){r=e}),t(function(e){n.reason=e,r()})},(s=[{key:"throwIfRequested",value:function(){if(this.reason)throw new Error(this.reason)}}])&&o(a.prototype,s),u&&o(a,u),Object.defineProperty(a,"prototype",{writable:!1}),a)},861:(e,t,r)=>{var n=r(287),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},898:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>{},Resolver:()=>w,STELLAR_TOML_MAX_SIZE:()=>v});var n=r(293),o=r.n(n),i=r(371),a=r(732);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return c(l,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),l}var a={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(c(t={},n,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,c(d,"constructor",f),c(f,"constructor",l),l.displayName="GeneratorFunction",c(f,o,"GeneratorFunction"),c(d),c(d,o,"Generator"),c(d,n,function(){return this}),c(d,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function c(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}c=function(e,t,r,n){function i(t,r){c(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},c(e,t,r,n)}function l(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function p(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var d,h,y,m,g,v=102400,b=i.ok.CancelToken,w=(d=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},h=null,y=[{key:"resolve",value:(m=u().m(function e(t){var r,n,s,c,l,f=arguments;return u().w(function(e){for(;;)if(0===e.n)return s=void 0===(n=f.length>1&&void 0!==f[1]?f[1]:{}).allowHttp?a.T.isAllowHttp():n.allowHttp,c=void 0===n.timeout?a.T.getTimeout():n.timeout,l=s?"http":"https",e.a(2,i.ok.get("".concat(l,"://").concat(t,"/.well-known/stellar.toml"),{maxRedirects:null!==(r=n.allowedRedirects)&&void 0!==r?r:0,maxContentLength:v,cancelToken:c?new b(function(e){return setTimeout(function(){return e("timeout of ".concat(c,"ms exceeded"))},c)}):void 0,timeout:c}).then(function(e){try{var t=o().parse(e.data);return Promise.resolve(t)}catch(e){return Promise.reject(new Error("stellar.toml is invalid - Parsing error on line ".concat(e.line,", column ").concat(e.column,": ").concat(e.message)))}}).catch(function(e){throw e.message.match(/^maxContentLength size/)?new Error("stellar.toml file exceeds allowed size of ".concat(v)):e}))},e)}),g=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=m.apply(e,t);function i(e){l(o,r,n,i,a,"next",e)}function a(e){l(o,r,n,i,a,"throw",e)}i(void 0)})},function(e){return g.apply(this,arguments)})}],h&&f(d.prototype,h),y&&f(d,y),Object.defineProperty(d,"prototype",{writable:!1}),d)},920:(e,t,r)=>{"use strict";async function n(e,t){const r={config:e};return r.status=t.status,r.statusText=t.statusText,r.headers=t.headers,"stream"===e.responseType?(r.data=t.body,r):t[e.responseType||"text"]().then(n=>{e.transformResponse?(Array.isArray(e.transformResponse)?e.transformResponse.map(r=>n=r.call(e,n,t?.headers,t?.status)):n=e.transformResponse(n,t?.headers,t?.status),r.data=n):(r.data=n,r.data=JSON.parse(n))}).catch(Object).then(()=>r)}function o(e){let t=e.url||"";return e.baseURL&&e.url&&(t=e.url.replace(/^(?!.*\/\/)\/?/,`${e.baseURL}/`)),e.params&&Object.keys(e.params).length>0&&e.url&&(t+=(~e.url.indexOf("?")?"&":"?")+(e.paramsSerializer?e.paramsSerializer(e.params):new URLSearchParams(e.params))),t}function i(e,t){const r={...t,...e};if(t?.params&&e?.params&&(r.params={...t?.params,...e?.params}),t?.headers&&e?.headers){r.headers=new Headers(t.headers||{});new Headers(e.headers||{}).forEach((e,t)=>{r.headers.set(t,e)})}return r}function a(e,t){const r=t.get("content-type");return r?"application/x-www-form-urlencoded"!==r||e instanceof URLSearchParams?"application/json"===r&&"object"==typeof e&&(e=JSON.stringify(e)):e=new URLSearchParams(e):"string"==typeof e?t.set("content-type","text/plain"):e instanceof URLSearchParams?t.set("content-type","application/x-www-form-urlencoded"):e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t.set("content-type","application/octet-stream"):"object"==typeof e&&"function"!=typeof e.append&&"function"!=typeof e.text&&(e=JSON.stringify(e),t.set("content-type","application/json")),e}async function s(e,t,r,u,c,p){"string"==typeof e?(t=t||{}).url=e:t=e||{};const d=i(t,r||{});if(d.fetchOptions=d.fetchOptions||{},d.timeout=d.timeout||0,d.headers=new Headers(d.headers||{}),d.transformRequest=d.transformRequest??a,p=p||d.data,d.transformRequest&&p&&(Array.isArray(d.transformRequest)?d.transformRequest.map(e=>p=e.call(d,p,d.headers)):p=d.transformRequest(p,d.headers)),d.url=o(d),d.method=u||d.method||"get",c&&c.request.handlers.length>0){const e=c.request.handlers.filter(e=>!e?.runWhen||"function"==typeof e.runWhen&&e.runWhen(d)).flatMap(e=>[e.fulfilled,e.rejected]);let t=d;for(let r=0,n=e.length;r<n;r+=2){const n=e[r],o=e[r+1];try{n&&(t=n(t))}catch(e){o&&o?.(e);break}}}const h=function(e,t){const r={...t,...e};t?.headers&&e?.headers&&(r.headers=new Headers(t.headers||{}),new Headers(e.headers||{}).forEach((e,t)=>{r.headers.set(t,e)}));return r}({method:d.method?.toUpperCase(),body:p,headers:d.headers,credentials:d.withCredentials?"include":void 0,signal:d.signal},d.fetchOptions);let y=async function(e,t){let r=null;if("any"in AbortSignal){const r=[];e.timeout&&r.push(AbortSignal.timeout(e.timeout)),e.signal&&r.push(e.signal),r.length>0&&(t.signal=AbortSignal.any(r))}else e.timeout&&(t.signal=AbortSignal.timeout(e.timeout));try{return r=await fetch(e.url,t),(e.validateStatus?e.validateStatus(r.status):r.ok)?await n(e,r):Promise.reject(new l(`Request failed with status code ${r?.status}`,[l.ERR_BAD_REQUEST,l.ERR_BAD_RESPONSE][Math.floor(r?.status/100)-4],e,new Request(e.url,t),await n(e,r)))}catch(t){if("AbortError"===t.name||"TimeoutError"===t.name){const r="TimeoutError"===t.name;return Promise.reject(r?new l(e.timeoutErrorMessage||`timeout of ${e.timeout} ms exceeded`,l.ECONNABORTED,e,s):new f(null,e))}return Promise.reject(new l(t.message,void 0,e,s,void 0))}}(d,h);if(c&&c.response.handlers.length>0){const e=c.response.handlers.flatMap(e=>[e.fulfilled,e.rejected]);for(let t=0,r=e.length;t<r;t+=2)y=y.then(e[t],e[t+1])}return y}r.r(t),r.d(t,{create:()=>A,fetchClient:()=>_});var u=class{handlers=[];constructor(){this.handlers=[]}use=(e,t,r)=>(this.handlers.push({fulfilled:e,rejected:t,runWhen:r?.runWhen}),this.handlers.length-1);eject=e=>{this.handlers[e]&&(this.handlers[e]=null)};clear=()=>{this.handlers=[]}};function c(e){e=e||{};const t={request:new u,response:new u},r=(r,n)=>s(r,n,e,void 0,t);return r.defaults=e,r.interceptors=t,r.getUri=t=>o(i(t||{},e)),r.request=r=>s(r,void 0,e,void 0,t),["get","delete","head","options"].forEach(n=>{r[n]=(r,o)=>s(r,o,e,n,t)}),["post","put","patch"].forEach(n=>{r[n]=(r,o,i)=>s(r,i,e,n,t,o)}),["postForm","putForm","patchForm"].forEach(n=>{r[n]=(r,o,i)=>((i=i||{}).headers=new Headers(i.headers||{}),i.headers.set("content-type","application/x-www-form-urlencoded"),s(r,i,e,n.replace("Form",""),t,o))}),r}var l=class extends Error{config;code;request;response;status;isAxiosError;constructor(e,t,r,n,o){super(e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="AxiosError",this.code=t,this.config=r,this.request=n,this.response=o,this.isAxiosError=!0}static ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";static ERR_BAD_OPTION="ERR_BAD_OPTION";static ERR_NETWORK="ERR_NETWORK";static ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";static ERR_BAD_REQUEST="ERR_BAD_REQUEST";static ERR_INVALID_URL="ERR_INVALID_URL";static ERR_CANCELED="ERR_CANCELED";static ECONNABORTED="ECONNABORTED";static ETIMEDOUT="ETIMEDOUT"},f=class extends l{constructor(e,t,r){super(e||"canceled",l.ERR_CANCELED,t,r),this.name="CanceledError"}};var p=c();p.create=e=>c(e);var d=p,h=r(798);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach(function(t){b(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,w(n.key),n)}}function b(e,t,r){return(t=w(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e){var t=function(e,t){if("object"!=y(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==y(t)?t:t+""}var S,E,T,k=(S=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),b(this,"handlers",[])},(E=[{key:"use",value:function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"forEach",value:function(e){this.handlers.forEach(function(t){null!==t&&e(t)})}}])&&v(S.prototype,E),T&&v(S,T),Object.defineProperty(S,"prototype",{writable:!1}),S);function O(e){var t=e||{};return t.headers=new Headers(t.headers||{}),t.headers.set("Content-Type","application/x-www-form-urlencoded"),t}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=g(g({},e),{},{headers:e.headers||{}}),r=d.create(t),n=new k,o=new k;return{interceptors:{request:n,response:o},defaults:g(g({},t),{},{adapter:function(e){return r.request(e)}}),create:function(e){return A(g(g({},this.defaults),e))},makeRequest:function(e){var t=this;return new Promise(function(r,i){var a=new AbortController;e.signal=a.signal,e.cancelToken&&e.cancelToken.promise.then(function(){a.abort(),i(new Error("Request canceled"))});var s=e;if(n.handlers.length>0)for(var u=n.handlers.filter(function(e){return null!==e}).flatMap(function(e){return[e.fulfilled,e.rejected]}),c=0,l=u.length;c<l;c+=2){var f=u[c],p=u[c+1];try{f&&(s=f(s))}catch(e){return p&&(null==p||p(e)),void i(e)}}var d=s.adapter||t.defaults.adapter;if(!d)throw new Error("No adapter available");var h=d(s).then(function(e){return{data:e.data,headers:e.headers,config:e.config,status:e.status,statusText:e.statusText}});if(o.handlers.length>0)for(var y=o.handlers.filter(function(e){return null!==e}).flatMap(function(e){return[e.fulfilled,e.rejected]}),m=function(e){h=h.then(function(t){var r=y[e];return"function"==typeof r?r(t):t},function(t){var r=y[e+1];if("function"==typeof r)return r(t);throw t}).then(function(e){return e})},g=0,v=y.length;g<v;g+=2)m(g);h.then(r).catch(i)})},get:function(e,t){return this.makeRequest(g(g(g({},this.defaults),t),{},{url:e,method:"get"}))},delete:function(e,t){return this.makeRequest(g(g(g({},this.defaults),t),{},{url:e,method:"delete"}))},head:function(e,t){return this.makeRequest(g(g(g({},this.defaults),t),{},{url:e,method:"head"}))},options:function(e,t){return this.makeRequest(g(g(g({},this.defaults),t),{},{url:e,method:"options"}))},post:function(e,t,r){return this.makeRequest(g(g(g({},this.defaults),r),{},{url:e,method:"post",data:t}))},put:function(e,t,r){return this.makeRequest(g(g(g({},this.defaults),r),{},{url:e,method:"put",data:t}))},patch:function(e,t,r){return this.makeRequest(g(g(g({},this.defaults),r),{},{url:e,method:"patch",data:t}))},postForm:function(e,t,r){var n=O(r);return this.makeRequest(g(g(g({},this.defaults),n),{},{url:e,method:"post",data:t}))},putForm:function(e,t,r){var n=O(r);return this.makeRequest(g(g(g({},this.defaults),n),{},{url:e,method:"put",data:t}))},patchForm:function(e,t,r){var n=O(r);return this.makeRequest(g(g(g({},this.defaults),n),{},{url:e,method:"patch",data:t}))},CancelToken:h.q,isCancel:function(e){return e instanceof Error&&"Request canceled"===e.message}}}var _=A()},924:(e,t,r)=>{"use strict";r.r(t),r.d(t,{StellarBase:()=>a,default:()=>s,httpClient:()=>n.ok});var n=r(371),o=r(356),i={};for(const e in o)["default","StellarBase","httpClient"].indexOf(e)<0&&(i[e]=()=>o[e]);r.d(t,i);var a=r(950);const s=(e=r.hmd(e)).exports},950:e=>{var t;self,t=()=>(()=>{var e={41:(e,t,r)=>{"use strict";var n=r(655),o=r(8068),i=r(9675),a=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!a&&a(e,t);if(n)n(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===u&&f?f.writable:!u});else{if(!l&&(s||u||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},76:e=>{"use strict";e.exports=Function.prototype.call},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*y}},392:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=r(5377);function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){e=o(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,a=this._len,s=0;s<i;){for(var u=a%n,c=Math.min(i-s,n-u),l=0;l<c;l++)r[u+l]=e[s+l];s+=c,(a+=c)%n===0&&this._update(r)}return this._len+=i,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,o=(r-n)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},414:e=>{"use strict";e.exports=Math.round},448:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Account:()=>Wn,Address:()=>sn,Asset:()=>Zt,AuthClawbackEnabledFlag:()=>gn,AuthImmutableFlag:()=>mn,AuthRequiredFlag:()=>hn,AuthRevocableFlag:()=>yn,BASE_FEE:()=>go,Claimant:()=>Mr,Contract:()=>Io,FeeBumpTransaction:()=>Kn,Hyper:()=>n.Hyper,Int128:()=>Zo,Int256:()=>oi,Keypair:()=>Xt,LiquidityPoolAsset:()=>Nr,LiquidityPoolFeeV18:()=>er,LiquidityPoolId:()=>zr,Memo:()=>Pn,MemoHash:()=>_n,MemoID:()=>On,MemoNone:()=>kn,MemoReturn:()=>xn,MemoText:()=>An,MuxedAccount:()=>Jn,Networks:()=>So,Operation:()=>vn,ScInt:()=>hi,SignerKey:()=>so,Soroban:()=>Ao,SorobanDataBuilder:()=>no,StrKey:()=>Lt,TimeoutInfinite:()=>vo,Transaction:()=>Ln,TransactionBase:()=>ar,TransactionBuilder:()=>bo,Uint128:()=>Lo,Uint256:()=>zo,UnsignedHyper:()=>n.UnsignedHyper,XdrLargeInt:()=>ci,authorizeEntry:()=>ji,authorizeInvocation:()=>Ni,buildInvocationTree:()=>Mi,cereal:()=>a,decodeAddressToMuxedAccount:()=>Xr,default:()=>Hi,encodeMuxedAccount:()=>Gr,encodeMuxedAccountToAddress:()=>$r,extractBaseAddress:()=>Wr,getLiquidityPoolId:()=>tr,hash:()=>u,humanizeEvents:()=>xi,nativeToScVal:()=>Ei,scValToBigInt:()=>yi,scValToNative:()=>Ti,sign:()=>kt,verify:()=>Ot,walkInvocationTree:()=>Vi,xdr:()=>i});var n=r(3740),o=n.config(function(e){var t=1024;e.typedef("Value",e.varOpaque()),e.struct("ScpBallot",[["counter",e.lookup("Uint32")],["value",e.lookup("Value")]]),e.enum("ScpStatementType",{scpStPrepare:0,scpStConfirm:1,scpStExternalize:2,scpStNominate:3}),e.struct("ScpNomination",[["quorumSetHash",e.lookup("Hash")],["votes",e.varArray(e.lookup("Value"),2147483647)],["accepted",e.varArray(e.lookup("Value"),2147483647)]]),e.struct("ScpStatementPrepare",[["quorumSetHash",e.lookup("Hash")],["ballot",e.lookup("ScpBallot")],["prepared",e.option(e.lookup("ScpBallot"))],["preparedPrime",e.option(e.lookup("ScpBallot"))],["nC",e.lookup("Uint32")],["nH",e.lookup("Uint32")]]),e.struct("ScpStatementConfirm",[["ballot",e.lookup("ScpBallot")],["nPrepared",e.lookup("Uint32")],["nCommit",e.lookup("Uint32")],["nH",e.lookup("Uint32")],["quorumSetHash",e.lookup("Hash")]]),e.struct("ScpStatementExternalize",[["commit",e.lookup("ScpBallot")],["nH",e.lookup("Uint32")],["commitQuorumSetHash",e.lookup("Hash")]]),e.union("ScpStatementPledges",{switchOn:e.lookup("ScpStatementType"),switchName:"type",switches:[["scpStPrepare","prepare"],["scpStConfirm","confirm"],["scpStExternalize","externalize"],["scpStNominate","nominate"]],arms:{prepare:e.lookup("ScpStatementPrepare"),confirm:e.lookup("ScpStatementConfirm"),externalize:e.lookup("ScpStatementExternalize"),nominate:e.lookup("ScpNomination")}}),e.struct("ScpStatement",[["nodeId",e.lookup("NodeId")],["slotIndex",e.lookup("Uint64")],["pledges",e.lookup("ScpStatementPledges")]]),e.struct("ScpEnvelope",[["statement",e.lookup("ScpStatement")],["signature",e.lookup("Signature")]]),e.struct("ScpQuorumSet",[["threshold",e.lookup("Uint32")],["validators",e.varArray(e.lookup("NodeId"),2147483647)],["innerSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)]]),e.typedef("Thresholds",e.opaque(4)),e.typedef("String32",e.string(32)),e.typedef("String64",e.string(64)),e.typedef("SequenceNumber",e.lookup("Int64")),e.typedef("DataValue",e.varOpaque(64)),e.typedef("AssetCode4",e.opaque(4)),e.typedef("AssetCode12",e.opaque(12)),e.enum("AssetType",{assetTypeNative:0,assetTypeCreditAlphanum4:1,assetTypeCreditAlphanum12:2,assetTypePoolShare:3}),e.union("AssetCode",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeCreditAlphanum4","assetCode4"],["assetTypeCreditAlphanum12","assetCode12"]],arms:{assetCode4:e.lookup("AssetCode4"),assetCode12:e.lookup("AssetCode12")}}),e.struct("AlphaNum4",[["assetCode",e.lookup("AssetCode4")],["issuer",e.lookup("AccountId")]]),e.struct("AlphaNum12",[["assetCode",e.lookup("AssetCode12")],["issuer",e.lookup("AccountId")]]),e.union("Asset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12")}}),e.struct("Price",[["n",e.lookup("Int32")],["d",e.lookup("Int32")]]),e.struct("Liabilities",[["buying",e.lookup("Int64")],["selling",e.lookup("Int64")]]),e.enum("ThresholdIndices",{thresholdMasterWeight:0,thresholdLow:1,thresholdMed:2,thresholdHigh:3}),e.enum("LedgerEntryType",{account:0,trustline:1,offer:2,data:3,claimableBalance:4,liquidityPool:5,contractData:6,contractCode:7,configSetting:8,ttl:9}),e.struct("Signer",[["key",e.lookup("SignerKey")],["weight",e.lookup("Uint32")]]),e.enum("AccountFlags",{authRequiredFlag:1,authRevocableFlag:2,authImmutableFlag:4,authClawbackEnabledFlag:8}),e.const("MASK_ACCOUNT_FLAGS",7),e.const("MASK_ACCOUNT_FLAGS_V17",15),e.const("MAX_SIGNERS",20),e.typedef("SponsorshipDescriptor",e.option(e.lookup("AccountId"))),e.struct("AccountEntryExtensionV3",[["ext",e.lookup("ExtensionPoint")],["seqLedger",e.lookup("Uint32")],["seqTime",e.lookup("TimePoint")]]),e.union("AccountEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[3,"v3"]],arms:{v3:e.lookup("AccountEntryExtensionV3")}}),e.struct("AccountEntryExtensionV2",[["numSponsored",e.lookup("Uint32")],["numSponsoring",e.lookup("Uint32")],["signerSponsoringIDs",e.varArray(e.lookup("SponsorshipDescriptor"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExtensionV2Ext")]]),e.union("AccountEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("AccountEntryExtensionV2")}}),e.struct("AccountEntryExtensionV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("AccountEntryExtensionV1Ext")]]),e.union("AccountEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("AccountEntryExtensionV1")}}),e.struct("AccountEntry",[["accountId",e.lookup("AccountId")],["balance",e.lookup("Int64")],["seqNum",e.lookup("SequenceNumber")],["numSubEntries",e.lookup("Uint32")],["inflationDest",e.option(e.lookup("AccountId"))],["flags",e.lookup("Uint32")],["homeDomain",e.lookup("String32")],["thresholds",e.lookup("Thresholds")],["signers",e.varArray(e.lookup("Signer"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExt")]]),e.enum("TrustLineFlags",{authorizedFlag:1,authorizedToMaintainLiabilitiesFlag:2,trustlineClawbackEnabledFlag:4}),e.const("MASK_TRUSTLINE_FLAGS",1),e.const("MASK_TRUSTLINE_FLAGS_V13",3),e.const("MASK_TRUSTLINE_FLAGS_V17",7),e.enum("LiquidityPoolType",{liquidityPoolConstantProduct:0}),e.union("TrustLineAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPoolId"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPoolId:e.lookup("PoolId")}}),e.union("TrustLineEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TrustLineEntryExtensionV2",[["liquidityPoolUseCount",e.lookup("Int32")],["ext",e.lookup("TrustLineEntryExtensionV2Ext")]]),e.union("TrustLineEntryV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("TrustLineEntryExtensionV2")}}),e.struct("TrustLineEntryV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("TrustLineEntryV1Ext")]]),e.union("TrustLineEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("TrustLineEntryV1")}}),e.struct("TrustLineEntry",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")],["balance",e.lookup("Int64")],["limit",e.lookup("Int64")],["flags",e.lookup("Uint32")],["ext",e.lookup("TrustLineEntryExt")]]),e.enum("OfferEntryFlags",{passiveFlag:1}),e.const("MASK_OFFERENTRY_FLAGS",1),e.union("OfferEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("OfferEntry",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["flags",e.lookup("Uint32")],["ext",e.lookup("OfferEntryExt")]]),e.union("DataEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("DataEntry",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")],["dataValue",e.lookup("DataValue")],["ext",e.lookup("DataEntryExt")]]),e.enum("ClaimPredicateType",{claimPredicateUnconditional:0,claimPredicateAnd:1,claimPredicateOr:2,claimPredicateNot:3,claimPredicateBeforeAbsoluteTime:4,claimPredicateBeforeRelativeTime:5}),e.union("ClaimPredicate",{switchOn:e.lookup("ClaimPredicateType"),switchName:"type",switches:[["claimPredicateUnconditional",e.void()],["claimPredicateAnd","andPredicates"],["claimPredicateOr","orPredicates"],["claimPredicateNot","notPredicate"],["claimPredicateBeforeAbsoluteTime","absBefore"],["claimPredicateBeforeRelativeTime","relBefore"]],arms:{andPredicates:e.varArray(e.lookup("ClaimPredicate"),2),orPredicates:e.varArray(e.lookup("ClaimPredicate"),2),notPredicate:e.option(e.lookup("ClaimPredicate")),absBefore:e.lookup("Int64"),relBefore:e.lookup("Int64")}}),e.enum("ClaimantType",{claimantTypeV0:0}),e.struct("ClaimantV0",[["destination",e.lookup("AccountId")],["predicate",e.lookup("ClaimPredicate")]]),e.union("Claimant",{switchOn:e.lookup("ClaimantType"),switchName:"type",switches:[["claimantTypeV0","v0"]],arms:{v0:e.lookup("ClaimantV0")}}),e.enum("ClaimableBalanceFlags",{claimableBalanceClawbackEnabledFlag:1}),e.const("MASK_CLAIMABLE_BALANCE_FLAGS",1),e.union("ClaimableBalanceEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("ClaimableBalanceEntryExtensionV1",[["ext",e.lookup("ClaimableBalanceEntryExtensionV1Ext")],["flags",e.lookup("Uint32")]]),e.union("ClaimableBalanceEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("ClaimableBalanceEntryExtensionV1")}}),e.struct("ClaimableBalanceEntry",[["balanceId",e.lookup("ClaimableBalanceId")],["claimants",e.varArray(e.lookup("Claimant"),10)],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["ext",e.lookup("ClaimableBalanceEntryExt")]]),e.struct("LiquidityPoolConstantProductParameters",[["assetA",e.lookup("Asset")],["assetB",e.lookup("Asset")],["fee",e.lookup("Int32")]]),e.struct("LiquidityPoolEntryConstantProduct",[["params",e.lookup("LiquidityPoolConstantProductParameters")],["reserveA",e.lookup("Int64")],["reserveB",e.lookup("Int64")],["totalPoolShares",e.lookup("Int64")],["poolSharesTrustLineCount",e.lookup("Int64")]]),e.union("LiquidityPoolEntryBody",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolEntryConstantProduct")}}),e.struct("LiquidityPoolEntry",[["liquidityPoolId",e.lookup("PoolId")],["body",e.lookup("LiquidityPoolEntryBody")]]),e.enum("ContractDataDurability",{temporary:0,persistent:1}),e.struct("ContractDataEntry",[["ext",e.lookup("ExtensionPoint")],["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")],["val",e.lookup("ScVal")]]),e.struct("ContractCodeCostInputs",[["ext",e.lookup("ExtensionPoint")],["nInstructions",e.lookup("Uint32")],["nFunctions",e.lookup("Uint32")],["nGlobals",e.lookup("Uint32")],["nTableEntries",e.lookup("Uint32")],["nTypes",e.lookup("Uint32")],["nDataSegments",e.lookup("Uint32")],["nElemSegments",e.lookup("Uint32")],["nImports",e.lookup("Uint32")],["nExports",e.lookup("Uint32")],["nDataSegmentBytes",e.lookup("Uint32")]]),e.struct("ContractCodeEntryV1",[["ext",e.lookup("ExtensionPoint")],["costInputs",e.lookup("ContractCodeCostInputs")]]),e.union("ContractCodeEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("ContractCodeEntryV1")}}),e.struct("ContractCodeEntry",[["ext",e.lookup("ContractCodeEntryExt")],["hash",e.lookup("Hash")],["code",e.varOpaque()]]),e.struct("TtlEntry",[["keyHash",e.lookup("Hash")],["liveUntilLedgerSeq",e.lookup("Uint32")]]),e.union("LedgerEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerEntryExtensionV1",[["sponsoringId",e.lookup("SponsorshipDescriptor")],["ext",e.lookup("LedgerEntryExtensionV1Ext")]]),e.union("LedgerEntryData",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("AccountEntry"),trustLine:e.lookup("TrustLineEntry"),offer:e.lookup("OfferEntry"),data:e.lookup("DataEntry"),claimableBalance:e.lookup("ClaimableBalanceEntry"),liquidityPool:e.lookup("LiquidityPoolEntry"),contractData:e.lookup("ContractDataEntry"),contractCode:e.lookup("ContractCodeEntry"),configSetting:e.lookup("ConfigSettingEntry"),ttl:e.lookup("TtlEntry")}}),e.union("LedgerEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerEntryExtensionV1")}}),e.struct("LedgerEntry",[["lastModifiedLedgerSeq",e.lookup("Uint32")],["data",e.lookup("LedgerEntryData")],["ext",e.lookup("LedgerEntryExt")]]),e.struct("LedgerKeyAccount",[["accountId",e.lookup("AccountId")]]),e.struct("LedgerKeyTrustLine",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")]]),e.struct("LedgerKeyOffer",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")]]),e.struct("LedgerKeyData",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")]]),e.struct("LedgerKeyClaimableBalance",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("LedgerKeyLiquidityPool",[["liquidityPoolId",e.lookup("PoolId")]]),e.struct("LedgerKeyContractData",[["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")]]),e.struct("LedgerKeyContractCode",[["hash",e.lookup("Hash")]]),e.struct("LedgerKeyConfigSetting",[["configSettingId",e.lookup("ConfigSettingId")]]),e.struct("LedgerKeyTtl",[["keyHash",e.lookup("Hash")]]),e.union("LedgerKey",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("LedgerKeyAccount"),trustLine:e.lookup("LedgerKeyTrustLine"),offer:e.lookup("LedgerKeyOffer"),data:e.lookup("LedgerKeyData"),claimableBalance:e.lookup("LedgerKeyClaimableBalance"),liquidityPool:e.lookup("LedgerKeyLiquidityPool"),contractData:e.lookup("LedgerKeyContractData"),contractCode:e.lookup("LedgerKeyContractCode"),configSetting:e.lookup("LedgerKeyConfigSetting"),ttl:e.lookup("LedgerKeyTtl")}}),e.enum("EnvelopeType",{envelopeTypeTxV0:0,envelopeTypeScp:1,envelopeTypeTx:2,envelopeTypeAuth:3,envelopeTypeScpvalue:4,envelopeTypeTxFeeBump:5,envelopeTypeOpId:6,envelopeTypePoolRevokeOpId:7,envelopeTypeContractId:8,envelopeTypeSorobanAuthorization:9}),e.enum("BucketListType",{live:0,hotArchive:1}),e.enum("BucketEntryType",{metaentry:-1,liveentry:0,deadentry:1,initentry:2}),e.enum("HotArchiveBucketEntryType",{hotArchiveMetaentry:-1,hotArchiveArchived:0,hotArchiveLive:1}),e.union("BucketMetadataExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"bucketListType"]],arms:{bucketListType:e.lookup("BucketListType")}}),e.struct("BucketMetadata",[["ledgerVersion",e.lookup("Uint32")],["ext",e.lookup("BucketMetadataExt")]]),e.union("BucketEntry",{switchOn:e.lookup("BucketEntryType"),switchName:"type",switches:[["liveentry","liveEntry"],["initentry","liveEntry"],["deadentry","deadEntry"],["metaentry","metaEntry"]],arms:{liveEntry:e.lookup("LedgerEntry"),deadEntry:e.lookup("LedgerKey"),metaEntry:e.lookup("BucketMetadata")}}),e.union("HotArchiveBucketEntry",{switchOn:e.lookup("HotArchiveBucketEntryType"),switchName:"type",switches:[["hotArchiveArchived","archivedEntry"],["hotArchiveLive","key"],["hotArchiveMetaentry","metaEntry"]],arms:{archivedEntry:e.lookup("LedgerEntry"),key:e.lookup("LedgerKey"),metaEntry:e.lookup("BucketMetadata")}}),e.typedef("UpgradeType",e.varOpaque(128)),e.enum("StellarValueType",{stellarValueBasic:0,stellarValueSigned:1}),e.struct("LedgerCloseValueSignature",[["nodeId",e.lookup("NodeId")],["signature",e.lookup("Signature")]]),e.union("StellarValueExt",{switchOn:e.lookup("StellarValueType"),switchName:"v",switches:[["stellarValueBasic",e.void()],["stellarValueSigned","lcValueSignature"]],arms:{lcValueSignature:e.lookup("LedgerCloseValueSignature")}}),e.struct("StellarValue",[["txSetHash",e.lookup("Hash")],["closeTime",e.lookup("TimePoint")],["upgrades",e.varArray(e.lookup("UpgradeType"),6)],["ext",e.lookup("StellarValueExt")]]),e.const("MASK_LEDGER_HEADER_FLAGS",7),e.enum("LedgerHeaderFlags",{disableLiquidityPoolTradingFlag:1,disableLiquidityPoolDepositFlag:2,disableLiquidityPoolWithdrawalFlag:4}),e.union("LedgerHeaderExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderExtensionV1",[["flags",e.lookup("Uint32")],["ext",e.lookup("LedgerHeaderExtensionV1Ext")]]),e.union("LedgerHeaderExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerHeaderExtensionV1")}}),e.struct("LedgerHeader",[["ledgerVersion",e.lookup("Uint32")],["previousLedgerHash",e.lookup("Hash")],["scpValue",e.lookup("StellarValue")],["txSetResultHash",e.lookup("Hash")],["bucketListHash",e.lookup("Hash")],["ledgerSeq",e.lookup("Uint32")],["totalCoins",e.lookup("Int64")],["feePool",e.lookup("Int64")],["inflationSeq",e.lookup("Uint32")],["idPool",e.lookup("Uint64")],["baseFee",e.lookup("Uint32")],["baseReserve",e.lookup("Uint32")],["maxTxSetSize",e.lookup("Uint32")],["skipList",e.array(e.lookup("Hash"),4)],["ext",e.lookup("LedgerHeaderExt")]]),e.enum("LedgerUpgradeType",{ledgerUpgradeVersion:1,ledgerUpgradeBaseFee:2,ledgerUpgradeMaxTxSetSize:3,ledgerUpgradeBaseReserve:4,ledgerUpgradeFlags:5,ledgerUpgradeConfig:6,ledgerUpgradeMaxSorobanTxSetSize:7}),e.struct("ConfigUpgradeSetKey",[["contractId",e.lookup("ContractId")],["contentHash",e.lookup("Hash")]]),e.union("LedgerUpgrade",{switchOn:e.lookup("LedgerUpgradeType"),switchName:"type",switches:[["ledgerUpgradeVersion","newLedgerVersion"],["ledgerUpgradeBaseFee","newBaseFee"],["ledgerUpgradeMaxTxSetSize","newMaxTxSetSize"],["ledgerUpgradeBaseReserve","newBaseReserve"],["ledgerUpgradeFlags","newFlags"],["ledgerUpgradeConfig","newConfig"],["ledgerUpgradeMaxSorobanTxSetSize","newMaxSorobanTxSetSize"]],arms:{newLedgerVersion:e.lookup("Uint32"),newBaseFee:e.lookup("Uint32"),newMaxTxSetSize:e.lookup("Uint32"),newBaseReserve:e.lookup("Uint32"),newFlags:e.lookup("Uint32"),newConfig:e.lookup("ConfigUpgradeSetKey"),newMaxSorobanTxSetSize:e.lookup("Uint32")}}),e.struct("ConfigUpgradeSet",[["updatedEntry",e.varArray(e.lookup("ConfigSettingEntry"),2147483647)]]),e.enum("TxSetComponentType",{txsetCompTxsMaybeDiscountedFee:0}),e.typedef("DependentTxCluster",e.varArray(e.lookup("TransactionEnvelope"),2147483647)),e.typedef("ParallelTxExecutionStage",e.varArray(e.lookup("DependentTxCluster"),2147483647)),e.struct("ParallelTxsComponent",[["baseFee",e.option(e.lookup("Int64"))],["executionStages",e.varArray(e.lookup("ParallelTxExecutionStage"),2147483647)]]),e.struct("TxSetComponentTxsMaybeDiscountedFee",[["baseFee",e.option(e.lookup("Int64"))],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.union("TxSetComponent",{switchOn:e.lookup("TxSetComponentType"),switchName:"type",switches:[["txsetCompTxsMaybeDiscountedFee","txsMaybeDiscountedFee"]],arms:{txsMaybeDiscountedFee:e.lookup("TxSetComponentTxsMaybeDiscountedFee")}}),e.union("TransactionPhase",{switchOn:e.int(),switchName:"v",switches:[[0,"v0Components"],[1,"parallelTxsComponent"]],arms:{v0Components:e.varArray(e.lookup("TxSetComponent"),2147483647),parallelTxsComponent:e.lookup("ParallelTxsComponent")}}),e.struct("TransactionSet",[["previousLedgerHash",e.lookup("Hash")],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.struct("TransactionSetV1",[["previousLedgerHash",e.lookup("Hash")],["phases",e.varArray(e.lookup("TransactionPhase"),2147483647)]]),e.union("GeneralizedTransactionSet",{switchOn:e.int(),switchName:"v",switches:[[1,"v1TxSet"]],arms:{v1TxSet:e.lookup("TransactionSetV1")}}),e.struct("TransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("TransactionResult")]]),e.struct("TransactionResultSet",[["results",e.varArray(e.lookup("TransactionResultPair"),2147483647)]]),e.union("TransactionHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"generalizedTxSet"]],arms:{generalizedTxSet:e.lookup("GeneralizedTransactionSet")}}),e.struct("TransactionHistoryEntry",[["ledgerSeq",e.lookup("Uint32")],["txSet",e.lookup("TransactionSet")],["ext",e.lookup("TransactionHistoryEntryExt")]]),e.union("TransactionHistoryResultEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionHistoryResultEntry",[["ledgerSeq",e.lookup("Uint32")],["txResultSet",e.lookup("TransactionResultSet")],["ext",e.lookup("TransactionHistoryResultEntryExt")]]),e.union("LedgerHeaderHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderHistoryEntry",[["hash",e.lookup("Hash")],["header",e.lookup("LedgerHeader")],["ext",e.lookup("LedgerHeaderHistoryEntryExt")]]),e.struct("LedgerScpMessages",[["ledgerSeq",e.lookup("Uint32")],["messages",e.varArray(e.lookup("ScpEnvelope"),2147483647)]]),e.struct("ScpHistoryEntryV0",[["quorumSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)],["ledgerMessages",e.lookup("LedgerScpMessages")]]),e.union("ScpHistoryEntry",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ScpHistoryEntryV0")}}),e.enum("LedgerEntryChangeType",{ledgerEntryCreated:0,ledgerEntryUpdated:1,ledgerEntryRemoved:2,ledgerEntryState:3,ledgerEntryRestored:4}),e.union("LedgerEntryChange",{switchOn:e.lookup("LedgerEntryChangeType"),switchName:"type",switches:[["ledgerEntryCreated","created"],["ledgerEntryUpdated","updated"],["ledgerEntryRemoved","removed"],["ledgerEntryState","state"],["ledgerEntryRestored","restored"]],arms:{created:e.lookup("LedgerEntry"),updated:e.lookup("LedgerEntry"),removed:e.lookup("LedgerKey"),state:e.lookup("LedgerEntry"),restored:e.lookup("LedgerEntry")}}),e.typedef("LedgerEntryChanges",e.varArray(e.lookup("LedgerEntryChange"),2147483647)),e.struct("OperationMeta",[["changes",e.lookup("LedgerEntryChanges")]]),e.struct("TransactionMetaV1",[["txChanges",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)]]),e.struct("TransactionMetaV2",[["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")]]),e.enum("ContractEventType",{system:0,contract:1,diagnostic:2}),e.struct("ContractEventV0",[["topics",e.varArray(e.lookup("ScVal"),2147483647)],["data",e.lookup("ScVal")]]),e.union("ContractEventBody",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ContractEventV0")}}),e.struct("ContractEvent",[["ext",e.lookup("ExtensionPoint")],["contractId",e.option(e.lookup("ContractId"))],["type",e.lookup("ContractEventType")],["body",e.lookup("ContractEventBody")]]),e.struct("DiagnosticEvent",[["inSuccessfulContractCall",e.bool()],["event",e.lookup("ContractEvent")]]),e.struct("SorobanTransactionMetaExtV1",[["ext",e.lookup("ExtensionPoint")],["totalNonRefundableResourceFeeCharged",e.lookup("Int64")],["totalRefundableResourceFeeCharged",e.lookup("Int64")],["rentFeeCharged",e.lookup("Int64")]]),e.union("SorobanTransactionMetaExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("SorobanTransactionMetaExtV1")}}),e.struct("SorobanTransactionMeta",[["ext",e.lookup("SorobanTransactionMetaExt")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)],["returnValue",e.lookup("ScVal")],["diagnosticEvents",e.varArray(e.lookup("DiagnosticEvent"),2147483647)]]),e.struct("TransactionMetaV3",[["ext",e.lookup("ExtensionPoint")],["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")],["sorobanMeta",e.option(e.lookup("SorobanTransactionMeta"))]]),e.struct("OperationMetaV2",[["ext",e.lookup("ExtensionPoint")],["changes",e.lookup("LedgerEntryChanges")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)]]),e.struct("SorobanTransactionMetaV2",[["ext",e.lookup("SorobanTransactionMetaExt")],["returnValue",e.option(e.lookup("ScVal"))]]),e.enum("TransactionEventStage",{transactionEventStageBeforeAllTxes:0,transactionEventStageAfterTx:1,transactionEventStageAfterAllTxes:2}),e.struct("TransactionEvent",[["stage",e.lookup("TransactionEventStage")],["event",e.lookup("ContractEvent")]]),e.struct("TransactionMetaV4",[["ext",e.lookup("ExtensionPoint")],["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMetaV2"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")],["sorobanMeta",e.option(e.lookup("SorobanTransactionMetaV2"))],["events",e.varArray(e.lookup("TransactionEvent"),2147483647)],["diagnosticEvents",e.varArray(e.lookup("DiagnosticEvent"),2147483647)]]),e.struct("InvokeHostFunctionSuccessPreImage",[["returnValue",e.lookup("ScVal")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)]]),e.union("TransactionMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"operations"],[1,"v1"],[2,"v2"],[3,"v3"],[4,"v4"]],arms:{operations:e.varArray(e.lookup("OperationMeta"),2147483647),v1:e.lookup("TransactionMetaV1"),v2:e.lookup("TransactionMetaV2"),v3:e.lookup("TransactionMetaV3"),v4:e.lookup("TransactionMetaV4")}}),e.struct("TransactionResultMeta",[["result",e.lookup("TransactionResultPair")],["feeProcessing",e.lookup("LedgerEntryChanges")],["txApplyProcessing",e.lookup("TransactionMeta")]]),e.struct("TransactionResultMetaV1",[["ext",e.lookup("ExtensionPoint")],["result",e.lookup("TransactionResultPair")],["feeProcessing",e.lookup("LedgerEntryChanges")],["txApplyProcessing",e.lookup("TransactionMeta")],["postTxApplyFeeProcessing",e.lookup("LedgerEntryChanges")]]),e.struct("UpgradeEntryMeta",[["upgrade",e.lookup("LedgerUpgrade")],["changes",e.lookup("LedgerEntryChanges")]]),e.struct("LedgerCloseMetaV0",[["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("TransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)]]),e.struct("LedgerCloseMetaExtV1",[["ext",e.lookup("ExtensionPoint")],["sorobanFeeWrite1Kb",e.lookup("Int64")]]),e.union("LedgerCloseMetaExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerCloseMetaExtV1")}}),e.struct("LedgerCloseMetaV1",[["ext",e.lookup("LedgerCloseMetaExt")],["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("GeneralizedTransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)],["totalByteSizeOfLiveSorobanState",e.lookup("Uint64")],["evictedKeys",e.varArray(e.lookup("LedgerKey"),2147483647)],["unused",e.varArray(e.lookup("LedgerEntry"),2147483647)]]),e.struct("LedgerCloseMetaV2",[["ext",e.lookup("LedgerCloseMetaExt")],["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("GeneralizedTransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMetaV1"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)],["totalByteSizeOfLiveSorobanState",e.lookup("Uint64")],["evictedKeys",e.varArray(e.lookup("LedgerKey"),2147483647)]]),e.union("LedgerCloseMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"],[1,"v1"],[2,"v2"]],arms:{v0:e.lookup("LedgerCloseMetaV0"),v1:e.lookup("LedgerCloseMetaV1"),v2:e.lookup("LedgerCloseMetaV2")}}),e.enum("ErrorCode",{errMisc:0,errData:1,errConf:2,errAuth:3,errLoad:4}),e.struct("Error",[["code",e.lookup("ErrorCode")],["msg",e.string(100)]]),e.struct("SendMore",[["numMessages",e.lookup("Uint32")]]),e.struct("SendMoreExtended",[["numMessages",e.lookup("Uint32")],["numBytes",e.lookup("Uint32")]]),e.struct("AuthCert",[["pubkey",e.lookup("Curve25519Public")],["expiration",e.lookup("Uint64")],["sig",e.lookup("Signature")]]),e.struct("Hello",[["ledgerVersion",e.lookup("Uint32")],["overlayVersion",e.lookup("Uint32")],["overlayMinVersion",e.lookup("Uint32")],["networkId",e.lookup("Hash")],["versionStr",e.string(100)],["listeningPort",e.int()],["peerId",e.lookup("NodeId")],["cert",e.lookup("AuthCert")],["nonce",e.lookup("Uint256")]]),e.const("AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED",200),e.struct("Auth",[["flags",e.int()]]),e.enum("IpAddrType",{iPv4:0,iPv6:1}),e.union("PeerAddressIp",{switchOn:e.lookup("IpAddrType"),switchName:"type",switches:[["iPv4","ipv4"],["iPv6","ipv6"]],arms:{ipv4:e.opaque(4),ipv6:e.opaque(16)}}),e.struct("PeerAddress",[["ip",e.lookup("PeerAddressIp")],["port",e.lookup("Uint32")],["numFailures",e.lookup("Uint32")]]),e.enum("MessageType",{errorMsg:0,auth:2,dontHave:3,peers:5,getTxSet:6,txSet:7,generalizedTxSet:17,transaction:8,getScpQuorumset:9,scpQuorumset:10,scpMessage:11,getScpState:12,hello:13,sendMore:16,sendMoreExtended:20,floodAdvert:18,floodDemand:19,timeSlicedSurveyRequest:21,timeSlicedSurveyResponse:22,timeSlicedSurveyStartCollecting:23,timeSlicedSurveyStopCollecting:24}),e.struct("DontHave",[["type",e.lookup("MessageType")],["reqHash",e.lookup("Uint256")]]),e.enum("SurveyMessageCommandType",{timeSlicedSurveyTopology:1}),e.enum("SurveyMessageResponseType",{surveyTopologyResponseV2:2}),e.struct("TimeSlicedSurveyStartCollectingMessage",[["surveyorId",e.lookup("NodeId")],["nonce",e.lookup("Uint32")],["ledgerNum",e.lookup("Uint32")]]),e.struct("SignedTimeSlicedSurveyStartCollectingMessage",[["signature",e.lookup("Signature")],["startCollecting",e.lookup("TimeSlicedSurveyStartCollectingMessage")]]),e.struct("TimeSlicedSurveyStopCollectingMessage",[["surveyorId",e.lookup("NodeId")],["nonce",e.lookup("Uint32")],["ledgerNum",e.lookup("Uint32")]]),e.struct("SignedTimeSlicedSurveyStopCollectingMessage",[["signature",e.lookup("Signature")],["stopCollecting",e.lookup("TimeSlicedSurveyStopCollectingMessage")]]),e.struct("SurveyRequestMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["encryptionKey",e.lookup("Curve25519Public")],["commandType",e.lookup("SurveyMessageCommandType")]]),e.struct("TimeSlicedSurveyRequestMessage",[["request",e.lookup("SurveyRequestMessage")],["nonce",e.lookup("Uint32")],["inboundPeersIndex",e.lookup("Uint32")],["outboundPeersIndex",e.lookup("Uint32")]]),e.struct("SignedTimeSlicedSurveyRequestMessage",[["requestSignature",e.lookup("Signature")],["request",e.lookup("TimeSlicedSurveyRequestMessage")]]),e.typedef("EncryptedBody",e.varOpaque(64e3)),e.struct("SurveyResponseMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["commandType",e.lookup("SurveyMessageCommandType")],["encryptedBody",e.lookup("EncryptedBody")]]),e.struct("TimeSlicedSurveyResponseMessage",[["response",e.lookup("SurveyResponseMessage")],["nonce",e.lookup("Uint32")]]),e.struct("SignedTimeSlicedSurveyResponseMessage",[["responseSignature",e.lookup("Signature")],["response",e.lookup("TimeSlicedSurveyResponseMessage")]]),e.struct("PeerStats",[["id",e.lookup("NodeId")],["versionStr",e.string(100)],["messagesRead",e.lookup("Uint64")],["messagesWritten",e.lookup("Uint64")],["bytesRead",e.lookup("Uint64")],["bytesWritten",e.lookup("Uint64")],["secondsConnected",e.lookup("Uint64")],["uniqueFloodBytesRecv",e.lookup("Uint64")],["duplicateFloodBytesRecv",e.lookup("Uint64")],["uniqueFetchBytesRecv",e.lookup("Uint64")],["duplicateFetchBytesRecv",e.lookup("Uint64")],["uniqueFloodMessageRecv",e.lookup("Uint64")],["duplicateFloodMessageRecv",e.lookup("Uint64")],["uniqueFetchMessageRecv",e.lookup("Uint64")],["duplicateFetchMessageRecv",e.lookup("Uint64")]]),e.struct("TimeSlicedNodeData",[["addedAuthenticatedPeers",e.lookup("Uint32")],["droppedAuthenticatedPeers",e.lookup("Uint32")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")],["p75ScpFirstToSelfLatencyMs",e.lookup("Uint32")],["p75ScpSelfToOtherLatencyMs",e.lookup("Uint32")],["lostSyncCount",e.lookup("Uint32")],["isValidator",e.bool()],["maxInboundPeerCount",e.lookup("Uint32")],["maxOutboundPeerCount",e.lookup("Uint32")]]),e.struct("TimeSlicedPeerData",[["peerStats",e.lookup("PeerStats")],["averageLatencyMs",e.lookup("Uint32")]]),e.typedef("TimeSlicedPeerDataList",e.varArray(e.lookup("TimeSlicedPeerData"),25)),e.struct("TopologyResponseBodyV2",[["inboundPeers",e.lookup("TimeSlicedPeerDataList")],["outboundPeers",e.lookup("TimeSlicedPeerDataList")],["nodeData",e.lookup("TimeSlicedNodeData")]]),e.union("SurveyResponseBody",{switchOn:e.lookup("SurveyMessageResponseType"),switchName:"type",switches:[["surveyTopologyResponseV2","topologyResponseBodyV2"]],arms:{topologyResponseBodyV2:e.lookup("TopologyResponseBodyV2")}}),e.const("TX_ADVERT_VECTOR_MAX_SIZE",1e3),e.typedef("TxAdvertVector",e.varArray(e.lookup("Hash"),e.lookup("TX_ADVERT_VECTOR_MAX_SIZE"))),e.struct("FloodAdvert",[["txHashes",e.lookup("TxAdvertVector")]]),e.const("TX_DEMAND_VECTOR_MAX_SIZE",1e3),e.typedef("TxDemandVector",e.varArray(e.lookup("Hash"),e.lookup("TX_DEMAND_VECTOR_MAX_SIZE"))),e.struct("FloodDemand",[["txHashes",e.lookup("TxDemandVector")]]),e.union("StellarMessage",{switchOn:e.lookup("MessageType"),switchName:"type",switches:[["errorMsg","error"],["hello","hello"],["auth","auth"],["dontHave","dontHave"],["peers","peers"],["getTxSet","txSetHash"],["txSet","txSet"],["generalizedTxSet","generalizedTxSet"],["transaction","transaction"],["timeSlicedSurveyRequest","signedTimeSlicedSurveyRequestMessage"],["timeSlicedSurveyResponse","signedTimeSlicedSurveyResponseMessage"],["timeSlicedSurveyStartCollecting","signedTimeSlicedSurveyStartCollectingMessage"],["timeSlicedSurveyStopCollecting","signedTimeSlicedSurveyStopCollectingMessage"],["getScpQuorumset","qSetHash"],["scpQuorumset","qSet"],["scpMessage","envelope"],["getScpState","getScpLedgerSeq"],["sendMore","sendMoreMessage"],["sendMoreExtended","sendMoreExtendedMessage"],["floodAdvert","floodAdvert"],["floodDemand","floodDemand"]],arms:{error:e.lookup("Error"),hello:e.lookup("Hello"),auth:e.lookup("Auth"),dontHave:e.lookup("DontHave"),peers:e.varArray(e.lookup("PeerAddress"),100),txSetHash:e.lookup("Uint256"),txSet:e.lookup("TransactionSet"),generalizedTxSet:e.lookup("GeneralizedTransactionSet"),transaction:e.lookup("TransactionEnvelope"),signedTimeSlicedSurveyRequestMessage:e.lookup("SignedTimeSlicedSurveyRequestMessage"),signedTimeSlicedSurveyResponseMessage:e.lookup("SignedTimeSlicedSurveyResponseMessage"),signedTimeSlicedSurveyStartCollectingMessage:e.lookup("SignedTimeSlicedSurveyStartCollectingMessage"),signedTimeSlicedSurveyStopCollectingMessage:e.lookup("SignedTimeSlicedSurveyStopCollectingMessage"),qSetHash:e.lookup("Uint256"),qSet:e.lookup("ScpQuorumSet"),envelope:e.lookup("ScpEnvelope"),getScpLedgerSeq:e.lookup("Uint32"),sendMoreMessage:e.lookup("SendMore"),sendMoreExtendedMessage:e.lookup("SendMoreExtended"),floodAdvert:e.lookup("FloodAdvert"),floodDemand:e.lookup("FloodDemand")}}),e.struct("AuthenticatedMessageV0",[["sequence",e.lookup("Uint64")],["message",e.lookup("StellarMessage")],["mac",e.lookup("HmacSha256Mac")]]),e.union("AuthenticatedMessage",{switchOn:e.lookup("Uint32"),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("AuthenticatedMessageV0")}}),e.const("MAX_OPS_PER_TX",100),e.union("LiquidityPoolParameters",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolConstantProductParameters")}}),e.struct("MuxedAccountMed25519",[["id",e.lookup("Uint64")],["ed25519",e.lookup("Uint256")]]),e.union("MuxedAccount",{switchOn:e.lookup("CryptoKeyType"),switchName:"type",switches:[["keyTypeEd25519","ed25519"],["keyTypeMuxedEd25519","med25519"]],arms:{ed25519:e.lookup("Uint256"),med25519:e.lookup("MuxedAccountMed25519")}}),e.struct("DecoratedSignature",[["hint",e.lookup("SignatureHint")],["signature",e.lookup("Signature")]]),e.enum("OperationType",{createAccount:0,payment:1,pathPaymentStrictReceive:2,manageSellOffer:3,createPassiveSellOffer:4,setOptions:5,changeTrust:6,allowTrust:7,accountMerge:8,inflation:9,manageData:10,bumpSequence:11,manageBuyOffer:12,pathPaymentStrictSend:13,createClaimableBalance:14,claimClaimableBalance:15,beginSponsoringFutureReserves:16,endSponsoringFutureReserves:17,revokeSponsorship:18,clawback:19,clawbackClaimableBalance:20,setTrustLineFlags:21,liquidityPoolDeposit:22,liquidityPoolWithdraw:23,invokeHostFunction:24,extendFootprintTtl:25,restoreFootprint:26}),e.struct("CreateAccountOp",[["destination",e.lookup("AccountId")],["startingBalance",e.lookup("Int64")]]),e.struct("PaymentOp",[["destination",e.lookup("MuxedAccount")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveOp",[["sendAsset",e.lookup("Asset")],["sendMax",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destAmount",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("PathPaymentStrictSendOp",[["sendAsset",e.lookup("Asset")],["sendAmount",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destMin",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("ManageSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("ManageBuyOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["buyAmount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("CreatePassiveSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")]]),e.struct("SetOptionsOp",[["inflationDest",e.option(e.lookup("AccountId"))],["clearFlags",e.option(e.lookup("Uint32"))],["setFlags",e.option(e.lookup("Uint32"))],["masterWeight",e.option(e.lookup("Uint32"))],["lowThreshold",e.option(e.lookup("Uint32"))],["medThreshold",e.option(e.lookup("Uint32"))],["highThreshold",e.option(e.lookup("Uint32"))],["homeDomain",e.option(e.lookup("String32"))],["signer",e.option(e.lookup("Signer"))]]),e.union("ChangeTrustAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPool"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPool:e.lookup("LiquidityPoolParameters")}}),e.struct("ChangeTrustOp",[["line",e.lookup("ChangeTrustAsset")],["limit",e.lookup("Int64")]]),e.struct("AllowTrustOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("AssetCode")],["authorize",e.lookup("Uint32")]]),e.struct("ManageDataOp",[["dataName",e.lookup("String64")],["dataValue",e.option(e.lookup("DataValue"))]]),e.struct("BumpSequenceOp",[["bumpTo",e.lookup("SequenceNumber")]]),e.struct("CreateClaimableBalanceOp",[["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["claimants",e.varArray(e.lookup("Claimant"),10)]]),e.struct("ClaimClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("BeginSponsoringFutureReservesOp",[["sponsoredId",e.lookup("AccountId")]]),e.enum("RevokeSponsorshipType",{revokeSponsorshipLedgerEntry:0,revokeSponsorshipSigner:1}),e.struct("RevokeSponsorshipOpSigner",[["accountId",e.lookup("AccountId")],["signerKey",e.lookup("SignerKey")]]),e.union("RevokeSponsorshipOp",{switchOn:e.lookup("RevokeSponsorshipType"),switchName:"type",switches:[["revokeSponsorshipLedgerEntry","ledgerKey"],["revokeSponsorshipSigner","signer"]],arms:{ledgerKey:e.lookup("LedgerKey"),signer:e.lookup("RevokeSponsorshipOpSigner")}}),e.struct("ClawbackOp",[["asset",e.lookup("Asset")],["from",e.lookup("MuxedAccount")],["amount",e.lookup("Int64")]]),e.struct("ClawbackClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("SetTrustLineFlagsOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("Asset")],["clearFlags",e.lookup("Uint32")],["setFlags",e.lookup("Uint32")]]),e.const("LIQUIDITY_POOL_FEE_V18",30),e.struct("LiquidityPoolDepositOp",[["liquidityPoolId",e.lookup("PoolId")],["maxAmountA",e.lookup("Int64")],["maxAmountB",e.lookup("Int64")],["minPrice",e.lookup("Price")],["maxPrice",e.lookup("Price")]]),e.struct("LiquidityPoolWithdrawOp",[["liquidityPoolId",e.lookup("PoolId")],["amount",e.lookup("Int64")],["minAmountA",e.lookup("Int64")],["minAmountB",e.lookup("Int64")]]),e.enum("HostFunctionType",{hostFunctionTypeInvokeContract:0,hostFunctionTypeCreateContract:1,hostFunctionTypeUploadContractWasm:2,hostFunctionTypeCreateContractV2:3}),e.enum("ContractIdPreimageType",{contractIdPreimageFromAddress:0,contractIdPreimageFromAsset:1}),e.struct("ContractIdPreimageFromAddress",[["address",e.lookup("ScAddress")],["salt",e.lookup("Uint256")]]),e.union("ContractIdPreimage",{switchOn:e.lookup("ContractIdPreimageType"),switchName:"type",switches:[["contractIdPreimageFromAddress","fromAddress"],["contractIdPreimageFromAsset","fromAsset"]],arms:{fromAddress:e.lookup("ContractIdPreimageFromAddress"),fromAsset:e.lookup("Asset")}}),e.struct("CreateContractArgs",[["contractIdPreimage",e.lookup("ContractIdPreimage")],["executable",e.lookup("ContractExecutable")]]),e.struct("CreateContractArgsV2",[["contractIdPreimage",e.lookup("ContractIdPreimage")],["executable",e.lookup("ContractExecutable")],["constructorArgs",e.varArray(e.lookup("ScVal"),2147483647)]]),e.struct("InvokeContractArgs",[["contractAddress",e.lookup("ScAddress")],["functionName",e.lookup("ScSymbol")],["args",e.varArray(e.lookup("ScVal"),2147483647)]]),e.union("HostFunction",{switchOn:e.lookup("HostFunctionType"),switchName:"type",switches:[["hostFunctionTypeInvokeContract","invokeContract"],["hostFunctionTypeCreateContract","createContract"],["hostFunctionTypeUploadContractWasm","wasm"],["hostFunctionTypeCreateContractV2","createContractV2"]],arms:{invokeContract:e.lookup("InvokeContractArgs"),createContract:e.lookup("CreateContractArgs"),wasm:e.varOpaque(),createContractV2:e.lookup("CreateContractArgsV2")}}),e.enum("SorobanAuthorizedFunctionType",{sorobanAuthorizedFunctionTypeContractFn:0,sorobanAuthorizedFunctionTypeCreateContractHostFn:1,sorobanAuthorizedFunctionTypeCreateContractV2HostFn:2}),e.union("SorobanAuthorizedFunction",{switchOn:e.lookup("SorobanAuthorizedFunctionType"),switchName:"type",switches:[["sorobanAuthorizedFunctionTypeContractFn","contractFn"],["sorobanAuthorizedFunctionTypeCreateContractHostFn","createContractHostFn"],["sorobanAuthorizedFunctionTypeCreateContractV2HostFn","createContractV2HostFn"]],arms:{contractFn:e.lookup("InvokeContractArgs"),createContractHostFn:e.lookup("CreateContractArgs"),createContractV2HostFn:e.lookup("CreateContractArgsV2")}}),e.struct("SorobanAuthorizedInvocation",[["function",e.lookup("SorobanAuthorizedFunction")],["subInvocations",e.varArray(e.lookup("SorobanAuthorizedInvocation"),2147483647)]]),e.struct("SorobanAddressCredentials",[["address",e.lookup("ScAddress")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["signature",e.lookup("ScVal")]]),e.enum("SorobanCredentialsType",{sorobanCredentialsSourceAccount:0,sorobanCredentialsAddress:1}),e.union("SorobanCredentials",{switchOn:e.lookup("SorobanCredentialsType"),switchName:"type",switches:[["sorobanCredentialsSourceAccount",e.void()],["sorobanCredentialsAddress","address"]],arms:{address:e.lookup("SorobanAddressCredentials")}}),e.struct("SorobanAuthorizationEntry",[["credentials",e.lookup("SorobanCredentials")],["rootInvocation",e.lookup("SorobanAuthorizedInvocation")]]),e.typedef("SorobanAuthorizationEntries",e.varArray(e.lookup("SorobanAuthorizationEntry"),2147483647)),e.struct("InvokeHostFunctionOp",[["hostFunction",e.lookup("HostFunction")],["auth",e.varArray(e.lookup("SorobanAuthorizationEntry"),2147483647)]]),e.struct("ExtendFootprintTtlOp",[["ext",e.lookup("ExtensionPoint")],["extendTo",e.lookup("Uint32")]]),e.struct("RestoreFootprintOp",[["ext",e.lookup("ExtensionPoint")]]),e.union("OperationBody",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountOp"],["payment","paymentOp"],["pathPaymentStrictReceive","pathPaymentStrictReceiveOp"],["manageSellOffer","manageSellOfferOp"],["createPassiveSellOffer","createPassiveSellOfferOp"],["setOptions","setOptionsOp"],["changeTrust","changeTrustOp"],["allowTrust","allowTrustOp"],["accountMerge","destination"],["inflation",e.void()],["manageData","manageDataOp"],["bumpSequence","bumpSequenceOp"],["manageBuyOffer","manageBuyOfferOp"],["pathPaymentStrictSend","pathPaymentStrictSendOp"],["createClaimableBalance","createClaimableBalanceOp"],["claimClaimableBalance","claimClaimableBalanceOp"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesOp"],["endSponsoringFutureReserves",e.void()],["revokeSponsorship","revokeSponsorshipOp"],["clawback","clawbackOp"],["clawbackClaimableBalance","clawbackClaimableBalanceOp"],["setTrustLineFlags","setTrustLineFlagsOp"],["liquidityPoolDeposit","liquidityPoolDepositOp"],["liquidityPoolWithdraw","liquidityPoolWithdrawOp"],["invokeHostFunction","invokeHostFunctionOp"],["extendFootprintTtl","extendFootprintTtlOp"],["restoreFootprint","restoreFootprintOp"]],arms:{createAccountOp:e.lookup("CreateAccountOp"),paymentOp:e.lookup("PaymentOp"),pathPaymentStrictReceiveOp:e.lookup("PathPaymentStrictReceiveOp"),manageSellOfferOp:e.lookup("ManageSellOfferOp"),createPassiveSellOfferOp:e.lookup("CreatePassiveSellOfferOp"),setOptionsOp:e.lookup("SetOptionsOp"),changeTrustOp:e.lookup("ChangeTrustOp"),allowTrustOp:e.lookup("AllowTrustOp"),destination:e.lookup("MuxedAccount"),manageDataOp:e.lookup("ManageDataOp"),bumpSequenceOp:e.lookup("BumpSequenceOp"),manageBuyOfferOp:e.lookup("ManageBuyOfferOp"),pathPaymentStrictSendOp:e.lookup("PathPaymentStrictSendOp"),createClaimableBalanceOp:e.lookup("CreateClaimableBalanceOp"),claimClaimableBalanceOp:e.lookup("ClaimClaimableBalanceOp"),beginSponsoringFutureReservesOp:e.lookup("BeginSponsoringFutureReservesOp"),revokeSponsorshipOp:e.lookup("RevokeSponsorshipOp"),clawbackOp:e.lookup("ClawbackOp"),clawbackClaimableBalanceOp:e.lookup("ClawbackClaimableBalanceOp"),setTrustLineFlagsOp:e.lookup("SetTrustLineFlagsOp"),liquidityPoolDepositOp:e.lookup("LiquidityPoolDepositOp"),liquidityPoolWithdrawOp:e.lookup("LiquidityPoolWithdrawOp"),invokeHostFunctionOp:e.lookup("InvokeHostFunctionOp"),extendFootprintTtlOp:e.lookup("ExtendFootprintTtlOp"),restoreFootprintOp:e.lookup("RestoreFootprintOp")}}),e.struct("Operation",[["sourceAccount",e.option(e.lookup("MuxedAccount"))],["body",e.lookup("OperationBody")]]),e.struct("HashIdPreimageOperationId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")]]),e.struct("HashIdPreimageRevokeId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")],["liquidityPoolId",e.lookup("PoolId")],["asset",e.lookup("Asset")]]),e.struct("HashIdPreimageContractId",[["networkId",e.lookup("Hash")],["contractIdPreimage",e.lookup("ContractIdPreimage")]]),e.struct("HashIdPreimageSorobanAuthorization",[["networkId",e.lookup("Hash")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["invocation",e.lookup("SorobanAuthorizedInvocation")]]),e.union("HashIdPreimage",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeOpId","operationId"],["envelopeTypePoolRevokeOpId","revokeId"],["envelopeTypeContractId","contractId"],["envelopeTypeSorobanAuthorization","sorobanAuthorization"]],arms:{operationId:e.lookup("HashIdPreimageOperationId"),revokeId:e.lookup("HashIdPreimageRevokeId"),contractId:e.lookup("HashIdPreimageContractId"),sorobanAuthorization:e.lookup("HashIdPreimageSorobanAuthorization")}}),e.enum("MemoType",{memoNone:0,memoText:1,memoId:2,memoHash:3,memoReturn:4}),e.union("Memo",{switchOn:e.lookup("MemoType"),switchName:"type",switches:[["memoNone",e.void()],["memoText","text"],["memoId","id"],["memoHash","hash"],["memoReturn","retHash"]],arms:{text:e.string(28),id:e.lookup("Uint64"),hash:e.lookup("Hash"),retHash:e.lookup("Hash")}}),e.struct("TimeBounds",[["minTime",e.lookup("TimePoint")],["maxTime",e.lookup("TimePoint")]]),e.struct("LedgerBounds",[["minLedger",e.lookup("Uint32")],["maxLedger",e.lookup("Uint32")]]),e.struct("PreconditionsV2",[["timeBounds",e.option(e.lookup("TimeBounds"))],["ledgerBounds",e.option(e.lookup("LedgerBounds"))],["minSeqNum",e.option(e.lookup("SequenceNumber"))],["minSeqAge",e.lookup("Duration")],["minSeqLedgerGap",e.lookup("Uint32")],["extraSigners",e.varArray(e.lookup("SignerKey"),2)]]),e.enum("PreconditionType",{precondNone:0,precondTime:1,precondV2:2}),e.union("Preconditions",{switchOn:e.lookup("PreconditionType"),switchName:"type",switches:[["precondNone",e.void()],["precondTime","timeBounds"],["precondV2","v2"]],arms:{timeBounds:e.lookup("TimeBounds"),v2:e.lookup("PreconditionsV2")}}),e.struct("LedgerFootprint",[["readOnly",e.varArray(e.lookup("LedgerKey"),2147483647)],["readWrite",e.varArray(e.lookup("LedgerKey"),2147483647)]]),e.struct("SorobanResources",[["footprint",e.lookup("LedgerFootprint")],["instructions",e.lookup("Uint32")],["diskReadBytes",e.lookup("Uint32")],["writeBytes",e.lookup("Uint32")]]),e.struct("SorobanResourcesExtV0",[["archivedSorobanEntries",e.varArray(e.lookup("Uint32"),2147483647)]]),e.union("SorobanTransactionDataExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"resourceExt"]],arms:{resourceExt:e.lookup("SorobanResourcesExtV0")}}),e.struct("SorobanTransactionData",[["ext",e.lookup("SorobanTransactionDataExt")],["resources",e.lookup("SorobanResources")],["resourceFee",e.lookup("Int64")]]),e.union("TransactionV0Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionV0",[["sourceAccountEd25519",e.lookup("Uint256")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["timeBounds",e.option(e.lookup("TimeBounds"))],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionV0Ext")]]),e.struct("TransactionV0Envelope",[["tx",e.lookup("TransactionV0")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"sorobanData"]],arms:{sorobanData:e.lookup("SorobanTransactionData")}}),e.struct("Transaction",[["sourceAccount",e.lookup("MuxedAccount")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["cond",e.lookup("Preconditions")],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionExt")]]),e.struct("TransactionV1Envelope",[["tx",e.lookup("Transaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("FeeBumpTransactionInnerTx",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","v1"]],arms:{v1:e.lookup("TransactionV1Envelope")}}),e.union("FeeBumpTransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("FeeBumpTransaction",[["feeSource",e.lookup("MuxedAccount")],["fee",e.lookup("Int64")],["innerTx",e.lookup("FeeBumpTransactionInnerTx")],["ext",e.lookup("FeeBumpTransactionExt")]]),e.struct("FeeBumpTransactionEnvelope",[["tx",e.lookup("FeeBumpTransaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTxV0","v0"],["envelopeTypeTx","v1"],["envelopeTypeTxFeeBump","feeBump"]],arms:{v0:e.lookup("TransactionV0Envelope"),v1:e.lookup("TransactionV1Envelope"),feeBump:e.lookup("FeeBumpTransactionEnvelope")}}),e.union("TransactionSignaturePayloadTaggedTransaction",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","tx"],["envelopeTypeTxFeeBump","feeBump"]],arms:{tx:e.lookup("Transaction"),feeBump:e.lookup("FeeBumpTransaction")}}),e.struct("TransactionSignaturePayload",[["networkId",e.lookup("Hash")],["taggedTransaction",e.lookup("TransactionSignaturePayloadTaggedTransaction")]]),e.enum("ClaimAtomType",{claimAtomTypeV0:0,claimAtomTypeOrderBook:1,claimAtomTypeLiquidityPool:2}),e.struct("ClaimOfferAtomV0",[["sellerEd25519",e.lookup("Uint256")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimOfferAtom",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimLiquidityAtom",[["liquidityPoolId",e.lookup("PoolId")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.union("ClaimAtom",{switchOn:e.lookup("ClaimAtomType"),switchName:"type",switches:[["claimAtomTypeV0","v0"],["claimAtomTypeOrderBook","orderBook"],["claimAtomTypeLiquidityPool","liquidityPool"]],arms:{v0:e.lookup("ClaimOfferAtomV0"),orderBook:e.lookup("ClaimOfferAtom"),liquidityPool:e.lookup("ClaimLiquidityAtom")}}),e.enum("CreateAccountResultCode",{createAccountSuccess:0,createAccountMalformed:-1,createAccountUnderfunded:-2,createAccountLowReserve:-3,createAccountAlreadyExist:-4}),e.union("CreateAccountResult",{switchOn:e.lookup("CreateAccountResultCode"),switchName:"code",switches:[["createAccountSuccess",e.void()],["createAccountMalformed",e.void()],["createAccountUnderfunded",e.void()],["createAccountLowReserve",e.void()],["createAccountAlreadyExist",e.void()]],arms:{}}),e.enum("PaymentResultCode",{paymentSuccess:0,paymentMalformed:-1,paymentUnderfunded:-2,paymentSrcNoTrust:-3,paymentSrcNotAuthorized:-4,paymentNoDestination:-5,paymentNoTrust:-6,paymentNotAuthorized:-7,paymentLineFull:-8,paymentNoIssuer:-9}),e.union("PaymentResult",{switchOn:e.lookup("PaymentResultCode"),switchName:"code",switches:[["paymentSuccess",e.void()],["paymentMalformed",e.void()],["paymentUnderfunded",e.void()],["paymentSrcNoTrust",e.void()],["paymentSrcNotAuthorized",e.void()],["paymentNoDestination",e.void()],["paymentNoTrust",e.void()],["paymentNotAuthorized",e.void()],["paymentLineFull",e.void()],["paymentNoIssuer",e.void()]],arms:{}}),e.enum("PathPaymentStrictReceiveResultCode",{pathPaymentStrictReceiveSuccess:0,pathPaymentStrictReceiveMalformed:-1,pathPaymentStrictReceiveUnderfunded:-2,pathPaymentStrictReceiveSrcNoTrust:-3,pathPaymentStrictReceiveSrcNotAuthorized:-4,pathPaymentStrictReceiveNoDestination:-5,pathPaymentStrictReceiveNoTrust:-6,pathPaymentStrictReceiveNotAuthorized:-7,pathPaymentStrictReceiveLineFull:-8,pathPaymentStrictReceiveNoIssuer:-9,pathPaymentStrictReceiveTooFewOffers:-10,pathPaymentStrictReceiveOfferCrossSelf:-11,pathPaymentStrictReceiveOverSendmax:-12}),e.struct("SimplePaymentResult",[["destination",e.lookup("AccountId")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictReceiveResult",{switchOn:e.lookup("PathPaymentStrictReceiveResultCode"),switchName:"code",switches:[["pathPaymentStrictReceiveSuccess","success"],["pathPaymentStrictReceiveMalformed",e.void()],["pathPaymentStrictReceiveUnderfunded",e.void()],["pathPaymentStrictReceiveSrcNoTrust",e.void()],["pathPaymentStrictReceiveSrcNotAuthorized",e.void()],["pathPaymentStrictReceiveNoDestination",e.void()],["pathPaymentStrictReceiveNoTrust",e.void()],["pathPaymentStrictReceiveNotAuthorized",e.void()],["pathPaymentStrictReceiveLineFull",e.void()],["pathPaymentStrictReceiveNoIssuer","noIssuer"],["pathPaymentStrictReceiveTooFewOffers",e.void()],["pathPaymentStrictReceiveOfferCrossSelf",e.void()],["pathPaymentStrictReceiveOverSendmax",e.void()]],arms:{success:e.lookup("PathPaymentStrictReceiveResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("PathPaymentStrictSendResultCode",{pathPaymentStrictSendSuccess:0,pathPaymentStrictSendMalformed:-1,pathPaymentStrictSendUnderfunded:-2,pathPaymentStrictSendSrcNoTrust:-3,pathPaymentStrictSendSrcNotAuthorized:-4,pathPaymentStrictSendNoDestination:-5,pathPaymentStrictSendNoTrust:-6,pathPaymentStrictSendNotAuthorized:-7,pathPaymentStrictSendLineFull:-8,pathPaymentStrictSendNoIssuer:-9,pathPaymentStrictSendTooFewOffers:-10,pathPaymentStrictSendOfferCrossSelf:-11,pathPaymentStrictSendUnderDestmin:-12}),e.struct("PathPaymentStrictSendResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictSendResult",{switchOn:e.lookup("PathPaymentStrictSendResultCode"),switchName:"code",switches:[["pathPaymentStrictSendSuccess","success"],["pathPaymentStrictSendMalformed",e.void()],["pathPaymentStrictSendUnderfunded",e.void()],["pathPaymentStrictSendSrcNoTrust",e.void()],["pathPaymentStrictSendSrcNotAuthorized",e.void()],["pathPaymentStrictSendNoDestination",e.void()],["pathPaymentStrictSendNoTrust",e.void()],["pathPaymentStrictSendNotAuthorized",e.void()],["pathPaymentStrictSendLineFull",e.void()],["pathPaymentStrictSendNoIssuer","noIssuer"],["pathPaymentStrictSendTooFewOffers",e.void()],["pathPaymentStrictSendOfferCrossSelf",e.void()],["pathPaymentStrictSendUnderDestmin",e.void()]],arms:{success:e.lookup("PathPaymentStrictSendResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("ManageSellOfferResultCode",{manageSellOfferSuccess:0,manageSellOfferMalformed:-1,manageSellOfferSellNoTrust:-2,manageSellOfferBuyNoTrust:-3,manageSellOfferSellNotAuthorized:-4,manageSellOfferBuyNotAuthorized:-5,manageSellOfferLineFull:-6,manageSellOfferUnderfunded:-7,manageSellOfferCrossSelf:-8,manageSellOfferSellNoIssuer:-9,manageSellOfferBuyNoIssuer:-10,manageSellOfferNotFound:-11,manageSellOfferLowReserve:-12}),e.enum("ManageOfferEffect",{manageOfferCreated:0,manageOfferUpdated:1,manageOfferDeleted:2}),e.union("ManageOfferSuccessResultOffer",{switchOn:e.lookup("ManageOfferEffect"),switchName:"effect",switches:[["manageOfferCreated","offer"],["manageOfferUpdated","offer"],["manageOfferDeleted",e.void()]],arms:{offer:e.lookup("OfferEntry")}}),e.struct("ManageOfferSuccessResult",[["offersClaimed",e.varArray(e.lookup("ClaimAtom"),2147483647)],["offer",e.lookup("ManageOfferSuccessResultOffer")]]),e.union("ManageSellOfferResult",{switchOn:e.lookup("ManageSellOfferResultCode"),switchName:"code",switches:[["manageSellOfferSuccess","success"],["manageSellOfferMalformed",e.void()],["manageSellOfferSellNoTrust",e.void()],["manageSellOfferBuyNoTrust",e.void()],["manageSellOfferSellNotAuthorized",e.void()],["manageSellOfferBuyNotAuthorized",e.void()],["manageSellOfferLineFull",e.void()],["manageSellOfferUnderfunded",e.void()],["manageSellOfferCrossSelf",e.void()],["manageSellOfferSellNoIssuer",e.void()],["manageSellOfferBuyNoIssuer",e.void()],["manageSellOfferNotFound",e.void()],["manageSellOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("ManageBuyOfferResultCode",{manageBuyOfferSuccess:0,manageBuyOfferMalformed:-1,manageBuyOfferSellNoTrust:-2,manageBuyOfferBuyNoTrust:-3,manageBuyOfferSellNotAuthorized:-4,manageBuyOfferBuyNotAuthorized:-5,manageBuyOfferLineFull:-6,manageBuyOfferUnderfunded:-7,manageBuyOfferCrossSelf:-8,manageBuyOfferSellNoIssuer:-9,manageBuyOfferBuyNoIssuer:-10,manageBuyOfferNotFound:-11,manageBuyOfferLowReserve:-12}),e.union("ManageBuyOfferResult",{switchOn:e.lookup("ManageBuyOfferResultCode"),switchName:"code",switches:[["manageBuyOfferSuccess","success"],["manageBuyOfferMalformed",e.void()],["manageBuyOfferSellNoTrust",e.void()],["manageBuyOfferBuyNoTrust",e.void()],["manageBuyOfferSellNotAuthorized",e.void()],["manageBuyOfferBuyNotAuthorized",e.void()],["manageBuyOfferLineFull",e.void()],["manageBuyOfferUnderfunded",e.void()],["manageBuyOfferCrossSelf",e.void()],["manageBuyOfferSellNoIssuer",e.void()],["manageBuyOfferBuyNoIssuer",e.void()],["manageBuyOfferNotFound",e.void()],["manageBuyOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("SetOptionsResultCode",{setOptionsSuccess:0,setOptionsLowReserve:-1,setOptionsTooManySigners:-2,setOptionsBadFlags:-3,setOptionsInvalidInflation:-4,setOptionsCantChange:-5,setOptionsUnknownFlag:-6,setOptionsThresholdOutOfRange:-7,setOptionsBadSigner:-8,setOptionsInvalidHomeDomain:-9,setOptionsAuthRevocableRequired:-10}),e.union("SetOptionsResult",{switchOn:e.lookup("SetOptionsResultCode"),switchName:"code",switches:[["setOptionsSuccess",e.void()],["setOptionsLowReserve",e.void()],["setOptionsTooManySigners",e.void()],["setOptionsBadFlags",e.void()],["setOptionsInvalidInflation",e.void()],["setOptionsCantChange",e.void()],["setOptionsUnknownFlag",e.void()],["setOptionsThresholdOutOfRange",e.void()],["setOptionsBadSigner",e.void()],["setOptionsInvalidHomeDomain",e.void()],["setOptionsAuthRevocableRequired",e.void()]],arms:{}}),e.enum("ChangeTrustResultCode",{changeTrustSuccess:0,changeTrustMalformed:-1,changeTrustNoIssuer:-2,changeTrustInvalidLimit:-3,changeTrustLowReserve:-4,changeTrustSelfNotAllowed:-5,changeTrustTrustLineMissing:-6,changeTrustCannotDelete:-7,changeTrustNotAuthMaintainLiabilities:-8}),e.union("ChangeTrustResult",{switchOn:e.lookup("ChangeTrustResultCode"),switchName:"code",switches:[["changeTrustSuccess",e.void()],["changeTrustMalformed",e.void()],["changeTrustNoIssuer",e.void()],["changeTrustInvalidLimit",e.void()],["changeTrustLowReserve",e.void()],["changeTrustSelfNotAllowed",e.void()],["changeTrustTrustLineMissing",e.void()],["changeTrustCannotDelete",e.void()],["changeTrustNotAuthMaintainLiabilities",e.void()]],arms:{}}),e.enum("AllowTrustResultCode",{allowTrustSuccess:0,allowTrustMalformed:-1,allowTrustNoTrustLine:-2,allowTrustTrustNotRequired:-3,allowTrustCantRevoke:-4,allowTrustSelfNotAllowed:-5,allowTrustLowReserve:-6}),e.union("AllowTrustResult",{switchOn:e.lookup("AllowTrustResultCode"),switchName:"code",switches:[["allowTrustSuccess",e.void()],["allowTrustMalformed",e.void()],["allowTrustNoTrustLine",e.void()],["allowTrustTrustNotRequired",e.void()],["allowTrustCantRevoke",e.void()],["allowTrustSelfNotAllowed",e.void()],["allowTrustLowReserve",e.void()]],arms:{}}),e.enum("AccountMergeResultCode",{accountMergeSuccess:0,accountMergeMalformed:-1,accountMergeNoAccount:-2,accountMergeImmutableSet:-3,accountMergeHasSubEntries:-4,accountMergeSeqnumTooFar:-5,accountMergeDestFull:-6,accountMergeIsSponsor:-7}),e.union("AccountMergeResult",{switchOn:e.lookup("AccountMergeResultCode"),switchName:"code",switches:[["accountMergeSuccess","sourceAccountBalance"],["accountMergeMalformed",e.void()],["accountMergeNoAccount",e.void()],["accountMergeImmutableSet",e.void()],["accountMergeHasSubEntries",e.void()],["accountMergeSeqnumTooFar",e.void()],["accountMergeDestFull",e.void()],["accountMergeIsSponsor",e.void()]],arms:{sourceAccountBalance:e.lookup("Int64")}}),e.enum("InflationResultCode",{inflationSuccess:0,inflationNotTime:-1}),e.struct("InflationPayout",[["destination",e.lookup("AccountId")],["amount",e.lookup("Int64")]]),e.union("InflationResult",{switchOn:e.lookup("InflationResultCode"),switchName:"code",switches:[["inflationSuccess","payouts"],["inflationNotTime",e.void()]],arms:{payouts:e.varArray(e.lookup("InflationPayout"),2147483647)}}),e.enum("ManageDataResultCode",{manageDataSuccess:0,manageDataNotSupportedYet:-1,manageDataNameNotFound:-2,manageDataLowReserve:-3,manageDataInvalidName:-4}),e.union("ManageDataResult",{switchOn:e.lookup("ManageDataResultCode"),switchName:"code",switches:[["manageDataSuccess",e.void()],["manageDataNotSupportedYet",e.void()],["manageDataNameNotFound",e.void()],["manageDataLowReserve",e.void()],["manageDataInvalidName",e.void()]],arms:{}}),e.enum("BumpSequenceResultCode",{bumpSequenceSuccess:0,bumpSequenceBadSeq:-1}),e.union("BumpSequenceResult",{switchOn:e.lookup("BumpSequenceResultCode"),switchName:"code",switches:[["bumpSequenceSuccess",e.void()],["bumpSequenceBadSeq",e.void()]],arms:{}}),e.enum("CreateClaimableBalanceResultCode",{createClaimableBalanceSuccess:0,createClaimableBalanceMalformed:-1,createClaimableBalanceLowReserve:-2,createClaimableBalanceNoTrust:-3,createClaimableBalanceNotAuthorized:-4,createClaimableBalanceUnderfunded:-5}),e.union("CreateClaimableBalanceResult",{switchOn:e.lookup("CreateClaimableBalanceResultCode"),switchName:"code",switches:[["createClaimableBalanceSuccess","balanceId"],["createClaimableBalanceMalformed",e.void()],["createClaimableBalanceLowReserve",e.void()],["createClaimableBalanceNoTrust",e.void()],["createClaimableBalanceNotAuthorized",e.void()],["createClaimableBalanceUnderfunded",e.void()]],arms:{balanceId:e.lookup("ClaimableBalanceId")}}),e.enum("ClaimClaimableBalanceResultCode",{claimClaimableBalanceSuccess:0,claimClaimableBalanceDoesNotExist:-1,claimClaimableBalanceCannotClaim:-2,claimClaimableBalanceLineFull:-3,claimClaimableBalanceNoTrust:-4,claimClaimableBalanceNotAuthorized:-5}),e.union("ClaimClaimableBalanceResult",{switchOn:e.lookup("ClaimClaimableBalanceResultCode"),switchName:"code",switches:[["claimClaimableBalanceSuccess",e.void()],["claimClaimableBalanceDoesNotExist",e.void()],["claimClaimableBalanceCannotClaim",e.void()],["claimClaimableBalanceLineFull",e.void()],["claimClaimableBalanceNoTrust",e.void()],["claimClaimableBalanceNotAuthorized",e.void()]],arms:{}}),e.enum("BeginSponsoringFutureReservesResultCode",{beginSponsoringFutureReservesSuccess:0,beginSponsoringFutureReservesMalformed:-1,beginSponsoringFutureReservesAlreadySponsored:-2,beginSponsoringFutureReservesRecursive:-3}),e.union("BeginSponsoringFutureReservesResult",{switchOn:e.lookup("BeginSponsoringFutureReservesResultCode"),switchName:"code",switches:[["beginSponsoringFutureReservesSuccess",e.void()],["beginSponsoringFutureReservesMalformed",e.void()],["beginSponsoringFutureReservesAlreadySponsored",e.void()],["beginSponsoringFutureReservesRecursive",e.void()]],arms:{}}),e.enum("EndSponsoringFutureReservesResultCode",{endSponsoringFutureReservesSuccess:0,endSponsoringFutureReservesNotSponsored:-1}),e.union("EndSponsoringFutureReservesResult",{switchOn:e.lookup("EndSponsoringFutureReservesResultCode"),switchName:"code",switches:[["endSponsoringFutureReservesSuccess",e.void()],["endSponsoringFutureReservesNotSponsored",e.void()]],arms:{}}),e.enum("RevokeSponsorshipResultCode",{revokeSponsorshipSuccess:0,revokeSponsorshipDoesNotExist:-1,revokeSponsorshipNotSponsor:-2,revokeSponsorshipLowReserve:-3,revokeSponsorshipOnlyTransferable:-4,revokeSponsorshipMalformed:-5}),e.union("RevokeSponsorshipResult",{switchOn:e.lookup("RevokeSponsorshipResultCode"),switchName:"code",switches:[["revokeSponsorshipSuccess",e.void()],["revokeSponsorshipDoesNotExist",e.void()],["revokeSponsorshipNotSponsor",e.void()],["revokeSponsorshipLowReserve",e.void()],["revokeSponsorshipOnlyTransferable",e.void()],["revokeSponsorshipMalformed",e.void()]],arms:{}}),e.enum("ClawbackResultCode",{clawbackSuccess:0,clawbackMalformed:-1,clawbackNotClawbackEnabled:-2,clawbackNoTrust:-3,clawbackUnderfunded:-4}),e.union("ClawbackResult",{switchOn:e.lookup("ClawbackResultCode"),switchName:"code",switches:[["clawbackSuccess",e.void()],["clawbackMalformed",e.void()],["clawbackNotClawbackEnabled",e.void()],["clawbackNoTrust",e.void()],["clawbackUnderfunded",e.void()]],arms:{}}),e.enum("ClawbackClaimableBalanceResultCode",{clawbackClaimableBalanceSuccess:0,clawbackClaimableBalanceDoesNotExist:-1,clawbackClaimableBalanceNotIssuer:-2,clawbackClaimableBalanceNotClawbackEnabled:-3}),e.union("ClawbackClaimableBalanceResult",{switchOn:e.lookup("ClawbackClaimableBalanceResultCode"),switchName:"code",switches:[["clawbackClaimableBalanceSuccess",e.void()],["clawbackClaimableBalanceDoesNotExist",e.void()],["clawbackClaimableBalanceNotIssuer",e.void()],["clawbackClaimableBalanceNotClawbackEnabled",e.void()]],arms:{}}),e.enum("SetTrustLineFlagsResultCode",{setTrustLineFlagsSuccess:0,setTrustLineFlagsMalformed:-1,setTrustLineFlagsNoTrustLine:-2,setTrustLineFlagsCantRevoke:-3,setTrustLineFlagsInvalidState:-4,setTrustLineFlagsLowReserve:-5}),e.union("SetTrustLineFlagsResult",{switchOn:e.lookup("SetTrustLineFlagsResultCode"),switchName:"code",switches:[["setTrustLineFlagsSuccess",e.void()],["setTrustLineFlagsMalformed",e.void()],["setTrustLineFlagsNoTrustLine",e.void()],["setTrustLineFlagsCantRevoke",e.void()],["setTrustLineFlagsInvalidState",e.void()],["setTrustLineFlagsLowReserve",e.void()]],arms:{}}),e.enum("LiquidityPoolDepositResultCode",{liquidityPoolDepositSuccess:0,liquidityPoolDepositMalformed:-1,liquidityPoolDepositNoTrust:-2,liquidityPoolDepositNotAuthorized:-3,liquidityPoolDepositUnderfunded:-4,liquidityPoolDepositLineFull:-5,liquidityPoolDepositBadPrice:-6,liquidityPoolDepositPoolFull:-7}),e.union("LiquidityPoolDepositResult",{switchOn:e.lookup("LiquidityPoolDepositResultCode"),switchName:"code",switches:[["liquidityPoolDepositSuccess",e.void()],["liquidityPoolDepositMalformed",e.void()],["liquidityPoolDepositNoTrust",e.void()],["liquidityPoolDepositNotAuthorized",e.void()],["liquidityPoolDepositUnderfunded",e.void()],["liquidityPoolDepositLineFull",e.void()],["liquidityPoolDepositBadPrice",e.void()],["liquidityPoolDepositPoolFull",e.void()]],arms:{}}),e.enum("LiquidityPoolWithdrawResultCode",{liquidityPoolWithdrawSuccess:0,liquidityPoolWithdrawMalformed:-1,liquidityPoolWithdrawNoTrust:-2,liquidityPoolWithdrawUnderfunded:-3,liquidityPoolWithdrawLineFull:-4,liquidityPoolWithdrawUnderMinimum:-5}),e.union("LiquidityPoolWithdrawResult",{switchOn:e.lookup("LiquidityPoolWithdrawResultCode"),switchName:"code",switches:[["liquidityPoolWithdrawSuccess",e.void()],["liquidityPoolWithdrawMalformed",e.void()],["liquidityPoolWithdrawNoTrust",e.void()],["liquidityPoolWithdrawUnderfunded",e.void()],["liquidityPoolWithdrawLineFull",e.void()],["liquidityPoolWithdrawUnderMinimum",e.void()]],arms:{}}),e.enum("InvokeHostFunctionResultCode",{invokeHostFunctionSuccess:0,invokeHostFunctionMalformed:-1,invokeHostFunctionTrapped:-2,invokeHostFunctionResourceLimitExceeded:-3,invokeHostFunctionEntryArchived:-4,invokeHostFunctionInsufficientRefundableFee:-5}),e.union("InvokeHostFunctionResult",{switchOn:e.lookup("InvokeHostFunctionResultCode"),switchName:"code",switches:[["invokeHostFunctionSuccess","success"],["invokeHostFunctionMalformed",e.void()],["invokeHostFunctionTrapped",e.void()],["invokeHostFunctionResourceLimitExceeded",e.void()],["invokeHostFunctionEntryArchived",e.void()],["invokeHostFunctionInsufficientRefundableFee",e.void()]],arms:{success:e.lookup("Hash")}}),e.enum("ExtendFootprintTtlResultCode",{extendFootprintTtlSuccess:0,extendFootprintTtlMalformed:-1,extendFootprintTtlResourceLimitExceeded:-2,extendFootprintTtlInsufficientRefundableFee:-3}),e.union("ExtendFootprintTtlResult",{switchOn:e.lookup("ExtendFootprintTtlResultCode"),switchName:"code",switches:[["extendFootprintTtlSuccess",e.void()],["extendFootprintTtlMalformed",e.void()],["extendFootprintTtlResourceLimitExceeded",e.void()],["extendFootprintTtlInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("RestoreFootprintResultCode",{restoreFootprintSuccess:0,restoreFootprintMalformed:-1,restoreFootprintResourceLimitExceeded:-2,restoreFootprintInsufficientRefundableFee:-3}),e.union("RestoreFootprintResult",{switchOn:e.lookup("RestoreFootprintResultCode"),switchName:"code",switches:[["restoreFootprintSuccess",e.void()],["restoreFootprintMalformed",e.void()],["restoreFootprintResourceLimitExceeded",e.void()],["restoreFootprintInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("OperationResultCode",{opInner:0,opBadAuth:-1,opNoAccount:-2,opNotSupported:-3,opTooManySubentries:-4,opExceededWorkLimit:-5,opTooManySponsoring:-6}),e.union("OperationResultTr",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountResult"],["payment","paymentResult"],["pathPaymentStrictReceive","pathPaymentStrictReceiveResult"],["manageSellOffer","manageSellOfferResult"],["createPassiveSellOffer","createPassiveSellOfferResult"],["setOptions","setOptionsResult"],["changeTrust","changeTrustResult"],["allowTrust","allowTrustResult"],["accountMerge","accountMergeResult"],["inflation","inflationResult"],["manageData","manageDataResult"],["bumpSequence","bumpSeqResult"],["manageBuyOffer","manageBuyOfferResult"],["pathPaymentStrictSend","pathPaymentStrictSendResult"],["createClaimableBalance","createClaimableBalanceResult"],["claimClaimableBalance","claimClaimableBalanceResult"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesResult"],["endSponsoringFutureReserves","endSponsoringFutureReservesResult"],["revokeSponsorship","revokeSponsorshipResult"],["clawback","clawbackResult"],["clawbackClaimableBalance","clawbackClaimableBalanceResult"],["setTrustLineFlags","setTrustLineFlagsResult"],["liquidityPoolDeposit","liquidityPoolDepositResult"],["liquidityPoolWithdraw","liquidityPoolWithdrawResult"],["invokeHostFunction","invokeHostFunctionResult"],["extendFootprintTtl","extendFootprintTtlResult"],["restoreFootprint","restoreFootprintResult"]],arms:{createAccountResult:e.lookup("CreateAccountResult"),paymentResult:e.lookup("PaymentResult"),pathPaymentStrictReceiveResult:e.lookup("PathPaymentStrictReceiveResult"),manageSellOfferResult:e.lookup("ManageSellOfferResult"),createPassiveSellOfferResult:e.lookup("ManageSellOfferResult"),setOptionsResult:e.lookup("SetOptionsResult"),changeTrustResult:e.lookup("ChangeTrustResult"),allowTrustResult:e.lookup("AllowTrustResult"),accountMergeResult:e.lookup("AccountMergeResult"),inflationResult:e.lookup("InflationResult"),manageDataResult:e.lookup("ManageDataResult"),bumpSeqResult:e.lookup("BumpSequenceResult"),manageBuyOfferResult:e.lookup("ManageBuyOfferResult"),pathPaymentStrictSendResult:e.lookup("PathPaymentStrictSendResult"),createClaimableBalanceResult:e.lookup("CreateClaimableBalanceResult"),claimClaimableBalanceResult:e.lookup("ClaimClaimableBalanceResult"),beginSponsoringFutureReservesResult:e.lookup("BeginSponsoringFutureReservesResult"),endSponsoringFutureReservesResult:e.lookup("EndSponsoringFutureReservesResult"),revokeSponsorshipResult:e.lookup("RevokeSponsorshipResult"),clawbackResult:e.lookup("ClawbackResult"),clawbackClaimableBalanceResult:e.lookup("ClawbackClaimableBalanceResult"),setTrustLineFlagsResult:e.lookup("SetTrustLineFlagsResult"),liquidityPoolDepositResult:e.lookup("LiquidityPoolDepositResult"),liquidityPoolWithdrawResult:e.lookup("LiquidityPoolWithdrawResult"),invokeHostFunctionResult:e.lookup("InvokeHostFunctionResult"),extendFootprintTtlResult:e.lookup("ExtendFootprintTtlResult"),restoreFootprintResult:e.lookup("RestoreFootprintResult")}}),e.union("OperationResult",{switchOn:e.lookup("OperationResultCode"),switchName:"code",switches:[["opInner","tr"],["opBadAuth",e.void()],["opNoAccount",e.void()],["opNotSupported",e.void()],["opTooManySubentries",e.void()],["opExceededWorkLimit",e.void()],["opTooManySponsoring",e.void()]],arms:{tr:e.lookup("OperationResultTr")}}),e.enum("TransactionResultCode",{txFeeBumpInnerSuccess:1,txSuccess:0,txFailed:-1,txTooEarly:-2,txTooLate:-3,txMissingOperation:-4,txBadSeq:-5,txBadAuth:-6,txInsufficientBalance:-7,txNoAccount:-8,txInsufficientFee:-9,txBadAuthExtra:-10,txInternalError:-11,txNotSupported:-12,txFeeBumpInnerFailed:-13,txBadSponsorship:-14,txBadMinSeqAgeOrGap:-15,txMalformed:-16,txSorobanInvalid:-17}),e.union("InnerTransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("InnerTransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("InnerTransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("InnerTransactionResultResult")],["ext",e.lookup("InnerTransactionResultExt")]]),e.struct("InnerTransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("InnerTransactionResult")]]),e.union("TransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txFeeBumpInnerSuccess","innerResultPair"],["txFeeBumpInnerFailed","innerResultPair"],["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{innerResultPair:e.lookup("InnerTransactionResultPair"),results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("TransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("TransactionResultResult")],["ext",e.lookup("TransactionResultExt")]]),e.typedef("Hash",e.opaque(32)),e.typedef("Uint256",e.opaque(32)),e.typedef("Uint32",e.uint()),e.typedef("Int32",e.int()),e.typedef("Uint64",e.uhyper()),e.typedef("Int64",e.hyper()),e.typedef("TimePoint",e.lookup("Uint64")),e.typedef("Duration",e.lookup("Uint64")),e.union("ExtensionPoint",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.enum("CryptoKeyType",{keyTypeEd25519:0,keyTypePreAuthTx:1,keyTypeHashX:2,keyTypeEd25519SignedPayload:3,keyTypeMuxedEd25519:256}),e.enum("PublicKeyType",{publicKeyTypeEd25519:0}),e.enum("SignerKeyType",{signerKeyTypeEd25519:0,signerKeyTypePreAuthTx:1,signerKeyTypeHashX:2,signerKeyTypeEd25519SignedPayload:3}),e.union("PublicKey",{switchOn:e.lookup("PublicKeyType"),switchName:"type",switches:[["publicKeyTypeEd25519","ed25519"]],arms:{ed25519:e.lookup("Uint256")}}),e.struct("SignerKeyEd25519SignedPayload",[["ed25519",e.lookup("Uint256")],["payload",e.varOpaque(64)]]),e.union("SignerKey",{switchOn:e.lookup("SignerKeyType"),switchName:"type",switches:[["signerKeyTypeEd25519","ed25519"],["signerKeyTypePreAuthTx","preAuthTx"],["signerKeyTypeHashX","hashX"],["signerKeyTypeEd25519SignedPayload","ed25519SignedPayload"]],arms:{ed25519:e.lookup("Uint256"),preAuthTx:e.lookup("Uint256"),hashX:e.lookup("Uint256"),ed25519SignedPayload:e.lookup("SignerKeyEd25519SignedPayload")}}),e.typedef("Signature",e.varOpaque(64)),e.typedef("SignatureHint",e.opaque(4)),e.typedef("NodeId",e.lookup("PublicKey")),e.typedef("AccountId",e.lookup("PublicKey")),e.typedef("ContractId",e.lookup("Hash")),e.struct("Curve25519Secret",[["key",e.opaque(32)]]),e.struct("Curve25519Public",[["key",e.opaque(32)]]),e.struct("HmacSha256Key",[["key",e.opaque(32)]]),e.struct("HmacSha256Mac",[["mac",e.opaque(32)]]),e.struct("ShortHashSeed",[["seed",e.opaque(16)]]),e.enum("BinaryFuseFilterType",{binaryFuseFilter8Bit:0,binaryFuseFilter16Bit:1,binaryFuseFilter32Bit:2}),e.struct("SerializedBinaryFuseFilter",[["type",e.lookup("BinaryFuseFilterType")],["inputHashSeed",e.lookup("ShortHashSeed")],["filterSeed",e.lookup("ShortHashSeed")],["segmentLength",e.lookup("Uint32")],["segementLengthMask",e.lookup("Uint32")],["segmentCount",e.lookup("Uint32")],["segmentCountLength",e.lookup("Uint32")],["fingerprintLength",e.lookup("Uint32")],["fingerprints",e.varOpaque()]]),e.typedef("PoolId",e.lookup("Hash")),e.enum("ClaimableBalanceIdType",{claimableBalanceIdTypeV0:0}),e.union("ClaimableBalanceId",{switchOn:e.lookup("ClaimableBalanceIdType"),switchName:"type",switches:[["claimableBalanceIdTypeV0","v0"]],arms:{v0:e.lookup("Hash")}}),e.enum("ScValType",{scvBool:0,scvVoid:1,scvError:2,scvU32:3,scvI32:4,scvU64:5,scvI64:6,scvTimepoint:7,scvDuration:8,scvU128:9,scvI128:10,scvU256:11,scvI256:12,scvBytes:13,scvString:14,scvSymbol:15,scvVec:16,scvMap:17,scvAddress:18,scvContractInstance:19,scvLedgerKeyContractInstance:20,scvLedgerKeyNonce:21}),e.enum("ScErrorType",{sceContract:0,sceWasmVm:1,sceContext:2,sceStorage:3,sceObject:4,sceCrypto:5,sceEvents:6,sceBudget:7,sceValue:8,sceAuth:9}),e.enum("ScErrorCode",{scecArithDomain:0,scecIndexBounds:1,scecInvalidInput:2,scecMissingValue:3,scecExistingValue:4,scecExceededLimit:5,scecInvalidAction:6,scecInternalError:7,scecUnexpectedType:8,scecUnexpectedSize:9}),e.union("ScError",{switchOn:e.lookup("ScErrorType"),switchName:"type",switches:[["sceContract","contractCode"],["sceWasmVm","code"],["sceContext","code"],["sceStorage","code"],["sceObject","code"],["sceCrypto","code"],["sceEvents","code"],["sceBudget","code"],["sceValue","code"],["sceAuth","code"]],arms:{contractCode:e.lookup("Uint32"),code:e.lookup("ScErrorCode")}}),e.struct("UInt128Parts",[["hi",e.lookup("Uint64")],["lo",e.lookup("Uint64")]]),e.struct("Int128Parts",[["hi",e.lookup("Int64")],["lo",e.lookup("Uint64")]]),e.struct("UInt256Parts",[["hiHi",e.lookup("Uint64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.struct("Int256Parts",[["hiHi",e.lookup("Int64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.enum("ContractExecutableType",{contractExecutableWasm:0,contractExecutableStellarAsset:1}),e.union("ContractExecutable",{switchOn:e.lookup("ContractExecutableType"),switchName:"type",switches:[["contractExecutableWasm","wasmHash"],["contractExecutableStellarAsset",e.void()]],arms:{wasmHash:e.lookup("Hash")}}),e.enum("ScAddressType",{scAddressTypeAccount:0,scAddressTypeContract:1,scAddressTypeMuxedAccount:2,scAddressTypeClaimableBalance:3,scAddressTypeLiquidityPool:4}),e.struct("MuxedEd25519Account",[["id",e.lookup("Uint64")],["ed25519",e.lookup("Uint256")]]),e.union("ScAddress",{switchOn:e.lookup("ScAddressType"),switchName:"type",switches:[["scAddressTypeAccount","accountId"],["scAddressTypeContract","contractId"],["scAddressTypeMuxedAccount","muxedAccount"],["scAddressTypeClaimableBalance","claimableBalanceId"],["scAddressTypeLiquidityPool","liquidityPoolId"]],arms:{accountId:e.lookup("AccountId"),contractId:e.lookup("ContractId"),muxedAccount:e.lookup("MuxedEd25519Account"),claimableBalanceId:e.lookup("ClaimableBalanceId"),liquidityPoolId:e.lookup("PoolId")}}),e.const("SCSYMBOL_LIMIT",32),e.typedef("ScVec",e.varArray(e.lookup("ScVal"),2147483647)),e.typedef("ScMap",e.varArray(e.lookup("ScMapEntry"),2147483647)),e.typedef("ScBytes",e.varOpaque()),e.typedef("ScString",e.string()),e.typedef("ScSymbol",e.string(32)),e.struct("ScNonceKey",[["nonce",e.lookup("Int64")]]),e.struct("ScContractInstance",[["executable",e.lookup("ContractExecutable")],["storage",e.option(e.lookup("ScMap"))]]),e.union("ScVal",{switchOn:e.lookup("ScValType"),switchName:"type",switches:[["scvBool","b"],["scvVoid",e.void()],["scvError","error"],["scvU32","u32"],["scvI32","i32"],["scvU64","u64"],["scvI64","i64"],["scvTimepoint","timepoint"],["scvDuration","duration"],["scvU128","u128"],["scvI128","i128"],["scvU256","u256"],["scvI256","i256"],["scvBytes","bytes"],["scvString","str"],["scvSymbol","sym"],["scvVec","vec"],["scvMap","map"],["scvAddress","address"],["scvContractInstance","instance"],["scvLedgerKeyContractInstance",e.void()],["scvLedgerKeyNonce","nonceKey"]],arms:{b:e.bool(),error:e.lookup("ScError"),u32:e.lookup("Uint32"),i32:e.lookup("Int32"),u64:e.lookup("Uint64"),i64:e.lookup("Int64"),timepoint:e.lookup("TimePoint"),duration:e.lookup("Duration"),u128:e.lookup("UInt128Parts"),i128:e.lookup("Int128Parts"),u256:e.lookup("UInt256Parts"),i256:e.lookup("Int256Parts"),bytes:e.lookup("ScBytes"),str:e.lookup("ScString"),sym:e.lookup("ScSymbol"),vec:e.option(e.lookup("ScVec")),map:e.option(e.lookup("ScMap")),address:e.lookup("ScAddress"),instance:e.lookup("ScContractInstance"),nonceKey:e.lookup("ScNonceKey")}}),e.struct("ScMapEntry",[["key",e.lookup("ScVal")],["val",e.lookup("ScVal")]]),e.enum("ScEnvMetaKind",{scEnvMetaKindInterfaceVersion:0}),e.struct("ScEnvMetaEntryInterfaceVersion",[["protocol",e.lookup("Uint32")],["preRelease",e.lookup("Uint32")]]),e.union("ScEnvMetaEntry",{switchOn:e.lookup("ScEnvMetaKind"),switchName:"kind",switches:[["scEnvMetaKindInterfaceVersion","interfaceVersion"]],arms:{interfaceVersion:e.lookup("ScEnvMetaEntryInterfaceVersion")}}),e.struct("ScMetaV0",[["key",e.string()],["val",e.string()]]),e.enum("ScMetaKind",{scMetaV0:0}),e.union("ScMetaEntry",{switchOn:e.lookup("ScMetaKind"),switchName:"kind",switches:[["scMetaV0","v0"]],arms:{v0:e.lookup("ScMetaV0")}}),e.const("SC_SPEC_DOC_LIMIT",1024),e.enum("ScSpecType",{scSpecTypeVal:0,scSpecTypeBool:1,scSpecTypeVoid:2,scSpecTypeError:3,scSpecTypeU32:4,scSpecTypeI32:5,scSpecTypeU64:6,scSpecTypeI64:7,scSpecTypeTimepoint:8,scSpecTypeDuration:9,scSpecTypeU128:10,scSpecTypeI128:11,scSpecTypeU256:12,scSpecTypeI256:13,scSpecTypeBytes:14,scSpecTypeString:16,scSpecTypeSymbol:17,scSpecTypeAddress:19,scSpecTypeMuxedAddress:20,scSpecTypeOption:1e3,scSpecTypeResult:1001,scSpecTypeVec:1002,scSpecTypeMap:1004,scSpecTypeTuple:1005,scSpecTypeBytesN:1006,scSpecTypeUdt:2e3}),e.struct("ScSpecTypeOption",[["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeResult",[["okType",e.lookup("ScSpecTypeDef")],["errorType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeVec",[["elementType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeMap",[["keyType",e.lookup("ScSpecTypeDef")],["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeTuple",[["valueTypes",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.struct("ScSpecTypeBytesN",[["n",e.lookup("Uint32")]]),e.struct("ScSpecTypeUdt",[["name",e.string(60)]]),e.union("ScSpecTypeDef",{switchOn:e.lookup("ScSpecType"),switchName:"type",switches:[["scSpecTypeVal",e.void()],["scSpecTypeBool",e.void()],["scSpecTypeVoid",e.void()],["scSpecTypeError",e.void()],["scSpecTypeU32",e.void()],["scSpecTypeI32",e.void()],["scSpecTypeU64",e.void()],["scSpecTypeI64",e.void()],["scSpecTypeTimepoint",e.void()],["scSpecTypeDuration",e.void()],["scSpecTypeU128",e.void()],["scSpecTypeI128",e.void()],["scSpecTypeU256",e.void()],["scSpecTypeI256",e.void()],["scSpecTypeBytes",e.void()],["scSpecTypeString",e.void()],["scSpecTypeSymbol",e.void()],["scSpecTypeAddress",e.void()],["scSpecTypeMuxedAddress",e.void()],["scSpecTypeOption","option"],["scSpecTypeResult","result"],["scSpecTypeVec","vec"],["scSpecTypeMap","map"],["scSpecTypeTuple","tuple"],["scSpecTypeBytesN","bytesN"],["scSpecTypeUdt","udt"]],arms:{option:e.lookup("ScSpecTypeOption"),result:e.lookup("ScSpecTypeResult"),vec:e.lookup("ScSpecTypeVec"),map:e.lookup("ScSpecTypeMap"),tuple:e.lookup("ScSpecTypeTuple"),bytesN:e.lookup("ScSpecTypeBytesN"),udt:e.lookup("ScSpecTypeUdt")}}),e.struct("ScSpecUdtStructFieldV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecUdtStructV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["fields",e.varArray(e.lookup("ScSpecUdtStructFieldV0"),40)]]),e.struct("ScSpecUdtUnionCaseVoidV0",[["doc",e.string(t)],["name",e.string(60)]]),e.struct("ScSpecUdtUnionCaseTupleV0",[["doc",e.string(t)],["name",e.string(60)],["type",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.enum("ScSpecUdtUnionCaseV0Kind",{scSpecUdtUnionCaseVoidV0:0,scSpecUdtUnionCaseTupleV0:1}),e.union("ScSpecUdtUnionCaseV0",{switchOn:e.lookup("ScSpecUdtUnionCaseV0Kind"),switchName:"kind",switches:[["scSpecUdtUnionCaseVoidV0","voidCase"],["scSpecUdtUnionCaseTupleV0","tupleCase"]],arms:{voidCase:e.lookup("ScSpecUdtUnionCaseVoidV0"),tupleCase:e.lookup("ScSpecUdtUnionCaseTupleV0")}}),e.struct("ScSpecUdtUnionV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtUnionCaseV0"),50)]]),e.struct("ScSpecUdtEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtEnumCaseV0"),50)]]),e.struct("ScSpecUdtErrorEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtErrorEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtErrorEnumCaseV0"),50)]]),e.struct("ScSpecFunctionInputV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecFunctionV0",[["doc",e.string(t)],["name",e.lookup("ScSymbol")],["inputs",e.varArray(e.lookup("ScSpecFunctionInputV0"),10)],["outputs",e.varArray(e.lookup("ScSpecTypeDef"),1)]]),e.enum("ScSpecEventParamLocationV0",{scSpecEventParamLocationData:0,scSpecEventParamLocationTopicList:1}),e.struct("ScSpecEventParamV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")],["location",e.lookup("ScSpecEventParamLocationV0")]]),e.enum("ScSpecEventDataFormat",{scSpecEventDataFormatSingleValue:0,scSpecEventDataFormatVec:1,scSpecEventDataFormatMap:2}),e.struct("ScSpecEventV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.lookup("ScSymbol")],["prefixTopics",e.varArray(e.lookup("ScSymbol"),2)],["params",e.varArray(e.lookup("ScSpecEventParamV0"),50)],["dataFormat",e.lookup("ScSpecEventDataFormat")]]),e.enum("ScSpecEntryKind",{scSpecEntryFunctionV0:0,scSpecEntryUdtStructV0:1,scSpecEntryUdtUnionV0:2,scSpecEntryUdtEnumV0:3,scSpecEntryUdtErrorEnumV0:4,scSpecEntryEventV0:5}),e.union("ScSpecEntry",{switchOn:e.lookup("ScSpecEntryKind"),switchName:"kind",switches:[["scSpecEntryFunctionV0","functionV0"],["scSpecEntryUdtStructV0","udtStructV0"],["scSpecEntryUdtUnionV0","udtUnionV0"],["scSpecEntryUdtEnumV0","udtEnumV0"],["scSpecEntryUdtErrorEnumV0","udtErrorEnumV0"],["scSpecEntryEventV0","eventV0"]],arms:{functionV0:e.lookup("ScSpecFunctionV0"),udtStructV0:e.lookup("ScSpecUdtStructV0"),udtUnionV0:e.lookup("ScSpecUdtUnionV0"),udtEnumV0:e.lookup("ScSpecUdtEnumV0"),udtErrorEnumV0:e.lookup("ScSpecUdtErrorEnumV0"),eventV0:e.lookup("ScSpecEventV0")}}),e.struct("ConfigSettingContractExecutionLanesV0",[["ledgerMaxTxCount",e.lookup("Uint32")]]),e.struct("ConfigSettingContractComputeV0",[["ledgerMaxInstructions",e.lookup("Int64")],["txMaxInstructions",e.lookup("Int64")],["feeRatePerInstructionsIncrement",e.lookup("Int64")],["txMemoryLimit",e.lookup("Uint32")]]),e.struct("ConfigSettingContractParallelComputeV0",[["ledgerMaxDependentTxClusters",e.lookup("Uint32")]]),e.struct("ConfigSettingContractLedgerCostV0",[["ledgerMaxDiskReadEntries",e.lookup("Uint32")],["ledgerMaxDiskReadBytes",e.lookup("Uint32")],["ledgerMaxWriteLedgerEntries",e.lookup("Uint32")],["ledgerMaxWriteBytes",e.lookup("Uint32")],["txMaxDiskReadEntries",e.lookup("Uint32")],["txMaxDiskReadBytes",e.lookup("Uint32")],["txMaxWriteLedgerEntries",e.lookup("Uint32")],["txMaxWriteBytes",e.lookup("Uint32")],["feeDiskReadLedgerEntry",e.lookup("Int64")],["feeWriteLedgerEntry",e.lookup("Int64")],["feeDiskRead1Kb",e.lookup("Int64")],["sorobanStateTargetSizeBytes",e.lookup("Int64")],["rentFee1KbSorobanStateSizeLow",e.lookup("Int64")],["rentFee1KbSorobanStateSizeHigh",e.lookup("Int64")],["sorobanStateRentFeeGrowthFactor",e.lookup("Uint32")]]),e.struct("ConfigSettingContractLedgerCostExtV0",[["txMaxFootprintEntries",e.lookup("Uint32")],["feeWrite1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractHistoricalDataV0",[["feeHistorical1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractEventsV0",[["txMaxContractEventsSizeBytes",e.lookup("Uint32")],["feeContractEvents1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractBandwidthV0",[["ledgerMaxTxsSizeBytes",e.lookup("Uint32")],["txMaxSizeBytes",e.lookup("Uint32")],["feeTxSize1Kb",e.lookup("Int64")]]),e.enum("ContractCostType",{wasmInsnExec:0,memAlloc:1,memCpy:2,memCmp:3,dispatchHostFunction:4,visitObject:5,valSer:6,valDeser:7,computeSha256Hash:8,computeEd25519PubKey:9,verifyEd25519Sig:10,vmInstantiation:11,vmCachedInstantiation:12,invokeVmFunction:13,computeKeccak256Hash:14,decodeEcdsaCurve256Sig:15,recoverEcdsaSecp256k1Key:16,int256AddSub:17,int256Mul:18,int256Div:19,int256Pow:20,int256Shift:21,chaCha20DrawBytes:22,parseWasmInstructions:23,parseWasmFunctions:24,parseWasmGlobals:25,parseWasmTableEntries:26,parseWasmTypes:27,parseWasmDataSegments:28,parseWasmElemSegments:29,parseWasmImports:30,parseWasmExports:31,parseWasmDataSegmentBytes:32,instantiateWasmInstructions:33,instantiateWasmFunctions:34,instantiateWasmGlobals:35,instantiateWasmTableEntries:36,instantiateWasmTypes:37,instantiateWasmDataSegments:38,instantiateWasmElemSegments:39,instantiateWasmImports:40,instantiateWasmExports:41,instantiateWasmDataSegmentBytes:42,sec1DecodePointUncompressed:43,verifyEcdsaSecp256r1Sig:44,bls12381EncodeFp:45,bls12381DecodeFp:46,bls12381G1CheckPointOnCurve:47,bls12381G1CheckPointInSubgroup:48,bls12381G2CheckPointOnCurve:49,bls12381G2CheckPointInSubgroup:50,bls12381G1ProjectiveToAffine:51,bls12381G2ProjectiveToAffine:52,bls12381G1Add:53,bls12381G1Mul:54,bls12381G1Msm:55,bls12381MapFpToG1:56,bls12381HashToG1:57,bls12381G2Add:58,bls12381G2Mul:59,bls12381G2Msm:60,bls12381MapFp2ToG2:61,bls12381HashToG2:62,bls12381Pairing:63,bls12381FrFromU256:64,bls12381FrToU256:65,bls12381FrAddSub:66,bls12381FrMul:67,bls12381FrPow:68,bls12381FrInv:69}),e.struct("ContractCostParamEntry",[["ext",e.lookup("ExtensionPoint")],["constTerm",e.lookup("Int64")],["linearTerm",e.lookup("Int64")]]),e.struct("StateArchivalSettings",[["maxEntryTtl",e.lookup("Uint32")],["minTemporaryTtl",e.lookup("Uint32")],["minPersistentTtl",e.lookup("Uint32")],["persistentRentRateDenominator",e.lookup("Int64")],["tempRentRateDenominator",e.lookup("Int64")],["maxEntriesToArchive",e.lookup("Uint32")],["liveSorobanStateSizeWindowSampleSize",e.lookup("Uint32")],["liveSorobanStateSizeWindowSamplePeriod",e.lookup("Uint32")],["evictionScanSize",e.lookup("Uint32")],["startingEvictionScanLevel",e.lookup("Uint32")]]),e.struct("EvictionIterator",[["bucketListLevel",e.lookup("Uint32")],["isCurrBucket",e.bool()],["bucketFileOffset",e.lookup("Uint64")]]),e.struct("ConfigSettingScpTiming",[["ledgerTargetCloseTimeMilliseconds",e.lookup("Uint32")],["nominationTimeoutInitialMilliseconds",e.lookup("Uint32")],["nominationTimeoutIncrementMilliseconds",e.lookup("Uint32")],["ballotTimeoutInitialMilliseconds",e.lookup("Uint32")],["ballotTimeoutIncrementMilliseconds",e.lookup("Uint32")]]),e.const("CONTRACT_COST_COUNT_LIMIT",1024),e.typedef("ContractCostParams",e.varArray(e.lookup("ContractCostParamEntry"),e.lookup("CONTRACT_COST_COUNT_LIMIT"))),e.enum("ConfigSettingId",{configSettingContractMaxSizeBytes:0,configSettingContractComputeV0:1,configSettingContractLedgerCostV0:2,configSettingContractHistoricalDataV0:3,configSettingContractEventsV0:4,configSettingContractBandwidthV0:5,configSettingContractCostParamsCpuInstructions:6,configSettingContractCostParamsMemoryBytes:7,configSettingContractDataKeySizeBytes:8,configSettingContractDataEntrySizeBytes:9,configSettingStateArchival:10,configSettingContractExecutionLanes:11,configSettingLiveSorobanStateSizeWindow:12,configSettingEvictionIterator:13,configSettingContractParallelComputeV0:14,configSettingContractLedgerCostExtV0:15,configSettingScpTiming:16}),e.union("ConfigSettingEntry",{switchOn:e.lookup("ConfigSettingId"),switchName:"configSettingId",switches:[["configSettingContractMaxSizeBytes","contractMaxSizeBytes"],["configSettingContractComputeV0","contractCompute"],["configSettingContractLedgerCostV0","contractLedgerCost"],["configSettingContractHistoricalDataV0","contractHistoricalData"],["configSettingContractEventsV0","contractEvents"],["configSettingContractBandwidthV0","contractBandwidth"],["configSettingContractCostParamsCpuInstructions","contractCostParamsCpuInsns"],["configSettingContractCostParamsMemoryBytes","contractCostParamsMemBytes"],["configSettingContractDataKeySizeBytes","contractDataKeySizeBytes"],["configSettingContractDataEntrySizeBytes","contractDataEntrySizeBytes"],["configSettingStateArchival","stateArchivalSettings"],["configSettingContractExecutionLanes","contractExecutionLanes"],["configSettingLiveSorobanStateSizeWindow","liveSorobanStateSizeWindow"],["configSettingEvictionIterator","evictionIterator"],["configSettingContractParallelComputeV0","contractParallelCompute"],["configSettingContractLedgerCostExtV0","contractLedgerCostExt"],["configSettingScpTiming","contractScpTiming"]],arms:{contractMaxSizeBytes:e.lookup("Uint32"),contractCompute:e.lookup("ConfigSettingContractComputeV0"),contractLedgerCost:e.lookup("ConfigSettingContractLedgerCostV0"),contractHistoricalData:e.lookup("ConfigSettingContractHistoricalDataV0"),contractEvents:e.lookup("ConfigSettingContractEventsV0"),contractBandwidth:e.lookup("ConfigSettingContractBandwidthV0"),contractCostParamsCpuInsns:e.lookup("ContractCostParams"),contractCostParamsMemBytes:e.lookup("ContractCostParams"),contractDataKeySizeBytes:e.lookup("Uint32"),contractDataEntrySizeBytes:e.lookup("Uint32"),stateArchivalSettings:e.lookup("StateArchivalSettings"),contractExecutionLanes:e.lookup("ConfigSettingContractExecutionLanesV0"),liveSorobanStateSizeWindow:e.varArray(e.lookup("Uint64"),2147483647),evictionIterator:e.lookup("EvictionIterator"),contractParallelCompute:e.lookup("ConfigSettingContractParallelComputeV0"),contractLedgerCostExt:e.lookup("ConfigSettingContractLedgerCostExtV0"),contractScpTiming:e.lookup("ConfigSettingScpTiming")}}),e.struct("LedgerCloseMetaBatch",[["startSequence",e.lookup("Uint32")],["endSequence",e.lookup("Uint32")],["ledgerCloseMeta",e.varArray(e.lookup("LedgerCloseMeta"),2147483647)]])});const i=o,a={XdrWriter:n.XdrWriter,XdrReader:n.XdrReader};var s=r(2802);function u(e){var t=new s.sha256;return t.update(e,"utf8"),t.digest()}const c="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function l(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function f(e,...t){if(!l(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function p(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function d(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const y="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,m=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function g(e){if(f(e),y)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=m[e[r]];return t}function v(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function b(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(y)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=v(e.charCodeAt(o)),i=v(e.charCodeAt(o+1));if(void 0===r||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+i}return n}function w(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function S(e){return"string"==typeof e&&(e=w(e)),f(e),e}function E(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];f(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}class T{}function k(e=32){if(c&&"function"==typeof c.getRandomValues)return c.getRandomValues(new Uint8Array(e));if(c&&"function"==typeof c.randomBytes)return Uint8Array.from(c.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}class O extends T{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=h(this.buffer)}update(e){p(this),f(e=S(e));const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){const a=Math.min(n-this.pos,o-i);if(a===n){const t=h(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){p(this),function(e,t){f(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,d(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),s=Number(r&i),u=n?4:0,c=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+c,s,n)}(r,n-8,BigInt(8*this.length),o),this.process(r,0);const a=h(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=s/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)a.setUint32(4*e,c[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=a,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const A=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),_=BigInt(2**32-1),x=BigInt(32);function P(e,t=!1){return t?{h:Number(e&_),l:Number(e>>x&_)}:{h:0|Number(e>>x&_),l:0|Number(e&_)}}const I=(e,t,r)=>e>>>r,R=(e,t,r)=>e<<32-r|t>>>r,B=(e,t,r)=>e>>>r|t<<32-r,C=(e,t,r)=>e<<32-r|t>>>r,j=(e,t,r)=>e<<64-r|t>>>r-32,U=(e,t,r)=>e>>>r-32|t<<64-r;function N(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}const L=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),D=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,F=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),M=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,V=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),q=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,H=function(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){const{h:r,l:a}=P(e[i],t);[n[i],o[i]]=[r,a]}return[n,o]}(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),z=H[0],K=H[1],X=new Uint32Array(80),$=new Uint32Array(80);class G extends O{constructor(e=64){super(128,e,16,!1),this.Ah=0|A[0],this.Al=0|A[1],this.Bh=0|A[2],this.Bl=0|A[3],this.Ch=0|A[4],this.Cl=0|A[5],this.Dh=0|A[6],this.Dl=0|A[7],this.Eh=0|A[8],this.El=0|A[9],this.Fh=0|A[10],this.Fl=0|A[11],this.Gh=0|A[12],this.Gl=0|A[13],this.Hh=0|A[14],this.Hl=0|A[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:o,Cl:i,Dh:a,Dl:s,Eh:u,El:c,Fh:l,Fl:f,Gh:p,Gl:d,Hh:h,Hl:y}=this;return[e,t,r,n,o,i,a,s,u,c,l,f,p,d,h,y]}set(e,t,r,n,o,i,a,s,u,c,l,f,p,d,h,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|f,this.Gh=0|p,this.Gl=0|d,this.Hh=0|h,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)X[r]=e.getUint32(t),$[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|X[e-15],r=0|$[e-15],n=B(t,r,1)^B(t,r,8)^I(t,0,7),o=C(t,r,1)^C(t,r,8)^R(t,r,7),i=0|X[e-2],a=0|$[e-2],s=B(i,a,19)^j(i,a,61)^I(i,0,6),u=C(i,a,19)^U(i,a,61)^R(i,a,6),c=F(o,u,$[e-7],$[e-16]),l=M(c,n,s,X[e-7],X[e-16]);X[e]=0|l,$[e]=0|c}let{Ah:r,Al:n,Bh:o,Bl:i,Ch:a,Cl:s,Dh:u,Dl:c,Eh:l,El:f,Fh:p,Fl:d,Gh:h,Gl:y,Hh:m,Hl:g}=this;for(let e=0;e<80;e++){const t=B(l,f,14)^B(l,f,18)^j(l,f,41),v=C(l,f,14)^C(l,f,18)^U(l,f,41),b=l&p^~l&h,w=V(g,v,f&d^~f&y,K[e],$[e]),S=q(w,m,t,b,z[e],X[e]),E=0|w,T=B(r,n,28)^j(r,n,34)^j(r,n,39),k=C(r,n,28)^U(r,n,34)^U(r,n,39),O=r&o^r&a^o&a,A=n&i^n&s^i&s;m=0|h,g=0|y,h=0|p,y=0|d,p=0|l,d=0|f,({h:l,l:f}=N(0|u,0|c,0|S,0|E)),u=0|a,c=0|s,a=0|o,s=0|i,o=0|r,i=0|n;const _=L(E,k,A);r=D(_,S,T,O),n=0|_}({h:r,l:n}=N(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:i}=N(0|this.Bh,0|this.Bl,0|o,0|i)),({h:a,l:s}=N(0|this.Ch,0|this.Cl,0|a,0|s)),({h:u,l:c}=N(0|this.Dh,0|this.Dl,0|u,0|c)),({h:l,l:f}=N(0|this.Eh,0|this.El,0|l,0|f)),({h:p,l:d}=N(0|this.Fh,0|this.Fl,0|p,0|d)),({h,l:y}=N(0|this.Gh,0|this.Gl,0|h,0|y)),({h:m,l:g}=N(0|this.Hh,0|this.Hl,0|m,0|g)),this.set(r,n,o,i,a,s,u,c,l,f,p,d,h,y,m,g)}roundClean(){d(X,$)}destroy(){d(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const W=function(e){const t=t=>e().update(S(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}(()=>new G),Q=BigInt(0),Z=BigInt(1);function Y(e,t=""){if("boolean"!=typeof e)throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e}function J(e,t,r=""){const n=l(e),o=e?.length,i=void 0!==t;if(!n||i&&o!==t)throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(i?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e));return e}function ee(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?Q:BigInt("0x"+e)}function te(e){return f(e),ee(g(Uint8Array.from(e).reverse()))}function re(e,t){return b(e.toString(16).padStart(2*t,"0"))}function ne(e,t,r){let n;if("string"==typeof t)try{n=b(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!l(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function oe(e){return Uint8Array.from(e)}const ie=e=>"bigint"==typeof e&&Q<=e;function ae(e,t,r,n){if(!function(e,t,r){return ie(e)&&ie(t)&&ie(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}const se=e=>(Z<<BigInt(e))-Z;function ue(e,t,r={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function n(t,r,n){const o=e[t];if(n&&void 0===o)return;const i=typeof o;if(i!==r||null===o)throw new Error(`param "${t}" is invalid: expected ${r}, got ${i}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}const ce=()=>{throw new Error("not implemented")};function le(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(void 0!==o)return o;const i=e(r,...n);return t.set(r,i),i}}const fe=BigInt(0),pe=BigInt(1),de=BigInt(2),he=BigInt(3),ye=BigInt(4),me=BigInt(5),ge=BigInt(7),ve=BigInt(8),be=BigInt(9),we=BigInt(16);function Se(e,t){const r=e%t;return r>=fe?r:t+r}function Ee(e,t,r){let n=e;for(;t-- >fe;)n*=n,n%=r;return n}function Te(e,t){if(e===fe)throw new Error("invert: expected non-zero number");if(t<=fe)throw new Error("invert: expected positive modulus, got "+t);let r=Se(e,t),n=t,o=fe,i=pe,a=pe,s=fe;for(;r!==fe;){const e=n/r,t=n%r,u=o-a*e,c=i-s*e;n=r,r=t,o=a,i=s,a=u,s=c}if(n!==pe)throw new Error("invert: does not exist");return Se(o,t)}function ke(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function Oe(e,t){const r=(e.ORDER+pe)/ye,n=e.pow(t,r);return ke(e,n,t),n}function Ae(e,t){const r=(e.ORDER-me)/ve,n=e.mul(t,de),o=e.pow(n,r),i=e.mul(t,o),a=e.mul(e.mul(i,de),o),s=e.mul(i,e.sub(a,e.ONE));return ke(e,s,t),s}function _e(e){if(e<he)throw new Error("sqrt is not defined for small field");let t=e-pe,r=0;for(;t%de===fe;)t/=de,r++;let n=de;const o=Ce(e);for(;1===Re(o,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return Oe;let i=o.pow(n,t);const a=(t+pe)/de;return function(e,n){if(e.is0(n))return n;if(1!==Re(e,n))throw new Error("Cannot find square root");let o=r,s=e.mul(e.ONE,i),u=e.pow(n,t),c=e.pow(n,a);for(;!e.eql(u,e.ONE);){if(e.is0(u))return e.ZERO;let t=1,r=e.sqr(u);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===o)throw new Error("Cannot find square root");const n=pe<<BigInt(o-t-1),i=e.pow(s,n);o=t,s=e.sqr(i),u=e.mul(u,s),c=e.mul(c,i)}return c}}const xe=(e,t)=>(Se(e,t)&pe)===pe,Pe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ie(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((t,r,o)=>e.is0(r)?t:(n[o]=t,e.mul(t,r)),e.ONE),i=e.inv(o);return t.reduceRight((t,r,o)=>e.is0(r)?t:(n[o]=e.mul(t,n[o]),e.mul(t,r)),i),n}function Re(e,t){const r=(e.ORDER-pe)/de,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),a=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!a)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function Be(e,t){void 0!==t&&function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Ce(e,t,r=!1,n={}){if(e<=fe)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,i,a,s=!1;if("object"==typeof t&&null!=t){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(i=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(s=e.modFromBytes),a=e.allowedLengths}else"number"==typeof t&&(o=t),n.sqrt&&(i=n.sqrt);const{nBitLength:u,nByteLength:c}=Be(e,o);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const f=Object.freeze({ORDER:e,isLE:r,BITS:u,BYTES:c,MASK:se(u),ZERO:fe,ONE:pe,allowedLengths:a,create:t=>Se(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return fe<=t&&t<e},is0:e=>e===fe,isValidNot0:e=>!f.is0(e)&&f.isValid(e),isOdd:e=>(e&pe)===pe,neg:t=>Se(-t,e),eql:(e,t)=>e===t,sqr:t=>Se(t*t,e),add:(t,r)=>Se(t+r,e),sub:(t,r)=>Se(t-r,e),mul:(t,r)=>Se(t*r,e),pow:(e,t)=>function(e,t,r){if(r<fe)throw new Error("invalid exponent, negatives unsupported");if(r===fe)return e.ONE;if(r===pe)return t;let n=e.ONE,o=t;for(;r>fe;)r&pe&&(n=e.mul(n,o)),o=e.sqr(o),r>>=pe;return n}(f,e,t),div:(t,r)=>Se(t*Te(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Te(t,e),sqrt:i||(t=>(l||(l=function(e){return e%ye===he?Oe:e%ve===me?Ae:e%we===be?function(e){const t=Ce(e),r=_e(e),n=r(t,t.neg(t.ONE)),o=r(t,n),i=r(t,t.neg(n)),a=(e+ge)/we;return(e,t)=>{let r=e.pow(t,a),s=e.mul(r,n);const u=e.mul(r,o),c=e.mul(r,i),l=e.eql(e.sqr(s),t),f=e.eql(e.sqr(u),t);r=e.cmov(r,s,l),s=e.cmov(c,u,f);const p=e.eql(e.sqr(s),t),d=e.cmov(r,s,p);return ke(e,d,t),d}}(e):_e(e)}(e)),l(f,t))),toBytes:e=>r?re(e,c).reverse():re(e,c),fromBytes:(t,n=!0)=>{if(a){if(!a.includes(t.length)||t.length>c)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+t.length);const e=new Uint8Array(c);e.set(t,r?0:e.length-t.length),t=e}if(t.length!==c)throw new Error("Field.fromBytes: expected "+c+" bytes, got "+t.length);let o=r?te(t):function(e){return ee(g(e))}(t);if(s&&(o=Se(o,e)),!n&&!f.isValid(o))throw new Error("invalid field element: outside of range 0..ORDER");return o},invertBatch:e=>Ie(f,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(f)}const je=BigInt(0),Ue=BigInt(1);function Ne(e,t){const r=t.negate();return e?r:t}function Le(e,t){const r=Ie(e.Fp,t.map(e=>e.Z));return t.map((t,n)=>e.fromAffine(t.toAffine(r[n])))}function De(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Fe(e,t){De(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:se(e),maxNumber:r,shiftBy:BigInt(e)}}function Me(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:a}=r;let s=Number(e&o),u=e>>a;s>n&&(s-=i,u+=Ue);const c=t*n;return{nextN:u,offset:c+Math.abs(s)-1,isZero:0===s,isNeg:s<0,isNegF:t%2!=0,offsetF:c}}const Ve=new WeakMap,qe=new WeakMap;function He(e){return qe.get(e)||1}function ze(e){if(e!==je)throw new Error("invalid wNAF")}class Ke{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>je;)t&Ue&&(r=r.add(n)),n=n.double(),t>>=Ue;return r}precomputeWindow(e,t){const{windows:r,windowSize:n}=Fe(t,this.bits),o=[];let i=e,a=i;for(let e=0;e<r;e++){a=i,o.push(a);for(let e=1;e<n;e++)a=a.add(i),o.push(a);i=a.double()}return o}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE;const i=Fe(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:a,offset:s,isZero:u,isNeg:c,isNegF:l,offsetF:f}=Me(r,e,i);r=a,u?o=o.add(Ne(l,t[f])):n=n.add(Ne(c,t[s]))}return ze(r),{p:n,f:o}}wNAFUnsafe(e,t,r,n=this.ZERO){const o=Fe(e,this.bits);for(let e=0;e<o.windows&&r!==je;e++){const{nextN:i,offset:a,isZero:s,isNeg:u}=Me(r,e,o);if(r=i,!s){const e=t[a];n=n.add(u?e.negate():e)}}return ze(r),n}getPrecomputes(e,t,r){let n=Ve.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),Ve.set(t,n))),n}cached(e,t,r){const n=He(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){const o=He(e);return 1===o?this._unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)}createCache(e,t){De(t,this.bits),qe.set(e,t),Ve.delete(e)}hasCache(e){return 1!==He(e)}}function Xe(e,t,r,n){(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})})(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,s=function(e){let t;for(t=0;e>Q;e>>=Z,t+=1);return t}(BigInt(o));let u=1;s>12?u=s-3:s>4?u=s-2:s>0&&(u=2);const c=se(u),l=new Array(Number(c)+1).fill(a);let f=a;for(let e=Math.floor((t.BITS-1)/u)*u;e>=0;e-=u){l.fill(a);for(let t=0;t<i;t++){const o=n[t],i=Number(o>>BigInt(e)&c);l[i]=l[i].add(r[t])}let t=a;for(let e=l.length-1,r=a;e>0;e--)r=r.add(l[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<u;e++)f=f.double()}return f}function $e(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){ue(e,Pe.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"}))}(t),t}return Ce(e,{isLE:r})}const Ge=BigInt(0),We=BigInt(1),Qe=BigInt(2),Ze=BigInt(8);class Ye{constructor(e){this.ep=e}static fromBytes(e){ce()}static fromHex(e){ce()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return g(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.init(this.ep.precompute(e,t))}toRawBytes(){return this.toBytes()}}function Je(e){const{CURVE:t,curveOpts:r,hash:n,eddsaOpts:o}=function(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r={Fp:e.Fp,Fn:Ce(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},n={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:r,hash:e.hash,eddsaOpts:n}}(e);return function(e,t){const r=t.Point;return Object.assign({},t,{ExtendedPoint:r,CURVE:e,nBitLength:r.Fn.BITS,nByteLength:r.Fn.BYTES})}(e,function(e,t,r={}){if("function"!=typeof t)throw new Error('"hash" function param is required');ue(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:n}=r,{BASE:o,Fp:i,Fn:a}=e,s=r.randomBytes||k,u=r.adjustScalarBytes||(e=>e),c=r.domain||((e,t,r)=>{if(Y(r,"phflag"),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function f(e){return a.create(te(e))}function p(e){const{head:r,prefix:n,scalar:i}=function(e){const r=g.secretKey;e=ne("private key",e,r);const n=ne("hashed private key",t(e),2*r),o=u(n.slice(0,r));return{head:o,prefix:n.slice(r,2*r),scalar:f(o)}}(e),a=o.multiply(i),s=a.toBytes();return{head:r,prefix:n,scalar:i,point:a,pointBytes:s}}function d(e){return p(e).pointBytes}function h(e=Uint8Array.of(),...r){const o=E(...r);return f(t(c(o,ne("context",e),!!n)))}const y={zip215:!0},m=i.BYTES,g={secretKey:m,publicKey:m,signature:2*m,seed:m};function v(e=s(g.seed)){return J(e,g.seed,"seed")}const b={getExtendedPublicKey:p,randomSecretKey:v,isValidSecretKey:function(e){return l(e)&&e.length===a.BYTES},isValidPublicKey:function(t,r){try{return!!e.fromBytes(t,r)}catch(e){return!1}},toMontgomery(t){const{y:r}=e.fromBytes(t),n=g.publicKey,o=32===n;if(!o&&57!==n)throw new Error("only defined for 25519 and 448");const a=o?i.div(We+r,We-r):i.div(r-We,r+We);return i.toBytes(a)},toMontgomeryPriv(e){const r=g.secretKey;J(e,r);const n=t(e.subarray(0,r));return u(n).subarray(0,r)},randomPrivateKey:v,precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)};return Object.freeze({keygen:function(e){const t=b.randomSecretKey(e);return{secretKey:t,publicKey:d(t)}},getPublicKey:d,sign:function(e,t,r={}){e=ne("message",e),n&&(e=n(e));const{prefix:i,scalar:s,pointBytes:u}=p(t),c=h(r.context,i,e),l=o.multiply(c).toBytes(),f=h(r.context,l,u,e),d=a.create(c+f*s);if(!a.isValid(d))throw new Error("sign failed: invalid s");return J(E(l,a.toBytes(d)),g.signature,"result")},verify:function(t,r,i,a=y){const{context:s,zip215:u}=a,c=g.signature;t=ne("signature",t,c),r=ne("message",r),i=ne("publicKey",i,g.publicKey),void 0!==u&&Y(u,"zip215"),n&&(r=n(r));const l=c/2,f=t.subarray(0,l),p=te(t.subarray(l,c));let d,m,v;try{d=e.fromBytes(i,u),m=e.fromBytes(f,u),v=o.multiplyUnsafe(p)}catch(e){return!1}if(!u&&d.isSmallOrder())return!1;const b=h(s,m.toBytes(),d.toBytes(),r);return m.add(d.multiplyUnsafe(b)).subtract(v).clearCofactor().is0()},utils:b,Point:e,lengths:g})}(function(e,t={}){const r=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>je))throw new Error(`CURVE.${e} must be positive bigint`)}const o=$e(t.p,r.Fp,n),i=$e(t.n,r.Fn,n),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}}("edwards",e,t,t.FpFnLE),{Fp:n,Fn:o}=r;let i=r.CURVE;const{h:a}=i;ue(t,{},{uvRatio:"function"});const s=Qe<<BigInt(8*o.BYTES)-We,u=e=>n.create(e),c=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(n.div(e,t))}}catch(e){return{isValid:!1,value:Ge}}});if(!function(e,t,r,n){const o=e.sqr(r),i=e.sqr(n),a=e.add(e.mul(t.a,o),i),s=e.add(e.ONE,e.mul(t.d,e.mul(o,i)));return e.eql(a,s)}(n,i,i.Gx,i.Gy))throw new Error("bad curve params: generator point");function l(e,t,r=!1){return ae("coordinate "+e,t,r?We:Ge,s),t}function f(e){if(!(e instanceof h))throw new Error("ExtendedPoint expected")}const p=le((e,t)=>{const{X:r,Y:o,Z:i}=e,a=e.is0();null==t&&(t=a?Ze:n.inv(i));const s=u(r*t),c=u(o*t),l=n.mul(i,t);if(a)return{x:Ge,y:We};if(l!==We)throw new Error("invZ was invalid");return{x:s,y:c}}),d=le(e=>{const{a:t,d:r}=i;if(e.is0())throw new Error("bad point: ZERO");const{X:n,Y:o,Z:a,T:s}=e,c=u(n*n),l=u(o*o),f=u(a*a),p=u(f*f),d=u(c*t);if(u(f*u(d+l))!==u(p+u(r*u(c*l))))throw new Error("bad point: equation left != right (1)");if(u(n*o)!==u(a*s))throw new Error("bad point: equation left != right (2)");return!0});class h{constructor(e,t,r,n){this.X=l("x",e),this.Y=l("y",t),this.Z=l("z",r,!0),this.T=l("t",n),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){if(e instanceof h)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return l("x",t),l("y",r),new h(t,r,We,u(t*r))}static fromBytes(e,t=!1){const r=n.BYTES,{a:o,d:a}=i;e=oe(J(e,r,"point")),Y(t,"zip215");const l=oe(e),f=e[r-1];l[r-1]=-129&f;const p=te(l),d=t?s:n.ORDER;ae("point.y",p,Ge,d);const y=u(p*p),m=u(y-We),g=u(a*y-o);let{isValid:v,value:b}=c(m,g);if(!v)throw new Error("bad point: invalid y coordinate");const w=(b&We)===We,S=!!(128&f);if(!t&&b===Ge&&S)throw new Error("bad point: x=0 and x_0=1");return S!==w&&(b=u(-b)),h.fromAffine({x:b,y:p})}static fromHex(e,t=!1){return h.fromBytes(ne("point",e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return y.createCache(this,e),t||this.multiply(Qe),this}assertValidity(){d(this)}equals(e){f(e);const{X:t,Y:r,Z:n}=this,{X:o,Y:i,Z:a}=e,s=u(t*a),c=u(o*n),l=u(r*a),p=u(i*n);return s===c&&l===p}is0(){return this.equals(h.ZERO)}negate(){return new h(u(-this.X),this.Y,this.Z,u(-this.T))}double(){const{a:e}=i,{X:t,Y:r,Z:n}=this,o=u(t*t),a=u(r*r),s=u(Qe*u(n*n)),c=u(e*o),l=t+r,f=u(u(l*l)-o-a),p=c+a,d=p-s,y=c-a,m=u(f*d),g=u(p*y),v=u(f*y),b=u(d*p);return new h(m,g,b,v)}add(e){f(e);const{a:t,d:r}=i,{X:n,Y:o,Z:a,T:s}=this,{X:c,Y:l,Z:p,T:d}=e,y=u(n*c),m=u(o*l),g=u(s*r*d),v=u(a*p),b=u((n+o)*(c+l)-y-m),w=v-g,S=v+g,E=u(m-t*y),T=u(b*w),k=u(S*E),O=u(b*E),A=u(w*S);return new h(T,k,A,O)}subtract(e){return this.add(e.negate())}multiply(e){if(!o.isValidNot0(e))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:t,f:r}=y.cached(this,e,e=>Le(h,e));return Le(h,[t,r])[0]}multiplyUnsafe(e,t=h.ZERO){if(!o.isValid(e))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return e===Ge?h.ZERO:this.is0()||e===We?this:y.unsafe(this,e,e=>Le(h,e),t)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return y.unsafe(this,i.n).is0()}toAffine(e){return p(this,e)}clearCofactor(){return a===We?this:this.multiplyUnsafe(a)}toBytes(){const{x:e,y:t}=this.toAffine(),r=n.toBytes(t);return r[r.length-1]|=e&We?128:0,r}toHex(){return g(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(e){return Le(h,e)}static msm(e,t){return Xe(h,o,e,t)}_setWindowSize(e){this.precompute(e)}toRawBytes(){return this.toBytes()}}h.BASE=new h(i.Gx,i.Gy,We,u(i.Gx*i.Gy)),h.ZERO=new h(Ge,We,We,Ge),h.Fp=n,h.Fn=o;const y=new Ke(h,o.BITS);return h.BASE.precompute(8),h}(t,r),n,o))}w("HashToScalar-");const et=BigInt(0),tt=BigInt(1),rt=BigInt(2),nt=(BigInt(3),BigInt(5)),ot=BigInt(8),it=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),at={p:it,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:ot,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function st(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const ut=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function ct(e,t){const r=it,n=Se(t*t*t,r),o=Se(n*n*t,r);let i=Se(e*n*function(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=it,a=e*e%i*e%i,s=Ee(a,rt,i)*a%i,u=Ee(s,tt,i)*e%i,c=Ee(u,nt,i)*u%i,l=Ee(c,t,i)*c%i,f=Ee(l,r,i)*l%i,p=Ee(f,n,i)*f%i,d=Ee(p,o,i)*p%i,h=Ee(d,o,i)*p%i,y=Ee(h,t,i)*c%i;return{pow_p_5_8:Ee(y,rt,i)*e%i,b2:a}}(e*o).pow_p_5_8,r);const a=Se(t*i*i,r),s=i,u=Se(i*ut,r),c=a===e,l=a===Se(-e,r),f=a===Se(-e*ut,r);return c&&(i=s),(l||f)&&(i=u),xe(i,r)&&(i=Se(-i,r)),{isValid:c||l,value:i}}const lt=Ce(at.p,{isLE:!0}),ft=Ce(at.n,{isLE:!0}),pt=Je({...at,Fp:lt,hash:W,adjustScalarBytes:st,uvRatio:ct}),dt=ut,ht=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),yt=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),mt=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),gt=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),vt=e=>ct(tt,e),bt=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),wt=e=>pt.Point.Fp.create(te(e)&bt);function St(e){const{d:t}=at,r=it,n=e=>lt.create(e),o=n(dt*e*e),i=n((o+tt)*mt);let a=BigInt(-1);const s=n((a-t*o)*n(o+t));let{isValid:u,value:c}=ct(i,s),l=n(c*e);xe(l,r)||(l=n(-l)),u||(c=l),u||(a=o);const f=n(a*(o-tt)*gt-s),p=c*c,d=n((c+c)*s),h=n(f*ht),y=n(tt-p),m=n(tt+p);return new pt.Point(n(d*m),n(y*h),n(h*m),n(d*y))}class Et extends Ye{constructor(e){super(e)}static fromAffine(e){return new Et(pt.Point.fromAffine(e))}assertSame(e){if(!(e instanceof Et))throw new Error("RistrettoPoint expected")}init(e){return new Et(e)}static hashToCurve(e){return function(e){f(e,64);const t=St(wt(e.subarray(0,32))),r=St(wt(e.subarray(32,64)));return new Et(t.add(r))}(ne("ristrettoHash",e,64))}static fromBytes(e){f(e,32);const{a:t,d:r}=at,n=it,o=e=>lt.create(e),i=wt(e);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(lt.toBytes(i),e)||xe(i,n))throw new Error("invalid ristretto255 encoding 1");const a=o(i*i),s=o(tt+t*a),u=o(tt-t*a),c=o(s*s),l=o(u*u),p=o(t*r*c-l),{isValid:d,value:h}=vt(o(p*l)),y=o(h*u),m=o(h*y*p);let g=o((i+i)*y);xe(g,n)&&(g=o(-g));const v=o(s*m),b=o(g*v);if(!d||xe(b,n)||v===et)throw new Error("invalid ristretto255 encoding 2");return new Et(new pt.Point(g,v,tt,b))}static fromHex(e){return Et.fromBytes(ne("ristrettoHex",e,32))}static msm(e,t){return Xe(Et,pt.Point.Fn,e,t)}toBytes(){let{X:e,Y:t,Z:r,T:n}=this.ep;const o=it,i=e=>lt.create(e),a=i(i(r+t)*i(r-t)),s=i(e*t),u=i(s*s),{value:c}=vt(i(a*u)),l=i(c*a),f=i(c*s),p=i(l*f*n);let d;if(xe(n*p,o)){let r=i(t*dt),n=i(e*dt);e=r,t=n,d=i(l*yt)}else d=f;xe(e*p,o)&&(t=i(-t));let h=i((r-t)*d);return xe(h,o)&&(h=i(-h)),lt.toBytes(h)}equals(e){this.assertSame(e);const{X:t,Y:r}=this.ep,{X:n,Y:o}=e.ep,i=e=>lt.create(e),a=i(t*o)===i(r*n),s=i(r*o)===i(t*n);return a||s}is0(){return this.equals(Et.ZERO)}}Et.BASE=new Et(pt.Point.BASE),Et.ZERO=new Et(pt.Point.ZERO),Et.Fp=lt,Et.Fn=ft;var Tt=r(8287).Buffer;function kt(e,t){return Tt.from(pt.sign(Tt.from(e),t))}function Ot(e,t,r){return pt.verify(Tt.from(t),Tt.from(e),Tt.from(r),{zip215:!1})}var At=function(e,t){for(var r="number"==typeof e,n=String(e);n.endsWith(t);)n=n.slice(0,-1);return r?Number(n):n},_t=r(5360),xt=r(8287).Buffer;function Pt(e){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(e)}function It(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rt(n.key),n)}}function Rt(e){var t=function(e){if("object"!=Pt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Pt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pt(t)?t:t+""}var Bt,Ct,jt,Ut={ed25519PublicKey:48,ed25519SecretSeed:144,med25519PublicKey:96,preAuthTx:152,sha256Hash:184,signedPayload:120,contract:16,liquidityPool:88,claimableBalance:8},Nt={G:"ed25519PublicKey",S:"ed25519SecretSeed",M:"med25519PublicKey",T:"preAuthTx",X:"sha256Hash",P:"signedPayload",C:"contract",L:"liquidityPool",B:"claimableBalance"},Lt=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"encodeEd25519PublicKey",value:function(e){return Mt("ed25519PublicKey",e)}},{key:"decodeEd25519PublicKey",value:function(e){return Ft("ed25519PublicKey",e)}},{key:"isValidEd25519PublicKey",value:function(e){return Dt("ed25519PublicKey",e)}},{key:"encodeEd25519SecretSeed",value:function(e){return Mt("ed25519SecretSeed",e)}},{key:"decodeEd25519SecretSeed",value:function(e){return Ft("ed25519SecretSeed",e)}},{key:"isValidEd25519SecretSeed",value:function(e){return Dt("ed25519SecretSeed",e)}},{key:"encodeMed25519PublicKey",value:function(e){return Mt("med25519PublicKey",e)}},{key:"decodeMed25519PublicKey",value:function(e){return Ft("med25519PublicKey",e)}},{key:"isValidMed25519PublicKey",value:function(e){return Dt("med25519PublicKey",e)}},{key:"encodePreAuthTx",value:function(e){return Mt("preAuthTx",e)}},{key:"decodePreAuthTx",value:function(e){return Ft("preAuthTx",e)}},{key:"encodeSha256Hash",value:function(e){return Mt("sha256Hash",e)}},{key:"decodeSha256Hash",value:function(e){return Ft("sha256Hash",e)}},{key:"encodeSignedPayload",value:function(e){return Mt("signedPayload",e)}},{key:"decodeSignedPayload",value:function(e){return Ft("signedPayload",e)}},{key:"isValidSignedPayload",value:function(e){return Dt("signedPayload",e)}},{key:"encodeContract",value:function(e){return Mt("contract",e)}},{key:"decodeContract",value:function(e){return Ft("contract",e)}},{key:"isValidContract",value:function(e){return Dt("contract",e)}},{key:"encodeClaimableBalance",value:function(e){return Mt("claimableBalance",e)}},{key:"decodeClaimableBalance",value:function(e){return Ft("claimableBalance",e)}},{key:"isValidClaimableBalance",value:function(e){return Dt("claimableBalance",e)}},{key:"encodeLiquidityPool",value:function(e){return Mt("liquidityPool",e)}},{key:"decodeLiquidityPool",value:function(e){return Ft("liquidityPool",e)}},{key:"isValidLiquidityPool",value:function(e){return Dt("liquidityPool",e)}},{key:"getVersionByteForPrefix",value:function(e){return Nt[e[0]]}}],t&&It(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Dt(e,t){if("string"!=typeof t)return!1;switch(e){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":case"liquidityPool":if(56!==t.length)return!1;break;case"claimableBalance":if(58!==t.length)return!1;break;case"med25519PublicKey":if(69!==t.length)return!1;break;case"signedPayload":if(t.length<56||t.length>165)return!1;break;default:return!1}var r="";try{r=Ft(e,t)}catch(e){return!1}switch(e){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":case"liquidityPool":return 32===r.length;case"claimableBalance":return 33===r.length;case"med25519PublicKey":return 40===r.length;case"signedPayload":return r.length>=40&&r.length<=100;default:return!1}}function Ft(e,t){if("string"!=typeof t)throw new TypeError("encoded argument must be of type String");var r=_t.decode(t),n=r[0],o=r.slice(0,-2),i=o.slice(1),a=r.slice(-2);if(t!==_t.encode(r))throw new Error("invalid encoded string");var s=Ut[e];if(void 0===s)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(Ut).join(", ")));if(n!==s)throw new Error("invalid version byte. expected ".concat(s,", got ").concat(n));if(!function(e,t){if(e.length!==t.length)return!1;if(0===e.length)return!0;for(var r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}(Vt(o),a))throw new Error("invalid checksum");return xt.from(i)}function Mt(e,t){if(null==t)throw new Error("cannot encode null data");var r=Ut[e];if(void 0===r)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(Ut).join(", ")));t=xt.from(t);var n=xt.from([r]),o=xt.concat([n,t]),i=xt.from(Vt(o)),a=xt.concat([o,i]);return _t.encode(a)}function Vt(e){for(var t=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],r=0,n=0;n<e.length;n+=1)r=r<<8^t[r>>8^e[n]],r&=65535;var o=new Uint8Array(2);return o[0]=255&r,o[1]=r>>8&255,o}Bt=Lt,jt=Nt,(Ct=Rt(Ct="types"))in Bt?Object.defineProperty(Bt,Ct,{value:jt,enumerable:!0,configurable:!0,writable:!0}):Bt[Ct]=jt;var qt=r(8287).Buffer;function Ht(e){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht(e)}function zt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Kt(n.key),n)}}function Kt(e){var t=function(e){if("object"!=Ht(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ht(t)?t:t+""}var Xt=function(e,t,r){return t&&zt(e.prototype,t),r&&zt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"ed25519"!==t.type)throw new Error("Invalid keys type");if(this.type=t.type,t.secretKey){if(t.secretKey=qt.from(t.secretKey),32!==t.secretKey.length)throw new Error("secretKey length is invalid");if(this._secretSeed=t.secretKey,this._publicKey=(r=t.secretKey,Tt.from(pt.getPublicKey(r))),this._secretKey=t.secretKey,t.publicKey&&!this._publicKey.equals(qt.from(t.publicKey)))throw new Error("secretKey does not match publicKey")}else if(this._publicKey=qt.from(t.publicKey),32!==this._publicKey.length)throw new Error("publicKey length is invalid");var r},[{key:"xdrAccountId",value:function(){return new i.AccountId.publicKeyTypeEd25519(this._publicKey)}},{key:"xdrPublicKey",value:function(){return new i.PublicKey.publicKeyTypeEd25519(this._publicKey)}},{key:"xdrMuxedAccount",value:function(e){if(void 0!==e){if("string"!=typeof e)throw new TypeError("expected string for ID, got ".concat(Ht(e)));return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromString(e),ed25519:this._publicKey}))}return new i.MuxedAccount.keyTypeEd25519(this._publicKey)}},{key:"rawPublicKey",value:function(){return this._publicKey}},{key:"signatureHint",value:function(){var e=this.xdrAccountId().toXDR();return e.slice(e.length-4)}},{key:"publicKey",value:function(){return Lt.encodeEd25519PublicKey(this._publicKey)}},{key:"secret",value:function(){if(!this._secretSeed)throw new Error("no secret key available");if("ed25519"===this.type)return Lt.encodeEd25519SecretSeed(this._secretSeed);throw new Error("Invalid Keypair type")}},{key:"rawSecretKey",value:function(){return this._secretSeed}},{key:"canSign",value:function(){return!!this._secretKey}},{key:"sign",value:function(e){if(!this.canSign())throw new Error("cannot sign: no secret key available");return kt(e,this._secretKey)}},{key:"verify",value:function(e,t){return Ot(e,t,this._publicKey)}},{key:"signDecorated",value:function(e){var t=this.sign(e),r=this.signatureHint();return new i.DecoratedSignature({hint:r,signature:t})}},{key:"signPayloadDecorated",value:function(e){var t=this.sign(e),r=this.signatureHint(),n=qt.from(e.slice(-4));return n.length<4&&(n=qt.concat([n,qt.alloc(4-e.length,0)])),new i.DecoratedSignature({hint:n.map(function(e,t){return e^r[t]}),signature:t})}}],[{key:"fromSecret",value:function(e){var t=Lt.decodeEd25519SecretSeed(e);return this.fromRawEd25519Seed(t)}},{key:"fromRawEd25519Seed",value:function(e){return new this({type:"ed25519",secretKey:e})}},{key:"master",value:function(e){if(!e)throw new Error("No network selected. Please pass a network argument, e.g. `Keypair.master(Networks.PUBLIC)`.");return this.fromRawEd25519Seed(u(e))}},{key:"fromPublicKey",value:function(e){if(32!==(e=Lt.decodeEd25519PublicKey(e)).length)throw new Error("Invalid Stellar public key");return new this({type:"ed25519",publicKey:e})}},{key:"random",value:function(){var e=pt.utils.randomPrivateKey();return this.fromRawEd25519Seed(e)}}]),$t=r(8287).Buffer;function Gt(e){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gt(e)}function Wt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qt(n.key),n)}}function Qt(e){var t=function(e){if("object"!=Gt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gt(t)?t:t+""}var Zt=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!/^[a-zA-Z0-9]{1,12}$/.test(t))throw new Error("Asset code is invalid (maximum alphanumeric, 12 characters at max)");if("xlm"!==String(t).toLowerCase()&&!r)throw new Error("Issuer cannot be null");if(r&&!Lt.isValidEd25519PublicKey(r))throw new Error("Issuer is invalid");"xlm"===String(t).toLowerCase()?this.code="XLM":this.code=t,this.issuer=r}return function(e,t,r){return t&&Wt(e.prototype,t),r&&Wt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"toXDRObject",value:function(){return this._toXDRObject(i.Asset)}},{key:"toChangeTrustXDRObject",value:function(){return this._toXDRObject(i.ChangeTrustAsset)}},{key:"toTrustLineXDRObject",value:function(){return this._toXDRObject(i.TrustLineAsset)}},{key:"contractId",value:function(e){var t=u($t.from(e)),r=i.HashIdPreimage.envelopeTypeContractId(new i.HashIdPreimageContractId({networkId:t,contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAsset(this.toXDRObject())}));return Lt.encodeContract(u(r.toXDR()))}},{key:"_toXDRObject",value:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.Asset;if(this.isNative())return r.assetTypeNative();this.code.length<=4?(e=i.AlphaNum4,t="assetTypeCreditAlphanum4"):(e=i.AlphaNum12,t="assetTypeCreditAlphanum12");var n=this.code.length<=4?4:12;return new r(t,new e({assetCode:this.code.padEnd(n,"\0"),issuer:Xt.fromPublicKey(this.issuer).xdrAccountId()}))}},{key:"getCode",value:function(){if(void 0!==this.code)return String(this.code)}},{key:"getIssuer",value:function(){if(void 0!==this.issuer)return String(this.issuer)}},{key:"getAssetType",value:function(){switch(this.getRawAssetType().value){case i.AssetType.assetTypeNative().value:return"native";case i.AssetType.assetTypeCreditAlphanum4().value:return"credit_alphanum4";case i.AssetType.assetTypeCreditAlphanum12().value:return"credit_alphanum12";default:return"unknown"}}},{key:"getRawAssetType",value:function(){return this.isNative()?i.AssetType.assetTypeNative():this.code.length<=4?i.AssetType.assetTypeCreditAlphanum4():i.AssetType.assetTypeCreditAlphanum12()}},{key:"isNative",value:function(){return!this.issuer}},{key:"equals",value:function(e){return this.code===e.getCode()&&this.issuer===e.getIssuer()}},{key:"toString",value:function(){return this.isNative()?"native":"".concat(this.getCode(),":").concat(this.getIssuer())}}],[{key:"native",value:function(){return new e("XLM")}},{key:"fromOperation",value:function(e){var t,r;switch(e.switch()){case i.AssetType.assetTypeNative():return this.native();case i.AssetType.assetTypeCreditAlphanum4():t=e.alphaNum4();case i.AssetType.assetTypeCreditAlphanum12():return t=t||e.alphaNum12(),r=Lt.encodeEd25519PublicKey(t.issuer().ed25519()),new this(At(t.assetCode(),"\0"),r);default:throw new Error("Invalid asset type: ".concat(e.switch().name))}}},{key:"compare",value:function(t,r){if(!(t&&t instanceof e))throw new Error("assetA is invalid");if(!(r&&r instanceof e))throw new Error("assetB is invalid");if(t.equals(r))return 0;var n=t.getRawAssetType().value,o=r.getRawAssetType().value;if(n!==o)return n<o?-1:1;var i=Yt(t.getCode(),r.getCode());return 0!==i?i:Yt(t.getIssuer(),r.getIssuer())}}])}();function Yt(e,t){return $t.compare($t.from(e,"ascii"),$t.from(t,"ascii"))}var Jt=r(8287).Buffer,er=30;function tr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("constant_product"!==e)throw new Error("liquidityPoolType is invalid");var r=t.assetA,n=t.assetB,o=t.fee;if(!(r&&r instanceof Zt))throw new Error("assetA is invalid");if(!(n&&n instanceof Zt))throw new Error("assetB is invalid");if(!o||o!==er)throw new Error("fee is invalid");if(-1!==Zt.compare(r,n))throw new Error("Assets are not in lexicographic order");var a=i.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(),s=new i.LiquidityPoolConstantProductParameters({assetA:r.toXDRObject(),assetB:n.toXDRObject(),fee:o}).toXDR();return u(Jt.concat([a,s]))}var rr=r(8287).Buffer;function nr(e){return nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nr(e)}function or(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ir(n.key),n)}}function ir(e){var t=function(e){if("object"!=nr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=nr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nr(t)?t:t+""}var ar=function(e,t){return t&&or(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r,n,o){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof o)throw new Error("Invalid passphrase provided to Transaction: expected a string but got a ".concat(nr(o)));this._networkPassphrase=o,this._tx=t,this._signatures=r,this._fee=n},[{key:"signatures",get:function(){return this._signatures},set:function(e){throw new Error("Transaction is immutable")}},{key:"tx",get:function(){return this._tx},set:function(e){throw new Error("Transaction is immutable")}},{key:"fee",get:function(){return this._fee},set:function(e){throw new Error("Transaction is immutable")}},{key:"networkPassphrase",get:function(){return this._networkPassphrase},set:function(e){this._networkPassphrase=e}},{key:"sign",value:function(){for(var e=this,t=this.hash(),r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];n.forEach(function(r){var n=r.signDecorated(t);e.signatures.push(n)})}},{key:"getKeypairSignature",value:function(e){return e.sign(this.hash()).toString("base64")}},{key:"addSignature",value:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!n||"string"!=typeof n)throw new Error("Invalid signature");if(!r||"string"!=typeof r)throw new Error("Invalid publicKey");var o=rr.from(n,"base64");try{t=(e=Xt.fromPublicKey(r)).signatureHint()}catch(e){throw new Error("Invalid publicKey")}if(!e.verify(this.hash(),o))throw new Error("Invalid signature");this.signatures.push(new i.DecoratedSignature({hint:t,signature:o}))}},{key:"addDecoratedSignature",value:function(e){this.signatures.push(e)}},{key:"signHashX",value:function(e){if("string"==typeof e&&(e=rr.from(e,"hex")),e.length>64)throw new Error("preimage cannnot be longer than 64 bytes");var t=e,r=u(e),n=r.slice(r.length-4);this.signatures.push(new i.DecoratedSignature({hint:n,signature:t}))}},{key:"hash",value:function(){return u(this.signatureBase())}},{key:"signatureBase",value:function(){throw new Error("Implement in subclass")}},{key:"toEnvelope",value:function(){throw new Error("Implement in subclass")}},{key:"toXDR",value:function(){return this.toEnvelope().toXDR().toString("base64")}}]),sr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ur=Math.ceil,cr=Math.floor,lr="[BigNumber Error] ",fr=lr+"Number primitive has more than 15 significant digits: ",pr=1e14,dr=14,hr=9007199254740991,yr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],mr=1e7,gr=1e9;function vr(e){var t=0|e;return e>0||e===t?t:t-1}function br(e){for(var t,r,n=1,o=e.length,i=e[0]+"";n<o;){for(t=e[n++]+"",r=dr-t.length;r--;t="0"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function wr(e,t){var r,n,o=e.c,i=t.c,a=e.s,s=t.s,u=e.e,c=t.e;if(!a||!s)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function Sr(e,t,r,n){if(e<t||e>r||e!==cr(e))throw Error(lr+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Er(e){var t=e.c.length-1;return vr(e.e/dr)==t&&e.c[t]%2!=0}function Tr(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function kr(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Or=function e(t){var r,n,o,i,a,s,u,c,l,f,p=A.prototype={constructor:A,toString:null,valueOf:null},d=new A(1),h=20,y=4,m=-7,g=21,v=-1e7,b=1e7,w=!1,S=1,E=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz",O=!0;function A(e,t){var r,i,a,s,u,c,l,f,p=this;if(!(p instanceof A))return new A(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>b?p.c=p.e=null:e.e<v?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,u=e;u>=10;u/=10,s++);return void(s>b?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!sr.test(f=String(e)))return o(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(s<0&&(s=u),s+=+f.slice(u+1),f=f.substring(0,u)):s<0&&(s=f.length)}else{if(Sr(t,2,k.length,"Base"),10==t&&O)return I(p=new A(e),h+p.e+1,y);if(f=String(e),c="number"==typeof e){if(0*e!=0)return o(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,A.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(fr+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=k.slice(0,t),s=u=0,l=f.length;u<l;u++)if(r.indexOf(i=f.charAt(u))<0){if("."==i){if(u>s){s=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,u=-1,s=0;continue}return o(p,String(e),c,t)}c=!1,(s=(f=n(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(u=0;48===f.charCodeAt(u);u++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(u,++l)){if(l-=u,c&&A.DEBUG&&l>15&&(e>hr||e!==cr(e)))throw Error(fr+p.s*e);if((s=s-u-1)>b)p.c=p.e=null;else if(s<v)p.c=[p.e=0];else{if(p.e=s,p.c=[],u=(s+1)%dr,s<0&&(u+=dr),u<l){for(u&&p.c.push(+f.slice(0,u)),l-=dr;u<l;)p.c.push(+f.slice(u,u+=dr));u=dr-(f=f.slice(u)).length}else u-=l;for(;u--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function _(e,t,r,n){var o,i,a,s,u;if(null==r?r=y:Sr(r,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)u=br(e.c),u=1==n||2==n&&(a<=m||a>=g)?Tr(u,a):kr(u,a,"0");else if(i=(e=I(new A(e),t,r)).e,s=(u=br(e.c)).length,1==n||2==n&&(t<=i||i<=m)){for(;s<t;u+="0",s++);u=Tr(u,i)}else if(t-=a+(2===n&&i>a),u=kr(u,i,"0"),i+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function x(e,t){for(var r,n,o=1,i=new A(e[0]);o<e.length;o++)(!(n=new A(e[o])).s||(r=wr(i,n))===t||0===r&&i.s===t)&&(i=n);return i}function P(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*dr-1)>b?e.c=e.e=null:r<v?e.c=[e.e=0]:(e.e=r,e.c=t),e}function I(e,t,r,n){var o,i,a,s,u,c,l,f=e.c,p=yr;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=dr,a=t,u=f[c=0],l=cr(u/p[o-a-1]%10);else if((c=ur((i+1)/dr))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));u=l=0,o=1,a=(i%=dr)-dr+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);l=(a=(i%=dr)-dr+o)<0?0:cr(u/p[o-a-1]%10)}if(n=n||t<0||null!=f[c+1]||(a<0?u:u%p[o-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(dr-t%dr)%dr],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[dr-i],f[c]=a>0?cr(u/p[o-a]%p[a])*s:0),n)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==pr&&(f[0]=1));break}if(f[c]+=s,f[c]!=pr)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>b?e.c=e.e=null:e.e<v&&(e.c=[e.e=0])}return e}function R(e){var t,r=e.e;return null===r?e.toString():(t=br(e.c),t=r<=m||r>=g?Tr(t,r):kr(t,r,"0"),e.s<0?"-"+t:t)}return A.clone=e,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(lr+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(Sr(r=e[t],0,gr,t),h=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(Sr(r=e[t],0,8,t),y=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(Sr(r[0],-gr,0,t),Sr(r[1],0,gr,t),m=r[0],g=r[1]):(Sr(r,-gr,gr,t),m=-(g=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)Sr(r[0],-gr,-1,t),Sr(r[1],1,gr,t),v=r[0],b=r[1];else{if(Sr(r,-gr,gr,t),!r)throw Error(lr+t+" cannot be zero: "+r);v=-(b=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(lr+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!r,Error(lr+"crypto unavailable");w=r}else w=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(Sr(r=e[t],0,9,t),S=r),e.hasOwnProperty(t="POW_PRECISION")&&(Sr(r=e[t],0,gr,t),E=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(lr+t+" not an object: "+r);T=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(lr+t+" invalid: "+r);O="0123456789"==r.slice(0,10),k=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:y,EXPONENTIAL_AT:[m,g],RANGE:[v,b],CRYPTO:w,MODULO_MODE:S,POW_PRECISION:E,FORMAT:T,ALPHABET:k}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-gr&&o<=gr&&o===cr(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%dr)<1&&(t+=dr),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=pr||r!==cr(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(lr+"Invalid BigNumber: "+e)},A.maximum=A.max=function(){return x(arguments,-1)},A.minimum=A.min=function(){return x(arguments,1)},A.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return cr(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,u=[],c=new A(d);if(null==e?e=h:Sr(e,0,gr),o=ur(e/dr),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(u.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw w=!1,Error(lr+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(u.push(i%1e14),s+=7);s=o/7}if(!w)for(;s<o;)(i=a())<9e15&&(u[s++]=i%1e14);for(o=u[--s],e%=dr,o&&e&&(i=yr[dr-e],u[s]=cr(o/i)*i);0===u[s];u.pop(),s--);if(s<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=dr);for(s=1,i=u[0];i>=10;i/=10,s++);s<dr&&(n-=dr-s)}return c.e=n,c.c=u,c}),A.sum=function(){for(var e=1,t=arguments,r=new A(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var o,i,a=[0],s=0,u=e.length;s<u;){for(i=a.length;i--;a[i]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>r-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,p,d,m,g,v=n.indexOf("."),b=h,w=y;for(v>=0&&(f=E,E=0,n=n.replace(".",""),d=(g=new A(o)).pow(n.length-v),E=f,g.c=t(kr(br(d.c),d.e,"0"),10,i,e),g.e=g.c.length),l=f=(m=t(n,o,i,s?(u=k,e):(u=e,k))).length;0==m[--f];m.pop());if(!m[0])return u.charAt(0);if(v<0?--l:(d.c=m,d.e=l,d.s=a,m=(d=r(d,g,b,w,i)).c,p=d.r,l=d.e),v=m[c=l+b+1],f=i/2,p=p||c<0||null!=m[c+1],p=w<4?(null!=v||p)&&(0==w||w==(d.s<0?3:2)):v>f||v==f&&(4==w||p||6==w&&1&m[c-1]||w==(d.s<0?8:7)),c<1||!m[0])n=p?kr(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(m.length=c,p)for(--i;++m[--c]>i;)m[c]=0,c||(++l,m=[1].concat(m));for(f=m.length;!m[--f];);for(v=0,n="";v<=f;n+=u.charAt(m[v++]));n=kr(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%mr,l=t/mr|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%mr)+(n=l*i+(a=e[u]/mr|0)*c)%mr*mr+s)/r|0)+(n/mr|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,i,a,s){var u,c,l,f,p,d,h,y,m,g,v,b,w,S,E,T,k,O=n.s==o.s?1:-1,_=n.c,x=o.c;if(!(_&&_[0]&&x&&x[0]))return new A(n.s&&o.s&&(_?!x||_[0]!=x[0]:x)?_&&0==_[0]||!x?0*O:O/0:NaN);for(m=(y=new A(O)).c=[],O=i+(c=n.e-o.e)+1,s||(s=pr,c=vr(n.e/dr)-vr(o.e/dr),O=O/dr|0),l=0;x[l]==(_[l]||0);l++);if(x[l]>(_[l]||0)&&c--,O<0)m.push(1),f=!0;else{for(S=_.length,T=x.length,l=0,O+=2,(p=cr(s/(x[0]+1)))>1&&(x=e(x,p,s),_=e(_,p,s),T=x.length,S=_.length),w=T,v=(g=_.slice(0,T)).length;v<T;g[v++]=0);k=x.slice(),k=[0].concat(k),E=x[0],x[1]>=s/2&&E++;do{if(p=0,(u=t(x,g,T,v))<0){if(b=g[0],T!=v&&(b=b*s+(g[1]||0)),(p=cr(b/E))>1)for(p>=s&&(p=s-1),h=(d=e(x,p,s)).length,v=g.length;1==t(d,g,h,v);)p--,r(d,T<h?k:x,h,s),h=d.length,u=1;else 0==p&&(u=p=1),h=(d=x.slice()).length;if(h<v&&(d=[0].concat(d)),r(g,d,v,s),v=g.length,-1==u)for(;t(x,g,T,v)<1;)p++,r(g,T<v?k:x,v,s),v=g.length}else 0===u&&(p++,g=[0]);m[l++]=p,g[0]?g[v++]=_[w]||0:(g=[_[w]],v=1)}while((w++<S||null!=g[0])&&O--);f=null!=g[0],m[0]||m.splice(0,1)}if(s==pr){for(l=1,O=m[0];O>=10;O/=10,l++);I(y,i+(y.e=l+c*dr-1)+1,a,f)}else y.e=c,y.r=+f;return y}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(f,"");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(s,function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t}),n&&(o=n,i=i.replace(u,"$1").replace(c,"0.$1")),t!=i))return new A(i,o);if(A.DEBUG)throw Error(lr+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},p.absoluteValue=p.abs=function(){var e=new A(this);return e.s<0&&(e.s=1),e},p.comparedTo=function(e,t){return wr(this,new A(e,t))},p.decimalPlaces=p.dp=function(e,t){var r,n,o,i=this;if(null!=e)return Sr(e,0,gr),null==t?t=y:Sr(t,0,8),I(new A(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-vr(this.e/dr))*dr,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},p.dividedBy=p.div=function(e,t){return r(this,new A(e,t),h,y)},p.dividedToIntegerBy=p.idiv=function(e,t){return r(this,new A(e,t),0,1)},p.exponentiatedBy=p.pow=function(e,t){var r,n,o,i,a,s,u,c,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(lr+"Exponent not an integer: "+R(e));if(null!=t&&(t=new A(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new A(Math.pow(+R(l),a?e.s*(2-Er(e)):+R(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(NaN);(n=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&Er(e)?-0:0,l.e>-1&&(i=1/i),new A(s?1/i:i);E&&(i=ur(E/dr+2))}for(a?(r=new A(.5),s&&(e.s=1),u=Er(e)):u=(o=Math.abs(+R(e)))%2,c=new A(d);;){if(u){if(!(c=c.times(l)).c)break;i?c.c.length>i&&(c.c.length=i):n&&(c=c.mod(t))}if(o){if(0===(o=cr(o/2)))break;u=o%2}else if(I(e=e.times(r),e.e+1,1),e.e>14)u=Er(e);else{if(0===(o=+R(e)))break;u=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}return n?c:(s&&(c=d.div(c)),t?c.mod(t):i?I(c,E,y,void 0):c)},p.integerValue=function(e){var t=new A(this);return null==e?e=y:Sr(e,0,8),I(t,t.e+1,e)},p.isEqualTo=p.eq=function(e,t){return 0===wr(this,new A(e,t))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(e,t){return wr(this,new A(e,t))>0},p.isGreaterThanOrEqualTo=p.gte=function(e,t){return 1===(t=wr(this,new A(e,t)))||0===t},p.isInteger=function(){return!!this.c&&vr(this.e/dr)>this.c.length-2},p.isLessThan=p.lt=function(e,t){return wr(this,new A(e,t))<0},p.isLessThanOrEqualTo=p.lte=function(e,t){return-1===(t=wr(this,new A(e,t)))||0===t},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new A(e,t)).s,!s||!t)return new A(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/dr,c=e.e/dr,l=a.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new A(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new A(l[0]?a:3==y?-0:0)}if(u=vr(u),c=vr(c),l=l.slice(),s=u-c){for((i=s<0)?(s=-s,o=l):(c=u,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(l[t]!=f[t]){i=l[t]<f[t];break}if(i&&(o=l,l=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=pr-1;n>s;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=pr}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?P(e,l,c):(e.s=3==y?-1:1,e.c=[e.e=0],e)},p.modulo=p.mod=function(e,t){var n,o,i=this;return e=new A(e,t),!i.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||i.c&&!i.c[0]?new A(i):(9==S?(o=e.s,e.s=1,n=r(i,e,0,3),e.s=o,n.s*=o):n=r(i,e,0,S),(e=i.minus(n.times(e))).c[0]||1!=S||(e.s=i.s),e)},p.multipliedBy=p.times=function(e,t){var r,n,o,i,a,s,u,c,l,f,p,d,h,y,m,g=this,v=g.c,b=(e=new A(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!g.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=g.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=vr(g.e/dr)+vr(e.e/dr),e.s*=g.s,(u=v.length)<(f=b.length)&&(h=v,v=b,b=h,o=u,u=f,f=o),o=u+f,h=[];o--;h.push(0));for(y=pr,m=mr,o=f;--o>=0;){for(r=0,p=b[o]%m,d=b[o]/m|0,i=o+(a=u);i>o;)r=((c=p*(c=v[--a]%m)+(s=d*c+(l=v[a]/m|0)*p)%m*m+h[i]+r)/y|0)+(s/m|0)+d*l,h[i--]=c%y;h[i]=r}return r?++n:h.splice(0,1),P(e,h,n)},p.negated=function(){var e=new A(this);return e.s=-e.s||null,e},p.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new A(e,t)).s,!o||!t)return new A(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/dr,a=e.e/dr,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new A(o/0);if(!s[0]||!u[0])return u[0]?e:new A(s[0]?n:0*o)}if(i=vr(i),a=vr(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/pr|0,s[t]=pr===s[t]?0:s[t]%pr;return o&&(s=[o].concat(s),++a),P(e,s,a)},p.precision=p.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return Sr(e,1,gr),null==t?t=y:Sr(t,0,8),I(new A(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*dr+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},p.shiftedBy=function(e){return Sr(e,-9007199254740991,hr),this.times("1e"+e)},p.squareRoot=p.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=h+4,f=new A("0.5");if(1!==u||!s||!s[0])return new A(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+R(a)))||u==1/0?(((t=br(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=vr((c+1)/2)-(c<0||c%2),n=new A(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new A(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),br(i.c).slice(0,u)===(t=br(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(I(n,n.e+h+2,1),e=!n.times(n).eq(a));break}if(!o&&(I(i,i.e+h+2,0),i.times(i).eq(a))){n=i;break}l+=4,u+=4,o=1}return I(n,n.e+h+1,y,e)},p.toExponential=function(e,t){return null!=e&&(Sr(e,0,gr),e++),_(this,e,t,1)},p.toFixed=function(e,t){return null!=e&&(Sr(e,0,gr),e=e+this.e+1),_(this,e,t)},p.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=T;else if("object"!=typeof r)throw Error(lr+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var i,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],f=a[1],p=o.s<0,d=p?l.slice(1):l,h=d.length;if(u&&(i=s,s=u,u=i,h-=i),s>0&&h>0){for(i=h%s||s,l=d.substr(0,i);i<h;i+=s)l+=c+d.substr(i,s);u>0&&(l+=c+d.slice(i)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},p.toFraction=function(e){var t,n,o,i,a,s,u,c,l,f,p,h,m=this,g=m.c;if(null!=e&&(!(u=new A(e)).isInteger()&&(u.c||1!==u.s)||u.lt(d)))throw Error(lr+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+R(u));if(!g)return new A(m);for(t=new A(d),l=n=new A(d),o=c=new A(d),h=br(g),a=t.e=h.length-m.e-1,t.c[0]=yr[(s=a%dr)<0?dr+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=b,b=1/0,u=new A(h),c.c[0]=0;f=r(u,t,0,1),1!=(i=n.plus(f.times(o))).comparedTo(e);)n=o,o=i,l=c.plus(f.times(i=l)),c=i,t=u.minus(f.times(i=t)),u=i;return i=r(e.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=m.s,p=r(l,o,a*=2,y).minus(m).abs().comparedTo(r(c,n,a,y).minus(m).abs())<1?[l,o]:[c,n],b=s,p},p.toNumber=function(){return+R(this)},p.toPrecision=function(e,t){return null!=e&&Sr(e,1,gr),_(this,e,t,2)},p.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=m||i>=g?Tr(br(r.c),i):kr(br(r.c),i,"0"):10===e&&O?t=kr(br((r=I(new A(r),h+i+1,y)).c),r.e,"0"):(Sr(e,2,k.length,"Base"),t=n(kr(br(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},p.valueOf=p.toJSON=function(){return R(this)},p._isBigNumber=!0,p[Symbol.toStringTag]="BigNumber",p[Symbol.for("nodejs.util.inspect.custom")]=p.valueOf,null!=t&&A.set(t),A}(),Ar=Or.clone();Ar.DEBUG=!0;const _r=Ar;function xr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Pr=2147483647;function Ir(e){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ir(e)}function Rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(r),!0).forEach(function(t){Cr(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Cr(e,t,r){return(t=Ur(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ur(n.key),n)}}function Ur(e){var t=function(e){if("object"!=Ir(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ir(t)?t:t+""}var Nr=function(e,t,r){return t&&jr(e.prototype,t),r&&jr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!(t&&t instanceof Zt))throw new Error("assetA is invalid");if(!(r&&r instanceof Zt))throw new Error("assetB is invalid");if(-1!==Zt.compare(t,r))throw new Error("Assets are not in lexicographic order");if(!n||n!==er)throw new Error("fee is invalid");this.assetA=t,this.assetB=r,this.fee=n},[{key:"toXDRObject",value:function(){var e=new i.LiquidityPoolConstantProductParameters({assetA:this.assetA.toXDRObject(),assetB:this.assetB.toXDRObject(),fee:this.fee}),t=new i.LiquidityPoolParameters("liquidityPoolConstantProduct",e);return new i.ChangeTrustAsset("assetTypePoolShare",t)}},{key:"getLiquidityPoolParameters",value:function(){return Br(Br({},this),{},{assetA:this.assetA,assetB:this.assetB,fee:this.fee})}},{key:"getAssetType",value:function(){return"liquidity_pool_shares"}},{key:"equals",value:function(e){return this.assetA.equals(e.assetA)&&this.assetB.equals(e.assetB)&&this.fee===e.fee}},{key:"toString",value:function(){var e=tr("constant_product",this.getLiquidityPoolParameters()).toString("hex");return"liquidity_pool:".concat(e)}}],[{key:"fromOperation",value:function(e){var t=e.switch();if(t===i.AssetType.assetTypePoolShare()){var r=e.liquidityPool().constantProduct();return new this(Zt.fromOperation(r.assetA()),Zt.fromOperation(r.assetB()),r.fee())}throw new Error("Invalid asset type: ".concat(t.name))}}]);function Lr(e){return Lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lr(e)}function Dr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Fr(n.key),n)}}function Fr(e){var t=function(e){if("object"!=Lr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Lr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Lr(t)?t:t+""}var Mr=function(e,t,r){return t&&Dr(e.prototype,t),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&!Lt.isValidEd25519PublicKey(t))throw new Error("Destination is invalid");if(this._destination=t,r){if(!(r instanceof i.ClaimPredicate))throw new Error("Predicate should be an xdr.ClaimPredicate");this._predicate=r}else this._predicate=i.ClaimPredicate.claimPredicateUnconditional()},[{key:"toXDRObject",value:function(){var e=new i.ClaimantV0({destination:Xt.fromPublicKey(this._destination).xdrAccountId(),predicate:this._predicate});return i.Claimant.claimantTypeV0(e)}},{key:"destination",get:function(){return this._destination},set:function(e){throw new Error("Claimant is immutable")}},{key:"predicate",get:function(){return this._predicate},set:function(e){throw new Error("Claimant is immutable")}}],[{key:"predicateUnconditional",value:function(){return i.ClaimPredicate.claimPredicateUnconditional()}},{key:"predicateAnd",value:function(e,t){if(!(e instanceof i.ClaimPredicate))throw new Error("left Predicate should be an xdr.ClaimPredicate");if(!(t instanceof i.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return i.ClaimPredicate.claimPredicateAnd([e,t])}},{key:"predicateOr",value:function(e,t){if(!(e instanceof i.ClaimPredicate))throw new Error("left Predicate should be an xdr.ClaimPredicate");if(!(t instanceof i.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return i.ClaimPredicate.claimPredicateOr([e,t])}},{key:"predicateNot",value:function(e){if(!(e instanceof i.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return i.ClaimPredicate.claimPredicateNot(e)}},{key:"predicateBeforeAbsoluteTime",value:function(e){return i.ClaimPredicate.claimPredicateBeforeAbsoluteTime(i.Int64.fromString(e))}},{key:"predicateBeforeRelativeTime",value:function(e){return i.ClaimPredicate.claimPredicateBeforeRelativeTime(i.Int64.fromString(e))}},{key:"fromXDR",value:function(e){var t;if(e.switch()===i.ClaimantType.claimantTypeV0())return t=e.v0(),new this(Lt.encodeEd25519PublicKey(t.destination().ed25519()),t.predicate());throw new Error("Invalid claimant type: ".concat(e.switch().name))}}]);function Vr(e){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vr(e)}function qr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hr(n.key),n)}}function Hr(e){var t=function(e){if("object"!=Vr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vr(t)?t:t+""}var zr=function(e,t,r){return t&&qr(e.prototype,t),r&&qr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("liquidityPoolId cannot be empty");if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Liquidity pool ID is not a valid hash");this.liquidityPoolId=t},[{key:"toXDRObject",value:function(){var e=i.PoolId.fromXDR(this.liquidityPoolId,"hex");return new i.TrustLineAsset("assetTypePoolShare",e)}},{key:"getLiquidityPoolId",value:function(){return String(this.liquidityPoolId)}},{key:"getAssetType",value:function(){return"liquidity_pool_shares"}},{key:"equals",value:function(e){return this.liquidityPoolId===e.getLiquidityPoolId()}},{key:"toString",value:function(){return"liquidity_pool:".concat(this.liquidityPoolId)}}],[{key:"fromOperation",value:function(e){var t=e.switch();if(t===i.AssetType.assetTypePoolShare())return new this(e.liquidityPoolId().toString("hex"));throw new Error("Invalid asset type: ".concat(t.name))}}]),Kr=r(8287).Buffer;function Xr(e){return Lt.isValidMed25519PublicKey(e)?function(e){var t=Lt.decodeMed25519PublicKey(e);return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromXDR(t.subarray(-8)),ed25519:t.subarray(0,-8)}))}(e):i.MuxedAccount.keyTypeEd25519(Lt.decodeEd25519PublicKey(e))}function $r(e){return e.switch().value===i.CryptoKeyType.keyTypeMuxedEd25519().value?function(e){if(e.switch()===i.CryptoKeyType.keyTypeEd25519())return $r(e);var t=e.med25519();return Lt.encodeMed25519PublicKey(Kr.concat([t.ed25519(),t.id().toXDR("raw")]))}(e):Lt.encodeEd25519PublicKey(e.ed25519())}function Gr(e,t){if(!Lt.isValidEd25519PublicKey(e))throw new Error("address should be a Stellar account ID (G...)");if("string"!=typeof t)throw new Error("id should be a string representing a number (uint64)");return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromString(t),ed25519:Lt.decodeEd25519PublicKey(e)}))}function Wr(e){if(Lt.isValidEd25519PublicKey(e))return e;if(!Lt.isValidMed25519PublicKey(e))throw new TypeError("expected muxed account (M...), got ".concat(e));var t=Xr(e);return Lt.encodeEd25519PublicKey(t.med25519().ed25519())}function Qr(e){if("string"!=typeof e||72!==e.length)throw new Error("must provide a valid claimable balance id")}var Zr=r(8287).Buffer,Yr=r(8287).Buffer;function Jr(e,t){if(e>=0&&e<=255)return!0;throw new Error("".concat(t," value must be between 0 and 255"))}var en=r(8287).Buffer;function tn(e){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tn(e)}var rn=r(8287).Buffer;function nn(e){return nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nn(e)}function on(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,an(n.key),n)}}function an(e){var t=function(e){if("object"!=nn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=nn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nn(t)?t:t+""}var sn=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Lt.isValidEd25519PublicKey(t))this._type="account",this._key=Lt.decodeEd25519PublicKey(t);else if(Lt.isValidContract(t))this._type="contract",this._key=Lt.decodeContract(t);else if(Lt.isValidMed25519PublicKey(t))this._type="muxedAccount",this._key=Lt.decodeMed25519PublicKey(t);else if(Lt.isValidClaimableBalance(t))this._type="claimableBalance",this._key=Lt.decodeClaimableBalance(t);else{if(!Lt.isValidLiquidityPool(t))throw new Error("Unsupported address type: ".concat(t));this._type="liquidityPool",this._key=Lt.decodeLiquidityPool(t)}}return function(e,t,r){return t&&on(e.prototype,t),r&&on(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"toString",value:function(){switch(this._type){case"account":return Lt.encodeEd25519PublicKey(this._key);case"contract":return Lt.encodeContract(this._key);case"claimableBalance":return Lt.encodeClaimableBalance(this._key);case"liquidityPool":return Lt.encodeLiquidityPool(this._key);case"muxedAccount":return Lt.encodeMed25519PublicKey(this._key);default:throw new Error("Unsupported address type")}}},{key:"toScVal",value:function(){return i.ScVal.scvAddress(this.toScAddress())}},{key:"toScAddress",value:function(){switch(this._type){case"account":return i.ScAddress.scAddressTypeAccount(i.PublicKey.publicKeyTypeEd25519(this._key));case"contract":return i.ScAddress.scAddressTypeContract(this._key);case"liquidityPool":return i.ScAddress.scAddressTypeLiquidityPool(this._key);case"claimableBalance":return i.ScAddress.scAddressTypeClaimableBalance(new i.ClaimableBalanceId("claimableBalanceIdTypeV".concat(this._key.at(0)),this._key.subarray(1)));case"muxedAccount":return i.ScAddress.scAddressTypeMuxedAccount(new i.MuxedEd25519Account({ed25519:this._key.subarray(0,32),id:i.Uint64.fromXDR(this._key.subarray(32,40),"raw")}));default:throw new Error("Unsupported address type: ".concat(this._type))}}},{key:"toBuffer",value:function(){return this._key}}],[{key:"fromString",value:function(t){return new e(t)}},{key:"account",value:function(t){return new e(Lt.encodeEd25519PublicKey(t))}},{key:"contract",value:function(t){return new e(Lt.encodeContract(t))}},{key:"claimableBalance",value:function(t){return new e(Lt.encodeClaimableBalance(t))}},{key:"liquidityPool",value:function(t){return new e(Lt.encodeLiquidityPool(t))}},{key:"muxedAccount",value:function(t){return new e(Lt.encodeMed25519PublicKey(t))}},{key:"fromScVal",value:function(t){return e.fromScAddress(t.address())}},{key:"fromScAddress",value:function(t){switch(t.switch().value){case i.ScAddressType.scAddressTypeAccount().value:return e.account(t.accountId().ed25519());case i.ScAddressType.scAddressTypeContract().value:return e.contract(t.contractId());case i.ScAddressType.scAddressTypeMuxedAccount().value:var r=rn.concat([t.muxedAccount().ed25519(),t.muxedAccount().id().toXDR("raw")]);return e.muxedAccount(r);case i.ScAddressType.scAddressTypeClaimableBalance().value:return e.claimableBalance(t.claimableBalanceId());case i.ScAddressType.scAddressTypeLiquidityPool().value:return e.liquidityPool(t.liquidityPoolId());default:throw new Error("Unsupported address type: ".concat(t.switch().name))}}}])}(),un=r(8287).Buffer;function cn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ln(e){return ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ln(e)}function fn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pn(n.key),n)}}function pn(e){var t=function(e){if("object"!=ln(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ln(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ln(t)?t:t+""}var dn=1e7,hn=1,yn=2,mn=4,gn=8,vn=function(e,t,r){return r&&fn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"setSourceAccount",value:function(e,t){if(t.source)try{e.sourceAccount=Xr(t.source)}catch(e){throw new Error("Source address is invalid")}}},{key:"fromXDRObject",value:function(e){var t={};e.sourceAccount()&&(t.source=$r(e.sourceAccount()));var r=e.body().value(),n=e.body().switch().name;switch(n){case"createAccount":t.type="createAccount",t.destination=bn(r.destination()),t.startingBalance=this._fromXDRAmount(r.startingBalance());break;case"payment":t.type="payment",t.destination=$r(r.destination()),t.asset=Zt.fromOperation(r.asset()),t.amount=this._fromXDRAmount(r.amount());break;case"pathPaymentStrictReceive":t.type="pathPaymentStrictReceive",t.sendAsset=Zt.fromOperation(r.sendAsset()),t.sendMax=this._fromXDRAmount(r.sendMax()),t.destination=$r(r.destination()),t.destAsset=Zt.fromOperation(r.destAsset()),t.destAmount=this._fromXDRAmount(r.destAmount()),t.path=[];var o=r.path();Object.keys(o).forEach(function(e){t.path.push(Zt.fromOperation(o[e]))});break;case"pathPaymentStrictSend":t.type="pathPaymentStrictSend",t.sendAsset=Zt.fromOperation(r.sendAsset()),t.sendAmount=this._fromXDRAmount(r.sendAmount()),t.destination=$r(r.destination()),t.destAsset=Zt.fromOperation(r.destAsset()),t.destMin=this._fromXDRAmount(r.destMin()),t.path=[];var a=r.path();Object.keys(a).forEach(function(e){t.path.push(Zt.fromOperation(a[e]))});break;case"changeTrust":t.type="changeTrust",r.line().switch()===i.AssetType.assetTypePoolShare()?t.line=Nr.fromOperation(r.line()):t.line=Zt.fromOperation(r.line()),t.limit=this._fromXDRAmount(r.limit());break;case"allowTrust":t.type="allowTrust",t.trustor=bn(r.trustor()),t.assetCode=r.asset().value().toString(),t.assetCode=At(t.assetCode,"\0"),t.authorize=r.authorize();break;case"setOptions":if(t.type="setOptions",r.inflationDest()&&(t.inflationDest=bn(r.inflationDest())),t.clearFlags=r.clearFlags(),t.setFlags=r.setFlags(),t.masterWeight=r.masterWeight(),t.lowThreshold=r.lowThreshold(),t.medThreshold=r.medThreshold(),t.highThreshold=r.highThreshold(),t.homeDomain=void 0!==r.homeDomain()?r.homeDomain().toString("ascii"):void 0,r.signer()){var s={},u=r.signer().key().arm();if("ed25519"===u)s.ed25519PublicKey=bn(r.signer().key());else if("preAuthTx"===u)s.preAuthTx=r.signer().key().preAuthTx();else if("hashX"===u)s.sha256Hash=r.signer().key().hashX();else if("ed25519SignedPayload"===u){var c=r.signer().key().ed25519SignedPayload();s.ed25519SignedPayload=Lt.encodeSignedPayload(c.toXDR())}s.weight=r.signer().weight(),t.signer=s}break;case"manageOffer":case"manageSellOffer":t.type="manageSellOffer",t.selling=Zt.fromOperation(r.selling()),t.buying=Zt.fromOperation(r.buying()),t.amount=this._fromXDRAmount(r.amount()),t.price=this._fromXDRPrice(r.price()),t.offerId=r.offerId().toString();break;case"manageBuyOffer":t.type="manageBuyOffer",t.selling=Zt.fromOperation(r.selling()),t.buying=Zt.fromOperation(r.buying()),t.buyAmount=this._fromXDRAmount(r.buyAmount()),t.price=this._fromXDRPrice(r.price()),t.offerId=r.offerId().toString();break;case"createPassiveOffer":case"createPassiveSellOffer":t.type="createPassiveSellOffer",t.selling=Zt.fromOperation(r.selling()),t.buying=Zt.fromOperation(r.buying()),t.amount=this._fromXDRAmount(r.amount()),t.price=this._fromXDRPrice(r.price());break;case"accountMerge":t.type="accountMerge",t.destination=$r(r);break;case"manageData":t.type="manageData",t.name=r.dataName().toString("ascii"),t.value=r.dataValue();break;case"inflation":t.type="inflation";break;case"bumpSequence":t.type="bumpSequence",t.bumpTo=r.bumpTo().toString();break;case"createClaimableBalance":t.type="createClaimableBalance",t.asset=Zt.fromOperation(r.asset()),t.amount=this._fromXDRAmount(r.amount()),t.claimants=[],r.claimants().forEach(function(e){t.claimants.push(Mr.fromXDR(e))});break;case"claimClaimableBalance":t.type="claimClaimableBalance",t.balanceId=r.toXDR("hex");break;case"beginSponsoringFutureReserves":t.type="beginSponsoringFutureReserves",t.sponsoredId=bn(r.sponsoredId());break;case"endSponsoringFutureReserves":t.type="endSponsoringFutureReserves";break;case"revokeSponsorship":!function(e,t){switch(e.switch().name){case"revokeSponsorshipLedgerEntry":var r=e.ledgerKey();switch(r.switch().name){case i.LedgerEntryType.account().name:t.type="revokeAccountSponsorship",t.account=bn(r.account().accountId());break;case i.LedgerEntryType.trustline().name:t.type="revokeTrustlineSponsorship",t.account=bn(r.trustLine().accountId());var n=r.trustLine().asset();n.switch()===i.AssetType.assetTypePoolShare()?t.asset=zr.fromOperation(n):t.asset=Zt.fromOperation(n);break;case i.LedgerEntryType.offer().name:t.type="revokeOfferSponsorship",t.seller=bn(r.offer().sellerId()),t.offerId=r.offer().offerId().toString();break;case i.LedgerEntryType.data().name:t.type="revokeDataSponsorship",t.account=bn(r.data().accountId()),t.name=r.data().dataName().toString("ascii");break;case i.LedgerEntryType.claimableBalance().name:t.type="revokeClaimableBalanceSponsorship",t.balanceId=r.claimableBalance().balanceId().toXDR("hex");break;case i.LedgerEntryType.liquidityPool().name:t.type="revokeLiquidityPoolSponsorship",t.liquidityPoolId=r.liquidityPool().liquidityPoolId().toString("hex");break;default:throw new Error("Unknown ledgerKey: ".concat(e.switch().name))}break;case"revokeSponsorshipSigner":t.type="revokeSignerSponsorship",t.account=bn(e.signer().accountId()),t.signer=function(e){var t={};switch(e.switch().name){case i.SignerKeyType.signerKeyTypeEd25519().name:t.ed25519PublicKey=Lt.encodeEd25519PublicKey(e.ed25519());break;case i.SignerKeyType.signerKeyTypePreAuthTx().name:t.preAuthTx=e.preAuthTx().toString("hex");break;case i.SignerKeyType.signerKeyTypeHashX().name:t.sha256Hash=e.hashX().toString("hex");break;default:throw new Error("Unknown signerKey: ".concat(e.switch().name))}return t}(e.signer().signerKey());break;default:throw new Error("Unknown revokeSponsorship: ".concat(e.switch().name))}}(r,t);break;case"clawback":t.type="clawback",t.amount=this._fromXDRAmount(r.amount()),t.from=$r(r.from()),t.asset=Zt.fromOperation(r.asset());break;case"clawbackClaimableBalance":t.type="clawbackClaimableBalance",t.balanceId=r.toXDR("hex");break;case"setTrustLineFlags":t.type="setTrustLineFlags",t.asset=Zt.fromOperation(r.asset()),t.trustor=bn(r.trustor());var l=r.clearFlags(),f=r.setFlags(),p={authorized:i.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:i.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:i.TrustLineFlags.trustlineClawbackEnabledFlag()};t.flags={},Object.keys(p).forEach(function(e){var r;t.flags[e]=(r=p[e].value,!!(f&r)||!(l&r)&&void 0)});break;case"liquidityPoolDeposit":t.type="liquidityPoolDeposit",t.liquidityPoolId=r.liquidityPoolId().toString("hex"),t.maxAmountA=this._fromXDRAmount(r.maxAmountA()),t.maxAmountB=this._fromXDRAmount(r.maxAmountB()),t.minPrice=this._fromXDRPrice(r.minPrice()),t.maxPrice=this._fromXDRPrice(r.maxPrice());break;case"liquidityPoolWithdraw":t.type="liquidityPoolWithdraw",t.liquidityPoolId=r.liquidityPoolId().toString("hex"),t.amount=this._fromXDRAmount(r.amount()),t.minAmountA=this._fromXDRAmount(r.minAmountA()),t.minAmountB=this._fromXDRAmount(r.minAmountB());break;case"invokeHostFunction":var d;t.type="invokeHostFunction",t.func=r.hostFunction(),t.auth=null!==(d=r.auth())&&void 0!==d?d:[];break;case"extendFootprintTtl":t.type="extendFootprintTtl",t.extendTo=r.extendTo();break;case"restoreFootprint":t.type="restoreFootprint";break;default:throw new Error("Unknown operation: ".concat(n))}return t}},{key:"isValidAmount",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)return!1;try{t=new _r(e)}catch(e){return!1}return!(!r&&t.isZero()||t.isNegative()||t.times(dn).gt(new _r("9223372036854775807").toString())||t.decimalPlaces()>7||t.isNaN()||!t.isFinite())}},{key:"constructAmountRequirementsError",value:function(e){return"".concat(e," argument must be of type String, represent a positive number and have at most 7 digits after the decimal")}},{key:"_checkUnsignedIntValue",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0!==t)switch("string"==typeof t&&(t=parseFloat(t)),!0){case"number"!=typeof t||!Number.isFinite(t)||t%1!=0:throw new Error("".concat(e," value is invalid"));case t<0:throw new Error("".concat(e," value must be unsigned"));case!r||r&&r(t,e):return t;default:throw new Error("".concat(e," value is invalid"))}}},{key:"_toXDRAmount",value:function(e){var t=new _r(e).times(dn);return n.Hyper.fromString(t.toString())}},{key:"_fromXDRAmount",value:function(e){return new _r(e).div(dn).toFixed(7)}},{key:"_fromXDRPrice",value:function(e){return new _r(e.n()).div(new _r(e.d())).toString()}},{key:"_toXDRPrice",value:function(e){var t;if(e.n&&e.d)t=new i.Price(e);else{var r=function(e){for(var t,r,n=new _r(e),o=[[new _r(0),new _r(1)],[new _r(1),new _r(0)]],i=2;!n.gt(Pr);){t=n.integerValue(_r.ROUND_FLOOR),r=n.minus(t);var a=t.times(o[i-1][0]).plus(o[i-2][0]),s=t.times(o[i-1][1]).plus(o[i-2][1]);if(a.gt(Pr)||s.gt(Pr))break;if(o.push([a,s]),r.eq(0))break;n=new _r(1).div(r),i+=1}var u=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xr(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o[o.length-1],2),c=u[0],l=u[1];if(c.isZero()||l.isZero())throw new Error("Couldn't find approximation");return[c.toNumber(),l.toNumber()]}(e);t=new i.Price({n:parseInt(r[0],10),d:parseInt(r[1],10)})}if(t.n()<0||t.d()<0)throw new Error("price must be positive");return t}}]);function bn(e){return Lt.encodeEd25519PublicKey(e.ed25519())}vn.accountMerge=function(e){var t={};try{t.body=i.OperationBody.accountMerge(Xr(e.destination))}catch(e){throw new Error("destination is invalid")}return this.setSourceAccount(t,e),new i.Operation(t)},vn.allowTrust=function(e){if(!Lt.isValidEd25519PublicKey(e.trustor))throw new Error("trustor is invalid");var t={};if(t.trustor=Xt.fromPublicKey(e.trustor).xdrAccountId(),e.assetCode.length<=4){var r=e.assetCode.padEnd(4,"\0");t.asset=i.AssetCode.assetTypeCreditAlphanum4(r)}else{if(!(e.assetCode.length<=12))throw new Error("Asset code must be 12 characters at max.");var n=e.assetCode.padEnd(12,"\0");t.asset=i.AssetCode.assetTypeCreditAlphanum12(n)}"boolean"==typeof e.authorize?e.authorize?t.authorize=i.TrustLineFlags.authorizedFlag().value:t.authorize=0:t.authorize=e.authorize;var o=new i.AllowTrustOp(t),a={};return a.body=i.OperationBody.allowTrust(o),this.setSourceAccount(a,e),new i.Operation(a)},vn.bumpSequence=function(e){var t={};if("string"!=typeof e.bumpTo)throw new Error("bumpTo must be a string");try{new _r(e.bumpTo)}catch(e){throw new Error("bumpTo must be a stringified number")}t.bumpTo=n.Hyper.fromString(e.bumpTo);var r=new i.BumpSequenceOp(t),o={};return o.body=i.OperationBody.bumpSequence(r),this.setSourceAccount(o,e),new i.Operation(o)},vn.changeTrust=function(e){var t={};if(e.asset instanceof Zt)t.line=e.asset.toChangeTrustXDRObject();else{if(!(e.asset instanceof Nr))throw new TypeError("asset must be Asset or LiquidityPoolAsset");t.line=e.asset.toXDRObject()}if(void 0!==e.limit&&!this.isValidAmount(e.limit,!0))throw new TypeError(this.constructAmountRequirementsError("limit"));e.limit?t.limit=this._toXDRAmount(e.limit):t.limit=n.Hyper.fromString(new _r("9223372036854775807").toString()),e.source&&(t.source=e.source.masterKeypair);var r=new i.ChangeTrustOp(t),o={};return o.body=i.OperationBody.changeTrust(r),this.setSourceAccount(o,e),new i.Operation(o)},vn.createAccount=function(e){if(!Lt.isValidEd25519PublicKey(e.destination))throw new Error("destination is invalid");if(!this.isValidAmount(e.startingBalance,!0))throw new TypeError(this.constructAmountRequirementsError("startingBalance"));var t={};t.destination=Xt.fromPublicKey(e.destination).xdrAccountId(),t.startingBalance=this._toXDRAmount(e.startingBalance);var r=new i.CreateAccountOp(t),n={};return n.body=i.OperationBody.createAccount(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.createClaimableBalance=function(e){if(!(e.asset instanceof Zt))throw new Error("must provide an asset for create claimable balance operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(!Array.isArray(e.claimants)||0===e.claimants.length)throw new Error("must provide at least one claimant");var t={};t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount),t.claimants=Object.values(e.claimants).map(function(e){return e.toXDRObject()});var r=new i.CreateClaimableBalanceOp(t),n={};return n.body=i.OperationBody.createClaimableBalance(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.claimClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Qr(e.balanceId);var t={};t.balanceId=i.ClaimableBalanceId.fromXDR(e.balanceId,"hex");var r=new i.ClaimClaimableBalanceOp(t),n={};return n.body=i.OperationBody.claimClaimableBalance(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.clawbackClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Qr(e.balanceId);var t={balanceId:i.ClaimableBalanceId.fromXDR(e.balanceId,"hex")},r={body:i.OperationBody.clawbackClaimableBalance(new i.ClawbackClaimableBalanceOp(t))};return this.setSourceAccount(r,e),new i.Operation(r)},vn.createPassiveSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price);var r=new i.CreatePassiveSellOfferOp(t),n={};return n.body=i.OperationBody.createPassiveSellOffer(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.inflation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=i.OperationBody.inflation(),this.setSourceAccount(t,e),new i.Operation(t)},vn.manageData=function(e){var t={};if(!("string"==typeof e.name&&e.name.length<=64))throw new Error("name must be a string, up to 64 characters");if(t.dataName=e.name,"string"!=typeof e.value&&!Zr.isBuffer(e.value)&&null!==e.value)throw new Error("value must be a string, Buffer or null");if("string"==typeof e.value?t.dataValue=Zr.from(e.value):t.dataValue=e.value,null!==t.dataValue&&t.dataValue.length>64)throw new Error("value cannot be longer that 64 bytes");var r=new i.ManageDataOp(t),n={};return n.body=i.OperationBody.manageData(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.manageSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount,!0))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0",t.offerId=n.Hyper.fromString(e.offerId);var r=new i.ManageSellOfferOp(t),o={};return o.body=i.OperationBody.manageSellOffer(r),this.setSourceAccount(o,e),new i.Operation(o)},vn.manageBuyOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.buyAmount,!0))throw new TypeError(this.constructAmountRequirementsError("buyAmount"));if(t.buyAmount=this._toXDRAmount(e.buyAmount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0",t.offerId=n.Hyper.fromString(e.offerId);var r=new i.ManageBuyOfferOp(t),o={};return o.body=i.OperationBody.manageBuyOffer(r),this.setSourceAccount(o,e),new i.Operation(o)},vn.pathPaymentStrictReceive=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendMax):throw new TypeError(this.constructAmountRequirementsError("sendMax"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destAmount):throw new TypeError(this.constructAmountRequirementsError("destAmount"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendMax=this._toXDRAmount(e.sendMax);try{t.destination=Xr(e.destination)}catch(e){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destAmount=this._toXDRAmount(e.destAmount);var r=e.path?e.path:[];t.path=r.map(function(e){return e.toXDRObject()});var n=new i.PathPaymentStrictReceiveOp(t),o={};return o.body=i.OperationBody.pathPaymentStrictReceive(n),this.setSourceAccount(o,e),new i.Operation(o)},vn.pathPaymentStrictSend=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendAmount):throw new TypeError(this.constructAmountRequirementsError("sendAmount"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destMin):throw new TypeError(this.constructAmountRequirementsError("destMin"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendAmount=this._toXDRAmount(e.sendAmount);try{t.destination=Xr(e.destination)}catch(e){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destMin=this._toXDRAmount(e.destMin);var r=e.path?e.path:[];t.path=r.map(function(e){return e.toXDRObject()});var n=new i.PathPaymentStrictSendOp(t),o={};return o.body=i.OperationBody.pathPaymentStrictSend(n),this.setSourceAccount(o,e),new i.Operation(o)},vn.payment=function(e){if(!e.asset)throw new Error("Must provide an asset for a payment operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));var t={};try{t.destination=Xr(e.destination)}catch(e){throw new Error("destination is invalid")}t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount);var r=new i.PaymentOp(t),n={};return n.body=i.OperationBody.payment(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.setOptions=function(e){var t={};if(e.inflationDest){if(!Lt.isValidEd25519PublicKey(e.inflationDest))throw new Error("inflationDest is invalid");t.inflationDest=Xt.fromPublicKey(e.inflationDest).xdrAccountId()}if(t.clearFlags=this._checkUnsignedIntValue("clearFlags",e.clearFlags),t.setFlags=this._checkUnsignedIntValue("setFlags",e.setFlags),t.masterWeight=this._checkUnsignedIntValue("masterWeight",e.masterWeight,Jr),t.lowThreshold=this._checkUnsignedIntValue("lowThreshold",e.lowThreshold,Jr),t.medThreshold=this._checkUnsignedIntValue("medThreshold",e.medThreshold,Jr),t.highThreshold=this._checkUnsignedIntValue("highThreshold",e.highThreshold,Jr),void 0!==e.homeDomain&&"string"!=typeof e.homeDomain)throw new TypeError("homeDomain argument must be of type String");if(t.homeDomain=e.homeDomain,e.signer){var r,n=this._checkUnsignedIntValue("signer.weight",e.signer.weight,Jr),o=0;if(e.signer.ed25519PublicKey){if(!Lt.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var a=Lt.decodeEd25519PublicKey(e.signer.ed25519PublicKey);r=new i.SignerKey.signerKeyTypeEd25519(a),o+=1}if(e.signer.preAuthTx){if("string"==typeof e.signer.preAuthTx&&(e.signer.preAuthTx=Yr.from(e.signer.preAuthTx,"hex")),!Yr.isBuffer(e.signer.preAuthTx)||32!==e.signer.preAuthTx.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");r=new i.SignerKey.signerKeyTypePreAuthTx(e.signer.preAuthTx),o+=1}if(e.signer.sha256Hash){if("string"==typeof e.signer.sha256Hash&&(e.signer.sha256Hash=Yr.from(e.signer.sha256Hash,"hex")),!Yr.isBuffer(e.signer.sha256Hash)||32!==e.signer.sha256Hash.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");r=new i.SignerKey.signerKeyTypeHashX(e.signer.sha256Hash),o+=1}if(e.signer.ed25519SignedPayload){if(!Lt.isValidSignedPayload(e.signer.ed25519SignedPayload))throw new Error("signer.ed25519SignedPayload is invalid.");var s=Lt.decodeSignedPayload(e.signer.ed25519SignedPayload),u=i.SignerKeyEd25519SignedPayload.fromXDR(s);r=i.SignerKey.signerKeyTypeEd25519SignedPayload(u),o+=1}if(1!==o)throw new Error("Signer object must contain exactly one of signer.ed25519PublicKey, signer.sha256Hash, signer.preAuthTx.");t.signer=new i.Signer({key:r,weight:n})}var c=new i.SetOptionsOp(t),l={};return l.body=i.OperationBody.setOptions(c),this.setSourceAccount(l,e),new i.Operation(l)},vn.beginSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(e.sponsoredId))throw new Error("sponsoredId is invalid");var t=new i.BeginSponsoringFutureReservesOp({sponsoredId:Xt.fromPublicKey(e.sponsoredId).xdrAccountId()}),r={};return r.body=i.OperationBody.beginSponsoringFutureReserves(t),this.setSourceAccount(r,e),new i.Operation(r)},vn.endSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=i.OperationBody.endSponsoringFutureReserves(),this.setSourceAccount(t,e),new i.Operation(t)},vn.revokeAccountSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");var t=i.LedgerKey.account(new i.LedgerKeyAccount({accountId:Xt.fromPublicKey(e.account).xdrAccountId()})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeTrustlineSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.asset instanceof Zt)e=t.asset.toTrustLineXDRObject();else{if(!(t.asset instanceof zr))throw new TypeError("asset must be an Asset or LiquidityPoolId");e=t.asset.toXDRObject()}var r=i.LedgerKey.trustline(new i.LedgerKeyTrustLine({accountId:Xt.fromPublicKey(t.account).xdrAccountId(),asset:e})),n=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(r),o={};return o.body=i.OperationBody.revokeSponsorship(n),this.setSourceAccount(o,t),new i.Operation(o)},vn.revokeOfferSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(e.seller))throw new Error("seller is invalid");if("string"!=typeof e.offerId)throw new Error("offerId is invalid");var t=i.LedgerKey.offer(new i.LedgerKeyOffer({sellerId:Xt.fromPublicKey(e.seller).xdrAccountId(),offerId:i.Int64.fromString(e.offerId)})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeDataSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");if("string"!=typeof e.name||e.name.length>64)throw new Error("name must be a string, up to 64 characters");var t=i.LedgerKey.data(new i.LedgerKeyData({accountId:Xt.fromPublicKey(e.account).xdrAccountId(),dataName:e.name})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeClaimableBalanceSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!=typeof e.balanceId)throw new Error("balanceId is invalid");var t=i.LedgerKey.claimableBalance(new i.LedgerKeyClaimableBalance({balanceId:i.ClaimableBalanceId.fromXDR(e.balanceId,"hex")})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeLiquidityPoolSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!=typeof e.liquidityPoolId)throw new Error("liquidityPoolId is invalid");var t=i.LedgerKey.liquidityPool(new i.LedgerKeyLiquidityPool({liquidityPoolId:i.PoolId.fromXDR(e.liquidityPoolId,"hex")})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={body:i.OperationBody.revokeSponsorship(r)};return this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeSignerSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.signer.ed25519PublicKey){if(!Lt.isValidEd25519PublicKey(t.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var r=Lt.decodeEd25519PublicKey(t.signer.ed25519PublicKey);e=new i.SignerKey.signerKeyTypeEd25519(r)}else if(t.signer.preAuthTx){var n;if(n="string"==typeof t.signer.preAuthTx?en.from(t.signer.preAuthTx,"hex"):t.signer.preAuthTx,!en.isBuffer(n)||32!==n.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");e=new i.SignerKey.signerKeyTypePreAuthTx(n)}else{if(!t.signer.sha256Hash)throw new Error("signer is invalid");var o;if(o="string"==typeof t.signer.sha256Hash?en.from(t.signer.sha256Hash,"hex"):t.signer.sha256Hash,!en.isBuffer(o)||32!==o.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");e=new i.SignerKey.signerKeyTypeHashX(o)}var a=new i.RevokeSponsorshipOpSigner({accountId:Xt.fromPublicKey(t.account).xdrAccountId(),signerKey:e}),s=i.RevokeSponsorshipOp.revokeSponsorshipSigner(a),u={};return u.body=i.OperationBody.revokeSponsorship(s),this.setSourceAccount(u,t),new i.Operation(u)},vn.clawback=function(e){var t={};if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));t.amount=this._toXDRAmount(e.amount),t.asset=e.asset.toXDRObject();try{t.from=Xr(e.from)}catch(e){throw new Error("from address is invalid")}var r={body:i.OperationBody.clawback(new i.ClawbackOp(t))};return this.setSourceAccount(r,e),new i.Operation(r)},vn.setTrustLineFlags=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if("object"!==tn(e.flags)||0===Object.keys(e.flags).length)throw new Error("opts.flags must be a map of boolean flags to modify");var r={authorized:i.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:i.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:i.TrustLineFlags.trustlineClawbackEnabledFlag()},n=0,o=0;Object.keys(e.flags).forEach(function(t){if(!Object.prototype.hasOwnProperty.call(r,t))throw new Error("unsupported flag name specified: ".concat(t));var i=e.flags[t],a=r[t].value;!0===i?o|=a:!1===i&&(n|=a)}),t.trustor=Xt.fromPublicKey(e.trustor).xdrAccountId(),t.asset=e.asset.toXDRObject(),t.clearFlags=n,t.setFlags=o;var a={body:i.OperationBody.setTrustLineFlags(new i.SetTrustLineFlagsOp(t))};return this.setSourceAccount(a,e),new i.Operation(a)},vn.liquidityPoolDeposit=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.liquidityPoolId,r=e.maxAmountA,n=e.maxAmountB,o=e.minPrice,a=e.maxPrice,s={};if(!t)throw new TypeError("liquidityPoolId argument is required");if(s.liquidityPoolId=i.PoolId.fromXDR(t,"hex"),!this.isValidAmount(r,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountA"));if(s.maxAmountA=this._toXDRAmount(r),!this.isValidAmount(n,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountB"));if(s.maxAmountB=this._toXDRAmount(n),void 0===o)throw new TypeError("minPrice argument is required");if(s.minPrice=this._toXDRPrice(o),void 0===a)throw new TypeError("maxPrice argument is required");s.maxPrice=this._toXDRPrice(a);var u=new i.LiquidityPoolDepositOp(s),c={body:i.OperationBody.liquidityPoolDeposit(u)};return this.setSourceAccount(c,e),new i.Operation(c)},vn.liquidityPoolWithdraw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if(!e.liquidityPoolId)throw new TypeError("liquidityPoolId argument is required");if(t.liquidityPoolId=i.PoolId.fromXDR(e.liquidityPoolId,"hex"),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),!this.isValidAmount(e.minAmountA,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountA"));if(t.minAmountA=this._toXDRAmount(e.minAmountA),!this.isValidAmount(e.minAmountB,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountB"));t.minAmountB=this._toXDRAmount(e.minAmountB);var r=new i.LiquidityPoolWithdrawOp(t),n={body:i.OperationBody.liquidityPoolWithdraw(r)};return this.setSourceAccount(n,e),new i.Operation(n)},vn.invokeHostFunction=function(e){if(!e.func)throw new TypeError("host function invocation ('func') required (got ".concat(JSON.stringify(e),")"));e.func.switch().value===i.HostFunctionType.hostFunctionTypeInvokeContract().value&&e.func.invokeContract().args().forEach(function(e){var t;try{t=sn.fromScVal(e)}catch(e){return}switch(t._type){case"claimableBalance":case"liquidityPool":throw new TypeError("claimable balances and liquidity pools cannot be arguments to invokeHostFunction")}});var t=new i.InvokeHostFunctionOp({hostFunction:e.func,auth:e.auth||[]}),r={body:i.OperationBody.invokeHostFunction(t)};return this.setSourceAccount(r,e),new i.Operation(r)},vn.extendFootprintTtl=function(e){var t;if((null!==(t=e.extendTo)&&void 0!==t?t:-1)<=0)throw new RangeError("extendTo has to be positive");var r=new i.ExtendFootprintTtlOp({ext:new i.ExtensionPoint(0),extendTo:e.extendTo}),n={body:i.OperationBody.extendFootprintTtl(r)};return this.setSourceAccount(n,e),new i.Operation(n)},vn.restoreFootprint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new i.RestoreFootprintOp({ext:new i.ExtensionPoint(0)}),r={body:i.OperationBody.restoreFootprint(t)};return this.setSourceAccount(r,null!=e?e:{}),new i.Operation(r)},vn.createStellarAssetContract=function(e){var t=e.asset;if("string"==typeof t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cn(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.split(":"),2),n=r[0],o=r[1];t=new Zt(n,o)}if(!(t instanceof Zt))throw new TypeError("expected Asset in 'opts.asset', got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeCreateContract(new i.CreateContractArgs({executable:i.ContractExecutable.contractExecutableStellarAsset(),contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAsset(t.toXDRObject())}))})},vn.invokeContractFunction=function(e){var t=new sn(e.contract);if("contract"!==t._type)throw new TypeError("expected contract strkey instance, got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeInvokeContract(new i.InvokeContractArgs({contractAddress:t.toScAddress(),functionName:e.function,args:e.args}))})},vn.createCustomContract=function(e){var t,r=un.from(e.salt||Xt.random().xdrPublicKey().value());if(!e.wasmHash||32!==e.wasmHash.length)throw new TypeError("expected hash(contract WASM) in 'opts.wasmHash', got ".concat(e.wasmHash));if(32!==r.length)throw new TypeError("expected 32-byte salt in 'opts.salt', got ".concat(e.wasmHash));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeCreateContractV2(new i.CreateContractArgsV2({executable:i.ContractExecutable.contractExecutableWasm(un.from(e.wasmHash)),contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAddress(new i.ContractIdPreimageFromAddress({address:e.address.toScAddress(),salt:r})),constructorArgs:null!==(t=e.constructorArgs)&&void 0!==t?t:[]}))})},vn.uploadContractWasm=function(e){return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeUploadContractWasm(un.from(e.wasm))})};var wn=r(8287).Buffer;function Sn(e){return Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sn(e)}function En(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tn(n.key),n)}}function Tn(e){var t=function(e){if("object"!=Sn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Sn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Sn(t)?t:t+""}var kn="none",On="id",An="text",_n="hash",xn="return",Pn=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._type=t,this._value=r,this._type){case kn:break;case On:e._validateIdValue(r);break;case An:e._validateTextValue(r);break;case _n:case xn:e._validateHashValue(r),"string"==typeof r&&(this._value=wn.from(r,"hex"));break;default:throw new Error("Invalid memo type")}}return function(e,t,r){return t&&En(e.prototype,t),r&&En(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"type",get:function(){return this._type},set:function(e){throw new Error("Memo is immutable")}},{key:"value",get:function(){switch(this._type){case kn:return null;case On:case An:return this._value;case _n:case xn:return wn.from(this._value);default:throw new Error("Invalid memo type")}},set:function(e){throw new Error("Memo is immutable")}},{key:"toXDRObject",value:function(){switch(this._type){case kn:return i.Memo.memoNone();case On:return i.Memo.memoId(n.UnsignedHyper.fromString(this._value));case An:return i.Memo.memoText(this._value);case _n:return i.Memo.memoHash(this._value);case xn:return i.Memo.memoReturn(this._value);default:return null}}}],[{key:"_validateIdValue",value:function(e){var t,r=new Error("Expects a int64 as a string. Got ".concat(e));if("string"!=typeof e)throw r;try{t=new _r(e)}catch(e){throw r}if(!t.isFinite())throw r;if(t.isNaN())throw r}},{key:"_validateTextValue",value:function(e){if(!i.Memo.armTypeForArm("text").isValid(e))throw new Error("Expects string, array or buffer, max 28 bytes")}},{key:"_validateHashValue",value:function(e){var t,r=new Error("Expects a 32 byte hash value or hex encoded string. Got ".concat(e));if(null==e)throw r;if("string"==typeof e){if(!/^[0-9A-Fa-f]{64}$/g.test(e))throw r;t=wn.from(e,"hex")}else{if(!wn.isBuffer(e))throw r;t=wn.from(e)}if(!t.length||32!==t.length)throw r}},{key:"none",value:function(){return new e(kn)}},{key:"text",value:function(t){return new e(An,t)}},{key:"id",value:function(t){return new e(On,t)}},{key:"hash",value:function(t){return new e(_n,t)}},{key:"return",value:function(t){return new e(xn,t)}},{key:"fromXDRObject",value:function(t){switch(t.arm()){case"id":return e.id(t.value().toString());case"text":return e.text(t.value());case"hash":return e.hash(t.value());case"retHash":return e.return(t.value())}if(void 0===t.value())return e.none();throw new Error("Unknown type")}}])}(),In=r(8287).Buffer;function Rn(e){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rn(e)}function Bn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cn(n.key),n)}}function Cn(e){var t=function(e){if("object"!=Rn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Rn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rn(t)?t:t+""}function jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jn=function(){return!!e})()}function Un(e){return Un=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Un(e)}function Nn(e,t){return Nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nn(e,t)}var Ln=function(e){function t(e,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e){var o=In.from(e,"base64");e=i.TransactionEnvelope.fromXDR(o)}var a=e.switch();if(a!==i.EnvelopeType.envelopeTypeTxV0()&&a!==i.EnvelopeType.envelopeTypeTx())throw new Error("Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an ".concat(a.name,"."));var s=e.value(),u=s.tx(),c=u.fee().toString();(n=function(e,t,r){return t=Un(t),function(e,t){if(t&&("object"==Rn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jn()?Reflect.construct(t,r||[],Un(e).constructor):t.apply(e,r))}(this,t,[u,(s.signatures()||[]).slice(),c,r]))._envelopeType=a,n._memo=u.memo(),n._sequence=u.seqNum().toString(),n._envelopeType===i.EnvelopeType.envelopeTypeTxV0()?n._source=Lt.encodeEd25519PublicKey(n.tx.sourceAccountEd25519()):n._source=$r(n.tx.sourceAccount());var l=null,f=null;switch(n._envelopeType){case i.EnvelopeType.envelopeTypeTxV0():f=u.timeBounds();break;case i.EnvelopeType.envelopeTypeTx():switch(u.cond().switch()){case i.PreconditionType.precondTime():f=u.cond().timeBounds();break;case i.PreconditionType.precondV2():f=(l=u.cond().v2()).timeBounds()}}if(f&&(n._timeBounds={minTime:f.minTime().toString(),maxTime:f.maxTime().toString()}),l){var p=l.ledgerBounds();p&&(n._ledgerBounds={minLedger:p.minLedger(),maxLedger:p.maxLedger()});var d=l.minSeqNum();d&&(n._minAccountSequence=d.toString()),n._minAccountSequenceAge=l.minSeqAge(),n._minAccountSequenceLedgerGap=l.minSeqLedgerGap(),n._extraSigners=l.extraSigners()}var h=u.operations()||[];return n._operations=h.map(function(e){return vn.fromXDRObject(e)}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nn(e,t)}(t,e),function(e,t){return t&&Bn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"timeBounds",get:function(){return this._timeBounds},set:function(e){throw new Error("Transaction is immutable")}},{key:"ledgerBounds",get:function(){return this._ledgerBounds},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequence",get:function(){return this._minAccountSequence},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequenceAge",get:function(){return this._minAccountSequenceAge},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequenceLedgerGap",get:function(){return this._minAccountSequenceLedgerGap},set:function(e){throw new Error("Transaction is immutable")}},{key:"extraSigners",get:function(){return this._extraSigners},set:function(e){throw new Error("Transaction is immutable")}},{key:"sequence",get:function(){return this._sequence},set:function(e){throw new Error("Transaction is immutable")}},{key:"source",get:function(){return this._source},set:function(e){throw new Error("Transaction is immutable")}},{key:"operations",get:function(){return this._operations},set:function(e){throw new Error("Transaction is immutable")}},{key:"memo",get:function(){return Pn.fromXDRObject(this._memo)},set:function(e){throw new Error("Transaction is immutable")}},{key:"signatureBase",value:function(){var e=this.tx;this._envelopeType===i.EnvelopeType.envelopeTypeTxV0()&&(e=i.Transaction.fromXDR(In.concat([i.PublicKeyType.publicKeyTypeEd25519().toXDR(),e.toXDR()])));var t=new i.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTx(e);return new i.TransactionSignaturePayload({networkId:i.Hash.fromXDR(u(this.networkPassphrase)),taggedTransaction:t}).toXDR()}},{key:"toEnvelope",value:function(){var e,t=this.tx.toXDR(),r=this.signatures.slice();switch(this._envelopeType){case i.EnvelopeType.envelopeTypeTxV0():e=new i.TransactionEnvelope.envelopeTypeTxV0(new i.TransactionV0Envelope({tx:i.TransactionV0.fromXDR(t),signatures:r}));break;case i.EnvelopeType.envelopeTypeTx():e=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:i.Transaction.fromXDR(t),signatures:r}));break;default:throw new Error("Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an ".concat(this._envelopeType.name,"."))}return e}},{key:"getClaimableBalanceId",value:function(e){if(!Number.isInteger(e)||e<0||e>=this.operations.length)throw new RangeError("invalid operation index");var t=this.operations[e];try{t=vn.createClaimableBalance(t)}catch(e){throw new TypeError("expected createClaimableBalance, got ".concat(t.type,": ").concat(e))}var r=Lt.decodeEd25519PublicKey(Wr(this.source)),n=u(i.HashIdPreimage.envelopeTypeOpId(new i.HashIdPreimageOperationId({sourceAccount:i.AccountId.publicKeyTypeEd25519(r),seqNum:i.SequenceNumber.fromString(this.sequence),opNum:e})).toXDR("raw"));return i.ClaimableBalanceId.claimableBalanceIdTypeV0(n).toXDR("hex")}}])}(ar),Dn=r(8287).Buffer;function Fn(e){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fn(e)}function Mn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vn(n.key),n)}}function Vn(e){var t=function(e){if("object"!=Fn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Fn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fn(t)?t:t+""}function qn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(qn=function(){return!!e})()}function Hn(e){return Hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hn(e)}function zn(e,t){return zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zn(e,t)}var Kn=function(e){function t(e,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e){var o=Dn.from(e,"base64");e=i.TransactionEnvelope.fromXDR(o)}var a=e.switch();if(a!==i.EnvelopeType.envelopeTypeTxFeeBump())throw new Error("Invalid TransactionEnvelope: expected an envelopeTypeTxFeeBump but received an ".concat(a.name,"."));var s=e.value(),u=s.tx(),c=u.fee().toString();n=function(e,t,r){return t=Hn(t),function(e,t){if(t&&("object"==Fn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qn()?Reflect.construct(t,r||[],Hn(e).constructor):t.apply(e,r))}(this,t,[u,(s.signatures()||[]).slice(),c,r]);var l=i.TransactionEnvelope.envelopeTypeTx(u.innerTx().v1());return n._feeSource=$r(n.tx.feeSource()),n._innerTransaction=new Ln(l,r),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zn(e,t)}(t,e),function(e,t){return t&&Mn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"innerTransaction",get:function(){return this._innerTransaction}},{key:"operations",get:function(){return this._innerTransaction.operations}},{key:"feeSource",get:function(){return this._feeSource}},{key:"signatureBase",value:function(){var e=new i.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTxFeeBump(this.tx);return new i.TransactionSignaturePayload({networkId:i.Hash.fromXDR(u(this.networkPassphrase)),taggedTransaction:e}).toXDR()}},{key:"toEnvelope",value:function(){var e=new i.FeeBumpTransactionEnvelope({tx:i.FeeBumpTransaction.fromXDR(this.tx.toXDR()),signatures:this.signatures.slice()});return new i.TransactionEnvelope.envelopeTypeTxFeeBump(e)}}])}(ar);function Xn(e){return Xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xn(e)}function $n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Gn(n.key),n)}}function Gn(e){var t=function(e){if("object"!=Xn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Xn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xn(t)?t:t+""}var Wn=function(e,t){return t&&$n(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Lt.isValidMed25519PublicKey(t))throw new Error("accountId is an M-address; use MuxedAccount instead");if(!Lt.isValidEd25519PublicKey(t))throw new Error("accountId is invalid");if("string"!=typeof r)throw new Error("sequence must be of type string");this._accountId=t,this.sequence=new _r(r)},[{key:"accountId",value:function(){return this._accountId}},{key:"sequenceNumber",value:function(){return this.sequence.toString()}},{key:"incrementSequenceNumber",value:function(){this.sequence=this.sequence.plus(1)}}]);function Qn(e){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(e)}function Zn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yn(n.key),n)}}function Yn(e){var t=function(e){if("object"!=Qn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Qn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qn(t)?t:t+""}var Jn=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.accountId();if(!Lt.isValidEd25519PublicKey(n))throw new Error("accountId is invalid");this.account=t,this._muxedXdr=Gr(n,r),this._mAddress=$r(this._muxedXdr),this._id=r}return function(e,t,r){return t&&Zn(e.prototype,t),r&&Zn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"baseAccount",value:function(){return this.account}},{key:"accountId",value:function(){return this._mAddress}},{key:"id",value:function(){return this._id}},{key:"setId",value:function(e){if("string"!=typeof e)throw new Error("id should be a string representing a number (uint64)");return this._muxedXdr.med25519().id(i.Uint64.fromString(e)),this._mAddress=$r(this._muxedXdr),this._id=e,this}},{key:"sequenceNumber",value:function(){return this.account.sequenceNumber()}},{key:"incrementSequenceNumber",value:function(){return this.account.incrementSequenceNumber()}},{key:"toXDRObject",value:function(){return this._muxedXdr}},{key:"equals",value:function(e){return this.accountId()===e.accountId()}}],[{key:"fromAddress",value:function(t,r){var n=Xr(t),o=Wr(t),i=n.med25519().id().toString();return new e(new Wn(o,r),i)}}])}();function eo(e){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(e)}function to(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ro(n.key),n)}}function ro(e){var t=function(e){if("object"!=eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eo(t)?t:t+""}var no=function(e,t,r){return t&&to(e.prototype,t),r&&to(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t,r){(t=ro(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_data",void 0),r=t?"string"==typeof t||ArrayBuffer.isView(t)?e.fromXDR(t):e.fromXDR(t.toXDR()):new i.SorobanTransactionData({resources:new i.SorobanResources({footprint:new i.LedgerFootprint({readOnly:[],readWrite:[]}),instructions:0,diskReadBytes:0,writeBytes:0}),ext:new i.SorobanTransactionDataExt(0),resourceFee:new i.Int64(0)}),this._data=r},[{key:"setResourceFee",value:function(e){return this._data.resourceFee(new i.Int64(e)),this}},{key:"setResources",value:function(e,t,r){return this._data.resources().instructions(e),this._data.resources().diskReadBytes(t),this._data.resources().writeBytes(r),this}},{key:"appendFootprint",value:function(e,t){return this.setFootprint(this.getReadOnly().concat(e),this.getReadWrite().concat(t))}},{key:"setFootprint",value:function(e,t){return null!==e&&this.setReadOnly(e),null!==t&&this.setReadWrite(t),this}},{key:"setReadOnly",value:function(e){return this._data.resources().footprint().readOnly(null!=e?e:[]),this}},{key:"setReadWrite",value:function(e){return this._data.resources().footprint().readWrite(null!=e?e:[]),this}},{key:"build",value:function(){return i.SorobanTransactionData.fromXDR(this._data.toXDR())}},{key:"getReadOnly",value:function(){return this.getFootprint().readOnly()}},{key:"getReadWrite",value:function(){return this.getFootprint().readWrite()}},{key:"getFootprint",value:function(){return this._data.resources().footprint()}}],[{key:"fromXDR",value:function(e){return i.SorobanTransactionData.fromXDR(e,"string"==typeof e?"base64":"raw")}}]);function oo(e){return oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oo(e)}function io(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ao(n.key),n)}}function ao(e){var t=function(e){if("object"!=oo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=oo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oo(t)?t:t+""}var so=function(e,t,r){return r&&io(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"decodeAddress",value:function(e){var t={ed25519PublicKey:i.SignerKey.signerKeyTypeEd25519,preAuthTx:i.SignerKey.signerKeyTypePreAuthTx,sha256Hash:i.SignerKey.signerKeyTypeHashX,signedPayload:i.SignerKey.signerKeyTypeEd25519SignedPayload},r=Lt.getVersionByteForPrefix(e),n=t[r];if(!n)throw new Error("invalid signer key type (".concat(r,")"));var o=Ft(r,e);return n("signedPayload"===r?new i.SignerKeyEd25519SignedPayload({ed25519:o.slice(0,32),payload:o.slice(36)}):o)}},{key:"encodeSignerKey",value:function(e){var t,r;switch(e.switch()){case i.SignerKeyType.signerKeyTypeEd25519():t="ed25519PublicKey",r=e.value();break;case i.SignerKeyType.signerKeyTypePreAuthTx():t="preAuthTx",r=e.value();break;case i.SignerKeyType.signerKeyTypeHashX():t="sha256Hash",r=e.value();break;case i.SignerKeyType.signerKeyTypeEd25519SignedPayload():t="signedPayload",r=e.ed25519SignedPayload().toXDR("raw");break;default:throw new Error("invalid SignerKey (type: ".concat(e.switch(),")"))}return Mt(t,r)}}]);function uo(e){return uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uo(e)}function co(e){return function(e){if(Array.isArray(e))return lo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return lo(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lo(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function fo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function po(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fo(Object(r),!0).forEach(function(t){ho(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ho(e,t,r){return(t=mo(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mo(n.key),n)}}function mo(e){var t=function(e){if("object"!=uo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=uo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uo(t)?t:t+""}var go="100",vo=0,bo=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("must specify source account for the transaction");if(void 0===r.fee)throw new Error("must specify fee for the transaction (in stroops)");this.source=t,this.operations=[],this.baseFee=r.fee,this.timebounds=r.timebounds?po({},r.timebounds):null,this.ledgerbounds=r.ledgerbounds?po({},r.ledgerbounds):null,this.minAccountSequence=r.minAccountSequence||null,this.minAccountSequenceAge=r.minAccountSequenceAge||null,this.minAccountSequenceLedgerGap=r.minAccountSequenceLedgerGap||null,this.extraSigners=r.extraSigners?co(r.extraSigners):null,this.memo=r.memo||Pn.none(),this.networkPassphrase=r.networkPassphrase||null,this.sorobanData=r.sorobanData?new no(r.sorobanData).build():null}return function(e,t,r){return t&&yo(e.prototype,t),r&&yo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"addOperation",value:function(e){return this.operations.push(e),this}},{key:"addOperationAt",value:function(e,t){return this.operations.splice(t,0,e),this}},{key:"clearOperations",value:function(){return this.operations=[],this}},{key:"clearOperationAt",value:function(e){return this.operations.splice(e,1),this}},{key:"addMemo",value:function(e){return this.memo=e,this}},{key:"setTimeout",value:function(e){if(null!==this.timebounds&&this.timebounds.maxTime>0)throw new Error("TimeBounds.max_time has been already set - setting timeout would overwrite it.");if(e<0)throw new Error("timeout cannot be negative");if(e>0){var t=Math.floor(Date.now()/1e3)+e;null===this.timebounds?this.timebounds={minTime:0,maxTime:t}:this.timebounds={minTime:this.timebounds.minTime,maxTime:t}}else this.timebounds={minTime:0,maxTime:0};return this}},{key:"setTimebounds",value:function(e,t){if("number"==typeof e&&(e=new Date(1e3*e)),"number"==typeof t&&(t=new Date(1e3*t)),null!==this.timebounds)throw new Error("TimeBounds has been already set - setting timebounds would overwrite it.");var r=Math.floor(e.valueOf()/1e3),n=Math.floor(t.valueOf()/1e3);if(r<0)throw new Error("min_time cannot be negative");if(n<0)throw new Error("max_time cannot be negative");if(n>0&&r>n)throw new Error("min_time cannot be greater than max_time");return this.timebounds={minTime:r,maxTime:n},this}},{key:"setLedgerbounds",value:function(e,t){if(null!==this.ledgerbounds)throw new Error("LedgerBounds has been already set - setting ledgerbounds would overwrite it.");if(e<0)throw new Error("min_ledger cannot be negative");if(t<0)throw new Error("max_ledger cannot be negative");if(t>0&&e>t)throw new Error("min_ledger cannot be greater than max_ledger");return this.ledgerbounds={minLedger:e,maxLedger:t},this}},{key:"setMinAccountSequence",value:function(e){if(null!==this.minAccountSequence)throw new Error("min_account_sequence has been already set - setting min_account_sequence would overwrite it.");return this.minAccountSequence=e,this}},{key:"setMinAccountSequenceAge",value:function(e){if("number"!=typeof e)throw new Error("min_account_sequence_age must be a number");if(null!==this.minAccountSequenceAge)throw new Error("min_account_sequence_age has been already set - setting min_account_sequence_age would overwrite it.");if(e<0)throw new Error("min_account_sequence_age cannot be negative");return this.minAccountSequenceAge=e,this}},{key:"setMinAccountSequenceLedgerGap",value:function(e){if(null!==this.minAccountSequenceLedgerGap)throw new Error("min_account_sequence_ledger_gap has been already set - setting min_account_sequence_ledger_gap would overwrite it.");if(e<0)throw new Error("min_account_sequence_ledger_gap cannot be negative");return this.minAccountSequenceLedgerGap=e,this}},{key:"setExtraSigners",value:function(e){if(!Array.isArray(e))throw new Error("extra_signers must be an array of strings.");if(null!==this.extraSigners)throw new Error("extra_signers has been already set - setting extra_signers would overwrite it.");if(e.length>2)throw new Error("extra_signers cannot be longer than 2 elements.");return this.extraSigners=co(e),this}},{key:"setNetworkPassphrase",value:function(e){return this.networkPassphrase=e,this}},{key:"setSorobanData",value:function(e){return this.sorobanData=new no(e).build(),this}},{key:"build",value:function(){var e=new _r(this.source.sequenceNumber()).plus(1),t={fee:new _r(this.baseFee).times(this.operations.length).toNumber(),seqNum:i.SequenceNumber.fromString(e.toString()),memo:this.memo?this.memo.toXDRObject():null};if(null===this.timebounds||void 0===this.timebounds.minTime||void 0===this.timebounds.maxTime)throw new Error("TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).");wo(this.timebounds.minTime)&&(this.timebounds.minTime=this.timebounds.minTime.getTime()/1e3),wo(this.timebounds.maxTime)&&(this.timebounds.maxTime=this.timebounds.maxTime.getTime()/1e3),this.timebounds.minTime=n.UnsignedHyper.fromString(this.timebounds.minTime.toString()),this.timebounds.maxTime=n.UnsignedHyper.fromString(this.timebounds.maxTime.toString());var r=new i.TimeBounds(this.timebounds);if(this.hasV2Preconditions()){var o=null;null!==this.ledgerbounds&&(o=new i.LedgerBounds(this.ledgerbounds));var a=this.minAccountSequence||"0";a=i.SequenceNumber.fromString(a);var s=n.UnsignedHyper.fromString(null!==this.minAccountSequenceAge?this.minAccountSequenceAge.toString():"0"),u=this.minAccountSequenceLedgerGap||0,c=null!==this.extraSigners?this.extraSigners.map(so.decodeAddress):[];t.cond=i.Preconditions.precondV2(new i.PreconditionsV2({timeBounds:r,ledgerBounds:o,minSeqNum:a,minSeqAge:s,minSeqLedgerGap:u,extraSigners:c}))}else t.cond=i.Preconditions.precondTime(r);t.sourceAccount=Xr(this.source.accountId()),this.sorobanData?t.ext=new i.TransactionExt(1,this.sorobanData):t.ext=new i.TransactionExt(0,i.Void);var l=new i.Transaction(t);l.operations(this.operations);var f=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:l})),p=new Ln(f,this.networkPassphrase);return this.source.incrementSequenceNumber(),p}},{key:"hasV2Preconditions",value:function(){return null!==this.ledgerbounds||null!==this.minAccountSequence||null!==this.minAccountSequenceAge||null!==this.minAccountSequenceLedgerGap||null!==this.extraSigners&&this.extraSigners.length>0}}],[{key:"cloneFrom",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t instanceof Ln))throw new TypeError("expected a 'Transaction', got: ".concat(t));var n,o=(BigInt(t.sequence)-1n).toString();if(Lt.isValidMed25519PublicKey(t.source))n=Jn.fromAddress(t.source,o);else{if(!Lt.isValidEd25519PublicKey(t.source))throw new TypeError("unsupported tx source account: ".concat(t.source));n=new Wn(t.source,o)}var i=new e(n,po({fee:(parseInt(t.fee,10)/t.operations.length||go).toString(),memo:t.memo,networkPassphrase:t.networkPassphrase,timebounds:t.timeBounds,ledgerbounds:t.ledgerBounds,minAccountSequence:t.minAccountSequence,minAccountSequenceAge:t.minAccountSequenceAge,minAccountSequenceLedgerGap:t.minAccountSequenceLedgerGap,extraSigners:t.extraSigners},r));return t._tx.operations().forEach(function(e){return i.addOperation(e)}),i}},{key:"buildFeeBumpTransaction",value:function(e,t,r,n){var o=r.operations.length,a=new _r(r.fee).div(o),s=new _r(t);if(s.lt(a))throw new Error("Invalid baseFee, it should be at least ".concat(a," stroops."));var u=new _r(go);if(s.lt(u))throw new Error("Invalid baseFee, it should be at least ".concat(u," stroops."));var c,l=r.toEnvelope();if(l.switch()===i.EnvelopeType.envelopeTypeTxV0()){var f=l.v0().tx(),p=new i.Transaction({sourceAccount:new i.MuxedAccount.keyTypeEd25519(f.sourceAccountEd25519()),fee:f.fee(),seqNum:f.seqNum(),cond:i.Preconditions.precondTime(f.timeBounds()),memo:f.memo(),operations:f.operations(),ext:new i.TransactionExt(0)});l=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:p,signatures:l.v0().signatures()}))}c="string"==typeof e?Xr(e):e.xdrMuxedAccount();var d=new i.FeeBumpTransaction({feeSource:c,fee:i.Int64.fromString(s.times(o+1).toString()),innerTx:i.FeeBumpTransactionInnerTx.envelopeTypeTx(l.v1()),ext:new i.FeeBumpTransactionExt(0)}),h=new i.FeeBumpTransactionEnvelope({tx:d,signatures:[]}),y=new i.TransactionEnvelope.envelopeTypeTxFeeBump(h);return new Kn(y,n)}},{key:"fromXDR",value:function(e,t){return"string"==typeof e&&(e=i.TransactionEnvelope.fromXDR(e,"base64")),e.switch()===i.EnvelopeType.envelopeTypeTxFeeBump()?new Kn(e,t):new Ln(e,t)}}])}();function wo(e){return e instanceof Date&&!isNaN(e)}var So={PUBLIC:"Public Global Stellar Network ; September 2015",TESTNET:"Test SDF Network ; September 2015",FUTURENET:"Test SDF Future Network ; October 2022",SANDBOX:"Local Sandbox Stellar Network ; September 2022",STANDALONE:"Standalone Network ; February 2017"};function Eo(e){return Eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eo(e)}function To(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ko(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Oo(n.key),n)}}function Oo(e){var t=function(e){if("object"!=Eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Eo(t)?t:t+""}var Ao=function(e,t,r){return r&&ko(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"formatTokenAmount",value:function(e,t){if(e.includes("."))throw new TypeError("No decimals are allowed");var r=e;return t>0&&(r=t>r.length?["0",r.toString().padStart(t,"0")].join("."):[r.slice(0,-t),r.slice(-t)].join(".")),r.replace(/(\.\d*?)0+$/,"$1")}},{key:"parseTokenAmount",value:function(e,t){var r,n=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return To(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?To(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(".").slice()),o=n[0],i=n[1];if(n.slice(2).length)throw new Error("Invalid decimal value: ".concat(e));return BigInt(o+(null!==(r=null==i?void 0:i.padEnd(t,"0"))&&void 0!==r?r:"0".repeat(t))).toString()}}]);function _o(e){return _o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_o(e)}function xo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Po(n.key),n)}}function Po(e){var t=function(e){if("object"!=_o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=_o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_o(t)?t:t+""}var Io=function(e,t){return t&&xo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);try{this._id=Lt.decodeContract(t)}catch(e){throw new Error("Invalid contract ID: ".concat(t))}},[{key:"contractId",value:function(){return Lt.encodeContract(this._id)}},{key:"toString",value:function(){return this.contractId()}},{key:"address",value:function(){return sn.contract(this._id)}},{key:"call",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return vn.invokeContractFunction({contract:this.address().toString(),function:e,args:r})}},{key:"getFootprint",value:function(){return i.LedgerKey.contractData(new i.LedgerKeyContractData({contract:this.address().toScAddress(),key:i.ScVal.scvLedgerKeyContractInstance(),durability:i.ContractDataDurability.persistent()}))}}]);function Ro(e){return Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(e)}function Bo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Co(n.key),n)}}function Co(e){var t=function(e){if("object"!=Ro(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ro(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ro(t)?t:t+""}function jo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jo=function(){return!!e})()}function Uo(e){return Uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Uo(e)}function No(e,t){return No=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},No(e,t)}var Lo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e,t,r){return t=Uo(t),function(e,t){if(t&&("object"==Ro(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jo()?Reflect.construct(t,r||[],Uo(e).constructor):t.apply(e,r))}(this,t,[r])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&No(e,t)}(t,e),function(e,t){return t&&Bo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"unsigned",get:function(){return!0}},{key:"size",get:function(){return 128}}])}(n.LargeInt);function Do(e){return Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Do(e)}function Fo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mo(n.key),n)}}function Mo(e){var t=function(e){if("object"!=Do(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Do(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Do(t)?t:t+""}function Vo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Vo=function(){return!!e})()}function qo(e){return qo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qo(e)}function Ho(e,t){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ho(e,t)}Lo.defineIntBoundaries();var zo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e,t,r){return t=qo(t),function(e,t){if(t&&("object"==Do(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Vo()?Reflect.construct(t,r||[],qo(e).constructor):t.apply(e,r))}(this,t,[r])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ho(e,t)}(t,e),function(e,t){return t&&Fo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"unsigned",get:function(){return!0}},{key:"size",get:function(){return 256}}])}(n.LargeInt);function Ko(e){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ko(e)}function Xo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$o(n.key),n)}}function $o(e){var t=function(e){if("object"!=Ko(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ko(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ko(t)?t:t+""}function Go(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Go=function(){return!!e})()}function Wo(e){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wo(e)}function Qo(e,t){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qo(e,t)}zo.defineIntBoundaries();var Zo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e,t,r){return t=Wo(t),function(e,t){if(t&&("object"==Ko(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Go()?Reflect.construct(t,r||[],Wo(e).constructor):t.apply(e,r))}(this,t,[r])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qo(e,t)}(t,e),function(e,t){return t&&Xo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"unsigned",get:function(){return!1}},{key:"size",get:function(){return 128}}])}(n.LargeInt);function Yo(e){return Yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yo(e)}function Jo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ei(n.key),n)}}function ei(e){var t=function(e){if("object"!=Yo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Yo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Yo(t)?t:t+""}function ti(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ti=function(){return!!e})()}function ri(e){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ri(e)}function ni(e,t){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ni(e,t)}Zo.defineIntBoundaries();var oi=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e,t,r){return t=ri(t),function(e,t){if(t&&("object"==Yo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ti()?Reflect.construct(t,r||[],ri(e).constructor):t.apply(e,r))}(this,t,[r])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ni(e,t)}(t,e),function(e,t){return t&&Jo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"unsigned",get:function(){return!1}},{key:"size",get:function(){return 256}}])}(n.LargeInt);function ii(e){return ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ii(e)}function ai(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ui(n.key),n)}}function si(e,t,r){return(t=ui(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ui(e){var t=function(e){if("object"!=ii(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ii(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ii(t)?t:t+""}oi.defineIntBoundaries();var ci=function(e,t,r){return t&&ai(e.prototype,t),r&&ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r){switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),si(this,"int",void 0),si(this,"type",void 0),r instanceof Array||(r=[r]),r=r.map(function(e){return"bigint"==typeof e?e:"function"==typeof e.toBigInt?e.toBigInt():BigInt(e)}),t){case"i64":this.int=new n.Hyper(r);break;case"i128":this.int=new Zo(r);break;case"i256":this.int=new oi(r);break;case"u64":this.int=new n.UnsignedHyper(r);break;case"u128":this.int=new Lo(r);break;case"u256":this.int=new zo(r);break;default:throw TypeError("invalid type: ".concat(t))}this.type=t},[{key:"toNumber",value:function(){var e=this.int.toBigInt();if(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)throw RangeError("value ".concat(e," not in range for Number ")+"[".concat(Number.MAX_SAFE_INTEGER,", ").concat(Number.MIN_SAFE_INTEGER,"]"));return Number(e)}},{key:"toBigInt",value:function(){return this.int.toBigInt()}},{key:"toI64",value:function(){this._sizeCheck(64);var e=this.toBigInt();if(BigInt.asIntN(64,e)!==e)throw RangeError("value too large for i64: ".concat(e));return i.ScVal.scvI64(new i.Int64(e))}},{key:"toU64",value:function(){return this._sizeCheck(64),i.ScVal.scvU64(new i.Uint64(BigInt.asUintN(64,this.toBigInt())))}},{key:"toI128",value:function(){this._sizeCheck(128);var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>64n),r=BigInt.asUintN(64,e);return i.ScVal.scvI128(new i.Int128Parts({hi:new i.Int64(t),lo:new i.Uint64(r)}))}},{key:"toU128",value:function(){this._sizeCheck(128);var e=this.int.toBigInt();return i.ScVal.scvU128(new i.UInt128Parts({hi:new i.Uint64(BigInt.asUintN(64,e>>64n)),lo:new i.Uint64(BigInt.asUintN(64,e))}))}},{key:"toI256",value:function(){var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return i.ScVal.scvI256(new i.Int256Parts({hiHi:new i.Int64(t),hiLo:new i.Uint64(r),loHi:new i.Uint64(n),loLo:new i.Uint64(o)}))}},{key:"toU256",value:function(){var e=this.int.toBigInt(),t=BigInt.asUintN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return i.ScVal.scvU256(new i.UInt256Parts({hiHi:new i.Uint64(t),hiLo:new i.Uint64(r),loHi:new i.Uint64(n),loLo:new i.Uint64(o)}))}},{key:"toScVal",value:function(){switch(this.type){case"i64":return this.toI64();case"i128":return this.toI128();case"i256":return this.toI256();case"u64":return this.toU64();case"u128":return this.toU128();case"u256":return this.toU256();default:throw TypeError("invalid type: ".concat(this.type))}}},{key:"valueOf",value:function(){return this.int.valueOf()}},{key:"toString",value:function(){return this.int.toString()}},{key:"toJSON",value:function(){return{value:this.toBigInt().toString(),type:this.type}}},{key:"_sizeCheck",value:function(e){if(this.int.size>e)throw RangeError("value too large for ".concat(e," bits (").concat(this.type,")"))}}],[{key:"isType",value:function(e){switch(e){case"i64":case"i128":case"i256":case"u64":case"u128":case"u256":return!0;default:return!1}}},{key:"getType",value:function(e){return e.slice(3).toLowerCase()}}]);function li(e){return li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},li(e)}function fi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(fi=function(){return!!e})()}function pi(e){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pi(e)}function di(e,t){return di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},di(e,t)}var hi=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=e<0,i=null!==(n=null==r?void 0:r.type)&&void 0!==n?n:"";if(i.startsWith("u")&&o)throw TypeError("specified type ".concat(r.type," yet negative (").concat(e,")"));if(""===i){i=o?"i":"u";var a=function(e){var t,r=e.toString(2).length;return null!==(t=[64,128,256].find(function(e){return r<=e}))&&void 0!==t?t:r}(e);switch(a){case 64:case 128:case 256:i+=a.toString();break;default:throw RangeError("expected 64/128/256 bits for input (".concat(e,"), got ").concat(a))}}return function(e,t,r){return t=pi(t),function(e,t){if(t&&("object"==li(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fi()?Reflect.construct(t,r||[],pi(e).constructor):t.apply(e,r))}(this,t,[i,e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&di(e,t)}(t,e),function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ci);function yi(e){var t=ci.getType(e.switch().name);switch(e.switch().name){case"scvU32":case"scvI32":return BigInt(e.value());case"scvU64":case"scvI64":return new ci(t,e.value()).toBigInt();case"scvU128":case"scvI128":return new ci(t,[e.value().lo(),e.value().hi()]).toBigInt();case"scvU256":case"scvI256":return new ci(t,[e.value().loLo(),e.value().loHi(),e.value().hiLo(),e.value().hiHi()]).toBigInt();default:throw TypeError("expected integer type, got ".concat(e.switch()))}}var mi=r(8287).Buffer;function gi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return vi(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function bi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function wi(e,t,r){return(t=function(e){var t=function(e){if("object"!=Si(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Si(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Si(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Si(e){return Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Si(e)}function Ei(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(Si(e)){case"object":var r,n,o;if(null===e)return i.ScVal.scvVoid();if(e instanceof i.ScVal)return e;if(e instanceof sn)return e.toScVal();if(e instanceof Xt)return Ei(e.publicKey(),{type:"address"});if(e instanceof Io)return e.address().toScVal();if(e instanceof Uint8Array||mi.isBuffer(e)){var a,s=Uint8Array.from(e);switch(null!==(a=null==t?void 0:t.type)&&void 0!==a?a:"bytes"){case"bytes":return i.ScVal.scvBytes(s);case"symbol":return i.ScVal.scvSymbol(s);case"string":return i.ScVal.scvString(s);default:throw new TypeError("invalid type (".concat(t.type,") specified for bytes-like value"))}}if(Array.isArray(e))return i.ScVal.scvVec(e.map(function(e,r){return Array.isArray(t.type)?Ei(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bi(Object(r),!0).forEach(function(t){wi(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},t.type.length>r&&{type:t.type[r]})):Ei(e,t)}));if("Object"!==(null!==(r=null===(n=e.constructor)||void 0===n?void 0:n.name)&&void 0!==r?r:""))throw new TypeError("cannot interpret ".concat(null===(o=e.constructor)||void 0===o?void 0:o.name," value as ScVal (").concat(JSON.stringify(e),")"));return i.ScVal.scvMap(Object.entries(e).sort(function(e,t){var r=gi(e,1)[0],n=gi(t,1)[0];return r.localeCompare(n)}).map(function(e){var r,n,o=gi(e,2),a=o[0],s=o[1],u=gi(null!==(r=(null!==(n=null==t?void 0:t.type)&&void 0!==n?n:{})[a])&&void 0!==r?r:[null,null],2),c=u[0],l=u[1],f=c?{type:c}:{},p=l?{type:l}:{};return new i.ScMapEntry({key:Ei(a,f),val:Ei(s,p)})}));case"number":case"bigint":switch(null==t?void 0:t.type){case"u32":return i.ScVal.scvU32(e);case"i32":return i.ScVal.scvI32(e)}return new hi(e,{type:null==t?void 0:t.type}).toScVal();case"string":var u,c=null!==(u=null==t?void 0:t.type)&&void 0!==u?u:"string";switch(c){case"string":return i.ScVal.scvString(e);case"symbol":return i.ScVal.scvSymbol(e);case"address":return new sn(e).toScVal();case"u32":return i.ScVal.scvU32(parseInt(e,10));case"i32":return i.ScVal.scvI32(parseInt(e,10));default:if(ci.isType(c))return new ci(c,e).toScVal();throw new TypeError("invalid type (".concat(t.type,") specified for string value"))}case"boolean":return i.ScVal.scvBool(e);case"undefined":return i.ScVal.scvVoid();case"function":return Ei(e());default:throw new TypeError("failed to convert typeof ".concat(Si(e)," (").concat(e,")"))}}function Ti(e){var t,r;switch(e.switch().value){case i.ScValType.scvVoid().value:return null;case i.ScValType.scvU64().value:case i.ScValType.scvI64().value:return e.value().toBigInt();case i.ScValType.scvU128().value:case i.ScValType.scvI128().value:case i.ScValType.scvU256().value:case i.ScValType.scvI256().value:return yi(e);case i.ScValType.scvVec().value:return(null!==(t=e.vec())&&void 0!==t?t:[]).map(Ti);case i.ScValType.scvAddress().value:return sn.fromScVal(e).toString();case i.ScValType.scvMap().value:return Object.fromEntries((null!==(r=e.map())&&void 0!==r?r:[]).map(function(e){return[Ti(e.key()),Ti(e.val())]}));case i.ScValType.scvBool().value:case i.ScValType.scvU32().value:case i.ScValType.scvI32().value:case i.ScValType.scvBytes().value:return e.value();case i.ScValType.scvSymbol().value:case i.ScValType.scvString().value:var n=e.value();if(mi.isBuffer(n)||ArrayBuffer.isView(n))try{return(new TextDecoder).decode(n)}catch(e){return new Uint8Array(n.buffer)}return n;case i.ScValType.scvTimepoint().value:case i.ScValType.scvDuration().value:return new i.Uint64(e.value()).toBigInt();case i.ScValType.scvError().value:if(e.error().switch().value===i.ScErrorType.sceContract().value)return{type:"contract",code:e.error().contractCode()};var o=e.error();return{type:"system",code:o.code().value,value:o.code().name};default:return e.value()}}function ki(e){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ki(e)}function Oi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ai(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oi(Object(r),!0).forEach(function(t){_i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _i(e,t,r){return(t=function(e){var t=function(e){if("object"!=ki(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ki(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xi(e){return e.map(function(e){return e.inSuccessfulContractCall?Pi(e.event()):Pi(e)})}function Pi(e){return Ai(Ai({},"function"==typeof e.contractId&&null!=e.contractId()&&{contractId:Lt.encodeContract(e.contractId())}),{},{type:e.type().name,topics:e.body().value().topics().map(function(e){return Ti(e)}),data:Ti(e.body().value().data())})}i.scvSortedMap=function(e){var t=Array.from(e).sort(function(e,t){var r=Ti(e.key()),n=Ti(t.key());switch(Si(r)){case"number":case"bigint":return r<n?-1:1;default:return r.toString().localeCompare(n.toString())}});return i.ScVal.scvMap(t)};var Ii=r(8287).Buffer;function Ri(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return Bi(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Bi(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Bi(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Bi(f,"constructor",c),Bi(c,"constructor",u),u.displayName="GeneratorFunction",Bi(c,o,"GeneratorFunction"),Bi(f),Bi(f,o,"Generator"),Bi(f,n,function(){return this}),Bi(f,"toString",function(){return"[object Generator]"}),(Ri=function(){return{w:i,m:p}})()}function Bi(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Bi=function(e,t,r,n){function i(t,r){Bi(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Bi(e,t,r,n)}function Ci(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function ji(e,t,r){return Ui.apply(this,arguments)}function Ui(){var e;return e=Ri().m(function e(t,r,n){var o,a,s,c,l,f,p,d,h,y,m=arguments;return Ri().w(function(e){for(;;)switch(e.n){case 0:if(o=m.length>3&&void 0!==m[3]?m[3]:So.FUTURENET,t.credentials().switch().value===i.SorobanCredentialsType.sorobanCredentialsAddress().value){e.n=1;break}return e.a(2,t);case 1:if(a=i.SorobanAuthorizationEntry.fromXDR(t.toXDR()),(s=a.credentials().address()).signatureExpirationLedger(n),c=u(Ii.from(o)),l=i.HashIdPreimage.envelopeTypeSorobanAuthorization(new i.HashIdPreimageSorobanAuthorization({networkId:c,nonce:s.nonce(),invocation:a.rootInvocation(),signatureExpirationLedger:s.signatureExpirationLedger()})),f=u(l.toXDR()),"function"!=typeof r){e.n=3;break}return e.n=2,r(l);case 2:null!=(h=e.v)&&h.signature?(p=Ii.from(h.signature),d=h.publicKey):(p=Ii.from(h),d=sn.fromScAddress(s.address()).toString()),e.n=4;break;case 3:p=Ii.from(r.sign(f)),d=r.publicKey();case 4:if(Xt.fromPublicKey(d).verify(f,p)){e.n=5;break}throw new Error("signature doesn't match payload");case 5:return y=Ei({public_key:Lt.decodeEd25519PublicKey(d),signature:p},{type:{public_key:["symbol",null],signature:["symbol",null]}}),s.signature(i.ScVal.scvVec([y])),e.a(2,a)}},e)}),Ui=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Ci(i,n,o,a,s,"next",e)}function s(e){Ci(i,n,o,a,s,"throw",e)}a(void 0)})},Ui.apply(this,arguments)}function Ni(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:So.FUTURENET,a=Xt.random().rawPublicKey(),s=new i.Int64(a.subarray(0,8).reduce(function(e,t){return e<<8|t},0)),u=n||e.publicKey();if(!u)throw new Error("authorizeInvocation requires publicKey parameter");return ji(new i.SorobanAuthorizationEntry({rootInvocation:r,credentials:i.SorobanCredentials.sorobanCredentialsAddress(new i.SorobanAddressCredentials({address:new sn(u).toScAddress(),nonce:s,signatureExpirationLedger:0,signature:i.ScVal.scvVec([])}))}),e,t,o)}function Li(e){return Li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Li(e)}function Di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Fi(e,t,r){return(t=function(e){var t=function(e){if("object"!=Li(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Li(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Li(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mi(e){var t=e.function(),r={},n=t.value();switch(t.switch().value){case 0:r.type="execute",r.args={source:sn.fromScAddress(n.contractAddress()).toString(),function:n.functionName(),args:n.args().map(function(e){return Ti(e)})};break;case 1:case 2:var o=2===t.switch().value;r.type="create",r.args={};var i=[n.executable(),n.contractIdPreimage()],a=i[0],s=i[1];if(!!a.switch().value!=!!s.switch().value)throw new Error("creation function appears invalid: ".concat(JSON.stringify(n)," (should be wasm+address or token+asset)"));switch(a.switch().value){case 0:var u=s.fromAddress();r.args.type="wasm",r.args.wasm=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Di(Object(r),!0).forEach(function(t){Fi(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Di(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({salt:u.salt().toString("hex"),hash:a.wasmHash().toString("hex"),address:sn.fromScAddress(u.address()).toString()},o&&{constructorArgs:n.constructorArgs().map(function(e){return Ti(e)})});break;case 1:r.args.type="sac",r.args.asset=Zt.fromOperation(s.fromAsset()).toString();break;default:throw new Error("unknown creation type: ".concat(JSON.stringify(a)))}break;default:throw new Error("unknown invocation type (".concat(t.switch(),"): ").concat(JSON.stringify(t)))}return r.invocations=e.subInvocations().map(function(e){return Mi(e)}),r}function Vi(e,t){qi(e,1,t)}function qi(e,t,r,n){!1!==r(e,t,n)&&e.subInvocations().forEach(function(n){return qi(n,t+1,r,e)})}const Hi=(e=r.hmd(e)).exports},453:(e,t,r)=>{"use strict";var n,o=r(9612),i=r(9383),a=r(1237),s=r(9290),u=r(9538),c=r(8068),l=r(9675),f=r(5345),p=r(1514),d=r(8968),h=r(6188),y=r(8002),m=r(5880),g=r(414),v=r(3093),b=Function,w=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},S=r(5795),E=r(655),T=function(){throw new l},k=S?function(){try{return T}catch(e){try{return S(arguments,"callee").get}catch(e){return T}}}():T,O=r(4039)(),A=r(3628),_=r(1064),x=r(8648),P=r(1002),I=r(76),R={},B="undefined"!=typeof Uint8Array&&A?A(Uint8Array):n,C={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":O&&A?A([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":R,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O&&A?A(A([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O&&A?A((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&O&&A?A((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&A?A(""[Symbol.iterator]()):n,"%Symbol%":O?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":k,"%TypedArray%":B,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":P,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":_,"%Math.abs%":p,"%Math.floor%":d,"%Math.max%":h,"%Math.min%":y,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":v,"%Reflect.getPrototypeOf%":x};if(A)try{null.error}catch(e){var j=A(A(e));C["%Error.prototype%"]=j}var U=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&A&&(r=A(o.prototype))}return C[t]=r,r},N={__proto__:null,"%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"]},L=r(6743),D=r(9957),F=L.call(I,Array.prototype.concat),M=L.call(P,Array.prototype.splice),V=L.call(I,String.prototype.replace),q=L.call(I,String.prototype.slice),H=L.call(I,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,X=function(e,t){var r,n=e;if(D(N,n)&&(n="%"+(r=N[n])[0]+"%"),D(C,n)){var o=C[n];if(o===R&&(o=U(n)),void 0===o&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=q(e,0,1),r=q(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return V(e,z,function(e,t,r,o){n[n.length]=r?V(o,K,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",o=X("%"+n+"%",t),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],M(r,F([0,1],u)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],h=q(d,0,1),y=q(d,-1);if(('"'===h||"'"===h||"`"===h||'"'===y||"'"===y||"`"===y)&&h!==y)throw new c("property names with quotes must have matching quotes");if("constructor"!==d&&p||(s=!0),D(C,i="%"+(n+="."+d)+"%"))a=C[i];else if(null!=a){if(!(d in a)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(S&&f+1>=r.length){var m=S(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=D(a,d),a=a[d];p&&!s&&(C[i]=a)}}return a}},487:(e,t,r)=>{"use strict";var n=r(6897),o=r(655),i=r(3126),a=r(2205);e.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},o?o(e.exports,"apply",{value:a}):e.exports.apply=a},537:(e,t,r)=>{var n=r(5606),o=r(6763),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},a=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(l(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,i=String(e).replace(a,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r<o;s=n[++r])v(s)||!T(s)?i+=" "+s:i+=" "+l(s);return i},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?o.trace(r):o.error(r),i=!0}return e.apply(this,arguments)}};var s={},u=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+c+"$","i")}function l(e,r){var n={seen:[],stylize:p};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),S(n.showHidden)&&(n.showHidden=!1),S(n.depth)&&(n.depth=2),S(n.colors)&&(n.colors=!1),S(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),d(n,e,n.depth)}function f(e,t){var r=l.styles[t];return r?"\x1b["+l.colors[r][0]+"m"+e+"\x1b["+l.colors[r][1]+"m":e}function p(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return w(o)||(o=d(e,o,n)),o}var i=function(e,t){if(S(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,r);if(i)return i;var a=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),O(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(A(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(O(r))return h(r)}var c,l="",f=!1,p=["{","}"];return m(r)&&(f=!0,p=["[","]"]),A(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(l=" "+RegExp.prototype.toString.call(r)),k(r)&&(l=" "+Date.prototype.toUTCString.call(r)),O(r)&&(l=" "+h(r)),0!==a.length||f&&0!=r.length?n<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=f?function(e,t,r,n,o){for(var i=[],a=0,s=t.length;a<s;++a)I(t,String(a))?i.push(y(e,t,r,n,String(a),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(y(e,t,r,n,o,!0))}),i}(e,r,n,s,a):a.map(function(t){return y(e,r,n,s,t,f)}),e.seen.pop(),function(e,t,r){var n=e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,l,p)):p[0]+l+p[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function y(e,t,r,n,o,i){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),I(n,o)||(a="["+o+"]"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?d(e,u.value,null):d(e,u.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),S(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function m(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function S(e){return void 0===e}function E(e){return T(e)&&"[object RegExp]"===_(e)}function T(e){return"object"==typeof e&&null!==e}function k(e){return T(e)&&"[object Date]"===_(e)}function O(e){return T(e)&&("[object Error]"===_(e)||e instanceof Error)}function A(e){return"function"==typeof e}function _(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(u.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);o.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=m,t.isBoolean=g,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=S,t.isRegExp=E,t.types.isRegExp=E,t.isObject=T,t.isDate=k,t.types.isDate=k,t.isError=O,t.types.isNativeError=O,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;o.log("%s - %s",(r=[x((e=new Date).getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":"),[e.getDate(),P[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!T(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,n){e?r(e):t(n)});try{e.apply(this,o)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then(function(e){n.nextTick(a.bind(null,null,e))},function(e){n.nextTick(B.bind(null,e,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},592:(e,t,r)=>{"use strict";var n=r(655),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},1002:e=>{"use strict";e.exports=Function.prototype.apply},1064:(e,t,r)=>{"use strict";var n=r(9612);e.exports=n.getPrototypeOf||null},1093:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},1189:(e,t,r)=>{"use strict";var n=Array.prototype.slice,o=r(1093),i=Object.keys,a=i?function(e){return i(e)}:r(8875),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1237:e=>{"use strict";e.exports=EvalError},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},1514:e=>{"use strict";e.exports=Math.abs},2205:(e,t,r)=>{"use strict";var n=r(6743),o=r(1002),i=r(3144);e.exports=function(){return i(n,o,arguments)}},2299:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},u=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},c=Object.is?Object.is:r(7653),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(4133);function p(e){return e.call.bind(e)}var d=p(Object.prototype.hasOwnProperty),h=p(Object.prototype.propertyIsEnumerable),y=p(Object.prototype.toString),m=r(537).types,g=m.isAnyArrayBuffer,v=m.isArrayBufferView,b=m.isDate,w=m.isMap,S=m.isRegExp,E=m.isSet,T=m.isNativeError,k=m.isBoxedPrimitive,O=m.isNumberObject,A=m.isStringObject,_=m.isBooleanObject,x=m.isBigIntObject,P=m.isSymbolObject,I=m.isFloat32Array,R=m.isFloat64Array;function B(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function C(e){return Object.keys(e).filter(B).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function j(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function U(e,t,r,n){if(e===t)return 0!==e||!r||c(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&f(e)&&f(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var o,s,u,l,p=y(e);if(p!==y(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=C(e),h=C(t);return d.length===h.length&&L(e,t,r,n,1,d)}if("[object Object]"===p&&(!w(e)&&w(t)||!E(e)&&E(t)))return!1;if(b(e)){if(!b(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(S(e)){if(!S(t)||(u=e,l=t,!(a?u.source===l.source&&u.flags===l.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(l))))return!1}else if(T(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!I(e)&&!R(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===j(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var m=C(e),B=C(t);return m.length===B.length&&L(e,t,r,n,0,m)}if(E(e))return!(!E(t)||e.size!==t.size)&&L(e,t,r,n,2);if(w(e))return!(!w(t)||e.size!==t.size)&&L(e,t,r,n,3);if(g(e)){if(s=t,(o=e).byteLength!==s.byteLength||0!==j(new Uint8Array(o),new Uint8Array(s)))return!1}else if(k(e)&&!function(e,t){return O(e)?O(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):A(e)?A(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):_(e)?_(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):x(e)?x(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):P(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return L(e,t,r,n,0)}function N(e,t){return t.filter(function(t){return h(e,t)})}function L(e,t,r,o,a,c){if(5===arguments.length){c=Object.keys(e);var f=Object.keys(t);if(c.length!==f.length)return!1}for(var p=0;p<c.length;p++)if(!d(t,c[p]))return!1;if(r&&5===arguments.length){var y=l(e);if(0!==y.length){var m=0;for(p=0;p<y.length;p++){var g=y[p];if(h(e,g)){if(!h(t,g))return!1;c.push(g),m++}else if(h(t,g))return!1}var v=l(t);if(y.length!==v.length&&N(t,v).length!==m)return!1}else{var b=l(t);if(0!==b.length&&0!==N(t,b).length)return!1}}if(0===c.length&&(0===a||1===a&&0===e.length||0===e.size))return!0;if(void 0===o)o={val1:new Map,val2:new Map,position:0};else{var w=o.val1.get(e);if(void 0!==w){var S=o.val2.get(t);if(void 0!==S)return w===S}o.position++}o.val1.set(e,o.position),o.val2.set(t,o.position);var E=function(e,t,r,o,a,c){var l=0;if(2===c){if(!function(e,t,r,n){for(var o=null,a=s(e),u=0;u<a.length;u++){var c=a[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!M(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=s(t),f=0;f<l.length;f++){var p=l[f];if("object"===i(p)&&null!==p){if(!D(o,p,r,n))return!1}else if(!r&&!e.has(p)&&!D(o,p,r,n))return!1}return 0===o.size}return!0}(e,t,r,a))return!1}else if(3===c){if(!function(e,t,r,o){for(var a=null,s=u(e),c=0;c<s.length;c++){var l=n(s[c],2),f=l[0],p=l[1];if("object"===i(f)&&null!==f)null===a&&(a=new Set),a.add(f);else{var d=t.get(f);if(void 0===d&&!t.has(f)||!U(p,d,r,o)){if(r)return!1;if(!V(e,t,f,p,o))return!1;null===a&&(a=new Set),a.add(f)}}}if(null!==a){for(var h=u(t),y=0;y<h.length;y++){var m=n(h[y],2),g=m[0],v=m[1];if("object"===i(g)&&null!==g){if(!q(a,e,g,v,r,o))return!1}else if(!(r||e.has(g)&&U(e.get(g),v,!1,o)||q(a,e,g,v,!1,o)))return!1}return 0===a.size}return!0}(e,t,r,a))return!1}else if(1===c)for(;l<e.length;l++){if(!d(e,l)){if(d(t,l))return!1;for(var f=Object.keys(e);l<f.length;l++){var p=f[l];if(!d(t,p)||!U(e[p],t[p],r,a))return!1}return f.length===Object.keys(t).length}if(!d(t,l)||!U(e[l],t[l],r,a))return!1}for(l=0;l<o.length;l++){var h=o[l];if(!U(e[h],t[h],r,a))return!1}return!0}(e,t,r,c,o,a);return o.val1.delete(e),o.val2.delete(t),E}function D(e,t,r,n){for(var o=s(e),i=0;i<o.length;i++){var a=o[i];if(U(t,a,r,n))return e.delete(a),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(f(e))return!1}return!0}function M(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function V(e,t,r,n,o){var i=F(r);if(null!=i)return i;var a=t.get(i);return!(void 0===a&&!t.has(i)||!U(n,a,!1,o))&&!e.has(i)&&U(n,a,!1,o)}function q(e,t,r,n,o,i){for(var a=s(e),u=0;u<a.length;u++){var c=a[u];if(U(r,c,o,i)&&U(n,t.get(c),o,i))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return U(e,t,!1)},isDeepStrictEqual:function(e,t){return U(e,t,!0)}}},2464:(e,t,r)=>{"use strict";var n=r(8452),o=r(6642);e.exports=function(){var e=o();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2682:(e,t,r)=>{"use strict";var n=r(9600),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a,s;arguments.length>=3&&(a=r),s=e,"[object Array]"===o.call(s)?function(e,t,r){for(var n=0,o=e.length;n<o;n++)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a):"string"==typeof e?function(e,t,r){for(var n=0,o=e.length;n<o;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,a):function(e,t,r){for(var n in e)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a)}},2802:(e,t,r)=>{"use strict";e.exports=function(t){var r=t.toLowerCase(),n=e.exports[r];if(!n)throw new Error(r+" is not supported (we accept pull requests)");return new n},e.exports.sha=r(7816),e.exports.sha1=r(3737),e.exports.sha224=r(6710),e.exports.sha256=r(4107),e.exports.sha384=r(2827),e.exports.sha512=r(2890)},2827:(e,t,r)=>{"use strict";var n=r(6698),o=r(2890),i=r(392),a=r(2861).Buffer,s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}n(u,o),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},2861:(e,t,r)=>{var n=r(8287),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},2890:(e,t,r)=>{"use strict";var n=r(6698),o=r(392),i=r(2861).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function p(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}n(u,o),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,o=0|this._ch,i=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,b=0|this._hh,w=0|this._al,S=0|this._bl,E=0|this._cl,T=0|this._dl,k=0|this._el,O=0|this._fl,A=0|this._gl,_=0|this._hl,x=0;x<32;x+=2)t[x]=e.readInt32BE(4*x),t[x+1]=e.readInt32BE(4*x+4);for(;x<160;x+=2){var P=t[x-30],I=t[x-30+1],R=d(P,I),B=h(I,P),C=y(P=t[x-4],I=t[x-4+1]),j=m(I,P),U=t[x-14],N=t[x-14+1],L=t[x-32],D=t[x-32+1],F=B+N|0,M=R+U+g(F,B)|0;M=(M=M+C+g(F=F+j|0,j)|0)+L+g(F=F+D|0,D)|0,t[x]=M,t[x+1]=F}for(var V=0;V<160;V+=2){M=t[V],F=t[V+1];var q=l(r,n,o),H=l(w,S,E),z=f(r,w),K=f(w,r),X=p(s,k),$=p(k,s),G=a[V],W=a[V+1],Q=c(s,u,v),Z=c(k,O,A),Y=_+$|0,J=b+X+g(Y,_)|0;J=(J=(J=J+Q+g(Y=Y+Z|0,Z)|0)+G+g(Y=Y+W|0,W)|0)+M+g(Y=Y+F|0,F)|0;var ee=K+H|0,te=z+q+g(ee,K)|0;b=v,_=A,v=u,A=O,u=s,O=k,s=i+J+g(k=T+Y|0,T)|0,i=o,T=E,o=n,E=S,n=r,S=w,r=J+te+g(w=Y+ee|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+S|0,this._cl=this._cl+E|0,this._dl=this._dl+T|0,this._el=this._el+k|0,this._fl=this._fl+O|0,this._gl=this._gl+A|0,this._hl=this._hl+_|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,S)|0,this._ch=this._ch+o+g(this._cl,E)|0,this._dh=this._dh+i+g(this._dl,T)|0,this._eh=this._eh+s+g(this._el,k)|0,this._fh=this._fh+u+g(this._fl,O)|0,this._gh=this._gh+v+g(this._gl,A)|0,this._hh=this._hh+b+g(this._hl,_)|0},u.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},3003:e=>{"use strict";e.exports=function(e){return e!=e}},3093:(e,t,r)=>{"use strict";var n=r(4459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3126:(e,t,r)=>{"use strict";var n=r(6743),o=r(9675),i=r(76),a=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(n,i,e)}},3144:(e,t,r)=>{"use strict";var n=r(6743),o=r(1002),i=r(76),a=r(7119);e.exports=a||n.call(i,o)},3628:(e,t,r)=>{"use strict";var n=r(8648),o=r(1064),i=r(7176);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},3737:(e,t,r)=>{"use strict";var n=r(6698),o=r(392),i=r(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<1|e>>>31}function l(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function p(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=c(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var d=0;d<80;++d){var h=~~(d/20),y=l(r)+p(h,n,o,i)+s+t[d]+a[h]|0;s=i,i=o,o=f(n),n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},3740:function(e,t,r){var n,o=r(6763);n=()=>(()=>{var e={616:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(287);n.hp.alloc(1).subarray(0,1)instanceof n.hp||(n.hp.prototype.subarray=function(e,t){const r=Uint8Array.prototype.subarray.call(this,e,t);return Object.setPrototypeOf(r,n.hp.prototype),r});const o=n.hp},281:(e,t,r)=>{const n=r(164);e.exports=n},164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Array:()=>M,Bool:()=>C,Double:()=>R,Enum:()=>z,Float:()=>I,Hyper:()=>A,Int:()=>E,LargeInt:()=>O,Opaque:()=>L,Option:()=>q,Quadruple:()=>B,Reference:()=>K,String:()=>U,Struct:()=>X,Union:()=>G,UnsignedHyper:()=>P,UnsignedInt:()=>x,VarArray:()=>V,VarOpaque:()=>F,Void:()=>H,XdrReader:()=>u,XdrWriter:()=>f,config:()=>ne});class n extends TypeError{constructor(e){super(`XDR Write Error: ${e}`)}}class o extends TypeError{constructor(e){super(`XDR Read Error: ${e}`)}}class i extends TypeError{constructor(e){super(`XDR Type Definition Error: ${e}`)}}class a extends i{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var s=r(616).A;class u{constructor(e){if(!s.isBuffer(e)){if(!(e instanceof Array||Array.isArray(e)||ArrayBuffer.isView(e)))throw new o(`source invalid: ${e}`);e=s.from(e)}this._buffer=e,this._length=e.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(e){const t=this._index;if(this._index+=e,this._length<this._index)throw new o("attempt to read outside the boundary of the buffer");const r=4-(e%4||4);if(r>0){for(let e=0;e<r;e++)if(0!==this._buffer[this._index+e])throw new o("invalid padding");this._index+=r}return t}rewind(){this._index=0}read(e){const t=this.advance(e);return this._buffer.subarray(t,t+e)}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 o("invalid XDR contract typecast - source buffer not entirely consumed")}}var c=r(616).A;const l=8192;class f{constructor(e){"number"==typeof e?e=c.allocUnsafe(e):e instanceof c||(e=c.allocUnsafe(l)),this._buffer=e,this._length=e.length}_buffer;_length;_index=0;alloc(e){const t=this._index;return this._index+=e,this._length<this._index&&this.resize(this._index),t}resize(e){const t=Math.ceil(e/l)*l,r=c.allocUnsafe(t);this._buffer.copy(r,0,0,this._length),this._buffer=r,this._length=t}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(e,t){if("string"==typeof e){const r=this.alloc(t);this._buffer.write(e,r,"utf8")}else{e instanceof c||(e=c.from(e));const r=this.alloc(t);e.copy(this._buffer,r,0,t)}const r=4-(t%4||4);if(r>0){const e=this.alloc(r);this._buffer.fill(0,e,this._index)}}writeInt32BE(e){const t=this.alloc(4);this._buffer.writeInt32BE(e,t)}writeUInt32BE(e){const t=this.alloc(4);this._buffer.writeUInt32BE(e,t)}writeBigInt64BE(e){const t=this.alloc(8);this._buffer.writeBigInt64BE(e,t)}writeBigUInt64BE(e){const t=this.alloc(8);this._buffer.writeBigUInt64BE(e,t)}writeFloatBE(e){const t=this.alloc(4);this._buffer.writeFloatBE(e,t)}writeDoubleBE(e){const t=this.alloc(8);this._buffer.writeDoubleBE(e,t)}static bufferChunkSize=l}var p=r(616).A;class d{toXDR(e="raw"){if(!this.write)return this.constructor.toXDR(this,e);const t=new f;return this.write(this,t),g(t.finalize(),e)}fromXDR(e,t="raw"){if(!this.read)return this.constructor.fromXDR(e,t);const r=new u(v(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}validateXDR(e,t="raw"){try{return this.fromXDR(e,t),!0}catch(e){return!1}}static toXDR(e,t="raw"){const r=new f;return this.write(e,r),g(r.finalize(),t)}static fromXDR(e,t="raw"){const r=new u(v(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}static validateXDR(e,t="raw"){try{return this.fromXDR(e,t),!0}catch(e){return!1}}}class h extends d{static read(e){throw new a}static write(e,t){throw new a}static isValid(e){return!1}}class y extends d{isValid(e){return!1}}class m extends TypeError{constructor(e){super(`Invalid format ${e}, must be one of "raw", "hex", "base64"`)}}function g(e,t){switch(t){case"raw":return e;case"hex":return e.toString("hex");case"base64":return e.toString("base64");default:throw new m(t)}}function v(e,t){switch(t){case"raw":return e;case"hex":return p.from(e,"hex");case"base64":return p.from(e,"base64");default:throw new m(t)}}function b(e,t){return null!=e&&(e instanceof t||w(e,t)&&"function"==typeof e.constructor.read&&"function"==typeof e.constructor.write&&w(e,"XdrType"))}function w(e,t){do{if(e.constructor.name===t)return!0}while(e=Object.getPrototypeOf(e));return!1}const S=2147483647;class E extends h{static read(e){return e.readInt32BE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");if((0|e)!==e)throw new n("invalid i32 value");t.writeInt32BE(e)}static isValid(e){return"number"==typeof e&&(0|e)===e&&e>=-2147483648&&e<=S}}function T(e,t,r){if("bigint"!=typeof e)throw new TypeError("Expected bigint 'value', got "+typeof e);const n=t/r;if(1===n)return[e];if(r<32||r>128||2!==n&&4!==n&&8!==n)throw new TypeError(`invalid bigint (${e}) and slice size (${t} -> ${r}) combination`);const o=BigInt(r),i=new Array(n);for(let t=0;t<n;t++)i[t]=BigInt.asIntN(r,e),e>>=o;return i}function k(e,t){if(t)return[0n,(1n<<BigInt(e))-1n];const r=1n<<BigInt(e-1);return[0n-r,r-1n]}E.MAX_VALUE=S,E.MIN_VALUE=2147483648;class O extends h{constructor(e){super(),this._value=function(e,t,r){e instanceof Array?e.length&&e[0]instanceof Array&&(e=e[0]):e=[e];const n=t/e.length;switch(n){case 32:case 64:case 128:case 256:break;default:throw new RangeError(`expected slices to fit in 32/64/128/256 bits, got ${e}`)}try{for(let t=0;t<e.length;t++)"bigint"!=typeof e[t]&&(e[t]=BigInt(e[t].valueOf()))}catch(t){throw new TypeError(`expected bigint-like values, got: ${e} (${t})`)}if(r&&1===e.length&&e[0]<0n)throw new RangeError(`expected a positive value, got: ${e}`);let o=BigInt.asUintN(n,e[0]);for(let t=1;t<e.length;t++)o|=BigInt.asUintN(n,e[t])<<BigInt(t*n);r||(o=BigInt.asIntN(t,o));const[i,a]=k(t,r);if(o>=i&&o<=a)return o;throw new TypeError(`bigint values [${e}] for ${function(e,t){return`${t?"u":"i"}${e}`}(t,r)} out of range [${i}, ${a}]: ${o}`)}(e,this.size,this.unsigned)}get unsigned(){throw new a}get size(){throw new a}slice(e){return T(this._value,this.size,e)}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}toBigInt(){return BigInt(this._value)}static read(e){const{size:t}=this.prototype;return 64===t?new this(e.readBigUInt64BE()):new this(...Array.from({length:t/64},()=>e.readBigUInt64BE()).reverse())}static write(e,t){if(e instanceof this)e=e._value;else if("bigint"!=typeof e||e>this.MAX_VALUE||e<this.MIN_VALUE)throw new n(`${e} is not a ${this.name}`);const{unsigned:r,size:o}=this.prototype;if(64===o)r?t.writeBigUInt64BE(e):t.writeBigInt64BE(e);else for(const n of T(e,o,64).reverse())r?t.writeBigUInt64BE(n):t.writeBigInt64BE(n)}static isValid(e){return"bigint"==typeof e||e instanceof this}static fromString(e){return new this(e)}static MAX_VALUE=0n;static MIN_VALUE=0n;static defineIntBoundaries(){const[e,t]=k(this.prototype.size,this.prototype.unsigned);this.MIN_VALUE=e,this.MAX_VALUE=t}}class A extends O{constructor(...e){super(e)}get low(){return 0|Number(0xffffffffn&this._value)}get high(){return 0|Number(this._value>>32n)}get size(){return 64}get unsigned(){return!1}static fromBits(e,t){return new this(e,t)}}A.defineIntBoundaries();const _=4294967295;class x extends h{static read(e){return e.readUInt32BE()}static write(e,t){if("number"!=typeof e||!(e>=0&&e<=_)||e%1!=0)throw new n("invalid u32 value");t.writeUInt32BE(e)}static isValid(e){return"number"==typeof e&&e%1==0&&e>=0&&e<=_}}x.MAX_VALUE=_,x.MIN_VALUE=0;class P extends O{constructor(...e){super(e)}get low(){return 0|Number(0xffffffffn&this._value)}get high(){return 0|Number(this._value>>32n)}get size(){return 64}get unsigned(){return!0}static fromBits(e,t){return new this(e,t)}}P.defineIntBoundaries();class I extends h{static read(e){return e.readFloatBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeFloatBE(e)}static isValid(e){return"number"==typeof e}}class R extends h{static read(e){return e.readDoubleBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeDoubleBE(e)}static isValid(e){return"number"==typeof e}}class B extends h{static read(){throw new i("quadruple not supported")}static write(){throw new i("quadruple not supported")}static isValid(){return!1}}class C extends h{static read(e){const t=E.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new o(`got ${t} when trying to read a bool`)}}static write(e,t){const r=e?1:0;E.write(r,t)}static isValid(e){return"boolean"==typeof e}}var j=r(616).A;class U extends y{constructor(e=x.MAX_VALUE){super(),this._maxLength=e}read(e){const t=x.read(e);if(t>this._maxLength)throw new o(`saw ${t} length String, max allowed is ${this._maxLength}`);return e.read(t)}readString(e){return this.read(e).toString("utf8")}write(e,t){const r="string"==typeof e?j.byteLength(e,"utf8"):e.length;if(r>this._maxLength)throw new n(`got ${e.length} bytes, max allowed is ${this._maxLength}`);x.write(r,t),t.write(e,r)}isValid(e){return"string"==typeof e?j.byteLength(e,"utf8")<=this._maxLength:!!(e instanceof Array||j.isBuffer(e))&&e.length<=this._maxLength}}var N=r(616).A;class L extends y{constructor(e){super(),this._length=e}read(e){return e.read(this._length)}write(e,t){const{length:r}=e;if(r!==this._length)throw new n(`got ${e.length} bytes, expected ${this._length}`);t.write(e,r)}isValid(e){return N.isBuffer(e)&&e.length===this._length}}var D=r(616).A;class F extends y{constructor(e=x.MAX_VALUE){super(),this._maxLength=e}read(e){const t=x.read(e);if(t>this._maxLength)throw new o(`saw ${t} length VarOpaque, max allowed is ${this._maxLength}`);return e.read(t)}write(e,t){const{length:r}=e;if(e.length>this._maxLength)throw new n(`got ${e.length} bytes, max allowed is ${this._maxLength}`);x.write(r,t),t.write(e,r)}isValid(e){return D.isBuffer(e)&&e.length<=this._maxLength}}class M extends y{constructor(e,t){super(),this._childType=e,this._length=t}read(e){const t=new r.g.Array(this._length);for(let r=0;r<this._length;r++)t[r]=this._childType.read(e);return t}write(e,t){if(!r.g.Array.isArray(e))throw new n("value is not array");if(e.length!==this._length)throw new n(`got array of size ${e.length}, expected ${this._length}`);for(const r of e)this._childType.write(r,t)}isValid(e){if(!(e instanceof r.g.Array)||e.length!==this._length)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class V extends y{constructor(e,t=x.MAX_VALUE){super(),this._childType=e,this._maxLength=t}read(e){const t=x.read(e);if(t>this._maxLength)throw new o(`saw ${t} length VarArray, max allowed is ${this._maxLength}`);const r=new Array(t);for(let n=0;n<t;n++)r[n]=this._childType.read(e);return r}write(e,t){if(!(e instanceof Array))throw new n("value is not array");if(e.length>this._maxLength)throw new n(`got array of size ${e.length}, max allowed is ${this._maxLength}`);x.write(e.length,t);for(const r of e)this._childType.write(r,t)}isValid(e){if(!(e instanceof Array)||e.length>this._maxLength)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class q extends h{constructor(e){super(),this._childType=e}read(e){if(C.read(e))return this._childType.read(e)}write(e,t){const r=null!=e;C.write(r,t),r&&this._childType.write(e,t)}isValid(e){return null==e||this._childType.isValid(e)}}class H extends h{static read(){}static write(e){if(void 0!==e)throw new n("trying to write value to a void slot")}static isValid(e){return void 0===e}}class z extends h{constructor(e,t){super(),this.name=e,this.value=t}static read(e){const t=E.read(e),r=this._byValue[t];if(void 0===r)throw new o(`unknown ${this.enumName} member for value ${t}`);return r}static write(e,t){if(!this.isValid(e))throw new n(`${e} has enum name ${e?.enumName}, not ${this.enumName}: ${JSON.stringify(e)}`);E.write(e.value,t)}static isValid(e){return e?.constructor?.enumName===this.enumName||b(e,this)}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(e){const t=this._members[e];if(!t)throw new TypeError(`${e} is not a member of ${this.enumName}`);return t}static fromValue(e){const t=this._byValue[e];if(void 0===t)throw new TypeError(`${e} is not a value of any member of ${this.enumName}`);return t}static create(e,t,r){const n=class extends z{};n.enumName=t,e.results[t]=n,n._members={},n._byValue={};for(const[e,t]of Object.entries(r)){const r=new n(e,t);n._members[e]=r,n._byValue[t]=r,n[e]=()=>r}return n}}class K extends h{resolve(){throw new i('"resolve" method should be implemented in the descendant class')}}class X extends y{constructor(e){super(),this._attributes=e||{}}static read(e){const t={};for(const[r,n]of this._fields)t[r]=n.read(e);return new this(t)}static write(e,t){if(!this.isValid(e))throw new n(`${e} has struct name ${e?.constructor?.structName}, not ${this.structName}: ${JSON.stringify(e)}`);for(const[r,n]of this._fields){const o=e._attributes[r];n.write(o,t)}}static isValid(e){return e?.constructor?.structName===this.structName||b(e,this)}static create(e,t,r){const n=class extends X{};n.structName=t,e.results[t]=n;const o=new Array(r.length);for(let t=0;t<r.length;t++){const i=r[t],a=i[0];let s=i[1];s instanceof K&&(s=s.resolve(e)),o[t]=[a,s],n.prototype[a]=$(a)}return n._fields=o,n}}function $(e){return function(t){return void 0!==t&&(this._attributes[e]=t),this._attributes[e]}}class G extends y{constructor(e,t){super(),this.set(e,t)}set(e,t){"string"==typeof e&&(e=this.constructor._switchOn.fromName(e)),this._switch=e;const r=this.constructor.armForSwitch(this._switch);this._arm=r,this._armType=r===H?H:this.constructor._arms[r],this._value=t}get(e=this._arm){if(this._arm!==H&&this._arm!==e)throw new TypeError(`${e} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(e){const t=this._switches.get(e);if(void 0!==t)return t;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${e}`)}static armTypeForArm(e){return e===H?H:this._arms[e]}static read(e){const t=this._switchOn.read(e),r=this.armForSwitch(t),n=r===H?H:this._arms[r];let o;return o=void 0!==n?n.read(e):r.read(e),new this(t,o)}static write(e,t){if(!this.isValid(e))throw new n(`${e} has union name ${e?.unionName}, not ${this.unionName}: ${JSON.stringify(e)}`);this._switchOn.write(e.switch(),t),e.armType().write(e.value(),t)}static isValid(e){return e?.constructor?.unionName===this.unionName||b(e,this)}static create(e,t,r){const n=class extends G{};n.unionName=t,e.results[t]=n,r.switchOn instanceof K?n._switchOn=r.switchOn.resolve(e):n._switchOn=r.switchOn,n._switches=new Map,n._arms={};let o=r.defaultArm;o instanceof K&&(o=o.resolve(e)),n._defaultArm=o;for(const[e,t]of r.switches){const r="string"==typeof e?n._switchOn.fromName(e):e;n._switches.set(r,t)}if(void 0!==n._switchOn.values)for(const e of n._switchOn.values())n[e.name]=function(t){return new n(e,t)},n.prototype[e.name]=function(t){return this.set(e,t)};if(r.arms)for(const[t,o]of Object.entries(r.arms))n._arms[t]=o instanceof K?o.resolve(e):o,o!==H&&(n.prototype[t]=function(){return this.get(t)});return n}}class W extends K{constructor(e){super(),this.name=e}resolve(e){return e.definitions[this.name].resolve(e)}}class Q extends K{constructor(e,t,r=!1){super(),this.childReference=e,this.length=t,this.variable=r}resolve(e){let t=this.childReference,r=this.length;return t instanceof K&&(t=t.resolve(e)),r instanceof K&&(r=r.resolve(e)),this.variable?new V(t,r):new M(t,r)}}class Z extends K{constructor(e){super(),this.childReference=e,this.name=e.name}resolve(e){let t=this.childReference;return t instanceof K&&(t=t.resolve(e)),new q(t)}}class Y extends K{constructor(e,t){super(),this.sizedType=e,this.length=t}resolve(e){let t=this.length;return t instanceof K&&(t=t.resolve(e)),new this.sizedType(t)}}class J{constructor(e,t,r){this.constructor=e,this.name=t,this.config=r}resolve(e){return this.name in e.results?e.results[this.name]:this.constructor(e,this.name,this.config)}}function ee(e,t,r){return r instanceof K&&(r=r.resolve(e)),e.results[t]=r,r}function te(e,t,r){return e.results[t]=r,r}class re{constructor(e){this._destination=e,this._definitions={}}enum(e,t){const r=new J(z.create,e,t);this.define(e,r)}struct(e,t){const r=new J(X.create,e,t);this.define(e,r)}union(e,t){const r=new J(G.create,e,t);this.define(e,r)}typedef(e,t){const r=new J(ee,e,t);this.define(e,r)}const(e,t){const r=new J(te,e,t);this.define(e,r)}void(){return H}bool(){return C}int(){return E}hyper(){return A}uint(){return x}uhyper(){return P}float(){return I}double(){return R}quadruple(){return B}string(e){return new Y(U,e)}opaque(e){return new Y(L,e)}varOpaque(e){return new Y(F,e)}array(e,t){return new Q(e,t)}varArray(e,t){return new Q(e,t,!0)}option(e){return new Z(e)}define(e,t){if(void 0!==this._destination[e])throw new i(`${e} is already defined`);this._definitions[e]=t}lookup(e){return new W(e)}resolve(){for(const e of Object.values(this._definitions))e.resolve({definitions:this._definitions,results:this._destination})}}function ne(e,t={}){if(e){const r=new re(t);e(r),r.resolve()}return t}},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;s<c;s+=a)i.push(u(e,s,s+a>c?c:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},287:(e,t,r)=>{"use strict";const n=r(526),i=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=u(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|y(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Z(e.length)?u(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function p(e){return f(e),u(e<0?0:0|y(e))}function d(e){const t=e.length<0?0:0|y(e.length),r=u(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function y(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:$(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function S(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Z(n))return a;e[r+a]=n}return a}function E(e,t,r,n){return W($(t,e.length-r),e,r,n)}function T(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return W(G(t),e,r,n)}function O(e,t,r,n){return W(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===o||"function"!=typeof o.error||o.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},c.allocUnsafe=function(e){return p(e)},c.allocUnsafeSlow=function(e){return p(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))o+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<s;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function R(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Y[e[n]];return o}function B(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function U(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=J(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=J(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const M={};function V(e,t,r){M[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,o,i)}function z(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}V("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),V("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=q(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function $(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*y}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(281)})(),e.exports=n()},3918:(e,t,r)=>{"use strict";var n=r(5606);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var t=function(e){if("object"!==m(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===m(t)?t:String(t)}function c(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return p(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},f(e)}function p(e,t,r){return p=d()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&h(o,r.prototype),o},p.apply(null,arguments)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}var g=r(537).inspect,v=r(9597).codes.ERR_INVALID_ARG_TYPE;function b(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var w="",S="",E="",T="",k={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function O(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function A(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function _(e,t,r){var o="",i="",a=0,s="",u=!1,c=A(e),l=c.split("\n"),f=A(t).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===f.length&&l[0]!==f[0]){var h=l[0].length+f[0].length;if(h<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(k[r],"\n\n")+"".concat(l[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&h<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][p]===f[0][p];)p++;p>2&&(d="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",p),"^"),p=0)}}for(var y=l[l.length-1],g=f[f.length-1];y===g&&(p++<2?s="\n ".concat(y).concat(s):o=y,l.pop(),f.pop(),0!==l.length&&0!==f.length);)y=l[l.length-1],g=f[f.length-1];var v=Math.max(l.length,f.length);if(0===v){var O=c.split("\n");if(O.length>30)for(O[26]="".concat(w,"...").concat(T);O.length>27;)O.pop();return"".concat(k.notIdentical,"\n\n").concat(O.join("\n"),"\n")}p>3&&(s="\n".concat(w,"...").concat(T).concat(s),u=!0),""!==o&&(s="\n ".concat(o).concat(s),o="");var _=0,x=k[r]+"\n".concat(S,"+ actual").concat(T," ").concat(E,"- expected").concat(T),P=" ".concat(w,"...").concat(T," Lines skipped");for(p=0;p<v;p++){var I=p-a;if(l.length<p+1)I>1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(T),u=!0):I>3&&(i+="\n ".concat(f[p-2]),_++),i+="\n ".concat(f[p-1]),_++),a=p,o+="\n".concat(E,"-").concat(T," ").concat(f[p]),_++;else if(f.length<p+1)I>1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(T),u=!0):I>3&&(i+="\n ".concat(l[p-2]),_++),i+="\n ".concat(l[p-1]),_++),a=p,i+="\n".concat(S,"+").concat(T," ").concat(l[p]),_++;else{var R=f[p],B=l[p],C=B!==R&&(!b(B,",")||B.slice(0,-1)!==R);C&&b(R,",")&&R.slice(0,-1)===B&&(C=!1,B+=","),C?(I>1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(T),u=!0):I>3&&(i+="\n ".concat(l[p-2]),_++),i+="\n ".concat(l[p-1]),_++),a=p,i+="\n".concat(S,"+").concat(T," ").concat(B),o+="\n".concat(E,"-").concat(T," ").concat(R),_+=2):(i+=o,o="",1!==I&&0!==p||(i+="\n ".concat(B),_++))}if(_>20&&p<v-2)return"".concat(x).concat(P,"\n").concat(i,"\n").concat(w,"...").concat(T).concat(o,"\n")+"".concat(w,"...").concat(T)}return"".concat(x).concat(u?P:"","\n").concat(i).concat(o).concat(s).concat(d)}var x=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(p,e);var r,o,a,u,f=(r=p,o=d(),function(){var e,t=y(r);if(o){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return c(this,e)});function p(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),"object"!==m(e)||null===e)throw new v("options","Object",e);var r=e.message,o=e.operator,i=e.stackStartFn,a=e.actual,s=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(w="\x1b[34m",S="\x1b[32m",T="\x1b[39m",E="\x1b[31m"):(w="",S="",T="",E="")),"object"===m(a)&&null!==a&&"object"===m(s)&&null!==s&&"stack"in a&&a instanceof Error&&"stack"in s&&s instanceof Error&&(a=O(a),s=O(s)),"deepStrictEqual"===o||"strictEqual"===o)t=f.call(this,_(a,s,o));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var d=k[o],h=A(a).split("\n");if("notStrictEqual"===o&&"object"===m(a)&&null!==a&&(d=k.notStrictEqualObject),h.length>30)for(h[26]="".concat(w,"...").concat(T);h.length>27;)h.pop();t=1===h.length?f.call(this,"".concat(d," ").concat(h[0])):f.call(this,"".concat(d,"\n\n").concat(h.join("\n"),"\n"))}else{var y=A(a),g="",b=k[o];"notDeepEqual"===o||"notEqual"===o?(y="".concat(k[o],"\n\n").concat(y)).length>1024&&(y="".concat(y.slice(0,1021),"...")):(g="".concat(A(s)),y.length>512&&(y="".concat(y.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===o||"equal"===o?y="".concat(b,"\n\n").concat(y,"\n\nshould equal\n\n"):g=" ".concat(o," ").concat(g)),t=f.call(this,"".concat(y).concat(g))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(l(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=a,t.expected=s,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(l(t),i),t.stack,t.name="AssertionError",c(t)}return a=p,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,i(i({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,u),Object.defineProperty(a,"prototype",{writable:!1}),p}(f(Error),g.custom);e.exports=x},4035:(e,t,r)=>{"use strict";var n,o=r(6556),i=r(9092)(),a=r(9957),s=r(5795);if(i){var u=o("RegExp.prototype.exec"),c={},l=function(){throw c},f={toString:l,valueOf:l};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=l),n=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!t||!a(t,"value"))return!1;try{u(e,f)}catch(e){return e===c}}}else{var p=o("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===p(e)}}e.exports=n},4039:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},4107:(e,t,r)=>{"use strict";var n=r(6698),o=r(392),i=r(2861).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function p(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function h(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}n(u,o),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,u=0|this._f,y=0|this._g,m=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=h(t[g-2])+t[g-7]+d(t[g-15])+t[g-16]|0;for(var v=0;v<64;++v){var b=m+p(s)+c(s,u,y)+a[v]+t[v]|0,w=f(r)+l(r,n,o)|0;m=y,y=u,u=s,s=i+b|0,i=o,o=n,n=r,r=b+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0,this._f=u+this._f|0,this._g=y+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},4133:(e,t,r)=>{"use strict";var n=r(487),o=r(8452),i=r(3003),a=r(6642),s=r(2464),u=n(a(),Number);o(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},4148:(e,t,r)=>{"use strict";var n=r(5606),o=r(6763);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e){if("object"!==i(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}var u,c,l=r(9597).codes,f=l.ERR_AMBIGUOUS_ARGUMENT,p=l.ERR_INVALID_ARG_TYPE,d=l.ERR_INVALID_ARG_VALUE,h=l.ERR_INVALID_RETURN_VALUE,y=l.ERR_MISSING_ARGS,m=r(3918),g=r(537).inspect,v=r(537).types,b=v.isPromise,w=v.isRegExp,S=r(9133)(),E=r(9394)(),T=r(8075)("RegExp.prototype.test");function k(){var e=r(2299);u=e.isDeepEqual,c=e.isDeepStrictEqual}new Map;var O=!1,A=e.exports=I,_={};function x(e){if(e.message instanceof Error)throw e.message;throw new m(e)}function P(e,t,r,n){if(!r){var o=!1;if(0===t)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new m({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw i.generatedMessage=o,i}}function I(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];P.apply(void 0,[I,t.length].concat(t))}A.fail=function e(t,r,i,a,s){var u,c=arguments.length;if(0===c?u="Failed":1===c?(i=t,t=void 0):(!1===O&&(O=!0,(n.emitWarning?n.emitWarning:o.warn.bind(o))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===c&&(a="!=")),i instanceof Error)throw i;var l={actual:t,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||e};void 0!==i&&(l.message=i);var f=new m(l);throw u&&(f.message=u,f.generatedMessage=!0),f},A.AssertionError=m,A.ok=I,A.equal=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");t!=r&&x({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},A.notEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");t==r&&x({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},A.deepEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===u&&k(),u(t,r)||x({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},A.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===u&&k(),u(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},A.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===u&&k(),c(t,r)||x({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},A.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===u&&k(),c(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},A.strictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");E(t,r)||x({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},A.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");E(t,r)&&x({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var R=function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&w(t[e])&&T(t[e],n[e])?o[e]=n[e]:o[e]=t[e])})});function B(e,t,r,n){if("function"!=typeof t){if(w(t))return T(t,e);if(2===arguments.length)throw new p("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var o=new m({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new d("error",t,"may not be an empty object");return void 0===u&&k(),a.forEach(function(o){"string"==typeof e[o]&&w(t[o])&&T(t[o],e[o])||function(e,t,r,n,o,i){if(!(r in e)||!c(e[r],t[r])){if(!n){var a=new R(e,o),s=new R(t,o,e),u=new m({actual:a,expected:s,operator:"deepStrictEqual",stackStartFn:i});throw u.actual=e,u.expected=t,u.operator=i.name,u}x({actual:e,expected:t,message:n,operator:i.name,stackStartFn:i})}}(e,t,o,r,a,n)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function C(e){if("function"!=typeof e)throw new p("fn","Function",e);try{e()}catch(e){return e}return _}function j(e){return b(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function U(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!j(t=e()))throw new h("instance of Promise","promiseFn",t)}else{if(!j(e))throw new p("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return _}).catch(function(e){return e})})}function N(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new p("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new f("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new f("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new p("error",["Object","Error","Function","RegExp"],r);if(t===_){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";x({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(o),stackStartFn:e})}if(r&&!B(t,r,n,e))throw t}function L(e,t,r,n){if(t!==_){if("string"==typeof r&&(n=r,r=void 0),!r||B(t,r)){var o=n?": ".concat(n):".",i="doesNotReject"===e.name?"rejection":"exception";x({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function D(e,t,r,n,o){if(!w(t))throw new p("regexp","RegExp",t);var a="match"===o;if("string"!=typeof e||T(t,e)!==a){if(r instanceof Error)throw r;var s=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(i(e)," (").concat(g(e),")"):(a?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(g(t),". Input:\n\n").concat(g(e),"\n"));var u=new m({actual:e,expected:t,message:r,operator:o,stackStartFn:n});throw u.generatedMessage=s,u}}function F(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];P.apply(void 0,[F,t.length].concat(t))}A.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];N.apply(void 0,[e,C(t)].concat(n))},A.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return U(t).then(function(t){return N.apply(void 0,[e,t].concat(n))})},A.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];L.apply(void 0,[e,C(t)].concat(n))},A.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return U(t).then(function(t){return L.apply(void 0,[e,t].concat(n))})},A.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=g(t);var n=new m({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var a=o.split("\n");a.shift();for(var s=n.stack.split("\n"),u=0;u<a.length;u++){var c=s.indexOf(a[u]);if(-1!==c){s=s.slice(0,c);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},A.match=function e(t,r,n){D(t,r,n,e,"match")},A.doesNotMatch=function e(t,r,n){D(t,r,n,e,"doesNotMatch")},A.strict=S(F,A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict},4372:(e,t,r)=>{"use strict";var n=r(9675),o=r(6556)("TypedArray.prototype.buffer",!0),i=r(5680);e.exports=o||function(e){if(!i(e))throw new n("Not a Typed Array");return e.buffer}},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4634:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},5345:e=>{"use strict";e.exports=URIError},5360:(e,t)=>{"use strict";var r=function(e,t){return t||(t={}),e.split("").forEach(function(e,r){e in t||(t[e]=r)}),t},n={alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",charmap:{0:14,1:8}};n.charmap=r(n.alphabet,n.charmap);var o={alphabet:"0123456789ABCDEFGHJKMNPQRSTVWXYZ",charmap:{O:0,I:1,L:1}};o.charmap=r(o.alphabet,o.charmap);var i={alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",charmap:{}};function a(e){if(this.buf=[],this.shift=8,this.carry=0,e){switch(e.type){case"rfc4648":this.charmap=t.rfc4648.charmap;break;case"crockford":this.charmap=t.crockford.charmap;break;case"base32hex":this.charmap=t.base32hex.charmap;break;default:throw new Error("invalid type")}e.charmap&&(this.charmap=e.charmap)}}function s(e){if(this.buf="",this.shift=3,this.carry=0,e){switch(e.type){case"rfc4648":this.alphabet=t.rfc4648.alphabet;break;case"crockford":this.alphabet=t.crockford.alphabet;break;case"base32hex":this.alphabet=t.base32hex.alphabet;break;default:throw new Error("invalid type")}e.alphabet?this.alphabet=e.alphabet:e.lc&&(this.alphabet=this.alphabet.toLowerCase())}}i.charmap=r(i.alphabet,i.charmap),a.prototype.charmap=n.charmap,a.prototype.write=function(e){var t=this.charmap,r=this.buf,n=this.shift,o=this.carry;return e.toUpperCase().split("").forEach(function(e){if("="!=e){var i=255&t[e];(n-=5)>0?o|=i<<n:n<0?(r.push(o|i>>-n),o=i<<(n+=8)&255):(r.push(o|i),n=8,o=0)}}),this.shift=n,this.carry=o,this},a.prototype.finalize=function(e){return e&&this.write(e),8!==this.shift&&0!==this.carry&&(this.buf.push(this.carry),this.shift=8,this.carry=0),this.buf},s.prototype.alphabet=n.alphabet,s.prototype.write=function(e){var t,r,n,o=this.shift,i=this.carry;for(n=0;n<e.length;n++)t=i|(r=e[n])>>o,this.buf+=this.alphabet[31&t],o>5&&(t=r>>(o-=5),this.buf+=this.alphabet[31&t]),i=r<<(o=5-o),o=8-o;return this.shift=o,this.carry=i,this},s.prototype.finalize=function(e){return e&&this.write(e),3!==this.shift&&(this.buf+=this.alphabet[31&this.carry],this.shift=3,this.carry=0),this.buf},t.encode=function(e,t){return new s(t).finalize(e)},t.decode=function(e,t){return new a(t).finalize(e)},t.Decoder=a,t.Encoder=s,t.charmap=r,t.crockford=o,t.rfc4648=n,t.base32hex=i},5377:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=r(4634),i=r(4372),a=ArrayBuffer.isView||function(e){try{return i(e),!0}catch(e){return!1}},s="undefined"!=typeof Uint8Array,u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,c=u&&(n.prototype instanceof Uint8Array||n.TYPED_ARRAY_SUPPORT);e.exports=function(e,t){if(e instanceof n)return e;if("string"==typeof e)return n.from(e,t);if(u&&a(e)){if(0===e.byteLength)return n.alloc(0);if(c){var r=n.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}var i=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l=n.from(i);if(l.length===e.byteLength)return l}if(s&&e instanceof Uint8Array)return n.from(e);var f=o(e);if(f)for(var p=0;p<e.length;p+=1){var d=e[p];if("number"!=typeof d||d<0||d>255||~~d!==d)throw new RangeError("Array items must be numbers in the range 0-255.")}if(f||n.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return n.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}},5606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&p())}function p(){if(!c){var e=a(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function h(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5680:(e,t,r)=>{"use strict";var n=r(5767);e.exports=function(e){return!!n(e)}},5767:(e,t,r)=>{"use strict";var n=r(2682),o=r(9209),i=r(487),a=r(6556),s=r(5795),u=r(3628),c=a("Object.prototype.toString"),l=r(9092)(),f="undefined"==typeof globalThis?r.g:globalThis,p=o(),d=a("String.prototype.slice"),h=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},y={__proto__:null};n(p,l&&s&&u?function(e){var t=new f[e];if(Symbol.toStringTag in t&&u){var r=u(t),n=s(r,Symbol.toStringTag);if(!n&&r){var o=u(r);n=s(o,Symbol.toStringTag)}y["$"+e]=i(n.get)}}:function(e){var t=new f[e],r=t.slice||t.set;r&&(y["$"+e]=i(r))}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!l){var t=d(c(e),8,-1);return h(p,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(y,function(r,n){if(!t)try{r(e),t=d(n,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return n(y,function(r,n){if(!t)try{"$"+r(e)===n&&(t=d(n,1))}catch(e){}}),t}(e):null}},5795:(e,t,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},5880:e=>{"use strict";e.exports=Math.pow},6188:e=>{"use strict";e.exports=Math.max},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,r)=>{"use strict";var n=r(453),o=r(3126),i=o([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o([r]):r}},6576:(e,t,r)=>{"use strict";var n=r(9394),o=r(8452);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6578:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},6642:(e,t,r)=>{"use strict";var n=r(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6710:(e,t,r)=>{"use strict";var n=r(6698),o=r(4107),i=r(392),a=r(2861).Buffer,s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,o),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},6743:(e,t,r)=>{"use strict";var n=r(9353);e.exports=Function.prototype.bind||n},6763:(e,t,r)=>{var n=r(537),o=r(4148);function i(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(e){u[e]=i()},"time"],[function(e){var t=u[e];if(!t)throw new Error("No such label: "+e);delete u[e];var r=i()-t;a.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),a.error(e.stack)},"trace"],[function(e){a.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=s.call(arguments,1);o.ok(!1,n.format.apply(null,t))}},"assert"]],l=0;l<c.length;l++){var f=c[l],p=f[0],d=f[1];a[d]||(a[d]=p)}e.exports=a},6897:(e,t,r)=>{"use strict";var n=r(453),o=r(41),i=r(592)(),a=r(5795),s=r(9675),u=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&a){var l=a(e,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(c=!1)}return(n||c||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(e,t,r)=>{"use strict";var n,o=r(3126),i=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!n&&i&&i(Object.prototype,"__proto__"),s=Object,u=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof u&&function(e){return u(null==e?e:s(e))}},7244:(e,t,r)=>{"use strict";var n=r(9092)(),o=r(6556)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},a=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"callee"in e&&"[object Function]"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(u(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7653:(e,t,r)=>{"use strict";var n=r(8452),o=r(487),i=r(9211),a=r(9394),s=r(6576),u=o(a(),Object);n(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},7816:(e,t,r)=>{"use strict";var n=r(6698),o=r(392),i=r(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var p=0;p<80;++p){var d=~~(p/20),h=c(r)+f(d,n,o,i)+s+t[p]+a[d]|0;s=i,i=o,o=l(n),n=r,r=h}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},8002:e=>{"use strict";e.exports=Math.min},8068:e=>{"use strict";e.exports=SyntaxError},8075:(e,t,r)=>{"use strict";var n=r(453),o=r(487),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},8184:(e,t,r)=>{"use strict";var n,o=r(6556),i=r(9721)(/^\s*(?:function)?\*/),a=r(9092)(),s=r(3628),u=o("Object.prototype.toString"),c=o("Function.prototype.toString");e.exports=function(e){if("function"!=typeof e)return!1;if(i(c(e)))return!0;if(!a)return"[object GeneratorFunction]"===u(e);if(!s)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&s(t)}return s(e)===n}},8287:(e,t,r)=>{"use strict";var n=r(6763);const o=r(7526),i=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=u(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|y(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Z(e.length)?u(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function p(e){return f(e),u(e<0?0:0|y(e))}function d(e){const t=e.length<0?0:0|y(e.length),r=u(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function y(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:$(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function S(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Z(n))return a;e[r+a]=n}return a}function E(e,t,r,n){return W($(t,e.length-r),e,r,n)}function T(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return W(G(t),e,r,n)}function O(e,t,r,n){return W(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},c.allocUnsafe=function(e){return p(e)},c.allocUnsafeSlow=function(e){return p(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))o+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<s;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function R(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Y[e[n]];return o}function B(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function U(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=J(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=J(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const M={};function V(e,t,r){M[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,o,i)}function z(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}V("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),V("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=q(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function $(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return o.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},8403:(e,t,r)=>{"use strict";var n=r(1189),o=r(1333)(),i=r(6556),a=r(9612),s=i("Array.prototype.push"),u=i("Object.prototype.propertyIsEnumerable"),c=o?a.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=a(e);if(1===arguments.length)return r;for(var i=1;i<arguments.length;++i){var l=a(arguments[i]),f=n(l),p=o&&(a.getOwnPropertySymbols||c);if(p)for(var d=p(l),h=0;h<d.length;++h){var y=d[h];u(l,y)&&s(f,y)}for(var m=0;m<f.length;++m){var g=f[m];if(u(l,g)){var v=l[g];r[g]=v}}}return r}},8452:(e,t,r)=>{"use strict";var n=r(1189),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(41),u=r(592)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(e,t,r,!0):s(e,t,r)},l=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)c(e,i[s],t[i[s]],r[i[s]])};l.supportsDescriptors=!!u,e.exports=l},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8875:(e,t,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(1093),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!p["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=a(e),s=t&&"[object String]"===i.call(e),p=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var h=c&&r;if(s&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)p.push(String(y));if(n&&e.length>0)for(var m=0;m<e.length;++m)p.push(String(m));else for(var g in e)h&&"prototype"===g||!o.call(e,g)||p.push(String(g));if(u)for(var v=function(e){if("undefined"==typeof window||!d)return f(e);try{return f(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)v&&"constructor"===l[b]||!o.call(e,l[b])||p.push(l[b]);return p}}e.exports=n},8968:e=>{"use strict";e.exports=Math.floor},9032:(e,t,r)=>{"use strict";var n=r(7244),o=r(8184),i=r(5767),a=r(5680);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),f=s(Number.prototype.valueOf),p=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var h=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function m(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===l(e)}function v(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function w(e){return"[object WeakSet]"===l(e)}function S(e){return"[object ArrayBuffer]"===l(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(S.working?S(e):e instanceof ArrayBuffer)}function T(e){return"[object DataView]"===l(e)}function k(e){return"undefined"!=typeof DataView&&(T.working?T(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||k(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},S.working="undefined"!=typeof ArrayBuffer&&S(new ArrayBuffer),t.isArrayBuffer=E,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=k;var O="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===l(e)}function _(e){return void 0!==O&&(void 0===A.working&&(A.working=A(new O)),A.working?A(e):e instanceof O)}function x(e){return m(e,f)}function P(e){return m(e,p)}function I(e){return m(e,d)}function R(e){return u&&m(e,h)}function B(e){return c&&m(e,y)}t.isSharedArrayBuffer=_,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=x,t.isStringObject=P,t.isBooleanObject=I,t.isBigIntObject=R,t.isSymbolObject=B,t.isBoxedPrimitive=function(e){return x(e)||P(e)||I(e)||R(e)||B(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||_(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},9092:(e,t,r)=>{"use strict";var n=r(1333);e.exports=function(){return n()&&!!Symbol.toStringTag}},9133:(e,t,r)=>{"use strict";var n=r(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var a in o)i+=a;return e!==i}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},9209:(e,t,r)=>{"use strict";var n=r(6578),o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof o[n[t]]&&(e[e.length]=n[t]);return e}},9211:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},9290:e=>{"use strict";e.exports=RangeError},9353:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),s=r(0,o.length-a.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(u)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,n(a,arguments));return Object(t)===t?t:this}return o.apply(e,n(a,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,i.prototype=new l,l.prototype=null}return i}},9383:e=>{"use strict";e.exports=Error},9394:(e,t,r)=>{"use strict";var n=r(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9538:e=>{"use strict";e.exports=ReferenceError},9597:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,o=a(e);if(t){var i=a(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}var s,u,c={};function l(e,t,r){r||(r=Error);var n=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(s,r);var n,a=i(s);function s(r,n,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i=a.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,o)),i.code=e,i}return n=s,Object.defineProperty(n,"prototype",{writable:!1}),n}(r);c[e]=n}function f(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(e,t,o){var i,a,u;if(void 0===s&&(s=r(4148)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,4)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))u="The ".concat(e," ").concat(i," ").concat(f(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+1>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";u='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(f(t,"type"))}return u+". Received type ".concat(n(o))},TypeError),l("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(537));var o=u.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)},TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(4148)),s(t.length>0,"At least one arg needs to be specified");var o="The ",i=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),i){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,i-1).join(", "),o+=", and ".concat(t[i-1]," arguments")}return"".concat(o," must be specified")},TypeError),e.exports.codes=c},9600:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},9612:e=>{"use strict";e.exports=Object},9675:e=>{"use strict";e.exports=TypeError},9721:(e,t,r)=>{"use strict";var n=r(6556),o=r(4035),i=n("RegExp.prototype.exec"),a=r(9675);e.exports=function(e){if(!o(e))throw new a("`regex` must be a RegExp");return function(t){return null!==i(e,t)}}},9957:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(6743);e.exports=i.call(n,o)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(448)})(),e.exports=t()},976:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function a(e,t,r){return t=l(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,r||[],l(e).constructor):t.apply(e,r))}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(u())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&c(o,r.prototype),o}(e,arguments,l(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)},s(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}r.d(t,{Cu:()=>z,v7:()=>_,nS:()=>U,Dr:()=>f,m_:()=>b});var f=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=(this instanceof t?this.constructor:void 0).prototype;return(n=a(this,t,[e])).__proto__=o,n.constructor=t,n.response=r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),r=t,(n=[{key:"getResponse",value:function(){return this.response}}])&&o(r.prototype,n),i&&o(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(s(Error));function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function h(e){var t=function(e,t){if("object"!=p(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==p(t)?t:t+""}function y(e,t,r){return t=g(t),function(e,t){if(t&&("object"==p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,m()?Reflect.construct(t,r||[],g(e).constructor):t.apply(e,r))}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}var b=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=(this instanceof t?this.constructor:void 0).prototype;return(n=y(this,t,[e,r])).__proto__=o,n.constructor=t,n.name="NotFoundError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(t,e),r=t,n&&d(r.prototype,n),o&&d(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(f);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E(n.key),n)}}function E(e){var t=function(e,t){if("object"!=w(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==w(t)?t:t+""}function T(e,t,r){return t=O(t),function(e,t){if(t&&("object"==w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,k()?Reflect.construct(t,r||[],O(e).constructor):t.apply(e,r))}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}var _=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=(this instanceof t?this.constructor:void 0).prototype;return(n=T(this,t,[e,r])).__proto__=o,n.constructor=t,n.name="BadRequestError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(t,e),r=t,n&&S(r.prototype,n),o&&S(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(f);function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function P(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,I(n.key),n)}}function I(e){var t=function(e,t){if("object"!=x(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==x(t)?t:t+""}function R(e,t,r){return t=C(t),function(e,t){if(t&&("object"==x(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,B()?Reflect.construct(t,r||[],C(e).constructor):t.apply(e,r))}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}var U=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=(this instanceof t?this.constructor:void 0).prototype;return(n=R(this,t,[e,r])).__proto__=o,n.constructor=t,n.name="BadResponseError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}(t,e),r=t,n&&P(r.prototype,n),o&&P(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(f);function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function L(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D(n.key),n)}}function D(e){var t=function(e,t){if("object"!=N(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==N(t)?t:t+""}function F(e,t,r){return t=H(t),function(e,t){if(t&&("object"==N(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,V()?Reflect.construct(t,r||[],H(e).constructor):t.apply(e,r))}function M(e){var t="function"==typeof Map?new Map:void 0;return M=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(V())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&q(o,r.prototype),o}(e,arguments,H(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),q(r,e)},M(e)}function V(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(V=function(){return!!e})()}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},q(e,t)}function H(e){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},H(e)}var z=function(e){function t(e,r,n){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=(this instanceof t?this.constructor:void 0).prototype;return(o=F(this,t,[e])).__proto__=i,o.constructor=t,o.name="AccountRequiresMemoError",o.accountId=r,o.operationIndex=n,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q(e,t)}(t,e),r=t,n&&L(r.prototype,n),o&&L(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(M(Error))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(924)})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("StellarSdk",[],t):"object"==typeof exports?exports.StellarSdk=t():e.StellarSdk=t()}(self,()=>(()=>{var e={76:(e,t,r)=>{"use strict";var n;r.d(t,{j:()=>n}),function(e){var t=function(e){return e.SUCCESS="SUCCESS",e.NOT_FOUND="NOT_FOUND",e.FAILED="FAILED",e}({});function r(e){return"transactionData"in e}e.GetTransactionStatus=t,e.isSimulationError=function(e){return"error"in e},e.isSimulationSuccess=r,e.isSimulationRestore=function(e){return r(e)&&"restorePreamble"in e&&!!e.restorePreamble.transactionData},e.isSimulationRaw=function(e){return!e._parsed}}(n||(n={}))},121:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}r.d(t,{A:()=>c});var a,s,u,c=(a=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},u=[{key:"validateTimebounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e.timeBounds)return!1;var r=Math.floor(Date.now()/1e3),n=e.timeBounds,o=n.minTime,i=n.maxTime;return r>=Number.parseInt(o,10)-t&&r<=Number.parseInt(i,10)+t}},{key:"sleep",value:function(e){return new Promise(function(t){return setTimeout(t,e)})}}],(s=null)&&o(a.prototype,s),u&&o(a,u),Object.defineProperty(a,"prototype",{writable:!1}),a)},127:function(e,t,r){var n,o,i;!function(a,s){"use strict";e.exports?e.exports=s(r(193)):(o=[r(193)],void 0===(i="function"==typeof(n=s)?n.apply(t,o):n)||(e.exports=i))}(0,function(e,t){"use strict";var r=t&&t.URITemplate,n=Object.prototype.hasOwnProperty;function o(e){return o._cache[e]?o._cache[e]:this instanceof o?(this.expression=e,o._cache[e]=this,this):new o(e)}function i(e){this.data=e,this.cache={}}var a=o.prototype,s={"":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encode"},"+":{prefix:"",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},"#":{prefix:"#",separator:",",named:!1,empty_name_separator:!1,encode:"encodeReserved"},".":{prefix:".",separator:".",named:!1,empty_name_separator:!1,encode:"encode"},"/":{prefix:"/",separator:"/",named:!1,empty_name_separator:!1,encode:"encode"},";":{prefix:";",separator:";",named:!0,empty_name_separator:!1,encode:"encode"},"?":{prefix:"?",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"},"&":{prefix:"&",separator:"&",named:!0,empty_name_separator:!0,encode:"encode"}};return o._cache={},o.EXPRESSION_PATTERN=/\{([^a-zA-Z0-9%_]?)([^\}]+)(\}|$)/g,o.VARIABLE_PATTERN=/^([^*:.](?:\.?[^*:.])*)((\*)|:(\d+))?$/,o.VARIABLE_NAME_PATTERN=/[^a-zA-Z0-9%_.]/,o.LITERAL_PATTERN=/[<>{}"`^| \\]/,o.expand=function(e,t,r){var n,i,a,u=s[e.operator],c=u.named?"Named":"Unnamed",l=e.variables,f=[];for(a=0;i=l[a];a++){if(0===(n=t.get(i.name)).type&&r&&r.strict)throw new Error('Missing expansion value for variable "'+i.name+'"');if(n.val.length){if(n.type>1&&i.maxlength)throw new Error('Invalid expression: Prefix modifier not applicable to variable "'+i.name+'"');f.push(o["expand"+c](n,u,i.explode,i.explode&&u.separator||",",i.maxlength,i.name))}else n.type&&f.push("")}return f.length?u.prefix+f.join(u.separator):""},o.expandNamed=function(t,r,n,o,i,a){var s,u,c,l="",f=r.encode,p=r.empty_name_separator,d=!t[f].length,h=2===t.type?"":e[f](a);for(u=0,c=t.val.length;u<c;u++)i?(s=e[f](t.val[u][1].substring(0,i)),2===t.type&&(h=e[f](t.val[u][0].substring(0,i)))):d?(s=e[f](t.val[u][1]),2===t.type?(h=e[f](t.val[u][0]),t[f].push([h,s])):t[f].push([void 0,s])):(s=t[f][u][1],2===t.type&&(h=t[f][u][0])),l&&(l+=o),n?l+=h+(p||s?"=":"")+s:(u||(l+=e[f](a)+(p||s?"=":"")),2===t.type&&(l+=h+","),l+=s);return l},o.expandUnnamed=function(t,r,n,o,i){var a,s,u,c="",l=r.encode,f=r.empty_name_separator,p=!t[l].length;for(s=0,u=t.val.length;s<u;s++)i?a=e[l](t.val[s][1].substring(0,i)):p?(a=e[l](t.val[s][1]),t[l].push([2===t.type?e[l](t.val[s][0]):void 0,a])):a=t[l][s][1],c&&(c+=o),2===t.type&&(c+=i?e[l](t.val[s][0].substring(0,i)):t[l][s][0],c+=n?f||a?"=":"":","),c+=a;return c},o.noConflict=function(){return t.URITemplate===o&&(t.URITemplate=r),o},a.expand=function(e,t){var r="";this.parts&&this.parts.length||this.parse(),e instanceof i||(e=new i(e));for(var n=0,a=this.parts.length;n<a;n++)r+="string"==typeof this.parts[n]?this.parts[n]:o.expand(this.parts[n],e,t);return r},a.parse=function(){var e,t,r,n=this.expression,i=o.EXPRESSION_PATTERN,a=o.VARIABLE_PATTERN,u=o.VARIABLE_NAME_PATTERN,c=o.LITERAL_PATTERN,l=[],f=0,p=function(e){if(e.match(c))throw new Error('Invalid Literal "'+e+'"');return e};for(i.lastIndex=0;;){if(null===(t=i.exec(n))){l.push(p(n.substring(f)));break}if(l.push(p(n.substring(f,t.index))),f=t.index+t[0].length,!s[t[1]])throw new Error('Unknown Operator "'+t[1]+'" in "'+t[0]+'"');if(!t[3])throw new Error('Unclosed Expression "'+t[0]+'"');for(var d=0,h=(e=t[2].split(",")).length;d<h;d++){if(null===(r=e[d].match(a)))throw new Error('Invalid Variable "'+e[d]+'" in "'+t[0]+'"');if(r[1].match(u))throw new Error('Invalid Variable Name "'+r[1]+'" in "'+t[0]+'"');e[d]={name:r[1],explode:!!r[3],maxlength:r[4]&&parseInt(r[4],10)}}if(!e.length)throw new Error('Expression Missing Variable(s) "'+t[0]+'"');l.push({expression:t[0],operator:t[1],variables:e})}return l.length||l.push(p(n)),this.parts=l,this},i.prototype.get=function(e){var t,r,o,i=this.data,a={type:0,val:[],encode:[],encodeReserved:[]};if(void 0!==this.cache[e])return this.cache[e];if(this.cache[e]=a,null==(o="[object Function]"===String(Object.prototype.toString.call(i))?i(e):"[object Function]"===String(Object.prototype.toString.call(i[e]))?i[e](e):i[e]))return a;if("[object Array]"===String(Object.prototype.toString.call(o))){for(t=0,r=o.length;t<r;t++)void 0!==o[t]&&null!==o[t]&&a.val.push([void 0,String(o[t])]);a.val.length&&(a.type=3)}else if("[object Object]"===String(Object.prototype.toString.call(o))){for(t in o)n.call(o,t)&&void 0!==o[t]&&null!==o[t]&&a.val.push([t,String(o[t])]);a.val.length&&(a.type=2)}else a.type=1,a.val.push([void 0,String(o)]);return a},e.expand=function(t,r){var n=new o(t).expand(r);return new e(n)},o})},193:function(e,t,r){var n,o,i;!function(a,s){"use strict";e.exports?e.exports=s(r(340),r(430),r(704)):(o=[r(340),r(430),r(704)],void 0===(i="function"==typeof(n=s)?n.apply(t,o):n)||(e.exports=i))}(0,function(e,t,r,n){"use strict";var o=n&&n.URI;function i(e,t){var r=arguments.length>=1;if(!(this instanceof i))return r?arguments.length>=2?new i(e,t):new i(e):new i;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.11";var a=i.prototype,s=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function f(e,t){var r,n,o={};if("RegExp"===c(t))o=null;else if(l(t))for(r=0,n=t.length;r<n;r++)o[t[r]]=!0;else o[t]=!0;for(r=0,n=e.length;r<n;r++){(o&&void 0!==o[e[r]]||!o&&t.test(e[r]))&&(e.splice(r,1),n--,r--)}return e}function p(e,t){var r,n;if(l(t)){for(r=0,n=t.length;r<n;r++)if(!p(e,t[r]))return!1;return!0}var o=c(t);for(r=0,n=e.length;r<n;r++)if("RegExp"===o){if("string"==typeof e[r]&&e[r].match(t))return!0}else if(e[r]===t)return!0;return!1}function d(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function h(e){return e.replace(/^\/+|\/+$/g,"")}function y(e){return escape(e)}function m(e){return encodeURIComponent(e).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u201e\u2018\u2019]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=m,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=m,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var r=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var g,v={encode:"encode",decode:"decode"},b=function(e,t){return function(r){try{return i[t](r+"").replace(i.characters[e][t].expression,function(r){return i.characters[e][t].map[r]})}catch(e){return r}}};for(g in v)i[g+"PathSegment"]=b("pathname",v[g]),i[g+"UrnPathSegment"]=b("urnpath",v[g]);var w=function(e,t,r){return function(n){var o;o=r?function(e){return i[t](i[r](e))}:i[t];for(var a=(n+"").split(e),s=0,u=a.length;s<u;s++)a[s]=o(a[s]);return a.join(e)}};function S(e){return function(t,r){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!r),this)}}function E(e,t){return function(r,n){return void 0===r?this._parts[e]||"":(null!==r&&(r+="").charAt(0)===t&&(r=r.substring(1)),this._parts[e]=r,this.build(!n),this)}}i.decodePath=w("/","decodePathSegment"),i.decodeUrnPath=w(":","decodeUrnPathSegment"),i.recodePath=w("/","encodePathSegment","decode"),i.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),i.encodeReserved=b("reserved","encode"),i.parse=function(e,t){var r;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),(r=(e=(e=e.replace(i.leading_whitespace_expression,"")).replace(i.ascii_tab_whitespace,"")).indexOf("#"))>-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=i.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var r,n,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,o)||null,"/"===t.port&&(t.port=null);else{var a=e.indexOf(":"),s=e.indexOf("/"),u=e.indexOf(":",a+1);-1!==u&&(-1===s||u<s)?(t.hostname=e.substring(0,o)||null,t.port=null):(n=e.substring(0,o).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var r=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var n,o=e.indexOf("/"),a=e.lastIndexOf("@",o>-1?o:e.length-1);return a>-1&&(-1===o||a<o)?(n=e.substring(0,a).split(":"),t.username=n[0]?i.decode(n[0]):null,n.shift(),t.password=n[0]?i.decode(n.join(":")):null,e=r.substring(a+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,o,a={},u=e.split("&"),c=u.length,l=0;l<c;l++)r=u[l].split("="),n=i.decodeQuery(r.shift(),t),o=r.length?i.decodeQuery(r.join("="),t):null,"__proto__"!==n&&(s.call(a,n)?("string"!=typeof a[n]&&null!==a[n]||(a[n]=[a[n]]),a[n].push(o)):a[n]=o);return a},i.build=function(e){var t="",r=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",r=!0),t+=i.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&r&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){var t="";return e.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t="";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,r){var n,o,a,u,c="";for(o in e)if("__proto__"!==o&&s.call(e,o))if(l(e[o]))for(n={},a=0,u=e[o].length;a<u;a++)void 0!==e[o][a]&&void 0===n[e[o][a]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][a],r),!0!==t&&(n[e[o][a]+""]=!0));else void 0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],r));return c.substring(1)},i.buildQueryParameter=function(e,t,r){return i.encodeQuery(e,r)+(null!==t?"="+i.encodeQuery(t,r):"")},i.addQuery=function(e,t,r){if("object"==typeof t)for(var n in t)s.call(t,n)&&i.addQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=r);"string"==typeof e[t]&&(e[t]=[e[t]]),l(r)||(r=[r]),e[t]=(e[t]||[]).concat(r)}},i.setQuery=function(e,t,r){if("object"==typeof t)for(var n in t)s.call(t,n)&&i.setQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===r?null:r}},i.removeQuery=function(e,t,r){var n,o,a;if(l(t))for(n=0,o=t.length;n<o;n++)e[t[n]]=void 0;else if("RegExp"===c(t))for(a in e)t.test(a)&&(e[a]=void 0);else if("object"==typeof t)for(a in t)s.call(t,a)&&i.removeQuery(e,a,t[a]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===c(r)?!l(e[t])&&r.test(e[t])?e[t]=void 0:e[t]=f(e[t],r):e[t]!==String(r)||l(r)&&1!==r.length?l(e[t])&&(e[t]=f(e[t],r)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,r,n){switch(c(t)){case"String":break;case"RegExp":for(var o in e)if(s.call(e,o)&&t.test(o)&&(void 0===r||i.hasQuery(e,o,r)))return!0;return!1;case"Object":for(var a in t)if(s.call(t,a)&&!i.hasQuery(e,a,t[a]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(r)){case"Undefined":return t in e;case"Boolean":return r===Boolean(l(e[t])?e[t].length:e[t]);case"Function":return!!r(e[t],t,e);case"Array":return!!l(e[t])&&(n?p:d)(e[t],r);case"RegExp":return l(e[t])?!!n&&p(e[t],r):Boolean(e[t]&&e[t].match(r));case"Number":r=String(r);case"String":return l(e[t])?!!n&&p(e[t],r):e[t]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var e=[],t=[],r=0,n=0;n<arguments.length;n++){var o=new i(arguments[n]);e.push(o);for(var a=o.segment(),s=0;s<a.length;s++)"string"==typeof a[s]&&t.push(a[s]),a[s]&&r++}if(!t.length||!r)return new i("");var u=new i("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r)){r--;break}return r<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(r)&&"/"===t.charAt(r)||(r=e.substring(0,r).lastIndexOf("/")),e.substring(0,r+1))},i.withinString=function(e,t,r){r||(r={});var n=r.start||i.findUri.start,o=r.end||i.findUri.end,a=r.trim||i.findUri.trim,s=r.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var c=n.exec(e);if(!c)break;var l=c.index;if(r.ignoreHtml){var f=e.slice(Math.max(l-3,0),l);if(f&&u.test(f))continue}for(var p=l+e.slice(l).search(o),d=e.slice(l,p),h=-1;;){var y=s.exec(d);if(!y)break;var m=y.index+y[0].length;h=Math.max(h,m)}if(!((d=h>-1?d.slice(0,h)+d.slice(h).replace(a,""):d.replace(a,"")).length<=c[0].length||r.ignore&&r.ignore.test(d))){var g=t(d,l,p=l+d.length,e);void 0!==g?(g=String(g),e=e.slice(0,l)+g+e.slice(p),n.lastIndex=l+g.length):n.lastIndex=p}}return n.lastIndex=0,e},i.ensureValidHostname=function(t,r){var n=!!t,o=!1;if(!!r&&(o=p(i.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=o),this},a.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new i(this)},a.valueOf=a.toString=function(){return this.build(!1)._string},a.protocol=S("protocol"),a.username=S("username"),a.password=S("password"),a.hostname=S("hostname"),a.port=S("port"),a.query=E("query","?"),a.fragment=E("fragment","#"),a.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},a.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},a.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},a.path=a.pathname,a.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var n=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1);if(!n&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var a=n?e._parts:e;for(r in a)"query"!==r&&s.call(this._parts,r)&&(this._parts[r]=a[r]);a.query&&this.query(a.query,!1)}return this.build(!t),this},a.is=function(e){var t=!1,n=!1,o=!1,a=!1,s=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,n=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),s=(a=!(t=n||o))&&r&&r.has(this._parts.hostname),u=a&&i.idn_expression.test(this._parts.hostname),c=a&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return a;case"sld":return s;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var T=a.protocol,k=a.port,O=a.hostname;a.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return T.call(this,e,t)},a.scheme=a.protocol,a.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),k.call(this,e,t))},a.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return O.call(this,e,t)},a.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=i(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},a.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},a.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=i.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},a.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=i.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},a.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,n),a=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,e),this.build(!t),this},a.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},a.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},a.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return e?i.decodePath(n):n}var o=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,o),s=new RegExp("^"+u(a));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),this.build(!t),this},a.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return e?i.decodePathSegment(n):n}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var a=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),o?this.normalizePath(t):this.build(!t),this},a.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,o=this.filename(),a=o.lastIndexOf(".");return-1===a?"":(r=o.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?i.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var s,c=this.suffix();if(c)s=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return s&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e)),this.build(!t),this},a.segment=function(e,t,r){var n=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),a=o.split(n);if(void 0!==e&&"number"!=typeof e&&(r=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&a.shift(),e<0&&(e=Math.max(a.length+e,0)),void 0===t)return void 0===e?a:a[e];if(null===e||void 0===a[e])if(l(t)){a=[];for(var s=0,u=t.length;s<u;s++)(t[s].length||a.length&&a[a.length-1].length)&&(a.length&&!a[a.length-1].length&&a.pop(),a.push(h(t[s])))}else(t||"string"==typeof t)&&(t=h(t),""===a[a.length-1]?a[a.length-1]=t:a.push(t));else t?a[e]=h(t):a.splice(e,1);return i&&a.unshift(""),this.path(a.join(n),r)},a.segmentCoded=function(e,t,r){var n,o,a;if("number"!=typeof e&&(r=t,t=e,e=void 0),void 0===t){if(l(n=this.segment(e,t,r)))for(o=0,a=n.length;o<a;o++)n[o]=i.decode(n[o]);else n=void 0!==n?i.decode(n):void 0;return n}if(l(t))for(o=0,a=t.length;o<a;o++)t[o]=i.encode(t[o]);else t="string"==typeof t||t instanceof String?i.encode(t):t;return this.segment(e,t,r)};var A=a.query;return a.query=function(e,t){if(!0===e)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var r=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=e.call(this,r);return this._parts.query=i.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):A.call(this,e,t)},a.setQuery=function(e,t,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)n[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in e)s.call(e,o)&&(n[o]=e[o])}return this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},a.addQuery=function(e,t,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(n,e,void 0===t?null:t),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},a.removeQuery=function(e,t,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(n,e,t),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},a.hasQuery=function(e,t,r){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(n,e,t,r)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},a.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},a.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},a.normalizePath=function(e){var t,r=this._parts.path;if(!r)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var n,o,a="";for("/"!==(r=i.recodePath(r)).charAt(0)&&(t=!0,r="/"+r),"/.."!==r.slice(-3)&&"/."!==r.slice(-2)||(r+="/"),r=r.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(a=r.substring(1).match(/^(\.\.\/)+/)||"")&&(a=a[0]);-1!==(n=r.search(/\/\.\.(\/|$)/));)0!==n?(-1===(o=r.substring(0,n).lastIndexOf("/"))&&(o=n),r=r.substring(0,o)+r.substring(n+3)):r=r.substring(3);return t&&this.is("relative")&&(r=a+r.substring(1)),this._parts.path=r,this.build(!e),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},a.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var e=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},a.unicode=function(){var e=i.encode,t=i.decode;i.encode=m,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},a.readable=function(){var t=this.clone();t.username("").password("").normalize();var r="";if(t._parts.protocol&&(r+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(r+=e.toUnicode(t._parts.hostname),t._parts.port&&(r+=":"+t._parts.port)):r+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(r+="/"),r+=t.path(!0),t._parts.query){for(var n="",o=0,a=t._parts.query.split("&"),s=a.length;o<s;o++){var u=(a[o]||"").split("=");n+="&"+i.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==u[1]&&(n+="="+i.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}r+="?"+n.substring(1)}return r+=i.decodeQuery(t.hash(),!0)},a.absoluteTo=function(e){var t,r,n,o=this.clone(),a=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof i||(e=new i(e)),o._parts.protocol)return o;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)return o;for(r=0;n=a[r];r++)o._parts[n]=e._parts[n];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},a.relativeTo=function(e){var t,r,n,o,a,s=this.clone().normalize();if(s._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new i(e).normalize(),t=s._parts,r=e._parts,o=s.path(),a=e.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==a.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===r.protocol&&(t.protocol=null),t.username!==r.username||t.password!==r.password)return s.build();if(null!==t.protocol||null!==t.username||null!==t.password)return s.build();if(t.hostname!==r.hostname||t.port!==r.port)return s.build();if(t.hostname=null,t.port=null,o===a)return t.path="",s.build();if(!(n=i.commonPath(o,a)))return s.build();var u=r.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=u+t.path.substring(n.length)||"./",s.build()},a.equals=function(e){var t,r,n,o,a,u=this.clone(),c=new i(e),f={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(n=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(n.length!==o.length)return!1;for(a in t=i.parseQuery(n,this._parts.escapeQuerySpace),r=i.parseQuery(o,this._parts.escapeQuerySpace),t)if(s.call(t,a)){if(l(t[a])){if(!d(t[a],r[a]))return!1}else if(t[a]!==r[a])return!1;f[a]=!0}for(a in r)if(s.call(r,a)&&!f[a])return!1;return!0},a.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},a.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},a.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},i})},209:(e,t,r)=>{"use strict";var n=65536,o=4294967295;var i=r(861).Buffer,a=r.g.crypto||r.g.msCrypto;a&&a.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>n)for(var s=0;s<e;s+=n)a.getRandomValues(r.slice(s,s+n));else a.getRandomValues(r);if("function"==typeof t)return process.nextTick(function(){t(null,r)});return r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},242:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>{}})},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*y}},287:(e,t,r)=>{"use strict";const n=r(526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Q(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|h(e))}function p(e){const t=e.length<0?0:0|h(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function h(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(o)return n?-1:X(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function w(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Q(n))return a;e[r+a]=n}return a}function S(e,t,r,n){return G(X(t,e.length-r),e,r,n)}function E(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function T(e,t,r,n){return G($(t),e,r,n)}function k(e,t,r,n){return G(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=_));return r}(n)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.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}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(W(t,Uint8Array))o+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==l[e]){i=c[e],a=l[e];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function x(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Z[e[n]];return o}function R(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function j(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function U(e,t,r,n,o){q(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function N(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),u.prototype.readBigUInt64BE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),u.prototype.readBigInt64BE=Y(function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){C(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){C(this,e,t,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Y(function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Y(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Y(function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Y(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=u.isBuffer(e)?e:u.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const F={};function M(e,t,r){F[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function q(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,o,i)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),M("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=V(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=V(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const K=/[^+/0-9A-Za-z-_]/g;function X(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Y(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},293:(e,t,r)=>{var n=r(546),o=r(708);e.exports={parse:function(e){var t=n.parse(e.toString());return o.compile(t)}}},299:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AssembledTransaction:()=>ke,Client:()=>ft,DEFAULT_TIMEOUT:()=>h,Err:()=>d,NULL_ACCOUNT:()=>y,Ok:()=>p,SentTransaction:()=>Z,Spec:()=>$e,Watcher:()=>Y,basicNodeSigner:()=>Ie});var n=r(950),o=r(496),i=r(76),a=r(680);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function l(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var p=l(function e(t){u(this,e),this.value=t},[{key:"unwrapErr",value:function(){throw new Error("No error")}},{key:"unwrap",value:function(){return this.value}},{key:"isOk",value:function(){return!0}},{key:"isErr",value:function(){return!1}}]),d=l(function e(t){u(this,e),this.error=t},[{key:"unwrapErr",value:function(){return this.error}},{key:"unwrap",value:function(){throw new Error(this.error.message)}},{key:"isOk",value:function(){return!1}},{key:"isErr",value:function(){return!0}}]),h=300,y="GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF",m=r(287).Buffer;function g(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return v(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(v(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,v(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,v(f,"constructor",c),v(c,"constructor",u),u.displayName="GeneratorFunction",v(c,o,"GeneratorFunction"),v(f),v(f,o,"Generator"),v(f,n,function(){return this}),v(f,"toString",function(){return"[object Generator]"}),(g=function(){return{w:i,m:p}})()}function v(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}v=function(e,t,r,n){function i(t,r){v(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},v(e,t,r,n)}function b(e){return function(e){if(Array.isArray(e))return w(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function E(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function T(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){E(i,n,o,a,s,"next",e)}function s(e){E(i,n,o,a,s,"throw",e)}a(void 0)})}}function k(e,t,r){return O.apply(this,arguments)}function O(){return O=T(g().m(function e(t,r,n){var o,i,a,s,u,c,l,f,p,d=arguments;return g().w(function(e){for(;;)switch(e.n){case 0:return o=d.length>3&&void 0!==d[3]?d[3]:1.5,i=d.length>4&&void 0!==d[4]&&d[4],s=0,f=a=[],e.n=1,t();case 1:if(f.push.call(f,e.v),r(a[a.length-1])){e.n=2;break}return e.a(2,a);case 2:u=new Date(Date.now()+1e3*n).valueOf(),l=c=1e3;case 3:if(!(Date.now()<u&&r(a[a.length-1]))){e.n=6;break}return s+=1,i&&console.info("Waiting ".concat(c,"ms before trying again (bringing the total wait time to ").concat(l,"ms so far, of total ").concat(1e3*n,"ms)")),e.n=4,new Promise(function(e){return setTimeout(e,c)});case 4:return c*=o,new Date(Date.now()+c).valueOf()>u&&(c=u-Date.now(),i&&console.info("was gonna wait too long; new waitTime: ".concat(c,"ms"))),l=c+l,p=a,e.n=5,t(a[a.length-1]);case 5:p.push.call(p,e.v),i&&r(a[a.length-1])&&console.info("".concat(s,". Called ").concat(t,"; ").concat(a.length," prev attempts. Most recent: ").concat(JSON.stringify(a[a.length-1],null,2))),e.n=3;break;case 6:return e.a(2,a)}},e)})),O.apply(this,arguments)}var A,_=/Error\(Contract, #(\d+)\)/;function x(e){return P.apply(this,arguments)}function P(){return(P=T(g().m(function e(t){var r,n,o;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,WebAssembly.compile(t);case 1:n=e.v,r=WebAssembly.Module.customSections(n,"contractspecv0"),e.n=3;break;case 2:e.p=2,e.v,o=I(t),r=o.get("contractspecv0");case 3:if(r&&0!==r.length){e.n=4;break}throw new Error("Could not obtain contract spec from wasm");case 4:return e.a(2,m.from(r[0]))}},e,null,[[0,2]])}))).apply(this,arguments)}function I(e){var t=new Map,r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),n=0,o=function(t){if(n+t>e.byteLength)throw new Error("Buffer overflow");var o=new Uint8Array(r,n,t);return n+=t,o};if("0,97,115,109"!==b(o(4)).join())throw new Error("Invalid WASM magic");if("1,0,0,0"!==b(o(4)).join())throw new Error("Invalid WASM version");for(;n<e.byteLength;){var i=o(1)[0],a=p(),s=n;if(0===i){var u=p();if(0===u||n+u>s+a)continue;var c=o(u),l=o(a-(n-s));try{var f=new TextDecoder("utf-8",{fatal:!0}).decode(c);l.length>0&&t.set(f,(t.get(f)||[]).concat(l))}catch(e){}}else n+=a}function p(){for(var e=0,t=0;;){var r=o(1)[0];if(e|=(127&r)<<t,!(128&r))break;if((t+=7)>=32)throw new Error("Invalid WASM value")}return e>>>0}return t}function R(e){for(var t=new n.cereal.XdrReader(e),r=[];!t.eof;)r.push(n.xdr.ScSpecEntry.read(t));return r}function B(e,t){return C.apply(this,arguments)}function C(){return(C=T(g().m(function e(t,r){return g().w(function(e){for(;;)if(0===e.n)return e.a(2,t.publicKey?r.getAccount(t.publicKey):new n.Account(y,"0"))},e)}))).apply(this,arguments)}function j(e,t,r){return t=F(t),function(e,t){if(t&&("object"==M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,L()?Reflect.construct(t,r||[],F(e).constructor):t.apply(e,r))}function U(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}function N(e){var t="function"==typeof Map?new Map:void 0;return N=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(L())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&D(o,r.prototype),o}(e,arguments,F(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),D(r,e)},N(e)}function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(L=function(){return!!e})()}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function V(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return q(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(q(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,q(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,q(f,"constructor",c),q(c,"constructor",u),u.displayName="GeneratorFunction",q(c,o,"GeneratorFunction"),q(f),q(f,o,"Generator"),q(f,n,function(){return this}),q(f,"toString",function(){return"[object Generator]"}),(V=function(){return{w:i,m:p}})()}function q(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}q=function(e,t,r,n){function i(t,r){q(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},q(e,t,r,n)}function H(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function z(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){H(i,n,o,a,s,"next",e)}function s(e){H(i,n,o,a,s,"throw",e)}a(void 0)})}}function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,W(n.key),n)}}function $(e,t,r){return t&&X(e.prototype,t),r&&X(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function G(e,t,r){return(t=W(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W(e){var t=function(e,t){if("object"!=M(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=M(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==M(t)?t:t+""}var Q,Z=function(){function e(t){var r,n,a=this;K(this,e),G(this,"send",(n=z(V().m(function t(r){var n,o,s;return V().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,a.server.sendTransaction(a.assembled.signed);case 1:if(a.sendTransactionResponse=t.v,"PENDING"===a.sendTransactionResponse.status){t.n=2;break}throw new e.Errors.SendFailed("Sending the transaction to the network failed!\n".concat(JSON.stringify(a.sendTransactionResponse,null,2)));case 2:return null!=r&&r.onSubmitted&&r.onSubmitted(a.sendTransactionResponse),o=a.sendTransactionResponse.hash,s=null!==(n=a.assembled.options.timeoutInSeconds)&&void 0!==n?n:h,t.n=3,k(z(V().m(function e(){var t;return V().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,a.server.getTransaction(o);case 1:return t=e.v,null!=r&&r.onProgress&&r.onProgress(t),e.a(2,t)}},e)})),function(e){return e.status===i.j.GetTransactionStatus.NOT_FOUND},s);case 3:if(a.getTransactionResponseAll=t.v,a.getTransactionResponse=a.getTransactionResponseAll[a.getTransactionResponseAll.length-1],a.getTransactionResponse.status!==i.j.GetTransactionStatus.NOT_FOUND){t.n=4;break}throw new e.Errors.TransactionStillPending("Waited ".concat(s," seconds for transaction to complete, but it did not. ")+"Returning anyway. Check the transaction status manually. "+"Sent transaction: ".concat(JSON.stringify(a.sendTransactionResponse,null,2),"\n")+"All attempts to get the result: ".concat(JSON.stringify(a.getTransactionResponseAll,null,2)));case 4:return t.a(2,a)}},t)})),function(e){return n.apply(this,arguments)})),this.assembled=t,this.server=new o.Server(this.assembled.options.rpcUrl,{allowHttp:null!==(r=this.assembled.options.allowHttp)&&void 0!==r&&r})}return $(e,[{key:"result",get:function(){if("getTransactionResponse"in this&&this.getTransactionResponse){if("returnValue"in this.getTransactionResponse)return this.assembled.options.parseResultXdr(this.getTransactionResponse.returnValue);throw new Error("Transaction failed! Cannot parse result.")}if(this.sendTransactionResponse){var t,r=null===(t=this.sendTransactionResponse.errorResult)||void 0===t?void 0:t.result();if(r)throw new e.Errors.SendFailed("Transaction simulation looked correct, but attempting to send the transaction failed. Check `simulation` and `sendTransactionResponseAll` to troubleshoot. Decoded `sendTransactionResponse.errorResultXdr`: ".concat(r));throw new e.Errors.SendResultOnly("Transaction was sent to the network, but not yet awaited. No result to show. Await transaction completion with `getTransaction(sendTransactionResponse.hash)`")}throw new Error("Sending transaction failed: ".concat(JSON.stringify(this.assembled.signed)))}}])}();A=Z,G(Z,"Errors",{SendFailed:function(e){function t(){return K(this,t),j(this,t,arguments)}return U(t,e),$(t)}(N(Error)),SendResultOnly:function(e){function t(){return K(this,t),j(this,t,arguments)}return U(t,e),$(t)}(N(Error)),TransactionStillPending:function(e){function t(){return K(this,t),j(this,t,arguments)}return U(t,e),$(t)}(N(Error))}),G(Z,"init",(Q=z(V().m(function e(t,r){var n,o;return V().w(function(e){for(;;)switch(e.n){case 0:return n=new A(t),e.n=1,n.send(r);case 1:return o=e.v,e.a(2,o)}},e)})),function(e,t){return Q.apply(this,arguments)}));var Y=$(function e(){K(this,e)}),J=r(287).Buffer;function ee(e,t,r){return t=ie(t),function(e,t){if(t&&("object"==ae(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ne()?Reflect.construct(t,r||[],ie(e).constructor):t.apply(e,r))}function te(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oe(e,t)}function re(e){var t="function"==typeof Map?new Map:void 0;return re=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(ne())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&oe(o,r.prototype),o}(e,arguments,ie(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),oe(r,e)},re(e)}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ne=function(){return!!e})()}function oe(e,t){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oe(e,t)}function ie(e){return ie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ie(e)}function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?se(Object(r),!0).forEach(function(t){Ee(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ce(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(ae(e)+" is not iterable")}function le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||ye(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fe(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ye(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function pe(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return de(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(de(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,de(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,de(f,"constructor",c),de(c,"constructor",u),u.displayName="GeneratorFunction",de(c,o,"GeneratorFunction"),de(f),de(f,o,"Generator"),de(f,n,function(){return this}),de(f,"toString",function(){return"[object Generator]"}),(pe=function(){return{w:i,m:p}})()}function de(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}de=function(e,t,r,n){function i(t,r){de(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},de(e,t,r,n)}function he(e){return function(e){if(Array.isArray(e))return me(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ye(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(e,t){if(e){if("string"==typeof e)return me(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?me(e,t):void 0}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ge(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function ve(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){ge(i,n,o,a,s,"next",e)}function s(e){ge(i,n,o,a,s,"throw",e)}a(void 0)})}}function be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function we(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Te(n.key),n)}}function Se(e,t,r){return t&&we(e.prototype,t),r&&we(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ee(e,t,r){return(t=Te(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Te(e){var t=function(e,t){if("object"!=ae(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ae(t)?t:t+""}var ke=function(){function e(t){var r,s,u=this;be(this,e),Ee(this,"simulate",ve(pe().m(function t(){var r,o,s,c,l,f,p,d=arguments;return pe().w(function(t){for(;;)switch(t.n){case 0:if(r=(d.length>0&&void 0!==d[0]?d[0]:{}).restore,u.built){t.n=2;break}if(u.raw){t.n=1;break}throw new Error("Transaction has not yet been assembled; call `AssembledTransaction.build` first.");case 1:u.built=u.raw.build();case 2:return r=null!=r?r:u.options.restore,delete u.simulationResult,delete u.simulationTransactionData,t.n=3,u.server.simulateTransaction(u.built);case 3:if(u.simulation=t.v,!r||!i.j.isSimulationRestore(u.simulation)){t.n=8;break}return t.n=4,B(u.options,u.server);case 4:return o=t.v,t.n=5,u.restoreFootprint(u.simulation.restorePreamble,o);case 5:if((s=t.v).status!==i.j.GetTransactionStatus.SUCCESS){t.n=7;break}return p=new n.Contract(u.options.contractId),u.raw=new n.TransactionBuilder(o,{fee:null!==(c=u.options.fee)&&void 0!==c?c:n.BASE_FEE,networkPassphrase:u.options.networkPassphrase}).addOperation(p.call.apply(p,[u.options.method].concat(he(null!==(l=u.options.args)&&void 0!==l?l:[])))).setTimeout(null!==(f=u.options.timeoutInSeconds)&&void 0!==f?f:h),t.n=6,u.simulate();case 6:return t.a(2,u);case 7:throw new e.Errors.RestorationFailure("Automatic restore failed! You set 'restore: true' but the attempted restore did not work. Result:\n".concat(JSON.stringify(s)));case 8:return i.j.isSimulationSuccess(u.simulation)&&(u.built=(0,a.X)(u.built,u.simulation).build()),t.a(2,u)}},t)}))),Ee(this,"sign",ve(pe().m(function t(){var r,o,i,a,s,c,l,f,p,d,y,m,g=arguments;return pe().w(function(t){for(;;)switch(t.n){case 0:if(i=(o=g.length>0&&void 0!==g[0]?g[0]:{}).force,a=void 0!==i&&i,s=o.signTransaction,c=void 0===s?u.options.signTransaction:s,u.built){t.n=1;break}throw new Error("Transaction has not yet been simulated");case 1:if(a||!u.isReadCall){t.n=2;break}throw new e.Errors.NoSignatureNeeded("This is a read call. It requires no signature or sending. Use `force: true` to sign and send anyway.");case 2:if(c){t.n=3;break}throw new e.Errors.NoSigner("You must provide a signTransaction function, either when calling `signAndSend` or when initializing your Client");case 3:if(!(l=u.needsNonInvokerSigningBy().filter(function(e){return!e.startsWith("C")})).length){t.n=4;break}throw new e.Errors.NeedsMoreSignatures("Transaction requires signatures from ".concat(l,". ")+"See `needsNonInvokerSigningBy` for details.");case 4:return f=null!==(r=u.options.timeoutInSeconds)&&void 0!==r?r:h,u.built=n.TransactionBuilder.cloneFrom(u.built,{fee:u.built.fee,timebounds:void 0,sorobanData:u.simulationData.transactionData}).setTimeout(f).build(),p={networkPassphrase:u.options.networkPassphrase},u.options.address&&(p.address=u.options.address),void 0!==u.options.submit&&(p.submit=u.options.submit),u.options.submitUrl&&(p.submitUrl=u.options.submitUrl),t.n=5,c(u.built.toXDR(),p);case 5:d=t.v,y=d.signedTxXdr,m=d.error,u.handleWalletError(m),u.signed=n.TransactionBuilder.fromXDR(y,u.options.networkPassphrase);case 6:return t.a(2)}},t)}))),Ee(this,"signAndSend",ve(pe().m(function e(){var t,r,n,o,i,a,s,c=arguments;return pe().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=(t=c.length>0&&void 0!==c[0]?c[0]:{}).force,n=void 0!==r&&r,o=t.signTransaction,i=void 0===o?u.options.signTransaction:o,a=t.watcher,u.signed){e.n=3;break}return s=u.options.submit,u.options.submit&&(u.options.submit=!1),e.p=1,e.n=2,u.sign({force:n,signTransaction:i});case 2:return e.p=2,u.options.submit=s,e.f(2);case 3:return e.a(2,u.send(a))}},e,null,[[1,,2,3]])}))),Ee(this,"needsNonInvokerSigningBy",function(){var e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeAlreadySigned,r=void 0!==t&&t;if(!u.built)throw new Error("Transaction has not yet been simulated");if(!("operations"in u.built))throw new Error("Unexpected Transaction type; no operations: ".concat(JSON.stringify(u.built)));var o=u.built.operations[0];return he(new Set((null!==(e=o.auth)&&void 0!==e?e:[]).filter(function(e){return e.credentials().switch()===n.xdr.SorobanCredentialsType.sorobanCredentialsAddress()&&(r||"scvVoid"===e.credentials().address().signature().switch().name)}).map(function(e){return n.Address.fromScAddress(e.credentials().address().address()).toString()})))}),Ee(this,"signAuthEntries",ve(pe().m(function t(){var r,o,i,a,s,c,l,f,p,d,h,y,m,g,v,b,w,S=arguments;return pe().w(function(t){for(;;)switch(t.p=t.n){case 0:if(i=(o=S.length>0&&void 0!==S[0]?S[0]:{}).expiration,a=void 0===i?ve(pe().m(function e(){var t;return pe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.server.getLatestLedger();case 1:return t=e.v.sequence,e.a(2,t+100)}},e)}))():i,s=o.signAuthEntry,c=void 0===s?u.options.signAuthEntry:s,l=o.address,f=void 0===l?u.options.publicKey:l,p=o.authorizeEntry,d=void 0===p?n.authorizeEntry:p,u.built){t.n=1;break}throw new Error("Transaction has not yet been assembled or simulated");case 1:if(d!==n.authorizeEntry){t.n=4;break}if(0!==(h=u.needsNonInvokerSigningBy()).length){t.n=2;break}throw new e.Errors.NoUnsignedNonInvokerAuthEntries("No unsigned non-invoker auth entries; maybe you already signed?");case 2:if(-1!==h.indexOf(null!=f?f:"")){t.n=3;break}throw new e.Errors.NoSignatureNeeded('No auth entries for public key "'.concat(f,'"'));case 3:if(c){t.n=4;break}throw new e.Errors.NoSigner("You must provide `signAuthEntry` or a custom `authorizeEntry`");case 4:y=u.built.operations[0],m=null!==(r=y.auth)&&void 0!==r?r:[],g=fe(m.entries()),t.p=5,b=pe().m(function e(){var t,r,o,i,s,l,p,h;return pe().w(function(e){for(;;)switch(e.n){case 0:if(t=le(v.value,2),r=t[0],o=t[1],(i=n.xdr.SorobanCredentials.fromXDR(o.credentials().toXDR())).switch()===n.xdr.SorobanCredentialsType.sorobanCredentialsAddress()){e.n=1;break}return e.a(2,0);case 1:if(n.Address.fromScAddress(i.address().address()).toString()===f){e.n=2;break}return e.a(2,0);case 2:return s=null!=c?c:Promise.resolve,l=d,p=o,h=function(){var e=ve(pe().m(function e(t){var r,n,o;return pe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,s(t.toXDR("base64"),{address:f});case 1:return r=e.v,n=r.signedAuthEntry,o=r.error,u.handleWalletError(o),e.a(2,J.from(n,"base64"))}},e)}));return function(t){return e.apply(this,arguments)}}(),e.n=3,a;case 3:return e.n=4,l(p,h,e.v,u.options.networkPassphrase);case 4:m[r]=e.v;case 5:return e.a(2)}},e)}),g.s();case 6:if((v=g.n()).done){t.n=9;break}return t.d(ce(b()),7);case 7:if(0!==t.v){t.n=8;break}return t.a(3,8);case 8:t.n=6;break;case 9:t.n=11;break;case 10:t.p=10,w=t.v,g.e(w);case 11:return t.p=11,g.f(),t.f(11);case 12:return t.a(2)}},t,null,[[5,10,11,12]])}))),this.options=t,this.options.simulate=null===(r=this.options.simulate)||void 0===r||r,this.server=new o.Server(this.options.rpcUrl,{allowHttp:null!==(s=this.options.allowHttp)&&void 0!==s&&s})}return Se(e,[{key:"toJSON",value:function(){var e;return JSON.stringify({method:this.options.method,tx:null===(e=this.built)||void 0===e?void 0:e.toXDR(),simulationResult:{auth:this.simulationData.result.auth.map(function(e){return e.toXDR("base64")}),retval:this.simulationData.result.retval.toXDR("base64")},simulationTransactionData:this.simulationData.transactionData.toXDR("base64")})}},{key:"toXDR",value:function(){var e;if(!this.built)throw new Error("Transaction has not yet been simulated; call `AssembledTransaction.simulate` first.");return null===(e=this.built)||void 0===e?void 0:e.toEnvelope().toXDR("base64")}},{key:"handleWalletError",value:function(t){if(t){var r=t.message,n=t.code,o="".concat(r).concat(t.ext?" (".concat(t.ext.join(", "),")"):"");switch(n){case-1:throw new e.Errors.InternalWalletError(o);case-2:throw new e.Errors.ExternalServiceError(o);case-3:throw new e.Errors.InvalidClientRequest(o);case-4:throw new e.Errors.UserRejected(o);default:throw new Error("Unhandled error: ".concat(o))}}}},{key:"simulationData",get:function(){var t;if(this.simulationResult&&this.simulationTransactionData)return{result:this.simulationResult,transactionData:this.simulationTransactionData};var r=this.simulation;if(!r)throw new e.Errors.NotYetSimulated("Transaction has not yet been simulated");if(i.j.isSimulationError(r))throw new e.Errors.SimulationFailed('Transaction simulation failed: "'.concat(r.error,'"'));if(i.j.isSimulationRestore(r))throw new e.Errors.ExpiredState("You need to restore some contract state before you can invoke this method.\nYou can set `restore` to true in the method options in order to automatically restore the contract state when needed.");return this.simulationResult=null!==(t=r.result)&&void 0!==t?t:{auth:[],retval:n.xdr.ScVal.scvVoid()},this.simulationTransactionData=r.transactionData.build(),{result:this.simulationResult,transactionData:this.simulationTransactionData}}},{key:"result",get:function(){try{if(!this.simulationData.result)throw new Error("No simulation result!");return this.options.parseResultXdr(this.simulationData.result.retval)}catch(r){if("object"!==S(t=r)||null===t||!("toString"in t))throw r;var e=this.parseError(r.toString());if(e)return e;throw r}var t}},{key:"parseError",value:function(e){if(this.options.errorTypes){var t=e.match(_);if(t){var r=parseInt(t[1],10),n=this.options.errorTypes[r];if(n)return new d(n)}}}},{key:"send",value:(u=ve(pe().m(function e(t){var r;return pe().w(function(e){for(;;)switch(e.n){case 0:if(this.signed){e.n=1;break}throw new Error("The transaction has not yet been signed. Run `sign` first, or use `signAndSend` instead.");case 1:return e.n=2,Z.init(this,t);case 2:return r=e.v,e.a(2,r)}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"isReadCall",get:function(){var e=this.simulationData.result.auth.length,t=this.simulationData.transactionData.resources().footprint().readWrite().length;return 0===e&&0===t}},{key:"restoreFootprint",value:(s=ve(pe().m(function t(r,n){var o,i,a;return pe().w(function(t){for(;;)switch(t.n){case 0:if(this.options.signTransaction){t.n=1;break}throw new Error("For automatic restore to work you must provide a signTransaction function when initializing your Client");case 1:if(null==n){t.n=2;break}a=n,t.n=4;break;case 2:return t.n=3,B(this.options,this.server);case 3:a=t.v;case 4:return n=a,t.n=5,e.buildFootprintRestoreTransaction(ue({},this.options),r.transactionData,n,r.minResourceFee);case 5:return o=t.v,t.n=6,o.signAndSend();case 6:if((i=t.v).getTransactionResponse){t.n=7;break}throw new e.Errors.RestorationFailure("The attempt at automatic restore failed. \n".concat(JSON.stringify(i)));case 7:return t.a(2,i.getTransactionResponse)}},t,this)})),function(e,t){return s.apply(this,arguments)})}],[{key:"fromJSON",value:function(t,r){var o=r.tx,i=r.simulationResult,a=r.simulationTransactionData,s=new e(t);return s.built=n.TransactionBuilder.fromXDR(o,t.networkPassphrase),s.simulationResult={auth:i.auth.map(function(e){return n.xdr.SorobanAuthorizationEntry.fromXDR(e,"base64")}),retval:n.xdr.ScVal.fromXDR(i.retval,"base64")},s.simulationTransactionData=n.xdr.SorobanTransactionData.fromXDR(a,"base64"),s}},{key:"fromXDR",value:function(t,r,o){var i,a=n.xdr.TransactionEnvelope.fromXDR(r,"base64"),s=n.TransactionBuilder.fromXDR(a,t.networkPassphrase),u=s.operations[0];if(null==u||null===(i=u.func)||void 0===i||!i.value||"function"!=typeof u.func.value)throw new Error("Could not extract the method from the transaction envelope.");var c=u.func.value();if(null==c||!c.functionName)throw new Error("Could not extract the method name from the transaction envelope.");var l=c.functionName().toString("utf-8"),f=new e(ue(ue({},t),{},{method:l,parseResultXdr:function(e){return o.funcResToNative(l,e)}}));return f.built=s,f}},{key:"build",value:function(t){var r,o=new n.Contract(t.contractId);return e.buildWithOp(o.call.apply(o,[t.method].concat(he(null!==(r=t.args)&&void 0!==r?r:[]))),t)}},{key:"buildWithOp",value:(r=ve(pe().m(function t(r,o){var i,a,s,u;return pe().w(function(t){for(;;)switch(t.n){case 0:return s=new e(o),t.n=1,B(o,s.server);case 1:if(u=t.v,s.raw=new n.TransactionBuilder(u,{fee:null!==(i=o.fee)&&void 0!==i?i:n.BASE_FEE,networkPassphrase:o.networkPassphrase}).setTimeout(null!==(a=o.timeoutInSeconds)&&void 0!==a?a:h).addOperation(r),!o.simulate){t.n=2;break}return t.n=2,s.simulate();case 2:return t.a(2,s)}},t)})),function(e,t){return r.apply(this,arguments)})},{key:"buildFootprintRestoreTransaction",value:(t=ve(pe().m(function t(r,o,i,a){var s,u;return pe().w(function(t){for(;;)switch(t.n){case 0:return(u=new e(r)).raw=new n.TransactionBuilder(i,{fee:a,networkPassphrase:r.networkPassphrase}).setSorobanData(o instanceof n.SorobanDataBuilder?o.build():o).addOperation(n.Operation.restoreFootprint({})).setTimeout(null!==(s=r.timeoutInSeconds)&&void 0!==s?s:h),t.n=1,u.simulate({restore:!1});case 1:return t.a(2,u)}},t)})),function(e,r,n,o){return t.apply(this,arguments)})}]);var t,r,s,u}();Ee(ke,"Errors",{ExpiredState:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),RestorationFailure:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),NeedsMoreSignatures:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),NoSignatureNeeded:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),NoUnsignedNonInvokerAuthEntries:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),NoSigner:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),NotYetSimulated:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),FakeAccount:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),SimulationFailed:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),InternalWalletError:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),ExternalServiceError:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),InvalidClientRequest:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error)),UserRejected:function(e){function t(){return be(this,t),ee(this,t,arguments)}return te(t,e),Se(t)}(re(Error))});var Oe=r(287).Buffer;function Ae(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return _e(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(_e(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_e(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,_e(f,"constructor",c),_e(c,"constructor",u),u.displayName="GeneratorFunction",_e(c,o,"GeneratorFunction"),_e(f),_e(f,o,"Generator"),_e(f,n,function(){return this}),_e(f,"toString",function(){return"[object Generator]"}),(Ae=function(){return{w:i,m:p}})()}function _e(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}_e=function(e,t,r,n){function i(t,r){_e(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},_e(e,t,r,n)}function xe(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Pe(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){xe(i,n,o,a,s,"next",e)}function s(e){xe(i,n,o,a,s,"throw",e)}a(void 0)})}}var Ie=function(e,t){return{signTransaction:(o=Pe(Ae().m(function r(o,i){var a;return Ae().w(function(r){for(;;)if(0===r.n)return(a=n.TransactionBuilder.fromXDR(o,(null==i?void 0:i.networkPassphrase)||t)).sign(e),r.a(2,{signedTxXdr:a.toXDR(),signerAddress:e.publicKey()})},r)})),function(e,t){return o.apply(this,arguments)}),signAuthEntry:(r=Pe(Ae().m(function t(r){var o;return Ae().w(function(t){for(;;)if(0===t.n)return o=e.sign((0,n.hash)(Oe.from(r,"base64"))).toString("base64"),t.a(2,{signedAuthEntry:o,signerAddress:e.publicKey()})},t)})),function(e){return r.apply(this,arguments)})};var r,o},Re=r(287).Buffer;function Be(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return Ce(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ce(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ce(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Ce(f,"constructor",c),Ce(c,"constructor",u),u.displayName="GeneratorFunction",Ce(c,o,"GeneratorFunction"),Ce(f),Ce(f,o,"Generator"),Ce(f,n,function(){return this}),Ce(f,"toString",function(){return"[object Generator]"}),(Be=function(){return{w:i,m:p}})()}function Ce(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ce=function(e,t,r,n){function i(t,r){Ce(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Ce(e,t,r,n)}function je(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(r),!0).forEach(function(t){Fe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Le(e){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(e)}function De(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Me(n.key),n)}}function Fe(e,t,r){return(t=Me(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Me(e){var t=function(e,t){if("object"!=Le(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Le(t)?t:t+""}function Ve(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qe(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function He(e){return/^\d+$/.test(e.name().toString())}var ze={U32:{type:"integer",minimum:0,maximum:4294967295},I32:{type:"integer",minimum:-2147483648,maximum:2147483647},U64:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:20},I64:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:21},U128:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:39},I128:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:40},U256:{type:"string",pattern:"^([1-9][0-9]*|0)$",minLength:1,maxLength:78},I256:{type:"string",pattern:"^(-?[1-9][0-9]*|0)$",minLength:1,maxLength:79},Address:{type:"string",format:"address",description:"Address can be a public key or contract id"},ScString:{type:"string",description:"ScString is a string"},ScSymbol:{type:"string",description:"ScSymbol is a string"},DataUrl:{type:"string",pattern:"^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$"}};function Ke(e){var t;switch(e.switch().value){case n.xdr.ScSpecType.scSpecTypeVal().value:t="Val";break;case n.xdr.ScSpecType.scSpecTypeBool().value:return{type:"boolean"};case n.xdr.ScSpecType.scSpecTypeVoid().value:return{type:"null"};case n.xdr.ScSpecType.scSpecTypeError().value:t="Error";break;case n.xdr.ScSpecType.scSpecTypeU32().value:t="U32";break;case n.xdr.ScSpecType.scSpecTypeI32().value:t="I32";break;case n.xdr.ScSpecType.scSpecTypeU64().value:t="U64";break;case n.xdr.ScSpecType.scSpecTypeI64().value:t="I64";break;case n.xdr.ScSpecType.scSpecTypeTimepoint().value:throw new Error("Timepoint type not supported");case n.xdr.ScSpecType.scSpecTypeDuration().value:throw new Error("Duration not supported");case n.xdr.ScSpecType.scSpecTypeU128().value:t="U128";break;case n.xdr.ScSpecType.scSpecTypeI128().value:t="I128";break;case n.xdr.ScSpecType.scSpecTypeU256().value:t="U256";break;case n.xdr.ScSpecType.scSpecTypeI256().value:t="I256";break;case n.xdr.ScSpecType.scSpecTypeBytes().value:t="DataUrl";break;case n.xdr.ScSpecType.scSpecTypeString().value:t="ScString";break;case n.xdr.ScSpecType.scSpecTypeSymbol().value:t="ScSymbol";break;case n.xdr.ScSpecType.scSpecTypeAddress().value:t="Address";break;case n.xdr.ScSpecType.scSpecTypeOption().value:return Ke(e.option().valueType());case n.xdr.ScSpecType.scSpecTypeResult().value:break;case n.xdr.ScSpecType.scSpecTypeVec().value:return{type:"array",items:Ke(e.vec().elementType())};case n.xdr.ScSpecType.scSpecTypeMap().value:var r=e.map();return{type:"array",items:{type:"array",items:[Ke(r.keyType()),Ke(r.valueType())],minItems:2,maxItems:2}};case n.xdr.ScSpecType.scSpecTypeTuple().value:var o=e.tuple(),i=o.valueTypes().length,a=i;return{type:"array",items:o.valueTypes().map(Ke),minItems:i,maxItems:a};case n.xdr.ScSpecType.scSpecTypeBytesN().value:return{$ref:"#/definitions/DataUrl",maxLength:e.bytesN().n()};case n.xdr.ScSpecType.scSpecTypeUdt().value:t=e.udt().name().toString()}return{$ref:"#/definitions/".concat(t)}}function Xe(e){var t={},r=[];e.forEach(function(e){var o=e.type(),i=e.name().toString();t[i]=Ke(o),o.switch().value!==n.xdr.ScSpecType.scSpecTypeOption().value&&r.push(i)});var o={properties:t};return r.length>0&&(o.required=r),o}var $e=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Fe(this,"entries",[]),Re.isBuffer(t))this.entries=R(t);else if("string"==typeof t)this.entries=R(Re.from(t,"base64"));else{if(0===t.length)throw new Error("Contract spec must have at least one entry");var r=t[0];this.entries="string"==typeof r?t.map(function(e){return n.xdr.ScSpecEntry.fromXDR(e,"base64")}):t}}return t=e,r=[{key:"funcs",value:function(){return this.entries.filter(function(e){return e.switch().value===n.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value}).map(function(e){return e.functionV0()})}},{key:"getFunc",value:function(e){var t=this.findEntry(e);if(t.switch().value!==n.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value)throw new Error("".concat(e," is not a function"));return t.functionV0()}},{key:"funcArgsToScVals",value:function(e,t){var r=this;return this.getFunc(e).inputs().map(function(e){return r.nativeToScVal(function(e,t){var r=t.name().toString(),n=Object.entries(e).find(function(e){return Ve(e,1)[0]===r});if(!n)throw new Error("Missing field ".concat(r));return n[1]}(t,e),e.type())})}},{key:"funcResToNative",value:function(e,t){var r="string"==typeof t?n.xdr.ScVal.fromXDR(t,"base64"):t,o=this.getFunc(e).outputs();if(0===o.length){var i=r.switch();if(i.value!==n.xdr.ScValType.scvVoid().value)throw new Error("Expected void, got ".concat(i.name));return null}if(o.length>1)throw new Error("Multiple outputs not supported");var a=o[0];return a.switch().value===n.xdr.ScSpecType.scSpecTypeResult().value?new p(this.scValToNative(r,a.result().okType())):this.scValToNative(r,a)}},{key:"findEntry",value:function(e){var t=this.entries.find(function(t){return t.value().name().toString()===e});if(!t)throw new Error("no such entry: ".concat(e));return t}},{key:"nativeToScVal",value:function(e,t){var r=this,o=t.switch(),i=o.value;if(o.value===n.xdr.ScSpecType.scSpecTypeUdt().value){var a=t.udt();return this.nativeToUdt(e,a.name().toString())}if(i===n.xdr.ScSpecType.scSpecTypeOption().value){var s=t.option();return void 0===e?n.xdr.ScVal.scvVoid():this.nativeToScVal(e,s.valueType())}switch(Le(e)){case"object":var u,c,l;if(null===e){if(i===n.xdr.ScSpecType.scSpecTypeVoid().value)return n.xdr.ScVal.scvVoid();throw new TypeError("Type ".concat(t," was not void, but value was null"))}if(e instanceof n.xdr.ScVal)return e;if(e instanceof n.Address){if(t.switch().value!==n.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError("Type ".concat(t," was not address, but value was Address"));return e.toScVal()}if(e instanceof n.Contract){if(t.switch().value!==n.xdr.ScSpecType.scSpecTypeAddress().value)throw new TypeError("Type ".concat(t," was not address, but value was Address"));return e.address().toScVal()}if(e instanceof Uint8Array||Re.isBuffer(e)){var f=Uint8Array.from(e);switch(i){case n.xdr.ScSpecType.scSpecTypeBytesN().value:var p=t.bytesN();if(f.length!==p.n())throw new TypeError("expected ".concat(p.n()," bytes, but got ").concat(f.length));return n.xdr.ScVal.scvBytes(f);case n.xdr.ScSpecType.scSpecTypeBytes().value:return n.xdr.ScVal.scvBytes(f);default:throw new TypeError("invalid type (".concat(t,") specified for Bytes and BytesN"))}}if(Array.isArray(e))switch(i){case n.xdr.ScSpecType.scSpecTypeVec().value:var d=t.vec().elementType();return n.xdr.ScVal.scvVec(e.map(function(e){return r.nativeToScVal(e,d)}));case n.xdr.ScSpecType.scSpecTypeTuple().value:var h=t.tuple().valueTypes();if(e.length!==h.length)throw new TypeError("Tuple expects ".concat(h.length," values, but ").concat(e.length," were provided"));return n.xdr.ScVal.scvVec(e.map(function(e,t){return r.nativeToScVal(e,h[t])}));case n.xdr.ScSpecType.scSpecTypeMap().value:var y=t.map(),m=y.keyType(),g=y.valueType();return n.xdr.ScVal.scvMap(e.map(function(e){var t=r.nativeToScVal(e[0],m),o=r.nativeToScVal(e[1],g);return new n.xdr.ScMapEntry({key:t,val:o})}));default:throw new TypeError("Type ".concat(t," was not vec, but value was Array"))}if(e.constructor===Map){if(i!==n.xdr.ScSpecType.scSpecTypeMap().value)throw new TypeError("Type ".concat(t," was not map, but value was Map"));for(var v=t.map(),b=[],w=e.entries(),S=w.next();!S.done;){var E=Ve(S.value,2),T=E[0],k=E[1],O=this.nativeToScVal(T,v.keyType()),A=this.nativeToScVal(k,v.valueType());b.push(new n.xdr.ScMapEntry({key:O,val:A})),S=w.next()}return n.xdr.ScVal.scvMap(b)}if("Object"!==(null!==(u=null===(c=e.constructor)||void 0===c?void 0:c.name)&&void 0!==u?u:""))throw new TypeError("cannot interpret ".concat(null===(l=e.constructor)||void 0===l?void 0:l.name," value as ScVal (").concat(JSON.stringify(e),")"));throw new TypeError("Received object ".concat(e," did not match the provided type ").concat(t));case"number":case"bigint":switch(i){case n.xdr.ScSpecType.scSpecTypeU32().value:return n.xdr.ScVal.scvU32(e);case n.xdr.ScSpecType.scSpecTypeI32().value:return n.xdr.ScVal.scvI32(e);case n.xdr.ScSpecType.scSpecTypeU64().value:case n.xdr.ScSpecType.scSpecTypeI64().value:case n.xdr.ScSpecType.scSpecTypeU128().value:case n.xdr.ScSpecType.scSpecTypeI128().value:case n.xdr.ScSpecType.scSpecTypeU256().value:case n.xdr.ScSpecType.scSpecTypeI256().value:var _=o.name.substring(10).toLowerCase();return new n.XdrLargeInt(_,e).toScVal();default:throw new TypeError("invalid type (".concat(t,") specified for integer"))}case"string":return function(e,t){switch(t.value){case n.xdr.ScSpecType.scSpecTypeString().value:return n.xdr.ScVal.scvString(e);case n.xdr.ScSpecType.scSpecTypeSymbol().value:return n.xdr.ScVal.scvSymbol(e);case n.xdr.ScSpecType.scSpecTypeAddress().value:return n.Address.fromString(e).toScVal();case n.xdr.ScSpecType.scSpecTypeU64().value:return new n.XdrLargeInt("u64",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI64().value:return new n.XdrLargeInt("i64",e).toScVal();case n.xdr.ScSpecType.scSpecTypeU128().value:return new n.XdrLargeInt("u128",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI128().value:return new n.XdrLargeInt("i128",e).toScVal();case n.xdr.ScSpecType.scSpecTypeU256().value:return new n.XdrLargeInt("u256",e).toScVal();case n.xdr.ScSpecType.scSpecTypeI256().value:return new n.XdrLargeInt("i256",e).toScVal();case n.xdr.ScSpecType.scSpecTypeBytes().value:case n.xdr.ScSpecType.scSpecTypeBytesN().value:return n.xdr.ScVal.scvBytes(Re.from(e,"base64"));default:throw new TypeError("invalid type ".concat(t.name," specified for string value"))}}(e,o);case"boolean":if(i!==n.xdr.ScSpecType.scSpecTypeBool().value)throw TypeError("Type ".concat(t," was not bool, but value was bool"));return n.xdr.ScVal.scvBool(e);case"undefined":if(!t)return n.xdr.ScVal.scvVoid();switch(i){case n.xdr.ScSpecType.scSpecTypeVoid().value:case n.xdr.ScSpecType.scSpecTypeOption().value:return n.xdr.ScVal.scvVoid();default:throw new TypeError("Type ".concat(t," was not void, but value was undefined"))}case"function":return this.nativeToScVal(e(),t);default:throw new TypeError("failed to convert typeof ".concat(Le(e)," (").concat(e,")"))}}},{key:"nativeToUdt",value:function(e,t){var r=this.findEntry(t);switch(r.switch()){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():if("number"!=typeof e)throw new TypeError("expected number for enum ".concat(t,", but got ").concat(Le(e)));return this.nativeToEnum(e,r.udtEnumV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.nativeToStruct(e,r.udtStructV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.nativeToUnion(e,r.udtUnionV0());default:throw new Error("failed to parse udt ".concat(t))}}},{key:"nativeToUnion",value:function(e,t){var r=this,o=e.tag,i=t.cases().find(function(e){return e.value().name().toString()===o});if(!i)throw new TypeError("no such enum entry: ".concat(o," in ").concat(t));var a=n.xdr.ScVal.scvSymbol(o);switch(i.switch()){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0():return n.xdr.ScVal.scvVec([a]);case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0():var s=i.tupleCase().type();if(Array.isArray(e.values)){if(e.values.length!==s.length)throw new TypeError("union ".concat(t," expects ").concat(s.length," values, but got ").concat(e.values.length));var u=e.values.map(function(e,t){return r.nativeToScVal(e,s[t])});return u.unshift(a),n.xdr.ScVal.scvVec(u)}throw new Error("failed to parse union case ".concat(i," with ").concat(e));default:throw new Error("failed to parse union ".concat(t," with ").concat(e))}}},{key:"nativeToStruct",value:function(e,t){var r=this,o=t.fields();if(o.some(He)){if(!o.every(He))throw new Error("mixed numeric and non-numeric field names are not allowed");return n.xdr.ScVal.scvVec(o.map(function(t,n){return r.nativeToScVal(e[n],o[n].type())}))}return n.xdr.ScVal.scvMap(o.map(function(t){var o=t.name().toString();return new n.xdr.ScMapEntry({key:r.nativeToScVal(o,n.xdr.ScSpecTypeDef.scSpecTypeSymbol()),val:r.nativeToScVal(e[o],t.type())})}))}},{key:"nativeToEnum",value:function(e,t){if(t.cases().some(function(t){return t.value()===e}))return n.xdr.ScVal.scvU32(e);throw new TypeError("no such enum entry: ".concat(e," in ").concat(t))}},{key:"scValStrToNative",value:function(e,t){return this.scValToNative(n.xdr.ScVal.fromXDR(e,"base64"),t)}},{key:"scValToNative",value:function(e,t){var r=this,o=t.switch(),i=o.value;if(i===n.xdr.ScSpecType.scSpecTypeUdt().value)return this.scValUdtToNative(e,t.udt());switch(e.switch().value){case n.xdr.ScValType.scvVoid().value:return;case n.xdr.ScValType.scvU64().value:case n.xdr.ScValType.scvI64().value:case n.xdr.ScValType.scvU128().value:case n.xdr.ScValType.scvI128().value:case n.xdr.ScValType.scvU256().value:case n.xdr.ScValType.scvI256().value:return(0,n.scValToBigInt)(e);case n.xdr.ScValType.scvVec().value:if(i===n.xdr.ScSpecType.scSpecTypeVec().value){var a,s=t.vec();return(null!==(a=e.vec())&&void 0!==a?a:[]).map(function(e){return r.scValToNative(e,s.elementType())})}if(i===n.xdr.ScSpecType.scSpecTypeTuple().value){var u,c=t.tuple().valueTypes();return(null!==(u=e.vec())&&void 0!==u?u:[]).map(function(e,t){return r.scValToNative(e,c[t])})}throw new TypeError("Type ".concat(t," was not vec, but ").concat(e," is"));case n.xdr.ScValType.scvAddress().value:return n.Address.fromScVal(e).toString();case n.xdr.ScValType.scvMap().value:var l,f=null!==(l=e.map())&&void 0!==l?l:[];if(i===n.xdr.ScSpecType.scSpecTypeMap().value){var p=t.map(),d=p.keyType(),h=p.valueType();return f.map(function(e){return[r.scValToNative(e.key(),d),r.scValToNative(e.val(),h)]})}throw new TypeError("ScSpecType ".concat(o.name," was not map, but ").concat(JSON.stringify(e,null,2)," is"));case n.xdr.ScValType.scvBool().value:case n.xdr.ScValType.scvU32().value:case n.xdr.ScValType.scvI32().value:case n.xdr.ScValType.scvBytes().value:return e.value();case n.xdr.ScValType.scvString().value:case n.xdr.ScValType.scvSymbol().value:var y;if(i!==n.xdr.ScSpecType.scSpecTypeString().value&&i!==n.xdr.ScSpecType.scSpecTypeSymbol().value)throw new Error("ScSpecType ".concat(o.name," was not string or symbol, but ").concat(JSON.stringify(e,null,2)," is"));return null===(y=e.value())||void 0===y?void 0:y.toString();case n.xdr.ScValType.scvTimepoint().value:case n.xdr.ScValType.scvDuration().value:return(0,n.scValToBigInt)(n.xdr.ScVal.scvU64(e.u64()));default:throw new TypeError("failed to convert ".concat(JSON.stringify(e,null,2)," to native type from type ").concat(o.name))}}},{key:"scValUdtToNative",value:function(e,t){var r=this.findEntry(t.name().toString());switch(r.switch()){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0():return this.enumToNative(e);case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0():return this.structToNative(e,r.udtStructV0());case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0():return this.unionToNative(e,r.udtUnionV0());default:throw new Error("failed to parse udt ".concat(t.name().toString(),": ").concat(r))}}},{key:"unionToNative",value:function(e,t){var r=this,o=e.vec();if(!o)throw new Error("".concat(JSON.stringify(e,null,2)," is not a vec"));if(0===o.length&&0!==t.cases.length)throw new Error("".concat(e," has length 0, but the there are at least one case in the union"));var i=o[0].sym().toString();if(o[0].switch().value!==n.xdr.ScValType.scvSymbol().value)throw new Error("{vec[0]} is not a symbol");var a=t.cases().find(function(e){return function(t){switch(t.switch().value){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:return t.tupleCase().name().toString()===e;case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:return t.voidCase().name().toString()===e;default:return!1}}}(i));if(!a)throw new Error("failed to find entry ".concat(i," in union {udt.name().toString()}"));var s={tag:i};if(a.switch().value===n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value){var u=a.tupleCase().type().map(function(e,t){return r.scValToNative(o[t+1],e)});s.values=u}return s}},{key:"structToNative",value:function(e,t){var r,n,o=this,i={},a=t.fields();return a.some(He)?null===(n=e.vec())||void 0===n?void 0:n.map(function(e,t){return o.scValToNative(e,a[t].type())}):(null===(r=e.map())||void 0===r||r.forEach(function(e,t){var r=a[t];i[r.name().toString()]=o.scValToNative(e.val(),r.type())}),i)}},{key:"enumToNative",value:function(e){if(e.switch().value!==n.xdr.ScValType.scvU32().value)throw new Error("Enum must have a u32 value");return e.u32()}},{key:"errorCases",value:function(){return this.entries.filter(function(e){return e.switch().value===n.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value}).flatMap(function(e){return e.value().cases()})}},{key:"jsonSchema",value:function(e){var t={};this.entries.forEach(function(e){switch(e.switch().value){case n.xdr.ScSpecEntryKind.scSpecEntryUdtEnumV0().value:var r=e.udtEnumV0();t[r.name().toString()]=function(e){var t=e.doc().toString(),r=e.cases(),n=[];r.forEach(function(e){var t=e.name().toString(),r=e.doc().toString();n.push({description:r,title:t,enum:[e.value()],type:"number"})});var o={oneOf:n};return t.length>0&&(o.description=t),o}(r);break;case n.xdr.ScSpecEntryKind.scSpecEntryUdtStructV0().value:var o=e.udtStructV0();t[o.name().toString()]=function(e){var t=e.fields();if(t.some(He)){if(!t.every(He))throw new Error("mixed numeric and non-numeric field names are not allowed");return{type:"array",items:t.map(function(e,r){return Ke(t[r].type())}),minItems:t.length,maxItems:t.length}}var r=e.doc().toString(),n=Xe(t),o=n.properties,i=n.required;return o.additionalProperties=!1,{description:r,properties:o,required:i,type:"object"}}(o);break;case n.xdr.ScSpecEntryKind.scSpecEntryUdtUnionV0().value:var i=e.udtUnionV0();t[i.name().toString()]=function(e){var t=e.doc().toString(),r=e.cases(),o=[];r.forEach(function(e){switch(e.switch().value){case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseVoidV0().value:var t=e.voidCase().name().toString();o.push({type:"object",title:t,properties:{tag:t},additionalProperties:!1,required:["tag"]});break;case n.xdr.ScSpecUdtUnionCaseV0Kind.scSpecUdtUnionCaseTupleV0().value:var r=e.tupleCase(),i=r.name().toString();o.push({type:"object",title:i,properties:{tag:i,values:{type:"array",items:r.type().map(Ke)}},required:["tag","values"],additionalProperties:!1})}});var i={oneOf:o};return t.length>0&&(i.description=t),i}(i);break;case n.xdr.ScSpecEntryKind.scSpecEntryFunctionV0().value:var a=e.functionV0(),s=a.name().toString(),u=function(e){var t=Xe(e.inputs()),r=t.properties,o=t.required,i={additionalProperties:!1,properties:r,type:"object"};(null==o?void 0:o.length)>0&&(i.required=o);var a={properties:{args:i}},s=e.outputs(),u=s.length>0?Ke(s[0]):Ke(n.xdr.ScSpecTypeDef.scSpecTypeVoid()),c=e.doc().toString();return c.length>0&&(a.description=c),a.additionalProperties=!1,u.additionalProperties=!1,{input:a,output:u}}(a),c=u.input;t[s]=c;case n.xdr.ScSpecEntryKind.scSpecEntryUdtErrorEnumV0().value:}});var r={$schema:"http://json-schema.org/draft-07/schema#",definitions:Ne(Ne({},ze),t)};return e&&(r.$ref="#/definitions/".concat(e)),r}}],o=[{key:"fromWasm",value:(i=Be().m(function t(r){var n;return Be().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,x(r);case 1:return n=t.v,t.a(2,new e(n))}},t)}),a=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=i.apply(e,t);function a(e){je(o,r,n,a,s,"next",e)}function s(e){je(o,r,n,a,s,"throw",e)}a(void 0)})},function(e){return a.apply(this,arguments)})}],r&&De(t.prototype,r),o&&De(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,o,i,a}(),Ge=r(287).Buffer;function We(e){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},We(e)}var Qe=["method"],Ze=["wasmHash","salt","format","fee","timeoutInSeconds","simulate"];function Ye(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return Je(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Je(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Je(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Je(f,"constructor",c),Je(c,"constructor",u),u.displayName="GeneratorFunction",Je(c,o,"GeneratorFunction"),Je(f),Je(f,o,"Generator"),Je(f,n,function(){return this}),Je(f,"toString",function(){return"[object Generator]"}),(Ye=function(){return{w:i,m:p}})()}function Je(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Je=function(e,t,r,n){function i(t,r){Je(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Je(e,t,r,n)}function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach(function(t){ot(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function rt(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function nt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,it(n.key),n)}}function ot(e,t,r){return(t=it(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function it(e){var t=function(e,t){if("object"!=We(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=We(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==We(t)?t:t+""}function at(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function st(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){at(i,n,o,a,s,"next",e)}function s(e){at(i,n,o,a,s,"throw",e)}a(void 0)})}}var ut="__constructor";function ct(e,t){return lt.apply(this,arguments)}function lt(){return lt=st(Ye().m(function e(t,r){var n,i,a,s,u,c,l=arguments;return Ye().w(function(e){for(;;)switch(e.n){case 0:if(n=l.length>2&&void 0!==l[2]?l[2]:"hex",r&&r.rpcUrl){e.n=1;break}throw new TypeError("options must contain rpcUrl");case 1:return i=r.rpcUrl,a=r.allowHttp,s={allowHttp:a},u=new o.Server(i,s),e.n=2,u.getContractWasmByHash(t,n);case 2:return c=e.v,e.a(2,$e.fromWasm(c))}},e)})),lt.apply(this,arguments)}var ft=function(){function e(t,r){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ot(this,"txFromJSON",function(e){var t=JSON.parse(e),r=t.method,o=rt(t,Qe);return ke.fromJSON(tt(tt({},n.options),{},{method:r,parseResultXdr:function(e){return n.spec.funcResToNative(r,e)}}),o)}),ot(this,"txFromXDR",function(e){return ke.fromXDR(n.options,e,n.spec)}),this.spec=t,this.options=r,this.spec.funcs().forEach(function(e){var o=e.name().toString();if(o!==ut){var i=function(e,n){return ke.build(tt(tt(tt({method:o,args:e&&t.funcArgsToScVals(o,e)},r),n),{},{errorTypes:t.errorCases().reduce(function(e,t){return tt(tt({},e),{},ot({},t.value(),{message:t.doc().toString()}))},{}),parseResultXdr:function(e){return t.funcResToNative(o,e)}}))};n[o]=0===t.getFunc(o).inputs().length?function(e){return i(void 0,e)}:i}})}return t=e,r=null,i=[{key:"deploy",value:(c=st(Ye().m(function t(r,o){var i,a,s,u,c,l,f,p,d;return Ye().w(function(t){for(;;)switch(t.n){case 0:return i=o.wasmHash,a=o.salt,s=o.format,u=o.fee,c=o.timeoutInSeconds,l=o.simulate,f=rt(o,Ze),t.n=1,ct(i,f,s);case 1:return p=t.v,d=n.Operation.createCustomContract({address:new n.Address(o.address||o.publicKey),wasmHash:"string"==typeof i?Ge.from(i,null!=s?s:"hex"):i,salt:a,constructorArgs:r?p.funcArgsToScVals(ut,r):[]}),t.a(2,ke.buildWithOp(d,tt(tt({fee:u,timeoutInSeconds:c,simulate:l},f),{},{contractId:"ignored",method:ut,parseResultXdr:function(t){return new e(p,tt(tt({},f),{},{contractId:n.Address.fromScVal(t).toString()}))}})))}},t)})),function(e,t){return c.apply(this,arguments)})},{key:"fromWasmHash",value:(u=st(Ye().m(function t(r,n){var i,a,s,u,c,l,f=arguments;return Ye().w(function(t){for(;;)switch(t.n){case 0:if(i=f.length>2&&void 0!==f[2]?f[2]:"hex",n&&n.rpcUrl){t.n=1;break}throw new TypeError("options must contain rpcUrl");case 1:return a=n.rpcUrl,s=n.allowHttp,u={allowHttp:s},c=new o.Server(a,u),t.n=2,c.getContractWasmByHash(r,i);case 2:return l=t.v,t.a(2,e.fromWasm(l,n))}},t)})),function(e,t){return u.apply(this,arguments)})},{key:"fromWasm",value:(s=st(Ye().m(function t(r,n){var o;return Ye().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,$e.fromWasm(r);case 1:return o=t.v,t.a(2,new e(o,n))}},t)})),function(e,t){return s.apply(this,arguments)})},{key:"from",value:(a=st(Ye().m(function t(r){var n,i,a,s,u,c;return Ye().w(function(t){for(;;)switch(t.n){case 0:if(r&&r.rpcUrl&&r.contractId){t.n=1;break}throw new TypeError("options must contain rpcUrl and contractId");case 1:return n=r.rpcUrl,i=r.contractId,a=r.allowHttp,s={allowHttp:a},u=new o.Server(n,s),t.n=2,u.getContractWasmByContractId(i);case 2:return c=t.v,t.a(2,e.fromWasm(c,r))}},t)})),function(e){return a.apply(this,arguments)})}],r&&nt(t.prototype,r),i&&nt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,i,a,s,u,c}()},340:function(e,t,r){var n;e=r.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var i,a=2147483647,s=36,u=/^xn--/,c=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function h(e){throw new RangeError(f[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function m(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(l,".")).split("."),t).join(".")}function g(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function v(e){return y(e,function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)}).join("")}function b(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:s}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,r){var n=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;n+=s)e=p(e/35);return p(n+36*e/(e+38))}function E(e){var t,r,n,o,i,u,c,l,f,d,y=[],m=e.length,g=0,w=128,E=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&h("not-basic"),y.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<m;){for(i=g,u=1,c=s;o>=m&&h("invalid-input"),((l=b(e.charCodeAt(o++)))>=s||l>p((a-g)/u))&&h("overflow"),g+=l*u,!(l<(f=c<=E?1:c>=E+26?26:c-E));c+=s)u>p(a/(d=s-f))&&h("overflow"),u*=d;E=S(g-i,t=y.length+1,0==i),p(g/t)>a-w&&h("overflow"),w+=p(g/t),g%=t,y.splice(g++,0,w)}return v(y)}function T(e){var t,r,n,o,i,u,c,l,f,y,m,v,b,E,T,k=[];for(v=(e=g(e)).length,t=128,r=0,i=72,u=0;u<v;++u)(m=e[u])<128&&k.push(d(m));for(n=o=k.length,o&&k.push("-");n<v;){for(c=a,u=0;u<v;++u)(m=e[u])>=t&&m<c&&(c=m);for(c-t>p((a-r)/(b=n+1))&&h("overflow"),r+=(c-t)*b,t=c,u=0;u<v;++u)if((m=e[u])<t&&++r>a&&h("overflow"),m==t){for(l=r,f=s;!(l<(y=f<=i?1:f>=i+26?26:f-i));f+=s)T=l-y,E=s-y,k.push(d(w(y+T%E,0))),l=p(T/E);k.push(d(w(l,0))),i=S(r,b,n==o),r=0,++n}++r,++t}return k.join("")}i={version:"1.3.2",ucs2:{decode:g,encode:v},decode:E,encode:T,toASCII:function(e){return m(e,function(e){return c.test(e)?"xn--"+T(e):e})},toUnicode:function(e){return m(e,function(e){return u.test(e)?E(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},356:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AccountRequiresMemoError:()=>n.Cu,BadRequestError:()=>n.v7,BadResponseError:()=>n.nS,Config:()=>o.T,Federation:()=>s,Friendbot:()=>c,Horizon:()=>l,NetworkError:()=>n.Dr,NotFoundError:()=>n.m_,StellarToml:()=>a,Utils:()=>i.A,WebAuth:()=>u,contract:()=>p,default:()=>y,rpc:()=>f});var n=r(976),o=r(732),i=r(121),a=r(898),s=r(600),u=r(479),c=r(242),l=r(733),f=r(496),p=r(299),d=r(950),h={};for(const e in d)["default","Config","Utils","StellarToml","Federation","WebAuth","Friendbot","Horizon","rpc","contract","AccountRequiresMemoError","BadRequestError","BadResponseError","NetworkError","NotFoundError"].indexOf(e)<0&&(h[e]=()=>d[e]);r.d(t,h);const y=(e=r.hmd(e)).exports;void 0===r.g.__USE_AXIOS__&&(r.g.__USE_AXIOS__=!0),void 0===r.g.__USE_EVENTSOURCE__&&(r.g.__USE_EVENTSOURCE__=!1)},371:(e,t,r)=>{"use strict";r.d(t,{ok:()=>n,vt:()=>o});r(798);var n,o,i=r(920);n=i.fetchClient,o=i.create},430:function(e,t,r){var n,o;!function(i,a){"use strict";e.exports?e.exports=a():void 0===(o="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=o)}(0,function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),o=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[o-1]&&""===n[o-2]&&n.pop(),-1!==n[(o=n.length)-1].indexOf(".")&&(i=7),t=0;t<o&&""!==n[t];t++);if(t<i)for(n.splice(t,1,"0000");n.length<i;)n.splice(t,0,"0000");for(var a=0;a<i;a++){r=n[a].split("");for(var s=0;s<3&&("0"===r[0]&&r.length>1);s++)r.splice(0,1);n[a]=r.join("")}var u=-1,c=0,l=0,f=-1,p=!1;for(a=0;a<i;a++)p?"0"===n[a]?l+=1:(p=!1,l>c&&(u=f,c=l)):"0"===n[a]&&(p=!0,f=a,l=1);l>c&&(u=f,c=l),c>1&&n.splice(u,c,""),o=n.length;var d="";for(""===n[0]&&(d=":"),a=0;a<o&&(d+=n[a],a!==o-1);a++)d+=":";return""===n[o-1]&&(d+=":"),d},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}})},479:(e,t,r)=>{"use strict";r.r(t),r.d(t,{InvalidChallengeError:()=>y,buildChallengeTx:()=>k,gatherTxSigners:()=>P,readChallengeTx:()=>O,verifyChallengeTxSigners:()=>_,verifyChallengeTxThreshold:()=>A,verifyTxSignedBy:()=>x});var n=r(209),o=r.n(n),i=r(950),a=r(121);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function c(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function l(e,t,r){return t=h(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(p())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&d(o,r.prototype),o}(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),d(r,e)},f(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}var y=function(e){function t(e){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=(this instanceof t?this.constructor:void 0).prototype;return(r=l(this,t,[e])).__proto__=n,r.constructor=t,r.name="InvalidChallengeError",r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(t,e),r=t,n&&u(r.prototype,n),o&&u(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(f(Error)),m=r(287).Buffer;function g(e){return function(e){if(Array.isArray(e))return E(e)}(e)||T(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=S(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function w(e){return function(e){if(Array.isArray(e))return e}(e)||T(e)||S(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return E(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function T(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:300,a=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;if(t.startsWith("M")&&u)throw Error("memo cannot be used if clientAccountID is a muxed account");var f=new i.Account(e.publicKey(),"-1"),p=Math.floor(Date.now()/1e3),d=o()(48).toString("base64"),h=new i.TransactionBuilder(f,{fee:i.BASE_FEE,networkPassphrase:a,timebounds:{minTime:p,maxTime:p+n}}).addOperation(i.Operation.manageData({name:"".concat(r," auth"),value:d,source:t})).addOperation(i.Operation.manageData({name:"web_auth_domain",value:s,source:f.accountId()}));if(c){if(!l)throw Error("clientSigningKey is required if clientDomain is provided");h.addOperation(i.Operation.manageData({name:"client_domain",value:c,source:l}))}u&&h.addMemo(i.Memo.id(u));var y=h.build();return y.sign(e),y.toEnvelope().toXDR("base64").toString()}function O(e,t,r,n,o){var s,u;if(t.startsWith("M"))throw Error("Invalid serverAccountID: multiplexed accounts are not supported.");try{u=new i.Transaction(e,r)}catch(t){try{u=new i.FeeBumpTransaction(e,r)}catch(e){throw new y("Invalid challenge: unable to deserialize challengeTx transaction string")}throw new y("Invalid challenge: expected a Transaction but received a FeeBumpTransaction")}if(0!==Number.parseInt(u.sequence,10))throw new y("The transaction sequence number should be zero");if(u.source!==t)throw new y("The transaction source account is not equal to the server's account");if(u.operations.length<1)throw new y("The transaction should contain at least one operation");var c=w(u.operations),l=c[0],f=c.slice(1);if(!l.source)throw new y("The transaction's operation should contain a source account");var p,d=l.source,h=null;if(u.memo.type!==i.MemoNone){if(d.startsWith("M"))throw new y("The transaction has a memo but the client account ID is a muxed account");if(u.memo.type!==i.MemoID)throw new y("The transaction's memo must be of type `id`");h=u.memo.value}if("manageData"!==l.type)throw new y("The transaction's operation type should be 'manageData'");if(u.timeBounds&&Number.parseInt(null===(s=u.timeBounds)||void 0===s?void 0:s.maxTime,10)===i.TimeoutInfinite)throw new y("The transaction requires non-infinite timebounds");if(!a.A.validateTimebounds(u,300))throw new y("The transaction has expired");if(void 0===l.value)throw new y("The transaction's operation values should not be null");if(!l.value)throw new y("The transaction's operation value should not be null");if(48!==m.from(l.value.toString(),"base64").length)throw new y("The transaction's operation value should be a 64 bytes base64 random string");if(!n)throw new y("Invalid homeDomains: a home domain must be provided for verification");if("string"==typeof n)"".concat(n," auth")===l.name&&(p=n);else{if(!Array.isArray(n))throw new y("Invalid homeDomains: homeDomains type is ".concat(b(n)," but should be a string or an array"));p=n.find(function(e){return"".concat(e," auth")===l.name})}if(!p)throw new y("Invalid homeDomains: the transaction's operation key name does not match the expected home domain");var g,S=v(f);try{for(S.s();!(g=S.n()).done;){var E=g.value;if("manageData"!==E.type)throw new y("The transaction has operations that are not of type 'manageData'");if(E.source!==t&&"client_domain"!==E.name)throw new y("The transaction has operations that are unrecognized");if("web_auth_domain"===E.name){if(void 0===E.value)throw new y("'web_auth_domain' operation value should not be null");if(E.value.compare(m.from(o)))throw new y("'web_auth_domain' operation value does not match ".concat(o))}}}catch(e){S.e(e)}finally{S.f()}if(!x(u,t))throw new y("Transaction not signed by server: '".concat(t,"'"));return{tx:u,clientAccountID:d,matchedHomeDomain:p,memo:h}}function A(e,t,r,n,o,i,a){for(var s=_(e,t,r,o.map(function(e){return e.key}),i,a),u=0,c=function(){var e,t=f[l],r=(null===(e=o.find(function(e){return e.key===t}))||void 0===e?void 0:e.weight)||0;u+=r},l=0,f=s;l<f.length;l++)c();if(u<n)throw new y("signers with weight ".concat(u," do not meet threshold ").concat(n,'"'));return s}function _(e,t,r,n,o,a){var s,u=O(e,t,r,o,a).tx;try{s=i.Keypair.fromPublicKey(t)}catch(e){throw new Error("Couldn't infer keypair from the provided 'serverAccountID': ".concat(e.message))}var c,l,f=new Set,p=v(n);try{for(p.s();!(c=p.n()).done;){var d=c.value;d!==s.publicKey()&&("G"===d.charAt(0)&&f.add(d))}}catch(e){p.e(e)}finally{p.f()}if(0===f.size)throw new y("No verifiable client signers provided, at least one G... address must be provided");var h,m=v(u.operations);try{for(m.s();!(h=m.n()).done;){var b=h.value;if("manageData"===b.type&&"client_domain"===b.name){if(l)throw new y("Found more than one client_domain operation");l=b.source}}}catch(e){m.e(e)}finally{m.f()}var w=[s.publicKey()].concat(g(Array.from(f)));l&&w.push(l);for(var S=P(u,w),E=!1,T=!1,k=0,A=S;k<A.length;k++){var _=A[k];_===s.publicKey()&&(E=!0),_===l&&(T=!0)}if(!E)throw new y("Transaction not signed by server: '".concat(s.publicKey(),"'"));if(l&&!T)throw new y("Transaction not signed by the source account of the 'client_domain' ManageData operation");if(1===S.length)throw new y("None of the given signers match the transaction signatures");if(S.length!==u.signatures.length)throw new y("Transaction has unrecognized signatures");return S.splice(S.indexOf(s.publicKey()),1),l&&S.splice(S.indexOf(l),1),S}function x(e,t){return 0!==P(e,[t]).length}function P(e,t){var r,n=e.hash(),o=g(e.signatures),a=new Set,s=v(t);try{for(s.s();!(r=s.n()).done;){var u=r.value;if(0===o.length)break;var c=void 0;try{c=i.Keypair.fromPublicKey(u)}catch(e){throw new y("Signer is not a valid address: ".concat(e.message))}for(var l=0;l<o.length;l++){var f=o[l];if(f.hint().equals(c.signatureHint())&&c.verify(n,f.signature())){a.add(u),o.splice(l,1);break}}}}catch(e){s.e(e)}finally{s.f()}return Array.from(a)}},496:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>n.j,AxiosClient:()=>s,BasicSleepStrategy:()=>P,Durability:()=>x,LinearSleepStrategy:()=>I,Server:()=>ae,assembleTransaction:()=>h.X,default:()=>se,parseRawEvents:()=>y.fG,parseRawSimulation:()=>y.jr});var n=r(76),o=r(193),i=r.n(o),a=r(950);const s=(0,r(371).vt)({headers:{"X-Client-Name":"js-soroban-client","X-Client-Version":"14.1.0"}});function u(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return c(l,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),l}var a={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(c(t={},n,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,c(d,"constructor",f),c(f,"constructor",l),l.displayName="GeneratorFunction",c(f,o,"GeneratorFunction"),c(d),c(d,o,"Generator"),c(d,n,function(){return this}),c(d,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function c(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}c=function(e,t,r,n){function i(t,r){c(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},c(e,t,r,n)}function l(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function f(e,t){return e.hasOwnProperty(t)}function p(e,t){return d.apply(this,arguments)}function d(){var e;return e=u().m(function e(t,r){var n,o,i,a=arguments;return u().w(function(e){for(;;)switch(e.n){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:null,e.n=1,s.post(t,{jsonrpc:"2.0",id:1,method:r,params:n});case 1:if(!f((o=e.v).data,"error")){e.n=2;break}throw o.data.error;case 2:return e.a(2,null===(i=o.data)||void 0===i?void 0:i.result);case 3:return e.a(2)}},e)}),d=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){l(i,n,o,a,s,"next",e)}function s(e){l(i,n,o,a,s,"throw",e)}a(void 0)})},d.apply(this,arguments)}var h=r(680),y=r(784),m=r(121),g=r(287).Buffer;function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach(function(t){S(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function S(e,t,r){return(t=_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return T(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(T(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,T(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,T(f,"constructor",c),T(c,"constructor",u),u.displayName="GeneratorFunction",T(c,o,"GeneratorFunction"),T(f),T(f,o,"Generator"),T(f,n,function(){return this}),T(f,"toString",function(){return"[object Generator]"}),(E=function(){return{w:i,m:p}})()}function T(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}T=function(e,t,r,n){function i(t,r){T(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},T(e,t,r,n)}function k(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function O(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){k(i,n,o,a,s,"next",e)}function s(e){k(i,n,o,a,s,"throw",e)}a(void 0)})}}function A(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_(n.key),n)}}function _(e){var t=function(e,t){if("object"!=v(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==v(t)?t:t+""}var x=function(e){return e.Temporary="temporary",e.Persistent="persistent",e}({}),P=function(e){return 1e3},I=function(e){return 1e3*e};function R(e){var t,r=[];switch(e.switch()){case 0:r=e.operations();break;case 1:case 2:case 3:case 4:r=e.value().operations();break;default:throw new Error("Unexpected transaction meta switch value")}var n=null===(t=r.flatMap(function(e){return e.changes()}).find(function(e){return e.switch()===a.xdr.LedgerEntryChangeType.ledgerEntryCreated()&&e.created().data().switch()===a.xdr.LedgerEntryType.account()}))||void 0===t||null===(t=t.created())||void 0===t||null===(t=t.data())||void 0===t||null===(t=t.account())||void 0===t||null===(t=t.seqNum())||void 0===t?void 0:t.toString();if(n)return n;throw new Error("No account created in transaction")}var B,C,j,U,N,L,D,F,M,V,q,H,z,K,X,$,G,W,Q,Z,Y,J,ee,te,re,ne,oe,ie,ae=(B=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=i()(t),r.headers&&0!==Object.keys(r.headers).length&&s.interceptors.request.use(function(e){return e.headers=Object.assign(e.headers,r.headers),e}),"https"!==this.serverURL.protocol()&&!r.allowHttp)throw new Error("Cannot connect to insecure Soroban RPC server if `allowHttp` isn't set")},C=[{key:"getAccount",value:(ie=O(E().m(function e(t){var r,n,o;return E().w(function(e){for(;;)switch(e.n){case 0:return r=a.xdr.LedgerKey.account(new a.xdr.LedgerKeyAccount({accountId:a.Keypair.fromPublicKey(t).xdrPublicKey()})),e.n=1,this.getLedgerEntries(r);case 1:if(0!==(n=e.v).entries.length){e.n=2;break}return e.a(2,Promise.reject({code:404,message:"Account not found: ".concat(t)}));case 2:return o=n.entries[0].val.account(),e.a(2,new a.Account(t,o.seqNum().toString()))}},e,this)})),function(e){return ie.apply(this,arguments)})},{key:"getHealth",value:(oe=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getHealth"))},e,this)})),function(){return oe.apply(this,arguments)})},{key:"getContractData",value:(ne=O(E().m(function e(t,r){var n,o,i,s,u,c=arguments;return E().w(function(e){for(;;)switch(e.n){case 0:if(n=c.length>2&&void 0!==c[2]?c[2]:x.Persistent,"string"!=typeof t){e.n=1;break}o=new a.Contract(t).address().toScAddress(),e.n=4;break;case 1:if(!(t instanceof a.Address)){e.n=2;break}o=t.toScAddress(),e.n=4;break;case 2:if(!(t instanceof a.Contract)){e.n=3;break}o=t.address().toScAddress(),e.n=4;break;case 3:throw new TypeError("unknown contract type: ".concat(t));case 4:u=n,e.n=u===x.Temporary?5:u===x.Persistent?6:7;break;case 5:return i=a.xdr.ContractDataDurability.temporary(),e.a(3,8);case 6:return i=a.xdr.ContractDataDurability.persistent(),e.a(3,8);case 7:throw new TypeError("invalid durability: ".concat(n));case 8:return s=a.xdr.LedgerKey.contractData(new a.xdr.LedgerKeyContractData({key:r,contract:o,durability:i})),e.a(2,this.getLedgerEntries(s).then(function(e){return 0===e.entries.length?Promise.reject({code:404,message:"Contract data not found. Contract: ".concat(a.Address.fromScAddress(o).toString(),", Key: ").concat(r.toXDR("base64"),", Durability: ").concat(n)}):e.entries[0]}))}},e,this)})),function(e,t){return ne.apply(this,arguments)})},{key:"getContractWasmByContractId",value:(re=O(E().m(function e(t){var r,n,o,i;return E().w(function(e){for(;;)switch(e.n){case 0:return n=new a.Contract(t).getFootprint(),e.n=1,this.getLedgerEntries(n);case 1:if((o=e.v).entries.length&&null!==(r=o.entries[0])&&void 0!==r&&r.val){e.n=2;break}return e.a(2,Promise.reject({code:404,message:"Could not obtain contract hash from server"}));case 2:return i=o.entries[0].val.contractData().val().instance().executable().wasmHash(),e.a(2,this.getContractWasmByHash(i))}},e,this)})),function(e){return re.apply(this,arguments)})},{key:"getContractWasmByHash",value:(te=O(E().m(function e(t){var r,n,o,i,s,u,c=arguments;return E().w(function(e){for(;;)switch(e.n){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:void 0,o="string"==typeof t?g.from(t,n):t,i=a.xdr.LedgerKey.contractCode(new a.xdr.LedgerKeyContractCode({hash:o})),e.n=1,this.getLedgerEntries(i);case 1:if((s=e.v).entries.length&&null!==(r=s.entries[0])&&void 0!==r&&r.val){e.n=2;break}return e.a(2,Promise.reject({code:404,message:"Could not obtain contract wasm from server"}));case 2:return u=s.entries[0].val.contractCode().code(),e.a(2,u)}},e,this)})),function(e){return te.apply(this,arguments)})},{key:"getLedgerEntries",value:(ee=O(E().m(function e(){var t=arguments;return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getLedgerEntries.apply(this,t).then(y.$D))},e,this)})),function(){return ee.apply(this,arguments)})},{key:"_getLedgerEntries",value:(J=O(E().m(function e(){var t,r,n,o=arguments;return E().w(function(e){for(;;)if(0===e.n){for(t=o.length,r=new Array(t),n=0;n<t;n++)r[n]=o[n];return e.a(2,p(this.serverURL.toString(),"getLedgerEntries",{keys:r.map(function(e){return e.toXDR("base64")})}))}},e,this)})),function(){return J.apply(this,arguments)})},{key:"pollTransaction",value:(Y=O(E().m(function e(t,r){var o,i,a,s,u,c;return E().w(function(e){for(;;)switch(e.n){case 0:a=(null!==(o=null==r?void 0:r.attempts)&&void 0!==o?o:0)<1?30:null!==(i=null==r?void 0:r.attempts)&&void 0!==i?i:30,u=1;case 1:if(!(u<a)){e.n=5;break}return e.n=2,this.getTransaction(t);case 2:if((s=e.v).status===n.j.GetTransactionStatus.NOT_FOUND){e.n=3;break}return e.a(2,s);case 3:return e.n=4,m.A.sleep((null!==(c=null==r?void 0:r.sleepStrategy)&&void 0!==c?c:P)(u));case 4:u++,e.n=1;break;case 5:return e.a(2,s)}},e,this)})),function(e,t){return Y.apply(this,arguments)})},{key:"getTransaction",value:(Z=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getTransaction(t).then(function(e){var r={};return e.status!==n.j.GetTransactionStatus.NOT_FOUND&&Object.assign(r,(0,y.WC)(e)),w({status:e.status,txHash:t,latestLedger:e.latestLedger,latestLedgerCloseTime:e.latestLedgerCloseTime,oldestLedger:e.oldestLedger,oldestLedgerCloseTime:e.oldestLedgerCloseTime},r)}))},e,this)})),function(e){return Z.apply(this,arguments)})},{key:"_getTransaction",value:(Q=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getTransaction",{hash:t}))},e,this)})),function(e){return Q.apply(this,arguments)})},{key:"getTransactions",value:(W=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getTransactions(t).then(function(e){return{transactions:(e.transactions||[]).map(y.tR),latestLedger:e.latestLedger,latestLedgerCloseTimestamp:e.latestLedgerCloseTimestamp,oldestLedger:e.oldestLedger,oldestLedgerCloseTimestamp:e.oldestLedgerCloseTimestamp,cursor:e.cursor}}))},e,this)})),function(e){return W.apply(this,arguments)})},{key:"_getTransactions",value:(G=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getTransactions",t))},e,this)})),function(e){return G.apply(this,arguments)})},{key:"getEvents",value:($=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._getEvents(t).then(y.fG))},e,this)})),function(e){return $.apply(this,arguments)})},{key:"_getEvents",value:(X=O(E().m(function e(t){var r;return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getEvents",w(w({filters:null!==(r=t.filters)&&void 0!==r?r:[],pagination:w(w({},t.cursor&&{cursor:t.cursor}),t.limit&&{limit:t.limit})},t.startLedger&&{startLedger:t.startLedger}),t.endLedger&&{endLedger:t.endLedger})))},e,this)})),function(e){return X.apply(this,arguments)})},{key:"getNetwork",value:(K=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getNetwork"))},e,this)})),function(){return K.apply(this,arguments)})},{key:"getLatestLedger",value:(z=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getLatestLedger"))},e,this)})),function(){return z.apply(this,arguments)})},{key:"simulateTransaction",value:(H=O(E().m(function e(t,r,n){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._simulateTransaction(t,r,n).then(y.jr))},e,this)})),function(e,t,r){return H.apply(this,arguments)})},{key:"_simulateTransaction",value:(q=O(E().m(function e(t,r,n){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"simulateTransaction",w({transaction:t.toXDR(),authMode:n},void 0!==r&&{resourceConfig:{instructionLeeway:r.cpuInstructions}})))},e,this)})),function(e,t,r){return q.apply(this,arguments)})},{key:"prepareTransaction",value:(V=O(E().m(function e(t){var r;return E().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.simulateTransaction(t);case 1:if(r=e.v,!n.j.isSimulationError(r)){e.n=2;break}throw new Error(r.error);case 2:return e.a(2,(0,h.X)(t,r).build())}},e,this)})),function(e){return V.apply(this,arguments)})},{key:"sendTransaction",value:(M=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,this._sendTransaction(t).then(y.Af))},e,this)})),function(e){return M.apply(this,arguments)})},{key:"_sendTransaction",value:(F=O(E().m(function e(t){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"sendTransaction",{transaction:t.toXDR()}))},e,this)})),function(e){return F.apply(this,arguments)})},{key:"requestAirdrop",value:(D=O(E().m(function e(t,r){var o,i,u,c,l,f,p,d,h;return E().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o="string"==typeof t?t:t.accountId(),d=r){e.n=2;break}return e.n=1,this.getNetwork();case 1:d=e.v.friendbotUrl;case 2:if(r=d){e.n=3;break}throw new Error("No friendbot URL configured for current network");case 3:return e.p=3,e.n=4,s.post("".concat(r,"?addr=").concat(encodeURIComponent(o)));case 4:if((i=e.v).data.result_meta_xdr){e.n=7;break}return e.n=5,this.getTransaction(i.data.hash);case 5:if((c=e.v).status===n.j.GetTransactionStatus.SUCCESS){e.n=6;break}throw new Error("Funding account ".concat(t," failed"));case 6:u=c.resultMetaXdr,e.n=8;break;case 7:u=a.xdr.TransactionMeta.fromXDR(i.data.result_meta_xdr,"base64");case 8:return l=R(u),e.a(2,new a.Account(o,l));case 9:if(e.p=9,h=e.v,400!==(null===(f=h.response)||void 0===f?void 0:f.status)){e.n=10;break}if(null===(p=h.response.detail)||void 0===p||!p.includes("createAccountAlreadyExist")){e.n=10;break}return e.a(2,this.getAccount(o));case 10:throw h;case 11:return e.a(2)}},e,this,[[3,9]])})),function(e,t){return D.apply(this,arguments)})},{key:"getFeeStats",value:(L=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getFeeStats"))},e,this)})),function(){return L.apply(this,arguments)})},{key:"getVersionInfo",value:(N=O(E().m(function e(){return E().w(function(e){for(;;)if(0===e.n)return e.a(2,p(this.serverURL.toString(),"getVersionInfo"))},e,this)})),function(){return N.apply(this,arguments)})},{key:"getSACBalance",value:(U=O(E().m(function e(t,r,n){var o,i,s,u,c,l,f,p,d,h,y;return E().w(function(e){for(;;)switch(e.n){case 0:if(a.StrKey.isValidContract(t)){e.n=1;break}throw new TypeError("expected contract ID, got ".concat(t));case 1:if(null==n){e.n=2;break}y=n,e.n=4;break;case 2:return e.n=3,this.getNetwork().then(function(e){return e.passphrase});case 3:y=e.v;case 4:return o=y,i=r.contractId(o),s=(0,a.nativeToScVal)(["Balance",t],{type:["symbol","address"]}),u=a.xdr.LedgerKey.contractData(new a.xdr.LedgerKeyContractData({contract:new a.Address(i).toScAddress(),durability:a.xdr.ContractDataDurability.persistent(),key:s})),e.n=5,this.getLedgerEntries(u);case 5:if(0!==(c=e.v).entries.length){e.n=6;break}return e.a(2,{latestLedger:c.latestLedger});case 6:if(l=c.entries[0],f=l.lastModifiedLedgerSeq,p=l.liveUntilLedgerSeq,(d=l.val).switch().value===a.xdr.LedgerEntryType.contractData().value){e.n=7;break}return e.a(2,{latestLedger:c.latestLedger});case 7:return h=(0,a.scValToNative)(d.contractData().val()),e.a(2,{latestLedger:c.latestLedger,balanceEntry:{liveUntilLedgerSeq:p,lastModifiedLedgerSeq:f,amount:h.amount.toString(),authorized:h.authorized,clawback:h.clawback}})}},e,this)})),function(e,t,r){return U.apply(this,arguments)})}],C&&A(B.prototype,C),j&&A(B,j),Object.defineProperty(B,"prototype",{writable:!1}),B);const se=(e=r.hmd(e)).exports},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(u(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},546:e=>{e.exports=function(){function e(e,t,r,n,o,i){this.message=e,this.expected=t,this.found=r,this.offset=n,this.line=o,this.column=i,this.name="SyntaxError"}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),{SyntaxError:e,parse:function(t){var r,n=arguments.length>1?arguments[1]:{},o={},i={start:jt},a=jt,s=function(){return pr},u=o,c="#",l={type:"literal",value:"#",description:'"#"'},f=void 0,p={type:"any",description:"any character"},d="[",h={type:"literal",value:"[",description:'"["'},y="]",m={type:"literal",value:"]",description:'"]"'},g=function(e){dr(hr("ObjectPath",e,Pt,It))},v=function(e){dr(hr("ArrayPath",e,Pt,It))},b=function(e,t){return e.concat(t)},w=function(e){return[e]},S=function(e){return e},E=".",T={type:"literal",value:".",description:'"."'},k="=",O={type:"literal",value:"=",description:'"="'},A=function(e,t){dr(hr("Assign",t,Pt,It,e))},_=function(e){return e.join("")},x=function(e){return e.value},P='"""',I={type:"literal",value:'"""',description:'"\\"\\"\\""'},R=null,B=function(e){return hr("String",e.join(""),Pt,It)},C='"',j={type:"literal",value:'"',description:'"\\""'},U="'''",N={type:"literal",value:"'''",description:"\"'''\""},L="'",D={type:"literal",value:"'",description:'"\'"'},F=function(e){return e},M=function(e){return e},V="\\",q={type:"literal",value:"\\",description:'"\\\\"'},H=function(){return""},z="e",K={type:"literal",value:"e",description:'"e"'},X="E",$={type:"literal",value:"E",description:'"E"'},G=function(e,t){return hr("Float",parseFloat(e+"e"+t),Pt,It)},W=function(e){return hr("Float",parseFloat(e),Pt,It)},Q="+",Z={type:"literal",value:"+",description:'"+"'},Y=function(e){return e.join("")},J="-",ee={type:"literal",value:"-",description:'"-"'},te=function(e){return"-"+e.join("")},re=function(e){return hr("Integer",parseInt(e,10),Pt,It)},ne="true",oe={type:"literal",value:"true",description:'"true"'},ie=function(){return hr("Boolean",!0,Pt,It)},ae="false",se={type:"literal",value:"false",description:'"false"'},ue=function(){return hr("Boolean",!1,Pt,It)},ce=function(){return hr("Array",[],Pt,It)},le=function(e){return hr("Array",e?[e]:[],Pt,It)},fe=function(e){return hr("Array",e,Pt,It)},pe=function(e,t){return hr("Array",e.concat(t),Pt,It)},de=function(e){return e},he=",",ye={type:"literal",value:",",description:'","'},me="{",ge={type:"literal",value:"{",description:'"{"'},ve="}",be={type:"literal",value:"}",description:'"}"'},we=function(e){return hr("InlineTable",e,Pt,It)},Se=function(e,t){return hr("InlineTableValue",t,Pt,It,e)},Ee=function(e){return"."+e},Te=function(e){return e.join("")},ke=":",Oe={type:"literal",value:":",description:'":"'},Ae=function(e){return e.join("")},_e="T",xe={type:"literal",value:"T",description:'"T"'},Pe="Z",Ie={type:"literal",value:"Z",description:'"Z"'},Re=function(e,t){return hr("Date",new Date(e+"T"+t+"Z"),Pt,It)},Be=function(e,t){return hr("Date",new Date(e+"T"+t),Pt,It)},Ce=/^[ \t]/,je={type:"class",value:"[ \\t]",description:"[ \\t]"},Ue="\n",Ne={type:"literal",value:"\n",description:'"\\n"'},Le="\r",De={type:"literal",value:"\r",description:'"\\r"'},Fe=/^[0-9a-f]/i,Me={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},Ve=/^[0-9]/,qe={type:"class",value:"[0-9]",description:"[0-9]"},He="_",ze={type:"literal",value:"_",description:'"_"'},Ke=function(){return""},Xe=/^[A-Za-z0-9_\-]/,$e={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},Ge=function(e){return e.join("")},We='\\"',Qe={type:"literal",value:'\\"',description:'"\\\\\\""'},Ze=function(){return'"'},Ye="\\\\",Je={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},et=function(){return"\\"},tt="\\b",rt={type:"literal",value:"\\b",description:'"\\\\b"'},nt=function(){return"\b"},ot="\\t",it={type:"literal",value:"\\t",description:'"\\\\t"'},at=function(){return"\t"},st="\\n",ut={type:"literal",value:"\\n",description:'"\\\\n"'},ct=function(){return"\n"},lt="\\f",ft={type:"literal",value:"\\f",description:'"\\\\f"'},pt=function(){return"\f"},dt="\\r",ht={type:"literal",value:"\\r",description:'"\\\\r"'},yt=function(){return"\r"},mt="\\U",gt={type:"literal",value:"\\U",description:'"\\\\U"'},vt=function(e){return function(e,t,r){var n=parseInt("0x"+e);if(!(!isFinite(n)||Math.floor(n)!=n||n<0||n>1114111||n>55295&&n<57344))return function(){var e,t,r=16384,n=[],o=-1,i=arguments.length;if(!i)return"";var a="";for(;++o<i;){var s=Number(arguments[o]);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(o+1==i||n.length>r)&&(a+=String.fromCharCode.apply(null,n),n.length=0)}return a}(n);!function(e,t,r){var n=new Error(e);throw n.line=t,n.column=r,n}("Invalid Unicode escape code: "+e,t,r)}(e.join(""))},bt="\\u",wt={type:"literal",value:"\\u",description:'"\\\\u"'},St=0,Et=0,Tt=0,kt={line:1,column:1,seenCR:!1},Ot=0,At=[],_t=0,xt={};if("startRule"in n){if(!(n.startRule in i))throw new Error("Can't start parsing from rule \""+n.startRule+'".');a=i[n.startRule]}function Pt(){return Rt(Et).line}function It(){return Rt(Et).column}function Rt(e){return Tt!==e&&(Tt>e&&(Tt=0,kt={line:1,column:1,seenCR:!1}),function(e,r,n){var o,i;for(o=r;o<n;o++)"\n"===(i=t.charAt(o))?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===i||"\u2028"===i||"\u2029"===i?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}(kt,Tt,e),Tt=e),kt}function Bt(e){St<Ot||(St>Ot&&(Ot=St,At=[]),At.push(e))}function Ct(r,n,o){var i=Rt(o),a=o<t.length?t.charAt(o):null;return null!==n&&function(e){var t=1;for(e.sort(function(e,t){return e.description<t.description?-1:e.description>t.description?1:0});t<e.length;)e[t-1]===e[t]?e.splice(t,1):t++}(n),new e(null!==r?r:function(e,t){var r,n=new Array(e.length);for(r=0;r<e.length;r++)n[r]=e[r].description;return"Expected "+(e.length>1?n.slice(0,-1).join(", ")+" or "+n[e.length-1]:n[0])+" but "+(t?'"'+function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}(t)+'"':"end of input")+" found."}(n,a),n,a,o,i.line,i.column)}function jt(){var e,t,r,n=49*St+0,i=xt[n];if(i)return St=i.nextPos,i.result;for(e=St,t=[],r=Ut();r!==o;)t.push(r),r=Ut();return t!==o&&(Et=e,t=s()),e=t,xt[n]={nextPos:St,result:e},e}function Ut(){var e,r,n,i,a,s,c,l=49*St+1,f=xt[l];if(f)return St=f.nextPos,f.result;for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if(n=function(){var e,r=49*St+2,n=xt[r];if(n)return St=n.nextPos,n.result;e=Nt(),e===o&&(e=function(){var e,r,n,i,a,s,c=49*St+4,l=xt[c];if(l)return St=l.nextPos,l.result;e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h));if(r!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();if(n!==o)if((i=Lt())!==o){for(a=[],s=nr();s!==o;)a.push(s),s=nr();a!==o?(93===t.charCodeAt(St)?(s=y,St++):(s=o,0===_t&&Bt(m)),s!==o?(Et=e,e=r=g(i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;return xt[c]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c,l,f=49*St+5,p=xt[f];if(p)return St=p.nextPos,p.result;e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h));if(r!==o)if(91===t.charCodeAt(St)?(n=d,St++):(n=o,0===_t&&Bt(h)),n!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if((a=Lt())!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();s!==o?(93===t.charCodeAt(St)?(c=y,St++):(c=o,0===_t&&Bt(m)),c!==o?(93===t.charCodeAt(St)?(l=y,St++):(l=o,0===_t&&Bt(m)),l!==o?(Et=e,e=r=v(a)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u;return xt[f]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c=49*St+9,l=xt[c];if(l)return St=l.nextPos,l.result;if(e=St,r=Mt(),r!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();if(n!==o)if(61===t.charCodeAt(St)?(i=k,St++):(i=o,0===_t&&Bt(O)),i!==o){for(a=[],s=nr();s!==o;)a.push(s),s=nr();a!==o&&(s=qt())!==o?(Et=e,e=r=A(r,s)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;if(e===o)if(e=St,(r=Vt())!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();if(n!==o)if(61===t.charCodeAt(St)?(i=k,St++):(i=o,0===_t&&Bt(O)),i!==o){for(a=[],s=nr();s!==o;)a.push(s),s=nr();a!==o&&(s=qt())!==o?(Et=e,e=r=A(r,s)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;return xt[c]={nextPos:St,result:e},e}())));return xt[r]={nextPos:St,result:e},e}(),n!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o){for(a=[],s=Nt();s!==o;)a.push(s),s=Nt();if(a!==o){if(s=[],(c=or())!==o)for(;c!==o;)s.push(c),c=or();else s=u;s===o&&(s=ar()),s!==o?e=r=[r,n,i,a,s]:(St=e,e=u)}else St=e,e=u}else St=e,e=u}else St=e,e=u;else St=e,e=u;if(e===o){if(e=St,r=[],(n=nr())!==o)for(;n!==o;)r.push(n),n=nr();else r=u;if(r!==o){if(n=[],(i=or())!==o)for(;i!==o;)n.push(i),i=or();else n=u;n===o&&(n=ar()),n!==o?e=r=[r,n]:(St=e,e=u)}else St=e,e=u;e===o&&(e=or())}return xt[l]={nextPos:St,result:e},e}function Nt(){var e,r,n,i,a,s,d=49*St+3,h=xt[d];if(h)return St=h.nextPos,h.result;if(e=St,35===t.charCodeAt(St)?(r=c,St++):(r=o,0===_t&&Bt(l)),r!==o){for(n=[],i=St,a=St,_t++,(s=or())===o&&(s=ar()),_t--,s===o?a=f:(St=a,a=u),a!==o?(t.length>St?(s=t.charAt(St),St++):(s=o,0===_t&&Bt(p)),s!==o?i=a=[a,s]:(St=i,i=u)):(St=i,i=u);i!==o;)n.push(i),i=St,a=St,_t++,(s=or())===o&&(s=ar()),_t--,s===o?a=f:(St=a,a=u),a!==o?(t.length>St?(s=t.charAt(St),St++):(s=o,0===_t&&Bt(p)),s!==o?i=a=[a,s]:(St=i,i=u)):(St=i,i=u);n!==o?e=r=[r,n]:(St=e,e=u)}else St=e,e=u;return xt[d]={nextPos:St,result:e},e}function Lt(){var e,t,r,n=49*St+6,i=xt[n];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(r=Ft())!==o)for(;r!==o;)t.push(r),r=Ft();else t=u;return t!==o&&(r=Dt())!==o?(Et=e,e=t=b(t,r)):(St=e,e=u),e===o&&(e=St,(t=Dt())!==o&&(Et=e,t=w(t)),e=t),xt[n]={nextPos:St,result:e},e}function Dt(){var e,t,r,n,i,a=49*St+7,s=xt[a];if(s)return St=s.nextPos,s.result;for(e=St,t=[],r=nr();r!==o;)t.push(r),r=nr();if(t!==o)if((r=Mt())!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();n!==o?(Et=e,e=t=S(r)):(St=e,e=u)}else St=e,e=u;else St=e,e=u;if(e===o){for(e=St,t=[],r=nr();r!==o;)t.push(r),r=nr();if(t!==o)if((r=Vt())!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();n!==o?(Et=e,e=t=S(r)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}return xt[a]={nextPos:St,result:e},e}function Ft(){var e,r,n,i,a,s,c,l=49*St+8,f=xt[l];if(f)return St=f.nextPos,f.result;for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if((n=Mt())!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if(46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),a!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();s!==o?(Et=e,e=r=S(n)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u;if(e===o){for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if((n=Vt())!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if(46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),a!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();s!==o?(Et=e,e=r=S(n)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u}return xt[l]={nextPos:St,result:e},e}function Mt(){var e,t,r,n=49*St+10,i=xt[n];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(r=cr())!==o)for(;r!==o;)t.push(r),r=cr();else t=u;return t!==o&&(Et=e,t=_(t)),e=t,xt[n]={nextPos:St,result:e},e}function Vt(){var e,t,r=49*St+11,n=xt[r];return n?(St=n.nextPos,n.result):(e=St,(t=Ht())!==o&&(Et=e,t=x(t)),(e=t)===o&&(e=St,(t=zt())!==o&&(Et=e,t=x(t)),e=t),xt[r]={nextPos:St,result:e},e)}function qt(){var e,r=49*St+12,n=xt[r];return n?(St=n.nextPos,n.result):(e=function(){var e,r=49*St+13,n=xt[r];if(n)return St=n.nextPos,n.result;e=function(){var e,r,n,i,a,s=49*St+14,c=xt[s];if(c)return St=c.nextPos,c.result;e=St,t.substr(St,3)===P?(r=P,St+=3):(r=o,0===_t&&Bt(I));if(r!==o)if((n=or())===o&&(n=R),n!==o){for(i=[],a=$t();a!==o;)i.push(a),a=$t();i!==o?(t.substr(St,3)===P?(a=P,St+=3):(a=o,0===_t&&Bt(I)),a!==o?(Et=e,e=r=B(i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;else St=e,e=u;return xt[s]={nextPos:St,result:e},e}(),e===o&&(e=Ht())===o&&(e=function(){var e,r,n,i,a,s=49*St+16,c=xt[s];if(c)return St=c.nextPos,c.result;e=St,t.substr(St,3)===U?(r=U,St+=3):(r=o,0===_t&&Bt(N));if(r!==o)if((n=or())===o&&(n=R),n!==o){for(i=[],a=Gt();a!==o;)i.push(a),a=Gt();i!==o?(t.substr(St,3)===U?(a=U,St+=3):(a=o,0===_t&&Bt(N)),a!==o?(Et=e,e=r=B(i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;else St=e,e=u;return xt[s]={nextPos:St,result:e},e}(),e===o&&(e=zt()));return xt[r]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s=49*St+38,c=xt[s];if(c)return St=c.nextPos,c.result;e=St,(r=rr())!==o?(84===t.charCodeAt(St)?(n=_e,St++):(n=o,0===_t&&Bt(xe)),n!==o?(i=function(){var e,r,n,i,a,s,c,l,f,p,d,h=49*St+36,y=xt[h];if(y)return St=y.nextPos,y.result;e=St,r=St,n=ur(),n!==o&&(i=ur())!==o?(58===t.charCodeAt(St)?(a=ke,St++):(a=o,0===_t&&Bt(Oe)),a!==o&&(s=ur())!==o&&(c=ur())!==o?(58===t.charCodeAt(St)?(l=ke,St++):(l=o,0===_t&&Bt(Oe)),l!==o&&(f=ur())!==o&&(p=ur())!==o?((d=tr())===o&&(d=R),d!==o?r=n=[n,i,a,s,c,l,f,p,d]:(St=r,r=u)):(St=r,r=u)):(St=r,r=u)):(St=r,r=u);r!==o&&(Et=e,r=Ae(r));return e=r,xt[h]={nextPos:St,result:e},e}(),i!==o?(90===t.charCodeAt(St)?(a=Pe,St++):(a=o,0===_t&&Bt(Ie)),a!==o?(Et=e,e=r=Re(r,i)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u);e===o&&(e=St,(r=rr())!==o?(84===t.charCodeAt(St)?(n=_e,St++):(n=o,0===_t&&Bt(xe)),n!==o?(i=function(){var e,r,n,i,a,s,c,l,f,p,d,h,y,m,g,v,b,w=49*St+37,S=xt[w];if(S)return St=S.nextPos,S.result;e=St,r=St,n=ur(),n!==o&&(i=ur())!==o?(58===t.charCodeAt(St)?(a=ke,St++):(a=o,0===_t&&Bt(Oe)),a!==o&&(s=ur())!==o&&(c=ur())!==o?(58===t.charCodeAt(St)?(l=ke,St++):(l=o,0===_t&&Bt(Oe)),l!==o&&(f=ur())!==o&&(p=ur())!==o?((d=tr())===o&&(d=R),d!==o?(45===t.charCodeAt(St)?(h=J,St++):(h=o,0===_t&&Bt(ee)),h===o&&(43===t.charCodeAt(St)?(h=Q,St++):(h=o,0===_t&&Bt(Z))),h!==o&&(y=ur())!==o&&(m=ur())!==o?(58===t.charCodeAt(St)?(g=ke,St++):(g=o,0===_t&&Bt(Oe)),g!==o&&(v=ur())!==o&&(b=ur())!==o?r=n=[n,i,a,s,c,l,f,p,d,h,y,m,g,v,b]:(St=r,r=u)):(St=r,r=u)):(St=r,r=u)):(St=r,r=u)):(St=r,r=u)):(St=r,r=u);r!==o&&(Et=e,r=Ae(r));return e=r,xt[w]={nextPos:St,result:e},e}(),i!==o?(Et=e,e=r=Be(r,i)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u));return xt[s]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a=49*St+23,s=xt[a];if(s)return St=s.nextPos,s.result;e=St,(r=Wt())===o&&(r=Qt());r!==o?(101===t.charCodeAt(St)?(n=z,St++):(n=o,0===_t&&Bt(K)),n===o&&(69===t.charCodeAt(St)?(n=X,St++):(n=o,0===_t&&Bt($))),n!==o&&(i=Qt())!==o?(Et=e,e=r=G(r,i)):(St=e,e=u)):(St=e,e=u);e===o&&(e=St,(r=Wt())!==o&&(Et=e,r=W(r)),e=r);return xt[a]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,t,r=49*St+25,n=xt[r];if(n)return St=n.nextPos,n.result;e=St,(t=Qt())!==o&&(Et=e,t=re(t));return e=t,xt[r]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n=49*St+27,i=xt[n];if(i)return St=i.nextPos,i.result;e=St,t.substr(St,4)===ne?(r=ne,St+=4):(r=o,0===_t&&Bt(oe));r!==o&&(Et=e,r=ie());e=r,e===o&&(e=St,t.substr(St,5)===ae?(r=ae,St+=5):(r=o,0===_t&&Bt(se)),r!==o&&(Et=e,r=ue()),e=r);return xt[n]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s=49*St+28,c=xt[s];if(c)return St=c.nextPos,c.result;e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h));if(r!==o){for(n=[],i=Jt();i!==o;)n.push(i),i=Jt();n!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===_t&&Bt(m)),i!==o?(Et=e,e=r=ce()):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;if(e===o&&(e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h)),r!==o?((n=Zt())===o&&(n=R),n!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===_t&&Bt(m)),i!==o?(Et=e,e=r=le(n)):(St=e,e=u)):(St=e,e=u)):(St=e,e=u),e===o)){if(e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h)),r!==o){if(n=[],(i=Yt())!==o)for(;i!==o;)n.push(i),i=Yt();else n=u;n!==o?(93===t.charCodeAt(St)?(i=y,St++):(i=o,0===_t&&Bt(m)),i!==o?(Et=e,e=r=fe(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;if(e===o)if(e=St,91===t.charCodeAt(St)?(r=d,St++):(r=o,0===_t&&Bt(h)),r!==o){if(n=[],(i=Yt())!==o)for(;i!==o;)n.push(i),i=Yt();else n=u;n!==o&&(i=Zt())!==o?(93===t.charCodeAt(St)?(a=y,St++):(a=o,0===_t&&Bt(m)),a!==o?(Et=e,e=r=pe(n,i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u}return xt[s]={nextPos:St,result:e},e}(),e===o&&(e=function(){var e,r,n,i,a,s,c=49*St+32,l=xt[c];if(l)return St=l.nextPos,l.result;e=St,123===t.charCodeAt(St)?(r=me,St++):(r=o,0===_t&&Bt(ge));if(r!==o){for(n=[],i=nr();i!==o;)n.push(i),i=nr();if(n!==o){for(i=[],a=er();a!==o;)i.push(a),a=er();if(i!==o){for(a=[],s=nr();s!==o;)a.push(s),s=nr();a!==o?(125===t.charCodeAt(St)?(s=ve,St++):(s=o,0===_t&&Bt(be)),s!==o?(Et=e,e=r=we(i)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u}else St=e,e=u}else St=e,e=u;return xt[c]={nextPos:St,result:e},e}())))))),xt[r]={nextPos:St,result:e},e)}function Ht(){var e,r,n,i,a=49*St+15,s=xt[a];if(s)return St=s.nextPos,s.result;if(e=St,34===t.charCodeAt(St)?(r=C,St++):(r=o,0===_t&&Bt(j)),r!==o){for(n=[],i=Kt();i!==o;)n.push(i),i=Kt();n!==o?(34===t.charCodeAt(St)?(i=C,St++):(i=o,0===_t&&Bt(j)),i!==o?(Et=e,e=r=B(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;return xt[a]={nextPos:St,result:e},e}function zt(){var e,r,n,i,a=49*St+17,s=xt[a];if(s)return St=s.nextPos,s.result;if(e=St,39===t.charCodeAt(St)?(r=L,St++):(r=o,0===_t&&Bt(D)),r!==o){for(n=[],i=Xt();i!==o;)n.push(i),i=Xt();n!==o?(39===t.charCodeAt(St)?(i=L,St++):(i=o,0===_t&&Bt(D)),i!==o?(Et=e,e=r=B(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;return xt[a]={nextPos:St,result:e},e}function Kt(){var e,r,n,i=49*St+18,a=xt[i];return a?(St=a.nextPos,a.result):((e=fr())===o&&(e=St,r=St,_t++,34===t.charCodeAt(St)?(n=C,St++):(n=o,0===_t&&Bt(j)),_t--,n===o?r=f:(St=r,r=u),r!==o?(t.length>St?(n=t.charAt(St),St++):(n=o,0===_t&&Bt(p)),n!==o?(Et=e,e=r=F(n)):(St=e,e=u)):(St=e,e=u)),xt[i]={nextPos:St,result:e},e)}function Xt(){var e,r,n,i=49*St+19,a=xt[i];return a?(St=a.nextPos,a.result):(e=St,r=St,_t++,39===t.charCodeAt(St)?(n=L,St++):(n=o,0===_t&&Bt(D)),_t--,n===o?r=f:(St=r,r=u),r!==o?(t.length>St?(n=t.charAt(St),St++):(n=o,0===_t&&Bt(p)),n!==o?(Et=e,e=r=F(n)):(St=e,e=u)):(St=e,e=u),xt[i]={nextPos:St,result:e},e)}function $t(){var e,r,n,i=49*St+20,a=xt[i];return a?(St=a.nextPos,a.result):((e=fr())===o&&(e=function(){var e,r,n,i,a=49*St+21,s=xt[a];if(s)return St=s.nextPos,s.result;e=St,92===t.charCodeAt(St)?(r=V,St++):(r=o,0===_t&&Bt(q));if(r!==o)if(or()!==o){for(n=[],i=ir();i!==o;)n.push(i),i=ir();n!==o?(Et=e,e=r=H()):(St=e,e=u)}else St=e,e=u;else St=e,e=u;return xt[a]={nextPos:St,result:e},e}(),e===o&&(e=St,r=St,_t++,t.substr(St,3)===P?(n=P,St+=3):(n=o,0===_t&&Bt(I)),_t--,n===o?r=f:(St=r,r=u),r!==o?(t.length>St?(n=t.charAt(St),St++):(n=o,0===_t&&Bt(p)),n!==o?(Et=e,e=r=M(n)):(St=e,e=u)):(St=e,e=u))),xt[i]={nextPos:St,result:e},e)}function Gt(){var e,r,n,i=49*St+22,a=xt[i];return a?(St=a.nextPos,a.result):(e=St,r=St,_t++,t.substr(St,3)===U?(n=U,St+=3):(n=o,0===_t&&Bt(N)),_t--,n===o?r=f:(St=r,r=u),r!==o?(t.length>St?(n=t.charAt(St),St++):(n=o,0===_t&&Bt(p)),n!==o?(Et=e,e=r=F(n)):(St=e,e=u)):(St=e,e=u),xt[i]={nextPos:St,result:e},e)}function Wt(){var e,r,n,i,a,s,c=49*St+24,l=xt[c];return l?(St=l.nextPos,l.result):(e=St,43===t.charCodeAt(St)?(r=Q,St++):(r=o,0===_t&&Bt(Z)),r===o&&(r=R),r!==o?(n=St,(i=lr())!==o?(46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),a!==o&&(s=lr())!==o?n=i=[i,a,s]:(St=n,n=u)):(St=n,n=u),n!==o?(Et=e,e=r=Y(n)):(St=e,e=u)):(St=e,e=u),e===o&&(e=St,45===t.charCodeAt(St)?(r=J,St++):(r=o,0===_t&&Bt(ee)),r!==o?(n=St,(i=lr())!==o?(46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),a!==o&&(s=lr())!==o?n=i=[i,a,s]:(St=n,n=u)):(St=n,n=u),n!==o?(Et=e,e=r=te(n)):(St=e,e=u)):(St=e,e=u)),xt[c]={nextPos:St,result:e},e)}function Qt(){var e,r,n,i,a,s=49*St+26,c=xt[s];if(c)return St=c.nextPos,c.result;if(e=St,43===t.charCodeAt(St)?(r=Q,St++):(r=o,0===_t&&Bt(Z)),r===o&&(r=R),r!==o){if(n=[],(i=ur())!==o)for(;i!==o;)n.push(i),i=ur();else n=u;n!==o?(i=St,_t++,46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),_t--,a===o?i=f:(St=i,i=u),i!==o?(Et=e,e=r=Y(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;if(e===o)if(e=St,45===t.charCodeAt(St)?(r=J,St++):(r=o,0===_t&&Bt(ee)),r!==o){if(n=[],(i=ur())!==o)for(;i!==o;)n.push(i),i=ur();else n=u;n!==o?(i=St,_t++,46===t.charCodeAt(St)?(a=E,St++):(a=o,0===_t&&Bt(T)),_t--,a===o?i=f:(St=i,i=u),i!==o?(Et=e,e=r=te(n)):(St=e,e=u)):(St=e,e=u)}else St=e,e=u;return xt[s]={nextPos:St,result:e},e}function Zt(){var e,t,r,n,i,a=49*St+29,s=xt[a];if(s)return St=s.nextPos,s.result;for(e=St,t=[],r=Jt();r!==o;)t.push(r),r=Jt();if(t!==o)if((r=qt())!==o){for(n=[],i=Jt();i!==o;)n.push(i),i=Jt();n!==o?(Et=e,e=t=de(r)):(St=e,e=u)}else St=e,e=u;else St=e,e=u;return xt[a]={nextPos:St,result:e},e}function Yt(){var e,r,n,i,a,s,c,l=49*St+30,f=xt[l];if(f)return St=f.nextPos,f.result;for(e=St,r=[],n=Jt();n!==o;)r.push(n),n=Jt();if(r!==o)if((n=qt())!==o){for(i=[],a=Jt();a!==o;)i.push(a),a=Jt();if(i!==o)if(44===t.charCodeAt(St)?(a=he,St++):(a=o,0===_t&&Bt(ye)),a!==o){for(s=[],c=Jt();c!==o;)s.push(c),c=Jt();s!==o?(Et=e,e=r=de(n)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u;return xt[l]={nextPos:St,result:e},e}function Jt(){var e,t=49*St+31,r=xt[t];return r?(St=r.nextPos,r.result):((e=nr())===o&&(e=or())===o&&(e=Nt()),xt[t]={nextPos:St,result:e},e)}function er(){var e,r,n,i,a,s,c,l,f,p,d,h=49*St+33,y=xt[h];if(y)return St=y.nextPos,y.result;for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if((n=Mt())!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if(61===t.charCodeAt(St)?(a=k,St++):(a=o,0===_t&&Bt(O)),a!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();if(s!==o)if((c=qt())!==o){for(l=[],f=nr();f!==o;)l.push(f),f=nr();if(l!==o)if(44===t.charCodeAt(St)?(f=he,St++):(f=o,0===_t&&Bt(ye)),f!==o){for(p=[],d=nr();d!==o;)p.push(d),d=nr();p!==o?(Et=e,e=r=Se(n,c)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u;if(e===o){for(e=St,r=[],n=nr();n!==o;)r.push(n),n=nr();if(r!==o)if((n=Mt())!==o){for(i=[],a=nr();a!==o;)i.push(a),a=nr();if(i!==o)if(61===t.charCodeAt(St)?(a=k,St++):(a=o,0===_t&&Bt(O)),a!==o){for(s=[],c=nr();c!==o;)s.push(c),c=nr();s!==o&&(c=qt())!==o?(Et=e,e=r=Se(n,c)):(St=e,e=u)}else St=e,e=u;else St=e,e=u}else St=e,e=u;else St=e,e=u}return xt[h]={nextPos:St,result:e},e}function tr(){var e,r,n,i=49*St+34,a=xt[i];return a?(St=a.nextPos,a.result):(e=St,46===t.charCodeAt(St)?(r=E,St++):(r=o,0===_t&&Bt(T)),r!==o&&(n=lr())!==o?(Et=e,e=r=Ee(n)):(St=e,e=u),xt[i]={nextPos:St,result:e},e)}function rr(){var e,r,n,i,a,s,c,l,f,p,d,h,y=49*St+35,m=xt[y];return m?(St=m.nextPos,m.result):(e=St,r=St,(n=ur())!==o&&(i=ur())!==o&&(a=ur())!==o&&(s=ur())!==o?(45===t.charCodeAt(St)?(c=J,St++):(c=o,0===_t&&Bt(ee)),c!==o&&(l=ur())!==o&&(f=ur())!==o?(45===t.charCodeAt(St)?(p=J,St++):(p=o,0===_t&&Bt(ee)),p!==o&&(d=ur())!==o&&(h=ur())!==o?r=n=[n,i,a,s,c,l,f,p,d,h]:(St=r,r=u)):(St=r,r=u)):(St=r,r=u),r!==o&&(Et=e,r=Te(r)),e=r,xt[y]={nextPos:St,result:e},e)}function nr(){var e,r=49*St+39,n=xt[r];return n?(St=n.nextPos,n.result):(Ce.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===_t&&Bt(je)),xt[r]={nextPos:St,result:e},e)}function or(){var e,r,n,i=49*St+40,a=xt[i];return a?(St=a.nextPos,a.result):(10===t.charCodeAt(St)?(e=Ue,St++):(e=o,0===_t&&Bt(Ne)),e===o&&(e=St,13===t.charCodeAt(St)?(r=Le,St++):(r=o,0===_t&&Bt(De)),r!==o?(10===t.charCodeAt(St)?(n=Ue,St++):(n=o,0===_t&&Bt(Ne)),n!==o?e=r=[r,n]:(St=e,e=u)):(St=e,e=u)),xt[i]={nextPos:St,result:e},e)}function ir(){var e,t=49*St+41,r=xt[t];return r?(St=r.nextPos,r.result):((e=or())===o&&(e=nr()),xt[t]={nextPos:St,result:e},e)}function ar(){var e,r,n=49*St+42,i=xt[n];return i?(St=i.nextPos,i.result):(e=St,_t++,t.length>St?(r=t.charAt(St),St++):(r=o,0===_t&&Bt(p)),_t--,r===o?e=f:(St=e,e=u),xt[n]={nextPos:St,result:e},e)}function sr(){var e,r=49*St+43,n=xt[r];return n?(St=n.nextPos,n.result):(Fe.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===_t&&Bt(Me)),xt[r]={nextPos:St,result:e},e)}function ur(){var e,r,n=49*St+44,i=xt[n];return i?(St=i.nextPos,i.result):(Ve.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===_t&&Bt(qe)),e===o&&(e=St,95===t.charCodeAt(St)?(r=He,St++):(r=o,0===_t&&Bt(ze)),r!==o&&(Et=e,r=Ke()),e=r),xt[n]={nextPos:St,result:e},e)}function cr(){var e,r=49*St+45,n=xt[r];return n?(St=n.nextPos,n.result):(Xe.test(t.charAt(St))?(e=t.charAt(St),St++):(e=o,0===_t&&Bt($e)),xt[r]={nextPos:St,result:e},e)}function lr(){var e,t,r,n=49*St+46,i=xt[n];if(i)return St=i.nextPos,i.result;if(e=St,t=[],(r=ur())!==o)for(;r!==o;)t.push(r),r=ur();else t=u;return t!==o&&(Et=e,t=Ge(t)),e=t,xt[n]={nextPos:St,result:e},e}function fr(){var e,r,n=49*St+47,i=xt[n];return i?(St=i.nextPos,i.result):(e=St,t.substr(St,2)===We?(r=We,St+=2):(r=o,0===_t&&Bt(Qe)),r!==o&&(Et=e,r=Ze()),(e=r)===o&&(e=St,t.substr(St,2)===Ye?(r=Ye,St+=2):(r=o,0===_t&&Bt(Je)),r!==o&&(Et=e,r=et()),(e=r)===o&&(e=St,t.substr(St,2)===tt?(r=tt,St+=2):(r=o,0===_t&&Bt(rt)),r!==o&&(Et=e,r=nt()),(e=r)===o&&(e=St,t.substr(St,2)===ot?(r=ot,St+=2):(r=o,0===_t&&Bt(it)),r!==o&&(Et=e,r=at()),(e=r)===o&&(e=St,t.substr(St,2)===st?(r=st,St+=2):(r=o,0===_t&&Bt(ut)),r!==o&&(Et=e,r=ct()),(e=r)===o&&(e=St,t.substr(St,2)===lt?(r=lt,St+=2):(r=o,0===_t&&Bt(ft)),r!==o&&(Et=e,r=pt()),(e=r)===o&&(e=St,t.substr(St,2)===dt?(r=dt,St+=2):(r=o,0===_t&&Bt(ht)),r!==o&&(Et=e,r=yt()),(e=r)===o&&(e=function(){var e,r,n,i,a,s,c,l,f,p,d,h=49*St+48,y=xt[h];if(y)return St=y.nextPos,y.result;e=St,t.substr(St,2)===mt?(r=mt,St+=2):(r=o,0===_t&&Bt(gt));r!==o?(n=St,(i=sr())!==o&&(a=sr())!==o&&(s=sr())!==o&&(c=sr())!==o&&(l=sr())!==o&&(f=sr())!==o&&(p=sr())!==o&&(d=sr())!==o?n=i=[i,a,s,c,l,f,p,d]:(St=n,n=u),n!==o?(Et=e,e=r=vt(n)):(St=e,e=u)):(St=e,e=u);e===o&&(e=St,t.substr(St,2)===bt?(r=bt,St+=2):(r=o,0===_t&&Bt(wt)),r!==o?(n=St,(i=sr())!==o&&(a=sr())!==o&&(s=sr())!==o&&(c=sr())!==o?n=i=[i,a,s,c]:(St=n,n=u),n!==o?(Et=e,e=r=vt(n)):(St=e,e=u)):(St=e,e=u));return xt[h]={nextPos:St,result:e},e}()))))))),xt[n]={nextPos:St,result:e},e)}var pr=[];function dr(e){pr.push(e)}function hr(e,t,r,n,o){var i={type:e,value:t,line:r(),column:n()};return o&&(i.key=o),i}if((r=a())!==o&&St===t.length)return r;throw r!==o&&St<t.length&&Bt({type:"end",description:"end of input"}),Ct(null,At,Ot)}}}()},600:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>{},FEDERATION_RESPONSE_MAX_SIZE:()=>b,Server:()=>w});var n=r(950),o=r(193),i=r.n(o),a=r(732),s=r(976),u=r(898),c=r(371);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function d(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return h(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(h(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,h(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,h(f,"constructor",c),h(c,"constructor",u),u.displayName="GeneratorFunction",h(c,o,"GeneratorFunction"),h(f),h(f,o,"Generator"),h(f,n,function(){return this}),h(f,"toString",function(){return"[object Generator]"}),(d=function(){return{w:i,m:p}})()}function h(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}h=function(e,t,r,n){function i(t,r){h(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},h(e,t,r,n)}function y(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function m(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){y(i,n,o,a,s,"next",e)}function s(e){y(i,n,o,a,s,"throw",e)}a(void 0)})}}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function v(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}var b=102400,w=function(){function e(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=i()(t),this.domain=r;var o=void 0===n.allowHttp?a.T.isAllowHttp():n.allowHttp;if(this.timeout=void 0===n.timeout?a.T.getTimeout():n.timeout,"https"!==this.serverURL.protocol()&&!o)throw new Error("Cannot connect to insecure federation server")}return t=e,r=[{key:"resolveAddress",value:(w=m(d().m(function e(t){var r,n;return d().w(function(e){for(;;)switch(e.n){case 0:if(r=t,!(t.indexOf("*")<0)){e.n=2;break}if(this.domain){e.n=1;break}return e.a(2,Promise.reject(new Error("Unknown domain. Make sure `address` contains a domain (ex. `bob*stellar.org`) or pass `domain` parameter when instantiating the server object.")));case 1:r="".concat(t,"*").concat(this.domain);case 2:return n=this.serverURL.query({type:"name",q:r}),e.a(2,this._sendRequest(n))}},e,this)})),function(e){return w.apply(this,arguments)})},{key:"resolveAccountId",value:(v=m(d().m(function e(t){var r;return d().w(function(e){for(;;)if(0===e.n)return r=this.serverURL.query({type:"id",q:t}),e.a(2,this._sendRequest(r))},e,this)})),function(e){return v.apply(this,arguments)})},{key:"resolveTransactionId",value:(y=m(d().m(function e(t){var r;return d().w(function(e){for(;;)if(0===e.n)return r=this.serverURL.query({type:"txid",q:t}),e.a(2,this._sendRequest(r))},e,this)})),function(e){return y.apply(this,arguments)})},{key:"_sendRequest",value:(h=m(d().m(function e(t){var r;return d().w(function(e){for(;;)if(0===e.n)return r=this.timeout,e.a(2,c.ok.get(t.toString(),{maxContentLength:b,timeout:r}).then(function(e){if(void 0!==e.data.memo&&"string"!=typeof e.data.memo)throw new Error("memo value should be of type string");return e.data}).catch(function(e){if(e instanceof Error){if(e.message.match(/^maxContentLength size/))throw new Error("federation response exceeds allowed size of ".concat(b));return Promise.reject(e)}return Promise.reject(new s.nS("Server query failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))}))},e,this)})),function(e){return h.apply(this,arguments)})}],o=[{key:"resolve",value:(p=m(d().m(function t(r){var o,i,a,s,u,c=arguments;return d().w(function(t){for(;;)switch(t.n){case 0:if(o=c.length>1&&void 0!==c[1]?c[1]:{},!(r.indexOf("*")<0)){t.n=2;break}if(n.StrKey.isValidEd25519PublicKey(r)){t.n=1;break}return t.a(2,Promise.reject(new Error("Invalid Account ID")));case 1:return t.a(2,Promise.resolve({account_id:r}));case 2:if(i=r.split("*"),a=f(i,2),s=a[1],2===i.length&&s){t.n=3;break}return t.a(2,Promise.reject(new Error("Invalid Stellar address")));case 3:return t.n=4,e.createForDomain(s,o);case 4:return u=t.v,t.a(2,u.resolveAddress(r))}},t)})),function(e){return p.apply(this,arguments)})},{key:"createForDomain",value:(l=m(d().m(function t(r){var n,o,i=arguments;return d().w(function(t){for(;;)switch(t.n){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.n=1,u.Resolver.resolve(r,n);case 1:if((o=t.v).FEDERATION_SERVER){t.n=2;break}return t.a(2,Promise.reject(new Error("stellar.toml does not contain FEDERATION_SERVER field")));case 2:return t.a(2,new e(o.FEDERATION_SERVER,r,n))}},t)})),function(e){return l.apply(this,arguments)})}],r&&g(t.prototype,r),o&&g(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,o,l,p,h,y,v,w}()},680:(e,t,r)=>{"use strict";r.d(t,{X:()=>a});var n=r(950),o=r(76),i=r(784);function a(e,t){if("innerTransaction"in e)return a(e.innerTransaction,t);if(!function(e){if(1!==e.operations.length)return!1;switch(e.operations[0].type){case"invokeHostFunction":case"extendFootprintTtl":case"restoreFootprint":return!0;default:return!1}}(e))throw new TypeError("unsupported transaction: must contain exactly one invokeHostFunction, extendFootprintTtl, or restoreFootprint operation");var r=(0,i.jr)(t);if(!o.j.isSimulationSuccess(r))throw new Error("simulation incorrect: ".concat(JSON.stringify(r)));var s=parseInt(e.fee)||0,u=parseInt(r.minResourceFee)||0,c=n.TransactionBuilder.cloneFrom(e,{fee:(s+u).toString(),sorobanData:r.transactionData.build(),networkPassphrase:e.networkPassphrase});if("invokeHostFunction"===e.operations[0].type){var l;c.clearOperations();var f=e.operations[0],p=null!==(l=f.auth)&&void 0!==l?l:[];c.addOperation(n.Operation.invokeHostFunction({source:f.source,func:f.func,auth:p.length>0?p:r.result.auth}))}return c}},704:function(e,t,r){var n,o;!function(i,a){"use strict";e.exports?e.exports=a():void 0===(o="function"==typeof(n=a)?n.call(t,r,t,e):n)||(e.exports=o)}(0,function(e){"use strict";var t=e&&e.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var o=r.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var o=r.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r})},708:e=>{"use strict";e.exports={compile:function(e){var t=[],r=[],n="",o=Object.create(null),i=o;return function(e){for(var t,r=0;r<e.length;r++)switch((t=e[r]).type){case"Assign":s(t);break;case"ObjectPath":f(t);break;case"ArrayPath":p(t)}return o}(e);function a(e,t,r){var n=new Error(e);throw n.line=t,n.column=r,n}function s(e){var o,s=e.key,l=e.value,f=e.line,p=e.column;o=n?n+"."+s:s,void 0!==i[s]&&a("Cannot redefine existing key '"+o+"'.",f,p),i[s]=c(l),u(o)||(t.push(o),r.push(o))}function u(e){return-1!==t.indexOf(e)}function c(e){return"Array"===e.type?function(e){for(var t=null,r=0;r<e.length;r++){var n=e[r];null===t?t=n.type:n.type!==t&&a("Cannot add value of type "+n.type+" to array of type "+t+".",n.line,n.column)}return e.map(c)}(e.value):"InlineTable"===e.type?l(e.value):e.value}function l(e){for(var t=Object.create(null),r=0;r<e.length;r++){var n=e[r];"InlineTable"===n.value.type?t[n.key]=l(n.value.value):"InlineTableValue"===n.type&&(t[n.key]=c(n.value))}return t}function f(e){var r=e.value,s=r.map(h).join("."),c=e.line,l=e.column;u(s)&&a("Cannot redefine existing key '"+r+"'.",c,l),t.push(s),i=d(o,r,Object.create(null),c,l),n=r}function p(e){var r=e.value,s=r.map(h).join("."),c=e.line,l=e.column;if(u(s)||t.push(s),(t=t.filter(function(e){return 0!==e.indexOf(s)})).push(s),i=d(o,r,[],c,l),n=s,i instanceof Array){var f=Object.create(null);i.push(f),i=f}else a("Cannot redefine existing key '"+r+"'.",c,l)}function d(e,t,n,o,i){for(var s=[],u="",c=(t.join("."),e),l=0;l<t.length;l++){var f=t[l];s.push(f),u=s.join("."),void 0===c[f]?l===t.length-1?c[f]=n:c[f]=Object.create(null):l!==t.length-1&&r.indexOf(u)>-1&&a("Cannot redefine existing key '"+u+"'.",o,i),(c=c[f])instanceof Array&&c.length&&l<t.length-1&&(c=c[c.length-1])}return c}function h(e){return e.indexOf(".")>-1?'"'+e+'"':e}}}},732:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}r.d(t,{T:()=>h});var c,l,f,p={allowHttp:!1,timeout:0},d=a({},p),h=(c=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},f=[{key:"setAllowHttp",value:function(e){d.allowHttp=e}},{key:"setTimeout",value:function(e){d.timeout=e}},{key:"isAllowHttp",value:function(){return d.allowHttp}},{key:"getTimeout",value:function(){return d.timeout}},{key:"setDefault",value:function(){d=a({},p)}}],(l=null)&&o(c.prototype,l),f&&o(c,f),Object.defineProperty(c,"prototype",{writable:!1}),c)},733:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{AccountResponse:()=>m,AxiosClient:()=>G,HorizonApi:()=>n,SERVER_TIME_MAP:()=>K,Server:()=>Gr,ServerApi:()=>i,default:()=>Wr,getCurrentServerTime:()=>W}),function(e){var t=function(e){return e.constantProduct="constant_product",e}({});e.LiquidityPoolType=t;var r=function(e){return e.createAccount="create_account",e.payment="payment",e.pathPayment="path_payment_strict_receive",e.createPassiveOffer="create_passive_sell_offer",e.manageOffer="manage_sell_offer",e.setOptions="set_options",e.changeTrust="change_trust",e.allowTrust="allow_trust",e.accountMerge="account_merge",e.inflation="inflation",e.manageData="manage_data",e.bumpSequence="bump_sequence",e.manageBuyOffer="manage_buy_offer",e.pathPaymentStrictSend="path_payment_strict_send",e.createClaimableBalance="create_claimable_balance",e.claimClaimableBalance="claim_claimable_balance",e.beginSponsoringFutureReserves="begin_sponsoring_future_reserves",e.endSponsoringFutureReserves="end_sponsoring_future_reserves",e.revokeSponsorship="revoke_sponsorship",e.clawback="clawback",e.clawbackClaimableBalance="clawback_claimable_balance",e.setTrustLineFlags="set_trust_line_flags",e.liquidityPoolDeposit="liquidity_pool_deposit",e.liquidityPoolWithdraw="liquidity_pool_withdraw",e.invokeHostFunction="invoke_host_function",e.bumpFootprintExpiration="bump_footprint_expiration",e.restoreFootprint="restore_footprint",e}({});e.OperationResponseType=r;var n=function(e){return e[e.createAccount=0]="createAccount",e[e.payment=1]="payment",e[e.pathPayment=2]="pathPayment",e[e.createPassiveOffer=3]="createPassiveOffer",e[e.manageOffer=4]="manageOffer",e[e.setOptions=5]="setOptions",e[e.changeTrust=6]="changeTrust",e[e.allowTrust=7]="allowTrust",e[e.accountMerge=8]="accountMerge",e[e.inflation=9]="inflation",e[e.manageData=10]="manageData",e[e.bumpSequence=11]="bumpSequence",e[e.manageBuyOffer=12]="manageBuyOffer",e[e.pathPaymentStrictSend=13]="pathPaymentStrictSend",e[e.createClaimableBalance=14]="createClaimableBalance",e[e.claimClaimableBalance=15]="claimClaimableBalance",e[e.beginSponsoringFutureReserves=16]="beginSponsoringFutureReserves",e[e.endSponsoringFutureReserves=17]="endSponsoringFutureReserves",e[e.revokeSponsorship=18]="revokeSponsorship",e[e.clawback=19]="clawback",e[e.clawbackClaimableBalance=20]="clawbackClaimableBalance",e[e.setTrustLineFlags=21]="setTrustLineFlags",e[e.liquidityPoolDeposit=22]="liquidityPoolDeposit",e[e.liquidityPoolWithdraw=23]="liquidityPoolWithdraw",e[e.invokeHostFunction=24]="invokeHostFunction",e[e.bumpFootprintExpiration=25]="bumpFootprintExpiration",e[e.restoreFootprint=26]="restoreFootprint",e}({});e.OperationResponseTypeI=n;var o=function(e){return e.TX_FAILED="tx_failed",e.TX_BAD_SEQ="tx_bad_seq",e.TX_BAD_AUTH="tx_bad_auth",e.TX_BAD_AUTH_EXTRA="tx_bad_auth_extra",e.TX_FEE_BUMP_INNER_SUCCESS="tx_fee_bump_inner_success",e.TX_FEE_BUMP_INNER_FAILED="tx_fee_bump_inner_failed",e.TX_NOT_SUPPORTED="tx_not_supported",e.TX_SUCCESS="tx_success",e.TX_TOO_EARLY="tx_too_early",e.TX_TOO_LATE="tx_too_late",e.TX_MISSING_OPERATION="tx_missing_operation",e.TX_INSUFFICIENT_BALANCE="tx_insufficient_balance",e.TX_NO_SOURCE_ACCOUNT="tx_no_source_account",e.TX_INSUFFICIENT_FEE="tx_insufficient_fee",e.TX_INTERNAL_ERROR="tx_internal_error",e}({});e.TransactionFailedResultCodes=o}(n||(n={}));var o,i,a=((o={})[o.account_created=0]="account_created",o[o.account_removed=1]="account_removed",o[o.account_credited=2]="account_credited",o[o.account_debited=3]="account_debited",o[o.account_thresholds_updated=4]="account_thresholds_updated",o[o.account_home_domain_updated=5]="account_home_domain_updated",o[o.account_flags_updated=6]="account_flags_updated",o[o.account_inflation_destination_updated=7]="account_inflation_destination_updated",o[o.signer_created=10]="signer_created",o[o.signer_removed=11]="signer_removed",o[o.signer_updated=12]="signer_updated",o[o.trustline_created=20]="trustline_created",o[o.trustline_removed=21]="trustline_removed",o[o.trustline_updated=22]="trustline_updated",o[o.trustline_authorized=23]="trustline_authorized",o[o.trustline_deauthorized=24]="trustline_deauthorized",o[o.trustline_authorized_to_maintain_liabilities=25]="trustline_authorized_to_maintain_liabilities",o[o.trustline_flags_updated=26]="trustline_flags_updated",o[o.offer_created=30]="offer_created",o[o.offer_removed=31]="offer_removed",o[o.offer_updated=32]="offer_updated",o[o.trade=33]="trade",o[o.data_created=40]="data_created",o[o.data_removed=41]="data_removed",o[o.data_updated=42]="data_updated",o[o.sequence_bumped=43]="sequence_bumped",o[o.claimable_balance_created=50]="claimable_balance_created",o[o.claimable_balance_claimant_created=51]="claimable_balance_claimant_created",o[o.claimable_balance_claimed=52]="claimable_balance_claimed",o[o.account_sponsorship_created=60]="account_sponsorship_created",o[o.account_sponsorship_updated=61]="account_sponsorship_updated",o[o.account_sponsorship_removed=62]="account_sponsorship_removed",o[o.trustline_sponsorship_created=63]="trustline_sponsorship_created",o[o.trustline_sponsorship_updated=64]="trustline_sponsorship_updated",o[o.trustline_sponsorship_removed=65]="trustline_sponsorship_removed",o[o.data_sponsorship_created=66]="data_sponsorship_created",o[o.data_sponsorship_updated=67]="data_sponsorship_updated",o[o.data_sponsorship_removed=68]="data_sponsorship_removed",o[o.claimable_balance_sponsorship_created=69]="claimable_balance_sponsorship_created",o[o.claimable_balance_sponsorship_updated=70]="claimable_balance_sponsorship_updated",o[o.claimable_balance_sponsorship_removed=71]="claimable_balance_sponsorship_removed",o[o.signer_sponsorship_created=72]="signer_sponsorship_created",o[o.signer_sponsorship_updated=73]="signer_sponsorship_updated",o[o.signer_sponsorship_removed=74]="signer_sponsorship_removed",o[o.claimable_balance_clawed_back=80]="claimable_balance_clawed_back",o[o.liquidity_pool_deposited=90]="liquidity_pool_deposited",o[o.liquidity_pool_withdrew=91]="liquidity_pool_withdrew",o[o.liquidity_pool_trade=92]="liquidity_pool_trade",o[o.liquidity_pool_created=93]="liquidity_pool_created",o[o.liquidity_pool_removed=94]="liquidity_pool_removed",o[o.liquidity_pool_revoked=95]="liquidity_pool_revoked",o[o.contract_credited=96]="contract_credited",o[o.contract_debited=97]="contract_debited",o);!function(e){e.EffectType=a;var t=function(e){return e.all="all",e.liquidityPools="liquidity_pool",e.orderbook="orderbook",e}({});e.TradeType=t;n.OperationResponseType,n.OperationResponseTypeI}(i||(i={}));var s=r(950);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function p(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}var d,h,y,m=(d=function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._baseAccount=new s.Account(t.account_id,t.sequence),Object.entries(t).forEach(function(e){var t=c(e,2),n=t[0],o=t[1];r[n]=o})},(h=[{key:"accountId",value:function(){return this._baseAccount.accountId()}},{key:"sequenceNumber",value:function(){return this._baseAccount.sequenceNumber()}},{key:"incrementSequenceNumber",value:function(){this._baseAccount.incrementSequenceNumber(),this.sequence=this._baseAccount.sequenceNumber()}}])&&f(d.prototype,h),y&&f(d,y),Object.defineProperty(d,"prototype",{writable:!1}),d),g=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,v=Math.ceil,b=Math.floor,w="[BigNumber Error] ",S=w+"Number primitive has more than 15 significant digits: ",E=1e14,T=14,k=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],A=1e7,_=1e9;function x(e){var t=0|e;return e>0||e===t?t:t-1}function P(e){for(var t,r,n=1,o=e.length,i=e[0]+"";n<o;){for(t=e[n++]+"",r=T-t.length;r--;t="0"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function I(e,t){var r,n,o=e.c,i=t.c,a=e.s,s=t.s,u=e.e,c=t.e;if(!a||!s)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function R(e,t,r,n){if(e<t||e>r||e!==b(e))throw Error(w+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function B(e){var t=e.c.length-1;return x(e.e/T)==t&&e.c[t]%2!=0}function C(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function j(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var U=function e(t){var r,n,o,i,a,s,u,c,l,f,p=z.prototype={constructor:z,toString:null,valueOf:null},d=new z(1),h=20,y=4,m=-7,U=21,N=-1e7,L=1e7,D=!1,F=1,M=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},q="0123456789abcdefghijklmnopqrstuvwxyz",H=!0;function z(e,t){var r,i,a,s,u,c,l,f,p=this;if(!(p instanceof z))return new z(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>L?p.c=p.e=null:e.e<N?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,u=e;u>=10;u/=10,s++);return void(s>L?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!g.test(f=String(e)))return o(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(s<0&&(s=u),s+=+f.slice(u+1),f=f.substring(0,u)):s<0&&(s=f.length)}else{if(R(t,2,q.length,"Base"),10==t&&H)return G(p=new z(e),h+p.e+1,y);if(f=String(e),c="number"==typeof e){if(0*e!=0)return o(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,z.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(S+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=q.slice(0,t),s=u=0,l=f.length;u<l;u++)if(r.indexOf(i=f.charAt(u))<0){if("."==i){if(u>s){s=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,u=-1,s=0;continue}return o(p,String(e),c,t)}c=!1,(s=(f=n(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(u=0;48===f.charCodeAt(u);u++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(u,++l)){if(l-=u,c&&z.DEBUG&&l>15&&(e>k||e!==b(e)))throw Error(S+p.s*e);if((s=s-u-1)>L)p.c=p.e=null;else if(s<N)p.c=[p.e=0];else{if(p.e=s,p.c=[],u=(s+1)%T,s<0&&(u+=T),u<l){for(u&&p.c.push(+f.slice(0,u)),l-=T;u<l;)p.c.push(+f.slice(u,u+=T));u=T-(f=f.slice(u)).length}else u-=l;for(;u--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function K(e,t,r,n){var o,i,a,s,u;if(null==r?r=y:R(r,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)u=P(e.c),u=1==n||2==n&&(a<=m||a>=U)?C(u,a):j(u,a,"0");else if(i=(e=G(new z(e),t,r)).e,s=(u=P(e.c)).length,1==n||2==n&&(t<=i||i<=m)){for(;s<t;u+="0",s++);u=C(u,i)}else if(t-=a+(2===n&&i>a),u=j(u,i,"0"),i+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function X(e,t){for(var r,n,o=1,i=new z(e[0]);o<e.length;o++)(!(n=new z(e[o])).s||(r=I(i,n))===t||0===r&&i.s===t)&&(i=n);return i}function $(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*T-1)>L?e.c=e.e=null:r<N?e.c=[e.e=0]:(e.e=r,e.c=t),e}function G(e,t,r,n){var o,i,a,s,u,c,l,f=e.c,p=O;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=T,a=t,u=f[c=0],l=b(u/p[o-a-1]%10);else if((c=v((i+1)/T))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));u=l=0,o=1,a=(i%=T)-T+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);l=(a=(i%=T)-T+o)<0?0:b(u/p[o-a-1]%10)}if(n=n||t<0||null!=f[c+1]||(a<0?u:u%p[o-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(T-t%T)%T],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[T-i],f[c]=a>0?b(u/p[o-a]%p[a])*s:0),n)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==E&&(f[0]=1));break}if(f[c]+=s,f[c]!=E)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>L?e.c=e.e=null:e.e<N&&(e.c=[e.e=0])}return e}function W(e){var t,r=e.e;return null===r?e.toString():(t=P(e.c),t=r<=m||r>=U?C(t,r):j(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(w+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(R(r=e[t],0,_,t),h=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(R(r=e[t],0,8,t),y=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(R(r[0],-_,0,t),R(r[1],0,_,t),m=r[0],U=r[1]):(R(r,-_,_,t),m=-(U=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)R(r[0],-_,-1,t),R(r[1],1,_,t),N=r[0],L=r[1];else{if(R(r,-_,_,t),!r)throw Error(w+t+" cannot be zero: "+r);N=-(L=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(w+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw D=!r,Error(w+"crypto unavailable");D=r}else D=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(R(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(R(r=e[t],0,_,t),M=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(w+t+" not an object: "+r);V=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(w+t+" invalid: "+r);H="0123456789"==r.slice(0,10),q=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:y,EXPONENTIAL_AT:[m,U],RANGE:[N,L],CRYPTO:D,MODULO_MODE:F,POW_PRECISION:M,FORMAT:V,ALPHABET:q}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-_&&o<=_&&o===b(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%T)<1&&(t+=T),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=E||r!==b(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(w+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return X(arguments,-1)},z.minimum=z.min=function(){return X(arguments,1)},z.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return b(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,u=[],c=new z(d);if(null==e?e=h:R(e,0,_),o=v(e/T),D)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(u.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw D=!1,Error(w+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(u.push(i%1e14),s+=7);s=o/7}if(!D)for(;s<o;)(i=a())<9e15&&(u[s++]=i%1e14);for(o=u[--s],e%=T,o&&e&&(i=O[T-e],u[s]=b(o/i)*i);0===u[s];u.pop(),s--);if(s<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=T);for(s=1,i=u[0];i>=10;i/=10,s++);s<T&&(n-=T-s)}return c.e=n,c.c=u,c}),z.sum=function(){for(var e=1,t=arguments,r=new z(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var o,i,a=[0],s=0,u=e.length;s<u;){for(i=a.length;i--;a[i]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>r-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,p,d,m,g,v=n.indexOf("."),b=h,w=y;for(v>=0&&(f=M,M=0,n=n.replace(".",""),d=(g=new z(o)).pow(n.length-v),M=f,g.c=t(j(P(d.c),d.e,"0"),10,i,e),g.e=g.c.length),l=f=(m=t(n,o,i,s?(u=q,e):(u=e,q))).length;0==m[--f];m.pop());if(!m[0])return u.charAt(0);if(v<0?--l:(d.c=m,d.e=l,d.s=a,m=(d=r(d,g,b,w,i)).c,p=d.r,l=d.e),v=m[c=l+b+1],f=i/2,p=p||c<0||null!=m[c+1],p=w<4?(null!=v||p)&&(0==w||w==(d.s<0?3:2)):v>f||v==f&&(4==w||p||6==w&&1&m[c-1]||w==(d.s<0?8:7)),c<1||!m[0])n=p?j(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(m.length=c,p)for(--i;++m[--c]>i;)m[c]=0,c||(++l,m=[1].concat(m));for(f=m.length;!m[--f];);for(v=0,n="";v<=f;n+=u.charAt(m[v++]));n=j(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%A,l=t/A|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%A)+(n=l*i+(a=e[u]/A|0)*c)%A*A+s)/r|0)+(n/A|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,i,a,s){var u,c,l,f,p,d,h,y,m,g,v,w,S,k,O,A,_,P=n.s==o.s?1:-1,I=n.c,R=o.c;if(!(I&&I[0]&&R&&R[0]))return new z(n.s&&o.s&&(I?!R||I[0]!=R[0]:R)?I&&0==I[0]||!R?0*P:P/0:NaN);for(m=(y=new z(P)).c=[],P=i+(c=n.e-o.e)+1,s||(s=E,c=x(n.e/T)-x(o.e/T),P=P/T|0),l=0;R[l]==(I[l]||0);l++);if(R[l]>(I[l]||0)&&c--,P<0)m.push(1),f=!0;else{for(k=I.length,A=R.length,l=0,P+=2,(p=b(s/(R[0]+1)))>1&&(R=e(R,p,s),I=e(I,p,s),A=R.length,k=I.length),S=A,v=(g=I.slice(0,A)).length;v<A;g[v++]=0);_=R.slice(),_=[0].concat(_),O=R[0],R[1]>=s/2&&O++;do{if(p=0,(u=t(R,g,A,v))<0){if(w=g[0],A!=v&&(w=w*s+(g[1]||0)),(p=b(w/O))>1)for(p>=s&&(p=s-1),h=(d=e(R,p,s)).length,v=g.length;1==t(d,g,h,v);)p--,r(d,A<h?_:R,h,s),h=d.length,u=1;else 0==p&&(u=p=1),h=(d=R.slice()).length;if(h<v&&(d=[0].concat(d)),r(g,d,v,s),v=g.length,-1==u)for(;t(R,g,A,v)<1;)p++,r(g,A<v?_:R,v,s),v=g.length}else 0===u&&(p++,g=[0]);m[l++]=p,g[0]?g[v++]=I[S]||0:(g=[I[S]],v=1)}while((S++<k||null!=g[0])&&P--);f=null!=g[0],m[0]||m.splice(0,1)}if(s==E){for(l=1,P=m[0];P>=10;P/=10,l++);G(y,i+(y.e=l+c*T-1)+1,a,f)}else y.e=c,y.r=+f;return y}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(f,"");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(s,function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t}),n&&(o=n,i=i.replace(u,"$1").replace(c,"0.$1")),t!=i))return new z(i,o);if(z.DEBUG)throw Error(w+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},p.absoluteValue=p.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},p.comparedTo=function(e,t){return I(this,new z(e,t))},p.decimalPlaces=p.dp=function(e,t){var r,n,o,i=this;if(null!=e)return R(e,0,_),null==t?t=y:R(t,0,8),G(new z(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-x(this.e/T))*T,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},p.dividedBy=p.div=function(e,t){return r(this,new z(e,t),h,y)},p.dividedToIntegerBy=p.idiv=function(e,t){return r(this,new z(e,t),0,1)},p.exponentiatedBy=p.pow=function(e,t){var r,n,o,i,a,s,u,c,l=this;if((e=new z(e)).c&&!e.isInteger())throw Error(w+"Exponent not an integer: "+W(e));if(null!=t&&(t=new z(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new z(Math.pow(+W(l),a?e.s*(2-B(e)):+W(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&B(e)?-0:0,l.e>-1&&(i=1/i),new z(s?1/i:i);M&&(i=v(M/T+2))}for(a?(r=new z(.5),s&&(e.s=1),u=B(e)):u=(o=Math.abs(+W(e)))%2,c=new z(d);;){if(u){if(!(c=c.times(l)).c)break;i?c.c.length>i&&(c.c.length=i):n&&(c=c.mod(t))}if(o){if(0===(o=b(o/2)))break;u=o%2}else if(G(e=e.times(r),e.e+1,1),e.e>14)u=B(e);else{if(0===(o=+W(e)))break;u=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}return n?c:(s&&(c=d.div(c)),t?c.mod(t):i?G(c,M,y,undefined):c)},p.integerValue=function(e){var t=new z(this);return null==e?e=y:R(e,0,8),G(t,t.e+1,e)},p.isEqualTo=p.eq=function(e,t){return 0===I(this,new z(e,t))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(e,t){return I(this,new z(e,t))>0},p.isGreaterThanOrEqualTo=p.gte=function(e,t){return 1===(t=I(this,new z(e,t)))||0===t},p.isInteger=function(){return!!this.c&&x(this.e/T)>this.c.length-2},p.isLessThan=p.lt=function(e,t){return I(this,new z(e,t))<0},p.isLessThanOrEqualTo=p.lte=function(e,t){return-1===(t=I(this,new z(e,t)))||0===t},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new z(e,t)).s,!s||!t)return new z(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/T,c=e.e/T,l=a.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new z(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new z(l[0]?a:3==y?-0:0)}if(u=x(u),c=x(c),l=l.slice(),s=u-c){for((i=s<0)?(s=-s,o=l):(c=u,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(l[t]!=f[t]){i=l[t]<f[t];break}if(i&&(o=l,l=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=E-1;n>s;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=E}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?$(e,l,c):(e.s=3==y?-1:1,e.c=[e.e=0],e)},p.modulo=p.mod=function(e,t){var n,o,i=this;return e=new z(e,t),!i.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||i.c&&!i.c[0]?new z(i):(9==F?(o=e.s,e.s=1,n=r(i,e,0,3),e.s=o,n.s*=o):n=r(i,e,0,F),(e=i.minus(n.times(e))).c[0]||1!=F||(e.s=i.s),e)},p.multipliedBy=p.times=function(e,t){var r,n,o,i,a,s,u,c,l,f,p,d,h,y,m,g=this,v=g.c,b=(e=new z(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!g.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=g.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=x(g.e/T)+x(e.e/T),e.s*=g.s,(u=v.length)<(f=b.length)&&(h=v,v=b,b=h,o=u,u=f,f=o),o=u+f,h=[];o--;h.push(0));for(y=E,m=A,o=f;--o>=0;){for(r=0,p=b[o]%m,d=b[o]/m|0,i=o+(a=u);i>o;)r=((c=p*(c=v[--a]%m)+(s=d*c+(l=v[a]/m|0)*p)%m*m+h[i]+r)/y|0)+(s/m|0)+d*l,h[i--]=c%y;h[i]=r}return r?++n:h.splice(0,1),$(e,h,n)},p.negated=function(){var e=new z(this);return e.s=-e.s||null,e},p.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new z(e,t)).s,!o||!t)return new z(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/T,a=e.e/T,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new z(o/0);if(!s[0]||!u[0])return u[0]?e:new z(s[0]?n:0*o)}if(i=x(i),a=x(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/E|0,s[t]=E===s[t]?0:s[t]%E;return o&&(s=[o].concat(s),++a),$(e,s,a)},p.precision=p.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return R(e,1,_),null==t?t=y:R(t,0,8),G(new z(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*T+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},p.shiftedBy=function(e){return R(e,-9007199254740991,k),this.times("1e"+e)},p.squareRoot=p.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=h+4,f=new z("0.5");if(1!==u||!s||!s[0])return new z(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+W(a)))||u==1/0?(((t=P(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=x((c+1)/2)-(c<0||c%2),n=new z(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new z(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),P(i.c).slice(0,u)===(t=P(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(n,n.e+h+2,1),e=!n.times(n).eq(a));break}if(!o&&(G(i,i.e+h+2,0),i.times(i).eq(a))){n=i;break}l+=4,u+=4,o=1}return G(n,n.e+h+1,y,e)},p.toExponential=function(e,t){return null!=e&&(R(e,0,_),e++),K(this,e,t,1)},p.toFixed=function(e,t){return null!=e&&(R(e,0,_),e=e+this.e+1),K(this,e,t)},p.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=V;else if("object"!=typeof r)throw Error(w+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var i,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],f=a[1],p=o.s<0,d=p?l.slice(1):l,h=d.length;if(u&&(i=s,s=u,u=i,h-=i),s>0&&h>0){for(i=h%s||s,l=d.substr(0,i);i<h;i+=s)l+=c+d.substr(i,s);u>0&&(l+=c+d.slice(i)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},p.toFraction=function(e){var t,n,o,i,a,s,u,c,l,f,p,h,m=this,g=m.c;if(null!=e&&(!(u=new z(e)).isInteger()&&(u.c||1!==u.s)||u.lt(d)))throw Error(w+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+W(u));if(!g)return new z(m);for(t=new z(d),l=n=new z(d),o=c=new z(d),h=P(g),a=t.e=h.length-m.e-1,t.c[0]=O[(s=a%T)<0?T+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=L,L=1/0,u=new z(h),c.c[0]=0;f=r(u,t,0,1),1!=(i=n.plus(f.times(o))).comparedTo(e);)n=o,o=i,l=c.plus(f.times(i=l)),c=i,t=u.minus(f.times(i=t)),u=i;return i=r(e.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=m.s,p=r(l,o,a*=2,y).minus(m).abs().comparedTo(r(c,n,a,y).minus(m).abs())<1?[l,o]:[c,n],L=s,p},p.toNumber=function(){return+W(this)},p.toPrecision=function(e,t){return null!=e&&R(e,1,_),K(this,e,t,2)},p.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=m||i>=U?C(P(r.c),i):j(P(r.c),i,"0"):10===e&&H?t=j(P((r=G(new z(r),h+i+1,y)).c),r.e,"0"):(R(e,2,q.length,"Base"),t=n(j(P(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},p.valueOf=p.toJSON=function(){return W(this)},p._isBigNumber=!0,p[Symbol.toStringTag]="BigNumber",p[Symbol.for("nodejs.util.inspect.custom")]=p.valueOf,null!=t&&z.set(t),z}();const N=U;var L=r(193),D=r.n(L),F=r(127),M=r.n(F),V=r(976),q=r(371);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}var z="14.1.0",K={},X=(0,q.vt)({headers:{"X-Client-Name":"js-stellar-sdk","X-Client-Version":z}});function $(e){return Math.floor(e/1e3)}X.interceptors.response.use(function(e){var t=D()(e.config.url).hostname(),r=0;if(e.headers instanceof Headers){var n=e.headers.get("date");n&&(r=$(Date.parse(n)))}else if("object"===H(e.headers)&&"date"in e.headers){var o=e.headers;"string"==typeof o.date&&(r=$(Date.parse(o.date)))}var i=$((new Date).getTime());return Number.isNaN(r)||(K[t]={serverTime:r,localTimeRecorded:i}),e});const G=X;function W(e){var t=K[e];if(!t||!t.localTimeRecorded||!t.serverTime)return null;var r=t.serverTime,n=t.localTimeRecorded,o=$((new Date).getTime());return o-n>300?null:o-n+r}function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}function Z(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return Y(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Y(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Y(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Y(f,"constructor",c),Y(c,"constructor",u),u.displayName="GeneratorFunction",Y(c,o,"GeneratorFunction"),Y(f),Y(f,o,"Generator"),Y(f,n,function(){return this}),Y(f,"toString",function(){return"[object Generator]"}),(Z=function(){return{w:i,m:p}})()}function Y(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Y=function(e,t,r,n){function i(t,r){Y(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Y(e,t,r,n)}function J(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function ee(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){J(i,n,o,a,s,"next",e)}function s(e){J(i,n,o,a,s,"throw",e)}a(void 0)})}}function te(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,re(n.key),n)}}function re(e){var t=function(e,t){if("object"!=Q(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Q(t)?t:t+""}var ne,oe,ie=["transaction"],ae=function(e,t,r){return t&&te(e.prototype,t),r&&te(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t.clone(),this.filter=[],this.originalSegments=this.url.segment()||[],this.neighborRoot=r},[{key:"call",value:function(){var e=this;return this.checkFilter(),this._sendNormalRequest(this.url).then(function(t){return e._parseResponse(t)})}},{key:"stream",value:function(){throw new Error("Streaming requires eventsource to be enabled. If you need this functionality, compile with USE_EVENTSOURCE=true.")}},{key:"cursor",value:function(e){return this.url.setQuery("cursor",e),this}},{key:"limit",value:function(e){return this.url.setQuery("limit",e.toString()),this}},{key:"order",value:function(e){return this.url.setQuery("order",e),this}},{key:"join",value:function(e){return this.url.setQuery("join",e),this}},{key:"forEndpoint",value:function(e,t){if(""===this.neighborRoot)throw new Error("Invalid usage: neighborRoot not set in constructor");return this.filter.push([e,t,this.neighborRoot]),this}},{key:"checkFilter",value:function(){if(this.filter.length>=2)throw new V.v7("Too many filters specified",this.filter);if(1===this.filter.length){var e=this.originalSegments.concat(this.filter[0]);this.url.segment(e)}}},{key:"_requestFnForLink",value:function(e){var t=this;return ee(Z().m(function r(){var n,o,i,a,s=arguments;return Z().w(function(r){for(;;)switch(r.n){case 0:return n=s.length>0&&void 0!==s[0]?s[0]:{},e.templated?(i=M()(e.href),o=D()(i.expand(n))):o=D()(e.href),r.n=1,t._sendNormalRequest(o);case 1:return a=r.v,r.a(2,t._parseResponse(a))}},r)}))}},{key:"_parseRecord",value:function(e){var t=this;return e._links?(Object.keys(e._links).forEach(function(r){var n=e._links[r],o=!1;if(void 0!==e[r]&&(e["".concat(r,"_attr")]=e[r],o=!0),o&&ie.indexOf(r)>=0){var i=t._parseRecord(e[r]);e[r]=ee(Z().m(function e(){return Z().w(function(e){for(;;)if(0===e.n)return e.a(2,i)},e)}))}else e[r]=t._requestFnForLink(n)}),e):e}},{key:"_sendNormalRequest",value:(oe=ee(Z().m(function e(t){var r;return Z().w(function(e){for(;;)if(0===e.n)return""===(r=t).authority()&&(r=r.authority(this.url.authority())),""===r.protocol()&&(r=r.protocol(this.url.protocol())),e.a(2,X.get(r.toString()).then(function(e){return e.data}).catch(this._handleNetworkError))},e,this)})),function(e){return oe.apply(this,arguments)})},{key:"_parseResponse",value:function(e){return e._embedded&&e._embedded.records?this._toCollectionPage(e):this._parseRecord(e)}},{key:"_toCollectionPage",value:function(e){for(var t,r,n=this,o=0;o<e._embedded.records.length;o+=1)e._embedded.records[o]=this._parseRecord(e._embedded.records[o]);return{records:e._embedded.records,next:(r=ee(Z().m(function t(){var r;return Z().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,n._sendNormalRequest(D()(e._links.next.href));case 1:return r=t.v,t.a(2,n._toCollectionPage(r))}},t)})),function(){return r.apply(this,arguments)}),prev:(t=ee(Z().m(function t(){var r;return Z().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,n._sendNormalRequest(D()(e._links.prev.href));case 1:return r=t.v,t.a(2,n._toCollectionPage(r))}},t)})),function(){return t.apply(this,arguments)})}}},{key:"_handleNetworkError",value:(ne=ee(Z().m(function e(t){var r,n,o;return Z().w(function(e){for(;;)switch(e.n){case 0:if(!t.response||!t.response.status){e.n=4;break}o=t.response.status,e.n=404===o?1:2;break;case 1:return e.a(2,Promise.reject(new V.m_(null!==(r=t.response.statusText)&&void 0!==r?r:"Not Found",t.response.data)));case 2:return e.a(2,Promise.reject(new V.Dr(null!==(n=t.response.statusText)&&void 0!==n?n:"Unknown",t.response.data)));case 3:e.n=5;break;case 4:return e.a(2,Promise.reject(new Error(t.message)));case 5:return e.a(2)}},e)})),function(e){return ne.apply(this,arguments)})}]),se=r(732);function ue(e){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(e)}function ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,le(n.key),n)}}function le(e){var t=function(e,t){if("object"!=ue(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ue(t)?t:t+""}function fe(e,t,r){return t=de(t),function(e,t){if(t&&("object"==ue(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,pe()?Reflect.construct(t,r||[],de(e).constructor):t.apply(e,r))}function pe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(pe=function(){return!!e})()}function de(e){return de=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},de(e)}function he(e,t){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},he(e,t)}var ye=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=fe(this,t,[e])).url.segment("accounts"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&he(e,t)}(t,e),function(e,t,r){return t&&ce(e.prototype,t),r&&ce(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"accountId",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"forSigner",value:function(e){return this.url.setQuery("signer",e),this}},{key:"forAsset",value:function(e){return this.url.setQuery("asset","".concat(e)),this}},{key:"sponsor",value:function(e){return this.url.setQuery("sponsor",e),this}},{key:"forLiquidityPool",value:function(e){return this.url.setQuery("liquidity_pool",e),this}}])}(ae);function me(e){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(e)}function ge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ve(n.key),n)}}function ve(e){var t=function(e,t){if("object"!=me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==me(t)?t:t+""}function be(e,t,r){return t=Se(t),function(e,t){if(t&&("object"==me(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,we()?Reflect.construct(t,r||[],Se(e).constructor):t.apply(e,r))}function we(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(we=function(){return!!e})()}function Se(e){return Se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Se(e)}function Ee(e,t){return Ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ee(e,t)}var Te=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=be(this,t,[e])).url.segment("assets"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ee(e,t)}(t,e),function(e,t,r){return t&&ge(e.prototype,t),r&&ge(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forCode",value:function(e){return this.url.setQuery("asset_code",e),this}},{key:"forIssuer",value:function(e){return this.url.setQuery("asset_issuer",e),this}}])}(ae);function ke(e){return ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(e)}function Oe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ae(n.key),n)}}function Ae(e){var t=function(e,t){if("object"!=ke(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ke(t)?t:t+""}function _e(e,t,r){return t=Pe(t),function(e,t){if(t&&("object"==ke(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xe()?Reflect.construct(t,r||[],Pe(e).constructor):t.apply(e,r))}function xe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xe=function(){return!!e})()}function Pe(e){return Pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pe(e)}function Ie(e,t){return Ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ie(e,t)}var Re=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=_e(this,t,[e])).url.segment("claimable_balances"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ie(e,t)}(t,e),function(e,t,r){return t&&Oe(e.prototype,t),r&&Oe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"claimableBalance",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"sponsor",value:function(e){return this.url.setQuery("sponsor",e),this}},{key:"claimant",value:function(e){return this.url.setQuery("claimant",e),this}},{key:"asset",value:function(e){return this.url.setQuery("asset",e.toString()),this}}])}(ae);function Be(e){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Be(e)}function Ce(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,je(n.key),n)}}function je(e){var t=function(e,t){if("object"!=Be(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Be(t)?t:t+""}function Ue(e,t,r){return t=Le(t),function(e,t){if(t&&("object"==Be(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ne()?Reflect.construct(t,r||[],Le(e).constructor):t.apply(e,r))}function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ne=function(){return!!e})()}function Le(e){return Le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Le(e)}function De(e,t){return De=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},De(e,t)}var Fe=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Ue(this,t,[e,"effects"])).url.segment("effects"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&De(e,t)}(t,e),function(e,t,r){return t&&Ce(e.prototype,t),r&&Ce(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forLedger",value:function(e){return this.forEndpoint("ledgers",e.toString())}},{key:"forTransaction",value:function(e){return this.forEndpoint("transactions",e)}},{key:"forOperation",value:function(e){return this.forEndpoint("operations",e)}},{key:"forLiquidityPool",value:function(e){return this.forEndpoint("liquidity_pools",e)}}])}(ae);function Me(e){return Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(e)}function Ve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qe(n.key),n)}}function qe(e){var t=function(e,t){if("object"!=Me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Me(t)?t:t+""}function He(e,t,r){return t=Ke(t),function(e,t){if(t&&("object"==Me(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ze()?Reflect.construct(t,r||[],Ke(e).constructor):t.apply(e,r))}function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ze=function(){return!!e})()}function Ke(e){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ke(e)}function Xe(e,t){return Xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xe(e,t)}var $e=function(e){function t(e,r){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=He(this,t,[e])).url.segment("friendbot"),n.url.setQuery("addr",r),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xe(e,t)}(t,e),function(e,t,r){return t&&Ve(e.prototype,t),r&&Ve(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ae);function Ge(e){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ge(e)}function We(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qe(n.key),n)}}function Qe(e){var t=function(e,t){if("object"!=Ge(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ge(t)?t:t+""}function Ze(e,t,r){return t=Je(t),function(e,t){if(t&&("object"==Ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ye()?Reflect.construct(t,r||[],Je(e).constructor):t.apply(e,r))}function Ye(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ye=function(){return!!e})()}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Je(e)}function et(e,t){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},et(e,t)}var tt=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Ze(this,t,[e])).url.segment("ledgers"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&et(e,t)}(t,e),function(e,t,r){return t&&We(e.prototype,t),r&&We(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"ledger",value:function(e){return this.filter.push(["ledgers",e.toString()]),this}}])}(ae);function rt(e){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rt(e)}function nt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ot(n.key),n)}}function ot(e){var t=function(e,t){if("object"!=rt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rt(t)?t:t+""}function it(e,t,r){return t=st(t),function(e,t){if(t&&("object"==rt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,at()?Reflect.construct(t,r||[],st(e).constructor):t.apply(e,r))}function at(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(at=function(){return!!e})()}function st(e){return st=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},st(e)}function ut(e,t){return ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ut(e,t)}var ct=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=it(this,t,[e])).url.segment("liquidity_pools"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ut(e,t)}(t,e),function(e,t,r){return t&&nt(e.prototype,t),r&&nt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forAssets",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map(function(e){return e.toString()}).join(",");return this.url.setQuery("reserves",n),this}},{key:"forAccount",value:function(e){return this.url.setQuery("account",e),this}},{key:"liquidityPoolId",value:function(e){if(!e.match(/[a-fA-F0-9]{64}/))throw new TypeError("".concat(e," does not look like a liquidity pool ID"));var t=new ae(this.url.clone());return t.filter.push([e.toLowerCase()]),t}}])}(ae);function lt(e){return lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lt(e)}function ft(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pt(n.key),n)}}function pt(e){var t=function(e,t){if("object"!=lt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lt(t)?t:t+""}function dt(e,t,r){return t=yt(t),function(e,t){if(t&&("object"==lt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ht()?Reflect.construct(t,r||[],yt(e).constructor):t.apply(e,r))}function ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ht=function(){return!!e})()}function yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yt(e)}function mt(e,t){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mt(e,t)}var gt=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=dt(this,t,[e,"offers"])).url.segment("offers"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mt(e,t)}(t,e),function(e,t,r){return t&&ft(e.prototype,t),r&&ft(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"offer",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"buying",value:function(e){return e.isNative()?this.url.setQuery("buying_asset_type","native"):(this.url.setQuery("buying_asset_type",e.getAssetType()),this.url.setQuery("buying_asset_code",e.getCode()),this.url.setQuery("buying_asset_issuer",e.getIssuer())),this}},{key:"selling",value:function(e){return e.isNative()?this.url.setQuery("selling_asset_type","native"):(this.url.setQuery("selling_asset_type",e.getAssetType()),this.url.setQuery("selling_asset_code",e.getCode()),this.url.setQuery("selling_asset_issuer",e.getIssuer())),this}},{key:"sponsor",value:function(e){return this.url.setQuery("sponsor",e),this}},{key:"seller",value:function(e){return this.url.setQuery("seller",e),this}}])}(ae);function vt(e){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vt(e)}function bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wt(n.key),n)}}function wt(e){var t=function(e,t){if("object"!=vt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vt(t)?t:t+""}function St(e,t,r){return t=Tt(t),function(e,t){if(t&&("object"==vt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Et()?Reflect.construct(t,r||[],Tt(e).constructor):t.apply(e,r))}function Et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Et=function(){return!!e})()}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tt(e)}function kt(e,t){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kt(e,t)}var Ot=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=St(this,t,[e,"operations"])).url.segment("operations"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kt(e,t)}(t,e),function(e,t,r){return t&&bt(e.prototype,t),r&&bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"operation",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forClaimableBalance",value:function(e){return this.forEndpoint("claimable_balances",e)}},{key:"forLedger",value:function(e){return this.forEndpoint("ledgers",e.toString())}},{key:"forTransaction",value:function(e){return this.forEndpoint("transactions",e)}},{key:"forLiquidityPool",value:function(e){return this.forEndpoint("liquidity_pools",e)}},{key:"includeFailed",value:function(e){return this.url.setQuery("include_failed",e.toString()),this}}])}(ae);function At(e){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(e)}function _t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xt(n.key),n)}}function xt(e){var t=function(e,t){if("object"!=At(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==At(t)?t:t+""}function Pt(e,t,r){return t=Rt(t),function(e,t){if(t&&("object"==At(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,It()?Reflect.construct(t,r||[],Rt(e).constructor):t.apply(e,r))}function It(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(It=function(){return!!e})()}function Rt(e){return Rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rt(e)}function Bt(e,t){return Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bt(e,t)}var Ct=function(e){function t(e,r,n){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=Pt(this,t,[e])).url.segment("order_book"),r.isNative()?o.url.setQuery("selling_asset_type","native"):(o.url.setQuery("selling_asset_type",r.getAssetType()),o.url.setQuery("selling_asset_code",r.getCode()),o.url.setQuery("selling_asset_issuer",r.getIssuer())),n.isNative()?o.url.setQuery("buying_asset_type","native"):(o.url.setQuery("buying_asset_type",n.getAssetType()),o.url.setQuery("buying_asset_code",n.getCode()),o.url.setQuery("buying_asset_issuer",n.getIssuer())),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bt(e,t)}(t,e),function(e,t,r){return t&&_t(e.prototype,t),r&&_t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ae);function jt(e){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jt(e)}function Ut(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nt(n.key),n)}}function Nt(e){var t=function(e,t){if("object"!=jt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jt(t)?t:t+""}function Lt(e,t,r){return t=Ft(t),function(e,t){if(t&&("object"==jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dt()?Reflect.construct(t,r||[],Ft(e).constructor):t.apply(e,r))}function Dt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Dt=function(){return!!e})()}function Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ft(e)}function Mt(e,t){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mt(e,t)}var Vt=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Lt(this,t,[e,"payments"])).url.segment("payments"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mt(e,t)}(t,e),function(e,t,r){return t&&Ut(e.prototype,t),r&&Ut(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forLedger",value:function(e){return this.forEndpoint("ledgers",e.toString())}},{key:"forTransaction",value:function(e){return this.forEndpoint("transactions",e)}},{key:"includeFailed",value:function(e){return this.url.setQuery("include_failed",e.toString()),this}}])}(ae);function qt(e){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qt(e)}function Ht(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zt(n.key),n)}}function zt(e){var t=function(e,t){if("object"!=qt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qt(t)?t:t+""}function Kt(e,t,r){return t=$t(t),function(e,t){if(t&&("object"==qt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Xt()?Reflect.construct(t,r||[],$t(e).constructor):t.apply(e,r))}function Xt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Xt=function(){return!!e})()}function $t(e){return $t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$t(e)}function Gt(e,t){return Gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gt(e,t)}var Wt=function(e){function t(e,r,n,o){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=Kt(this,t,[e])).url.segment("paths/strict-receive"),"string"==typeof r)i.url.setQuery("source_account",r);else{var a=r.map(function(e){return e.isNative()?"native":"".concat(e.getCode(),":").concat(e.getIssuer())}).join(",");i.url.setQuery("source_assets",a)}return i.url.setQuery("destination_amount",o),n.isNative()?i.url.setQuery("destination_asset_type","native"):(i.url.setQuery("destination_asset_type",n.getAssetType()),i.url.setQuery("destination_asset_code",n.getCode()),i.url.setQuery("destination_asset_issuer",n.getIssuer())),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gt(e,t)}(t,e),function(e,t,r){return t&&Ht(e.prototype,t),r&&Ht(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ae);function Qt(e){return Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qt(e)}function Zt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yt(n.key),n)}}function Yt(e){var t=function(e,t){if("object"!=Qt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qt(t)?t:t+""}function Jt(e,t,r){return t=tr(t),function(e,t){if(t&&("object"==Qt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,er()?Reflect.construct(t,r||[],tr(e).constructor):t.apply(e,r))}function er(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(er=function(){return!!e})()}function tr(e){return tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tr(e)}function rr(e,t){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rr(e,t)}var nr=function(e){function t(e,r,n,o){var i;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(i=Jt(this,t,[e])).url.segment("paths/strict-send"),r.isNative()?i.url.setQuery("source_asset_type","native"):(i.url.setQuery("source_asset_type",r.getAssetType()),i.url.setQuery("source_asset_code",r.getCode()),i.url.setQuery("source_asset_issuer",r.getIssuer())),i.url.setQuery("source_amount",n),"string"==typeof o)i.url.setQuery("destination_account",o);else{var a=o.map(function(e){return e.isNative()?"native":"".concat(e.getCode(),":").concat(e.getIssuer())}).join(",");i.url.setQuery("destination_assets",a)}return i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rr(e,t)}(t,e),function(e,t,r){return t&&Zt(e.prototype,t),r&&Zt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ae);function or(e){return or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},or(e)}function ir(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ar(n.key),n)}}function ar(e){var t=function(e,t){if("object"!=or(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==or(t)?t:t+""}function sr(e,t,r){return t=cr(t),function(e,t){if(t&&("object"==or(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ur()?Reflect.construct(t,r||[],cr(e).constructor):t.apply(e,r))}function ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ur=function(){return!!e})()}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cr(e)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lr(e,t)}var fr=[6e4,3e5,9e5,36e5,864e5,6048e5],pr=function(e){function t(e,r,n,o,i,a,s){var u;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(u=sr(this,t,[e])).url.segment("trade_aggregations"),r.isNative()?u.url.setQuery("base_asset_type","native"):(u.url.setQuery("base_asset_type",r.getAssetType()),u.url.setQuery("base_asset_code",r.getCode()),u.url.setQuery("base_asset_issuer",r.getIssuer())),n.isNative()?u.url.setQuery("counter_asset_type","native"):(u.url.setQuery("counter_asset_type",n.getAssetType()),u.url.setQuery("counter_asset_code",n.getCode()),u.url.setQuery("counter_asset_issuer",n.getIssuer())),"number"!=typeof o||"number"!=typeof i)throw new V.v7("Invalid time bounds",[o,i]);if(u.url.setQuery("start_time",o.toString()),u.url.setQuery("end_time",i.toString()),!u.isValidResolution(a))throw new V.v7("Invalid resolution",a);if(u.url.setQuery("resolution",a.toString()),!u.isValidOffset(s,a))throw new V.v7("Invalid offset",s);return u.url.setQuery("offset",s.toString()),u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lr(e,t)}(t,e),function(e,t,r){return t&&ir(e.prototype,t),r&&ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"isValidResolution",value:function(e){return fr.some(function(t){return t===e})}},{key:"isValidOffset",value:function(e,t){var r=36e5;return!(e>t||e>=24*r||e%r!==0)}}])}(ae);function dr(e){return dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dr(e)}function hr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yr(n.key),n)}}function yr(e){var t=function(e,t){if("object"!=dr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dr(t)?t:t+""}function mr(e,t,r){return t=vr(t),function(e,t){if(t&&("object"==dr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,gr()?Reflect.construct(t,r||[],vr(e).constructor):t.apply(e,r))}function gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gr=function(){return!!e})()}function vr(e){return vr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vr(e)}function br(e,t){return br=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},br(e,t)}var wr=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=mr(this,t,[e,"trades"])).url.segment("trades"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&br(e,t)}(t,e),function(e,t,r){return t&&hr(e.prototype,t),r&&hr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"forAssetPair",value:function(e,t){return e.isNative()?this.url.setQuery("base_asset_type","native"):(this.url.setQuery("base_asset_type",e.getAssetType()),this.url.setQuery("base_asset_code",e.getCode()),this.url.setQuery("base_asset_issuer",e.getIssuer())),t.isNative()?this.url.setQuery("counter_asset_type","native"):(this.url.setQuery("counter_asset_type",t.getAssetType()),this.url.setQuery("counter_asset_code",t.getCode()),this.url.setQuery("counter_asset_issuer",t.getIssuer())),this}},{key:"forOffer",value:function(e){return this.url.setQuery("offer_id",e),this}},{key:"forType",value:function(e){return this.url.setQuery("trade_type",e),this}},{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forLiquidityPool",value:function(e){return this.forEndpoint("liquidity_pools",e)}}])}(ae);function Sr(e){return Sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sr(e)}function Er(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tr(n.key),n)}}function Tr(e){var t=function(e,t){if("object"!=Sr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Sr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Sr(t)?t:t+""}function kr(e,t,r){return t=Ar(t),function(e,t){if(t&&("object"==Sr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Or()?Reflect.construct(t,r||[],Ar(e).constructor):t.apply(e,r))}function Or(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Or=function(){return!!e})()}function Ar(e){return Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ar(e)}function _r(e,t){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_r(e,t)}var xr=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=kr(this,t,[e,"transactions"])).url.segment("transactions"),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_r(e,t)}(t,e),function(e,t,r){return t&&Er(e.prototype,t),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"transaction",value:function(e){var t=new ae(this.url.clone());return t.filter.push([e]),t}},{key:"forAccount",value:function(e){return this.forEndpoint("accounts",e)}},{key:"forClaimableBalance",value:function(e){return this.forEndpoint("claimable_balances",e)}},{key:"forLedger",value:function(e){return this.forEndpoint("ledgers",e.toString())}},{key:"forLiquidityPool",value:function(e){return this.forEndpoint("liquidity_pools",e)}},{key:"includeFailed",value:function(e){return this.url.setQuery("include_failed",e.toString()),this}}])}(ae);function Pr(e){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pr(e)}function Ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ir(Object(r),!0).forEach(function(t){Br(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ir(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Br(e,t,r){return(t=Dr(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cr(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return jr(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(jr(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,jr(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,jr(f,"constructor",c),jr(c,"constructor",u),u.displayName="GeneratorFunction",jr(c,o,"GeneratorFunction"),jr(f),jr(f,o,"Generator"),jr(f,n,function(){return this}),jr(f,"toString",function(){return"[object Generator]"}),(Cr=function(){return{w:i,m:p}})()}function jr(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}jr=function(e,t,r,n){function i(t,r){jr(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},jr(e,t,r,n)}function Ur(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Nr(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Ur(i,n,o,a,s,"next",e)}function s(e){Ur(i,n,o,a,s,"throw",e)}a(void 0)})}}function Lr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Dr(n.key),n)}}function Dr(e){var t=function(e,t){if("object"!=Pr(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pr(t)?t:t+""}function Fr(e){return new N(e).div(1e7).toString()}var Mr,Vr,qr,Hr,zr,Kr,Xr,$r,Gr=function(e,t,r){return t&&Lr(e.prototype,t),r&&Lr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.serverURL=D()(t);var n=void 0===r.allowHttp?se.T.isAllowHttp():r.allowHttp,o={};if(r.appName&&(o["X-App-Name"]=r.appName),r.appVersion&&(o["X-App-Version"]=r.appVersion),r.authToken&&(o["X-Auth-Token"]=r.authToken),r.headers&&Object.assign(o,r.headers),Object.keys(o).length>0&&G.interceptors.request.use(function(e){return e.headers=e.headers||{},e.headers=Object.assign(e.headers,o),e}),"https"!==this.serverURL.protocol()&&!n)throw new Error("Cannot connect to insecure horizon server")},[{key:"fetchTimebounds",value:($r=Nr(Cr().m(function e(t){var r,n,o=arguments;return Cr().w(function(e){for(;;)switch(e.n){case 0:if(r=o.length>1&&void 0!==o[1]&&o[1],!(n=W(this.serverURL.hostname()))){e.n=1;break}return e.a(2,{minTime:0,maxTime:n+t});case 1:if(!r){e.n=2;break}return e.a(2,{minTime:0,maxTime:Math.floor((new Date).getTime()/1e3)+t});case 2:return e.n=3,G.get(D()(this.serverURL).toString());case 3:return e.a(2,this.fetchTimebounds(t,!0))}},e,this)})),function(e){return $r.apply(this,arguments)})},{key:"fetchBaseFee",value:(Xr=Nr(Cr().m(function e(){var t;return Cr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.feeStats();case 1:return t=e.v,e.a(2,parseInt(t.last_ledger_base_fee,10)||100)}},e,this)})),function(){return Xr.apply(this,arguments)})},{key:"feeStats",value:(Kr=Nr(Cr().m(function e(){var t;return Cr().w(function(e){for(;;)if(0===e.n)return(t=new ae(D()(this.serverURL))).filter.push(["fee_stats"]),e.a(2,t.call())},e,this)})),function(){return Kr.apply(this,arguments)})},{key:"root",value:(zr=Nr(Cr().m(function e(){var t;return Cr().w(function(e){for(;;)if(0===e.n)return t=new ae(D()(this.serverURL)),e.a(2,t.call())},e,this)})),function(){return zr.apply(this,arguments)})},{key:"submitTransaction",value:(Hr=Nr(Cr().m(function e(t){var r,n=arguments;return Cr().w(function(e){for(;;)switch(e.n){case 0:if((n.length>1&&void 0!==n[1]?n[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.n=1;break}return e.n=1,this.checkMemoRequired(t);case 1:return r=encodeURIComponent(t.toEnvelope().toXDR().toString("base64")),e.a(2,G.post(D()(this.serverURL).segment("transactions").toString(),"tx=".concat(r),{timeout:6e4,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(e){if(!e.data.result_xdr)return e.data;var t,r,n=s.xdr.TransactionResult.fromXDR(e.data.result_xdr,"base64").result().value();return n.length&&(t=n.map(function(e,t){if("manageBuyOffer"!==e.value().switch().name&&"manageSellOffer"!==e.value().switch().name)return null;r=!0;var n,o=new N(0),i=new N(0),a=e.value().value().success(),u=a.offersClaimed().map(function(e){var t=e.value(),r="";switch(e.switch()){case s.xdr.ClaimAtomType.claimAtomTypeV0():r=s.StrKey.encodeEd25519PublicKey(t.sellerEd25519());break;case s.xdr.ClaimAtomType.claimAtomTypeOrderBook():r=s.StrKey.encodeEd25519PublicKey(t.sellerId().ed25519());break;default:throw new Error("Invalid offer result type: ".concat(e.switch()))}var n=new N(t.amountBought().toString()),a=new N(t.amountSold().toString());o=o.plus(a),i=i.plus(n);var u=s.Asset.fromOperation(t.assetSold()),c=s.Asset.fromOperation(t.assetBought()),l={type:u.getAssetType(),assetCode:u.getCode(),issuer:u.getIssuer()},f={type:c.getAssetType(),assetCode:c.getCode(),issuer:c.getIssuer()};return{sellerId:r,offerId:t.offerId().toString(),assetSold:l,amountSold:Fr(a),assetBought:f,amountBought:Fr(n)}}),c=a.offer().switch().name;if("function"==typeof a.offer().value&&a.offer().value()){var l=a.offer().value();n={offerId:l.offerId().toString(),selling:{},buying:{},amount:Fr(l.amount().toString()),price:{n:l.price().n(),d:l.price().d()}};var f=s.Asset.fromOperation(l.selling());n.selling={type:f.getAssetType(),assetCode:f.getCode(),issuer:f.getIssuer()};var p=s.Asset.fromOperation(l.buying());n.buying={type:p.getAssetType(),assetCode:p.getCode(),issuer:p.getIssuer()}}return{offersClaimed:u,effect:c,operationIndex:t,currentOffer:n,amountBought:Fr(o),amountSold:Fr(i),isFullyOpen:!u.length&&"manageOfferDeleted"!==c,wasPartiallyFilled:!!u.length&&"manageOfferDeleted"!==c,wasImmediatelyFilled:!!u.length&&"manageOfferDeleted"===c,wasImmediatelyDeleted:!u.length&&"manageOfferDeleted"===c}}).filter(function(e){return!!e})),Rr(Rr({},e.data),{},{offerResults:r?t:void 0})}).catch(function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new V.nS("Transaction submission failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))}))}},e,this)})),function(e){return Hr.apply(this,arguments)})},{key:"submitAsyncTransaction",value:(qr=Nr(Cr().m(function e(t){var r,n=arguments;return Cr().w(function(e){for(;;)switch(e.n){case 0:if((n.length>1&&void 0!==n[1]?n[1]:{skipMemoRequiredCheck:!1}).skipMemoRequiredCheck){e.n=1;break}return e.n=1,this.checkMemoRequired(t);case 1:return r=encodeURIComponent(t.toEnvelope().toXDR().toString("base64")),e.a(2,G.post(D()(this.serverURL).segment("transactions_async").toString(),"tx=".concat(r),{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(function(e){return e.data}).catch(function(e){return e instanceof Error?Promise.reject(e):Promise.reject(new V.nS("Transaction submission failed. Server responded: ".concat(e.status," ").concat(e.statusText),e.data))}))}},e,this)})),function(e){return qr.apply(this,arguments)})},{key:"accounts",value:function(){return new ye(D()(this.serverURL))}},{key:"claimableBalances",value:function(){return new Re(D()(this.serverURL))}},{key:"ledgers",value:function(){return new tt(D()(this.serverURL))}},{key:"transactions",value:function(){return new xr(D()(this.serverURL))}},{key:"offers",value:function(){return new gt(D()(this.serverURL))}},{key:"orderbook",value:function(e,t){return new Ct(D()(this.serverURL),e,t)}},{key:"trades",value:function(){return new wr(D()(this.serverURL))}},{key:"operations",value:function(){return new Ot(D()(this.serverURL))}},{key:"liquidityPools",value:function(){return new ct(D()(this.serverURL))}},{key:"strictReceivePaths",value:function(e,t,r){return new Wt(D()(this.serverURL),e,t,r)}},{key:"strictSendPaths",value:function(e,t,r){return new nr(D()(this.serverURL),e,t,r)}},{key:"payments",value:function(){return new Vt(D()(this.serverURL))}},{key:"effects",value:function(){return new Fe(D()(this.serverURL))}},{key:"friendbot",value:function(e){return new $e(D()(this.serverURL),e)}},{key:"assets",value:function(){return new Te(D()(this.serverURL))}},{key:"loadAccount",value:(Vr=Nr(Cr().m(function e(t){var r;return Cr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.accounts().accountId(t).call();case 1:return r=e.v,e.a(2,new m(r))}},e,this)})),function(e){return Vr.apply(this,arguments)})},{key:"tradeAggregation",value:function(e,t,r,n,o,i){return new pr(D()(this.serverURL),e,t,r,n,o,i)}},{key:"checkMemoRequired",value:(Mr=Nr(Cr().m(function e(t){var r,n,o,i,a,u;return Cr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t instanceof s.FeeBumpTransaction&&(t=t.innerTransaction),"none"===t.memo.type){e.n=1;break}return e.a(2);case 1:r=new Set,n=0;case 2:if(!(n<t.operations.length)){e.n=14;break}o=t.operations[n],a=o.type,e.n="payment"===a||"pathPaymentStrictReceive"===a||"pathPaymentStrictSend"===a||"accountMerge"===a?3:4;break;case 3:return e.a(3,5);case 4:return e.a(3,13);case 5:if(i=o.destination,!r.has(i)){e.n=6;break}return e.a(3,13);case 6:if(r.add(i),!i.startsWith("M")){e.n=7;break}return e.a(3,13);case 7:return e.p=7,e.n=8,this.loadAccount(i);case 8:if("MQ=="!==e.v.data_attr["config.memo_required"]){e.n=9;break}throw new V.Cu("account requires memo",i,n);case 9:e.n=13;break;case 10:if(e.p=10,!((u=e.v)instanceof V.Cu)){e.n=11;break}throw u;case 11:if(u instanceof V.m_){e.n=12;break}throw u;case 12:return e.a(3,13);case 13:n+=1,e.n=2;break;case 14:return e.a(2)}},e,this,[[7,10]])})),function(e){return Mr.apply(this,arguments)})}]);const Wr=(e=r.hmd(e)).exports},784:(e,t,r)=>{"use strict";r.d(t,{$D:()=>d,Af:()=>c,WC:()=>l,fG:()=>p,jr:()=>h,tR:()=>f});var n=r(950),o=r(76);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){var t=e.errorResultXdr,r=e.diagnosticEventsXdr;return delete e.errorResultXdr,delete e.diagnosticEventsXdr,t?s(s(s({},e),void 0!==r&&r.length>0&&{diagnosticEvents:r.map(function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")})}),{},{errorResult:n.xdr.TransactionResult.fromXDR(t,"base64")}):s({},e)}function l(e){var t,r,o,i,a=n.xdr.TransactionMeta.fromXDR(e.resultMetaXdr,"base64"),s={ledger:e.ledger,createdAt:e.createdAt,applicationOrder:e.applicationOrder,feeBump:e.feeBump,envelopeXdr:n.xdr.TransactionEnvelope.fromXDR(e.envelopeXdr,"base64"),resultXdr:n.xdr.TransactionResult.fromXDR(e.resultXdr,"base64"),resultMetaXdr:a,events:{contractEventsXdr:(null!==(t=null===(r=e.events)||void 0===r?void 0:r.contractEventsXdr)&&void 0!==t?t:[]).map(function(e){return e.map(function(e){return n.xdr.ContractEvent.fromXDR(e,"base64")})}),transactionEventsXdr:(null!==(o=null===(i=e.events)||void 0===i?void 0:i.transactionEventsXdr)&&void 0!==o?o:[]).map(function(e){return n.xdr.TransactionEvent.fromXDR(e,"base64")})}};switch(a.switch()){case 3:case 4:var u,c,l=a.value();if(null!==l.sorobanMeta())s.returnValue=null!==(u=null===(c=l.sorobanMeta())||void 0===c?void 0:c.returnValue())&&void 0!==u?u:void 0}return e.diagnosticEventsXdr&&(s.diagnosticEventsXdr=e.diagnosticEventsXdr.map(function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")})),s}function f(e){return s({status:e.status,txHash:e.txHash},l(e))}function p(e){var t;return{latestLedger:e.latestLedger,oldestLedger:e.oldestLedger,latestLedgerCloseTime:e.latestLedgerCloseTime,oldestLedgerCloseTime:e.oldestLedgerCloseTime,cursor:e.cursor,events:(null!==(t=e.events)&&void 0!==t?t:[]).map(function(e){var t=s({},e);return delete t.contractId,s(s(s({},t),""!==e.contractId&&{contractId:new n.Contract(e.contractId)}),{},{topic:e.topic.map(function(e){return n.xdr.ScVal.fromXDR(e,"base64")}),value:n.xdr.ScVal.fromXDR(e.value,"base64")})})}}function d(e){var t;return{latestLedger:e.latestLedger,entries:(null!==(t=e.entries)&&void 0!==t?t:[]).map(function(e){if(!e.key||!e.xdr)throw new TypeError("invalid ledger entry: ".concat(JSON.stringify(e)));return s({lastModifiedLedgerSeq:e.lastModifiedLedgerSeq,key:n.xdr.LedgerKey.fromXDR(e.key,"base64"),val:n.xdr.LedgerEntryData.fromXDR(e.xdr,"base64")},void 0!==e.liveUntilLedgerSeq&&{liveUntilLedgerSeq:e.liveUntilLedgerSeq})})}}function h(e){var t,r;if(!o.j.isSimulationRaw(e))return e;var i={_parsed:!0,id:e.id,latestLedger:e.latestLedger,events:null!==(t=null===(r=e.events)||void 0===r?void 0:r.map(function(e){return n.xdr.DiagnosticEvent.fromXDR(e,"base64")}))&&void 0!==t?t:[]};return"string"==typeof e.error?s(s({},i),{},{error:e.error}):function(e,t){var r,o,i,a,u,c=s(s(s({},t),{},{transactionData:new n.SorobanDataBuilder(e.transactionData),minResourceFee:e.minResourceFee},null!==(r=null===(o=e.results)||void 0===o?void 0:o.length)&&void 0!==r&&r&&{result:e.results.map(function(e){var t;return{auth:(null!==(t=e.auth)&&void 0!==t?t:[]).map(function(e){return n.xdr.SorobanAuthorizationEntry.fromXDR(e,"base64")}),retval:e.xdr?n.xdr.ScVal.fromXDR(e.xdr,"base64"):n.xdr.ScVal.scvVoid()}})[0]}),null!==(i=null===(a=e.stateChanges)||void 0===a?void 0:a.length)&&void 0!==i&&i&&{stateChanges:null===(u=e.stateChanges)||void 0===u?void 0:u.map(function(e){return{type:e.type,key:n.xdr.LedgerKey.fromXDR(e.key,"base64"),before:e.before?n.xdr.LedgerEntry.fromXDR(e.before,"base64"):null,after:e.after?n.xdr.LedgerEntry.fromXDR(e.after,"base64"):null}})});return e.restorePreamble&&""!==e.restorePreamble.transactionData?s(s({},c),{},{restorePreamble:{minResourceFee:e.restorePreamble.minResourceFee,transactionData:new n.SorobanDataBuilder(e.restorePreamble.transactionData)}}):c}(e,i)}},798:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}r.d(t,{q:()=>c});var a,s,u,c=(a=function e(t){var r,n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promise=new Promise(function(e){r=e}),t(function(e){n.reason=e,r()})},(s=[{key:"throwIfRequested",value:function(){if(this.reason)throw new Error(this.reason)}}])&&o(a.prototype,s),u&&o(a,u),Object.defineProperty(a,"prototype",{writable:!1}),a)},861:(e,t,r)=>{var n=r(287),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},898:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Api:()=>{},Resolver:()=>w,STELLAR_TOML_MAX_SIZE:()=>v});var n=r(293),o=r.n(n),i=r(371),a=r(732);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return c(l,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),l}var a={};function s(){}function l(){}function f(){}t=Object.getPrototypeOf;var p=[][n]?t(t([][n]())):(c(t={},n,function(){return this}),t),d=f.prototype=s.prototype=Object.create(p);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,c(d,"constructor",f),c(f,"constructor",l),l.displayName="GeneratorFunction",c(f,o,"GeneratorFunction"),c(d),c(d,o,"Generator"),c(d,n,function(){return this}),c(d,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function c(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}c=function(e,t,r,n){function i(t,r){c(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},c(e,t,r,n)}function l(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function p(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}var d,h,y,m,g,v=102400,b=i.ok.CancelToken,w=(d=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},h=null,y=[{key:"resolve",value:(m=u().m(function e(t){var r,n,s,c,l,f=arguments;return u().w(function(e){for(;;)if(0===e.n)return s=void 0===(n=f.length>1&&void 0!==f[1]?f[1]:{}).allowHttp?a.T.isAllowHttp():n.allowHttp,c=void 0===n.timeout?a.T.getTimeout():n.timeout,l=s?"http":"https",e.a(2,i.ok.get("".concat(l,"://").concat(t,"/.well-known/stellar.toml"),{maxRedirects:null!==(r=n.allowedRedirects)&&void 0!==r?r:0,maxContentLength:v,cancelToken:c?new b(function(e){return setTimeout(function(){return e("timeout of ".concat(c,"ms exceeded"))},c)}):void 0,timeout:c}).then(function(e){try{var t=o().parse(e.data);return Promise.resolve(t)}catch(e){return Promise.reject(new Error("stellar.toml is invalid - Parsing error on line ".concat(e.line,", column ").concat(e.column,": ").concat(e.message)))}}).catch(function(e){throw e.message.match(/^maxContentLength size/)?new Error("stellar.toml file exceeds allowed size of ".concat(v)):e}))},e)}),g=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=m.apply(e,t);function i(e){l(o,r,n,i,a,"next",e)}function a(e){l(o,r,n,i,a,"throw",e)}i(void 0)})},function(e){return g.apply(this,arguments)})}],h&&f(d.prototype,h),y&&f(d,y),Object.defineProperty(d,"prototype",{writable:!1}),d)},920:(e,t,r)=>{"use strict";async function n(e,t){const r={config:e};return r.status=t.status,r.statusText=t.statusText,r.headers=t.headers,"stream"===e.responseType?(r.data=t.body,r):t[e.responseType||"text"]().then(n=>{e.transformResponse?(Array.isArray(e.transformResponse)?e.transformResponse.map(r=>n=r.call(e,n,t?.headers,t?.status)):n=e.transformResponse(n,t?.headers,t?.status),r.data=n):(r.data=n,r.data=JSON.parse(n))}).catch(Object).then(()=>r)}function o(e){let t=e.url||"";return e.baseURL&&e.url&&(t=e.url.replace(/^(?!.*\/\/)\/?/,`${e.baseURL}/`)),e.params&&Object.keys(e.params).length>0&&e.url&&(t+=(~e.url.indexOf("?")?"&":"?")+(e.paramsSerializer?e.paramsSerializer(e.params):new URLSearchParams(e.params))),t}function i(e,t){const r={...t,...e};if(t?.params&&e?.params&&(r.params={...t?.params,...e?.params}),t?.headers&&e?.headers){r.headers=new Headers(t.headers||{});new Headers(e.headers||{}).forEach((e,t)=>{r.headers.set(t,e)})}return r}function a(e,t){const r=t.get("content-type");return r?"application/x-www-form-urlencoded"!==r||e instanceof URLSearchParams?"application/json"===r&&"object"==typeof e&&(e=JSON.stringify(e)):e=new URLSearchParams(e):"string"==typeof e?t.set("content-type","text/plain"):e instanceof URLSearchParams?t.set("content-type","application/x-www-form-urlencoded"):e instanceof Blob||e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t.set("content-type","application/octet-stream"):"object"==typeof e&&"function"!=typeof e.append&&"function"!=typeof e.text&&(e=JSON.stringify(e),t.set("content-type","application/json")),e}async function s(e,t,r,u,c,p){"string"==typeof e?(t=t||{}).url=e:t=e||{};const d=i(t,r||{});if(d.fetchOptions=d.fetchOptions||{},d.timeout=d.timeout||0,d.headers=new Headers(d.headers||{}),d.transformRequest=d.transformRequest??a,p=p||d.data,d.transformRequest&&p&&(Array.isArray(d.transformRequest)?d.transformRequest.map(e=>p=e.call(d,p,d.headers)):p=d.transformRequest(p,d.headers)),d.url=o(d),d.method=u||d.method||"get",c&&c.request.handlers.length>0){const e=c.request.handlers.filter(e=>!e?.runWhen||"function"==typeof e.runWhen&&e.runWhen(d)).flatMap(e=>[e.fulfilled,e.rejected]);let t=d;for(let r=0,n=e.length;r<n;r+=2){const n=e[r],o=e[r+1];try{n&&(t=n(t))}catch(e){o&&o?.(e);break}}}const h=function(e,t){const r={...t,...e};t?.headers&&e?.headers&&(r.headers=new Headers(t.headers||{}),new Headers(e.headers||{}).forEach((e,t)=>{r.headers.set(t,e)}));return r}({method:d.method?.toUpperCase(),body:p,headers:d.headers,credentials:d.withCredentials?"include":void 0,signal:d.signal},d.fetchOptions);let y=async function(e,t){let r=null;if("any"in AbortSignal){const r=[];e.timeout&&r.push(AbortSignal.timeout(e.timeout)),e.signal&&r.push(e.signal),r.length>0&&(t.signal=AbortSignal.any(r))}else e.timeout&&(t.signal=AbortSignal.timeout(e.timeout));try{return r=await fetch(e.url,t),(e.validateStatus?e.validateStatus(r.status):r.ok)?await n(e,r):Promise.reject(new l(`Request failed with status code ${r?.status}`,[l.ERR_BAD_REQUEST,l.ERR_BAD_RESPONSE][Math.floor(r?.status/100)-4],e,new Request(e.url,t),await n(e,r)))}catch(t){if("AbortError"===t.name||"TimeoutError"===t.name){const r="TimeoutError"===t.name;return Promise.reject(r?new l(e.timeoutErrorMessage||`timeout of ${e.timeout} ms exceeded`,l.ECONNABORTED,e,s):new f(null,e))}return Promise.reject(new l(t.message,void 0,e,s,void 0))}}(d,h);if(c&&c.response.handlers.length>0){const e=c.response.handlers.flatMap(e=>[e.fulfilled,e.rejected]);for(let t=0,r=e.length;t<r;t+=2)y=y.then(e[t],e[t+1])}return y}r.r(t),r.d(t,{create:()=>A,fetchClient:()=>_});var u=class{handlers=[];constructor(){this.handlers=[]}use=(e,t,r)=>(this.handlers.push({fulfilled:e,rejected:t,runWhen:r?.runWhen}),this.handlers.length-1);eject=e=>{this.handlers[e]&&(this.handlers[e]=null)};clear=()=>{this.handlers=[]}};function c(e){e=e||{};const t={request:new u,response:new u},r=(r,n)=>s(r,n,e,void 0,t);return r.defaults=e,r.interceptors=t,r.getUri=t=>o(i(t||{},e)),r.request=r=>s(r,void 0,e,void 0,t),["get","delete","head","options"].forEach(n=>{r[n]=(r,o)=>s(r,o,e,n,t)}),["post","put","patch"].forEach(n=>{r[n]=(r,o,i)=>s(r,i,e,n,t,o)}),["postForm","putForm","patchForm"].forEach(n=>{r[n]=(r,o,i)=>((i=i||{}).headers=new Headers(i.headers||{}),i.headers.set("content-type","application/x-www-form-urlencoded"),s(r,i,e,n.replace("Form",""),t,o))}),r}var l=class extends Error{config;code;request;response;status;isAxiosError;constructor(e,t,r,n,o){super(e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="AxiosError",this.code=t,this.config=r,this.request=n,this.response=o,this.isAxiosError=!0}static ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";static ERR_BAD_OPTION="ERR_BAD_OPTION";static ERR_NETWORK="ERR_NETWORK";static ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";static ERR_BAD_REQUEST="ERR_BAD_REQUEST";static ERR_INVALID_URL="ERR_INVALID_URL";static ERR_CANCELED="ERR_CANCELED";static ECONNABORTED="ECONNABORTED";static ETIMEDOUT="ETIMEDOUT"},f=class extends l{constructor(e,t,r){super(e||"canceled",l.ERR_CANCELED,t,r),this.name="CanceledError"}};var p=c();p.create=e=>c(e);var d=p,h=r(798);function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach(function(t){b(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,w(n.key),n)}}function b(e,t,r){return(t=w(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e){var t=function(e,t){if("object"!=y(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==y(t)?t:t+""}var S,E,T,k=(S=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),b(this,"handlers",[])},(E=[{key:"use",value:function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"forEach",value:function(e){this.handlers.forEach(function(t){null!==t&&e(t)})}}])&&v(S.prototype,E),T&&v(S,T),Object.defineProperty(S,"prototype",{writable:!1}),S);function O(e){var t=e||{};return t.headers=new Headers(t.headers||{}),t.headers.set("Content-Type","application/x-www-form-urlencoded"),t}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=g(g({},e),{},{headers:e.headers||{}}),r=d.create(t),n=new k,o=new k;return{interceptors:{request:n,response:o},defaults:g(g({},t),{},{adapter:function(e){return r.request(e)}}),create:function(e){return A(g(g({},this.defaults),e))},makeRequest:function(e){var t=this;return new Promise(function(r,i){var a=new AbortController;e.signal=a.signal,e.cancelToken&&e.cancelToken.promise.then(function(){a.abort(),i(new Error("Request canceled"))});var s=e;if(n.handlers.length>0)for(var u=n.handlers.filter(function(e){return null!==e}).flatMap(function(e){return[e.fulfilled,e.rejected]}),c=0,l=u.length;c<l;c+=2){var f=u[c],p=u[c+1];try{f&&(s=f(s))}catch(e){return p&&(null==p||p(e)),void i(e)}}var d=s.adapter||t.defaults.adapter;if(!d)throw new Error("No adapter available");var h=d(s).then(function(e){return{data:e.data,headers:e.headers,config:e.config,status:e.status,statusText:e.statusText}});if(o.handlers.length>0)for(var y=o.handlers.filter(function(e){return null!==e}).flatMap(function(e){return[e.fulfilled,e.rejected]}),m=function(e){h=h.then(function(t){var r=y[e];return"function"==typeof r?r(t):t},function(t){var r=y[e+1];if("function"==typeof r)return r(t);throw t}).then(function(e){return e})},g=0,v=y.length;g<v;g+=2)m(g);h.then(r).catch(i)})},get:function(e,t){return this.makeRequest(g(g(g({},this.defaults),t),{},{url:e,method:"get"}))},delete:function(e,t){return this.makeRequest(g(g(g({},this.defaults),t),{},{url:e,method:"delete"}))},head:function(e,t){return this.makeRequest(g(g(g({},this.defaults),t),{},{url:e,method:"head"}))},options:function(e,t){return this.makeRequest(g(g(g({},this.defaults),t),{},{url:e,method:"options"}))},post:function(e,t,r){return this.makeRequest(g(g(g({},this.defaults),r),{},{url:e,method:"post",data:t}))},put:function(e,t,r){return this.makeRequest(g(g(g({},this.defaults),r),{},{url:e,method:"put",data:t}))},patch:function(e,t,r){return this.makeRequest(g(g(g({},this.defaults),r),{},{url:e,method:"patch",data:t}))},postForm:function(e,t,r){var n=O(r);return this.makeRequest(g(g(g({},this.defaults),n),{},{url:e,method:"post",data:t}))},putForm:function(e,t,r){var n=O(r);return this.makeRequest(g(g(g({},this.defaults),n),{},{url:e,method:"put",data:t}))},patchForm:function(e,t,r){var n=O(r);return this.makeRequest(g(g(g({},this.defaults),n),{},{url:e,method:"patch",data:t}))},CancelToken:h.q,isCancel:function(e){return e instanceof Error&&"Request canceled"===e.message}}}var _=A()},924:(e,t,r)=>{"use strict";r.r(t),r.d(t,{StellarBase:()=>a,default:()=>s,httpClient:()=>n.ok});var n=r(371),o=r(356),i={};for(const e in o)["default","StellarBase","httpClient"].indexOf(e)<0&&(i[e]=()=>o[e]);r.d(t,i);var a=r(950);const s=(e=r.hmd(e)).exports},950:e=>{var t;self,t=()=>(()=>{var e={41:(e,t,r)=>{"use strict";var n=r(655),o=r(8068),i=r(9675),a=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!a&&a(e,t);if(n)n(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===s&&f?f.enumerable:!s,value:r,writable:null===u&&f?f.writable:!u});else{if(!l&&(s||u||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},76:e=>{"use strict";e.exports=Function.prototype.call},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*y}},392:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=r(5377);function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){e=o(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,a=this._len,s=0;s<i;){for(var u=a%n,c=Math.min(i-s,n-u),l=0;l<c;l++)r[u+l]=e[s+l];s+=c,(a+=c)%n===0&&this._update(r)}return this._len+=i,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,o=(r-n)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},414:e=>{"use strict";e.exports=Math.round},448:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Account:()=>Wn,Address:()=>sn,Asset:()=>Zt,AuthClawbackEnabledFlag:()=>gn,AuthImmutableFlag:()=>mn,AuthRequiredFlag:()=>hn,AuthRevocableFlag:()=>yn,BASE_FEE:()=>go,Claimant:()=>Mr,Contract:()=>Io,FeeBumpTransaction:()=>Kn,Hyper:()=>n.Hyper,Int128:()=>Zo,Int256:()=>oi,Keypair:()=>Xt,LiquidityPoolAsset:()=>Nr,LiquidityPoolFeeV18:()=>er,LiquidityPoolId:()=>zr,Memo:()=>Pn,MemoHash:()=>_n,MemoID:()=>On,MemoNone:()=>kn,MemoReturn:()=>xn,MemoText:()=>An,MuxedAccount:()=>Jn,Networks:()=>So,Operation:()=>vn,ScInt:()=>hi,SignerKey:()=>so,Soroban:()=>Ao,SorobanDataBuilder:()=>no,StrKey:()=>Lt,TimeoutInfinite:()=>vo,Transaction:()=>Ln,TransactionBase:()=>ar,TransactionBuilder:()=>bo,Uint128:()=>Lo,Uint256:()=>zo,UnsignedHyper:()=>n.UnsignedHyper,XdrLargeInt:()=>ci,authorizeEntry:()=>ji,authorizeInvocation:()=>Ni,buildInvocationTree:()=>Mi,cereal:()=>a,decodeAddressToMuxedAccount:()=>Xr,default:()=>Hi,encodeMuxedAccount:()=>Gr,encodeMuxedAccountToAddress:()=>$r,extractBaseAddress:()=>Wr,getLiquidityPoolId:()=>tr,hash:()=>u,humanizeEvents:()=>xi,nativeToScVal:()=>Ei,scValToBigInt:()=>yi,scValToNative:()=>Ti,sign:()=>kt,verify:()=>Ot,walkInvocationTree:()=>Vi,xdr:()=>i});var n=r(3740),o=n.config(function(e){var t=1024;e.typedef("Value",e.varOpaque()),e.struct("ScpBallot",[["counter",e.lookup("Uint32")],["value",e.lookup("Value")]]),e.enum("ScpStatementType",{scpStPrepare:0,scpStConfirm:1,scpStExternalize:2,scpStNominate:3}),e.struct("ScpNomination",[["quorumSetHash",e.lookup("Hash")],["votes",e.varArray(e.lookup("Value"),2147483647)],["accepted",e.varArray(e.lookup("Value"),2147483647)]]),e.struct("ScpStatementPrepare",[["quorumSetHash",e.lookup("Hash")],["ballot",e.lookup("ScpBallot")],["prepared",e.option(e.lookup("ScpBallot"))],["preparedPrime",e.option(e.lookup("ScpBallot"))],["nC",e.lookup("Uint32")],["nH",e.lookup("Uint32")]]),e.struct("ScpStatementConfirm",[["ballot",e.lookup("ScpBallot")],["nPrepared",e.lookup("Uint32")],["nCommit",e.lookup("Uint32")],["nH",e.lookup("Uint32")],["quorumSetHash",e.lookup("Hash")]]),e.struct("ScpStatementExternalize",[["commit",e.lookup("ScpBallot")],["nH",e.lookup("Uint32")],["commitQuorumSetHash",e.lookup("Hash")]]),e.union("ScpStatementPledges",{switchOn:e.lookup("ScpStatementType"),switchName:"type",switches:[["scpStPrepare","prepare"],["scpStConfirm","confirm"],["scpStExternalize","externalize"],["scpStNominate","nominate"]],arms:{prepare:e.lookup("ScpStatementPrepare"),confirm:e.lookup("ScpStatementConfirm"),externalize:e.lookup("ScpStatementExternalize"),nominate:e.lookup("ScpNomination")}}),e.struct("ScpStatement",[["nodeId",e.lookup("NodeId")],["slotIndex",e.lookup("Uint64")],["pledges",e.lookup("ScpStatementPledges")]]),e.struct("ScpEnvelope",[["statement",e.lookup("ScpStatement")],["signature",e.lookup("Signature")]]),e.struct("ScpQuorumSet",[["threshold",e.lookup("Uint32")],["validators",e.varArray(e.lookup("NodeId"),2147483647)],["innerSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)]]),e.typedef("Thresholds",e.opaque(4)),e.typedef("String32",e.string(32)),e.typedef("String64",e.string(64)),e.typedef("SequenceNumber",e.lookup("Int64")),e.typedef("DataValue",e.varOpaque(64)),e.typedef("AssetCode4",e.opaque(4)),e.typedef("AssetCode12",e.opaque(12)),e.enum("AssetType",{assetTypeNative:0,assetTypeCreditAlphanum4:1,assetTypeCreditAlphanum12:2,assetTypePoolShare:3}),e.union("AssetCode",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeCreditAlphanum4","assetCode4"],["assetTypeCreditAlphanum12","assetCode12"]],arms:{assetCode4:e.lookup("AssetCode4"),assetCode12:e.lookup("AssetCode12")}}),e.struct("AlphaNum4",[["assetCode",e.lookup("AssetCode4")],["issuer",e.lookup("AccountId")]]),e.struct("AlphaNum12",[["assetCode",e.lookup("AssetCode12")],["issuer",e.lookup("AccountId")]]),e.union("Asset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12")}}),e.struct("Price",[["n",e.lookup("Int32")],["d",e.lookup("Int32")]]),e.struct("Liabilities",[["buying",e.lookup("Int64")],["selling",e.lookup("Int64")]]),e.enum("ThresholdIndices",{thresholdMasterWeight:0,thresholdLow:1,thresholdMed:2,thresholdHigh:3}),e.enum("LedgerEntryType",{account:0,trustline:1,offer:2,data:3,claimableBalance:4,liquidityPool:5,contractData:6,contractCode:7,configSetting:8,ttl:9}),e.struct("Signer",[["key",e.lookup("SignerKey")],["weight",e.lookup("Uint32")]]),e.enum("AccountFlags",{authRequiredFlag:1,authRevocableFlag:2,authImmutableFlag:4,authClawbackEnabledFlag:8}),e.const("MASK_ACCOUNT_FLAGS",7),e.const("MASK_ACCOUNT_FLAGS_V17",15),e.const("MAX_SIGNERS",20),e.typedef("SponsorshipDescriptor",e.option(e.lookup("AccountId"))),e.struct("AccountEntryExtensionV3",[["ext",e.lookup("ExtensionPoint")],["seqLedger",e.lookup("Uint32")],["seqTime",e.lookup("TimePoint")]]),e.union("AccountEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[3,"v3"]],arms:{v3:e.lookup("AccountEntryExtensionV3")}}),e.struct("AccountEntryExtensionV2",[["numSponsored",e.lookup("Uint32")],["numSponsoring",e.lookup("Uint32")],["signerSponsoringIDs",e.varArray(e.lookup("SponsorshipDescriptor"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExtensionV2Ext")]]),e.union("AccountEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("AccountEntryExtensionV2")}}),e.struct("AccountEntryExtensionV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("AccountEntryExtensionV1Ext")]]),e.union("AccountEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("AccountEntryExtensionV1")}}),e.struct("AccountEntry",[["accountId",e.lookup("AccountId")],["balance",e.lookup("Int64")],["seqNum",e.lookup("SequenceNumber")],["numSubEntries",e.lookup("Uint32")],["inflationDest",e.option(e.lookup("AccountId"))],["flags",e.lookup("Uint32")],["homeDomain",e.lookup("String32")],["thresholds",e.lookup("Thresholds")],["signers",e.varArray(e.lookup("Signer"),e.lookup("MAX_SIGNERS"))],["ext",e.lookup("AccountEntryExt")]]),e.enum("TrustLineFlags",{authorizedFlag:1,authorizedToMaintainLiabilitiesFlag:2,trustlineClawbackEnabledFlag:4}),e.const("MASK_TRUSTLINE_FLAGS",1),e.const("MASK_TRUSTLINE_FLAGS_V13",3),e.const("MASK_TRUSTLINE_FLAGS_V17",7),e.enum("LiquidityPoolType",{liquidityPoolConstantProduct:0}),e.union("TrustLineAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPoolId"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPoolId:e.lookup("PoolId")}}),e.union("TrustLineEntryExtensionV2Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TrustLineEntryExtensionV2",[["liquidityPoolUseCount",e.lookup("Int32")],["ext",e.lookup("TrustLineEntryExtensionV2Ext")]]),e.union("TrustLineEntryV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[2,"v2"]],arms:{v2:e.lookup("TrustLineEntryExtensionV2")}}),e.struct("TrustLineEntryV1",[["liabilities",e.lookup("Liabilities")],["ext",e.lookup("TrustLineEntryV1Ext")]]),e.union("TrustLineEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("TrustLineEntryV1")}}),e.struct("TrustLineEntry",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")],["balance",e.lookup("Int64")],["limit",e.lookup("Int64")],["flags",e.lookup("Uint32")],["ext",e.lookup("TrustLineEntryExt")]]),e.enum("OfferEntryFlags",{passiveFlag:1}),e.const("MASK_OFFERENTRY_FLAGS",1),e.union("OfferEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("OfferEntry",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["flags",e.lookup("Uint32")],["ext",e.lookup("OfferEntryExt")]]),e.union("DataEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("DataEntry",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")],["dataValue",e.lookup("DataValue")],["ext",e.lookup("DataEntryExt")]]),e.enum("ClaimPredicateType",{claimPredicateUnconditional:0,claimPredicateAnd:1,claimPredicateOr:2,claimPredicateNot:3,claimPredicateBeforeAbsoluteTime:4,claimPredicateBeforeRelativeTime:5}),e.union("ClaimPredicate",{switchOn:e.lookup("ClaimPredicateType"),switchName:"type",switches:[["claimPredicateUnconditional",e.void()],["claimPredicateAnd","andPredicates"],["claimPredicateOr","orPredicates"],["claimPredicateNot","notPredicate"],["claimPredicateBeforeAbsoluteTime","absBefore"],["claimPredicateBeforeRelativeTime","relBefore"]],arms:{andPredicates:e.varArray(e.lookup("ClaimPredicate"),2),orPredicates:e.varArray(e.lookup("ClaimPredicate"),2),notPredicate:e.option(e.lookup("ClaimPredicate")),absBefore:e.lookup("Int64"),relBefore:e.lookup("Int64")}}),e.enum("ClaimantType",{claimantTypeV0:0}),e.struct("ClaimantV0",[["destination",e.lookup("AccountId")],["predicate",e.lookup("ClaimPredicate")]]),e.union("Claimant",{switchOn:e.lookup("ClaimantType"),switchName:"type",switches:[["claimantTypeV0","v0"]],arms:{v0:e.lookup("ClaimantV0")}}),e.enum("ClaimableBalanceFlags",{claimableBalanceClawbackEnabledFlag:1}),e.const("MASK_CLAIMABLE_BALANCE_FLAGS",1),e.union("ClaimableBalanceEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("ClaimableBalanceEntryExtensionV1",[["ext",e.lookup("ClaimableBalanceEntryExtensionV1Ext")],["flags",e.lookup("Uint32")]]),e.union("ClaimableBalanceEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("ClaimableBalanceEntryExtensionV1")}}),e.struct("ClaimableBalanceEntry",[["balanceId",e.lookup("ClaimableBalanceId")],["claimants",e.varArray(e.lookup("Claimant"),10)],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["ext",e.lookup("ClaimableBalanceEntryExt")]]),e.struct("LiquidityPoolConstantProductParameters",[["assetA",e.lookup("Asset")],["assetB",e.lookup("Asset")],["fee",e.lookup("Int32")]]),e.struct("LiquidityPoolEntryConstantProduct",[["params",e.lookup("LiquidityPoolConstantProductParameters")],["reserveA",e.lookup("Int64")],["reserveB",e.lookup("Int64")],["totalPoolShares",e.lookup("Int64")],["poolSharesTrustLineCount",e.lookup("Int64")]]),e.union("LiquidityPoolEntryBody",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolEntryConstantProduct")}}),e.struct("LiquidityPoolEntry",[["liquidityPoolId",e.lookup("PoolId")],["body",e.lookup("LiquidityPoolEntryBody")]]),e.enum("ContractDataDurability",{temporary:0,persistent:1}),e.struct("ContractDataEntry",[["ext",e.lookup("ExtensionPoint")],["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")],["val",e.lookup("ScVal")]]),e.struct("ContractCodeCostInputs",[["ext",e.lookup("ExtensionPoint")],["nInstructions",e.lookup("Uint32")],["nFunctions",e.lookup("Uint32")],["nGlobals",e.lookup("Uint32")],["nTableEntries",e.lookup("Uint32")],["nTypes",e.lookup("Uint32")],["nDataSegments",e.lookup("Uint32")],["nElemSegments",e.lookup("Uint32")],["nImports",e.lookup("Uint32")],["nExports",e.lookup("Uint32")],["nDataSegmentBytes",e.lookup("Uint32")]]),e.struct("ContractCodeEntryV1",[["ext",e.lookup("ExtensionPoint")],["costInputs",e.lookup("ContractCodeCostInputs")]]),e.union("ContractCodeEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("ContractCodeEntryV1")}}),e.struct("ContractCodeEntry",[["ext",e.lookup("ContractCodeEntryExt")],["hash",e.lookup("Hash")],["code",e.varOpaque()]]),e.struct("TtlEntry",[["keyHash",e.lookup("Hash")],["liveUntilLedgerSeq",e.lookup("Uint32")]]),e.union("LedgerEntryExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerEntryExtensionV1",[["sponsoringId",e.lookup("SponsorshipDescriptor")],["ext",e.lookup("LedgerEntryExtensionV1Ext")]]),e.union("LedgerEntryData",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("AccountEntry"),trustLine:e.lookup("TrustLineEntry"),offer:e.lookup("OfferEntry"),data:e.lookup("DataEntry"),claimableBalance:e.lookup("ClaimableBalanceEntry"),liquidityPool:e.lookup("LiquidityPoolEntry"),contractData:e.lookup("ContractDataEntry"),contractCode:e.lookup("ContractCodeEntry"),configSetting:e.lookup("ConfigSettingEntry"),ttl:e.lookup("TtlEntry")}}),e.union("LedgerEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerEntryExtensionV1")}}),e.struct("LedgerEntry",[["lastModifiedLedgerSeq",e.lookup("Uint32")],["data",e.lookup("LedgerEntryData")],["ext",e.lookup("LedgerEntryExt")]]),e.struct("LedgerKeyAccount",[["accountId",e.lookup("AccountId")]]),e.struct("LedgerKeyTrustLine",[["accountId",e.lookup("AccountId")],["asset",e.lookup("TrustLineAsset")]]),e.struct("LedgerKeyOffer",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")]]),e.struct("LedgerKeyData",[["accountId",e.lookup("AccountId")],["dataName",e.lookup("String64")]]),e.struct("LedgerKeyClaimableBalance",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("LedgerKeyLiquidityPool",[["liquidityPoolId",e.lookup("PoolId")]]),e.struct("LedgerKeyContractData",[["contract",e.lookup("ScAddress")],["key",e.lookup("ScVal")],["durability",e.lookup("ContractDataDurability")]]),e.struct("LedgerKeyContractCode",[["hash",e.lookup("Hash")]]),e.struct("LedgerKeyConfigSetting",[["configSettingId",e.lookup("ConfigSettingId")]]),e.struct("LedgerKeyTtl",[["keyHash",e.lookup("Hash")]]),e.union("LedgerKey",{switchOn:e.lookup("LedgerEntryType"),switchName:"type",switches:[["account","account"],["trustline","trustLine"],["offer","offer"],["data","data"],["claimableBalance","claimableBalance"],["liquidityPool","liquidityPool"],["contractData","contractData"],["contractCode","contractCode"],["configSetting","configSetting"],["ttl","ttl"]],arms:{account:e.lookup("LedgerKeyAccount"),trustLine:e.lookup("LedgerKeyTrustLine"),offer:e.lookup("LedgerKeyOffer"),data:e.lookup("LedgerKeyData"),claimableBalance:e.lookup("LedgerKeyClaimableBalance"),liquidityPool:e.lookup("LedgerKeyLiquidityPool"),contractData:e.lookup("LedgerKeyContractData"),contractCode:e.lookup("LedgerKeyContractCode"),configSetting:e.lookup("LedgerKeyConfigSetting"),ttl:e.lookup("LedgerKeyTtl")}}),e.enum("EnvelopeType",{envelopeTypeTxV0:0,envelopeTypeScp:1,envelopeTypeTx:2,envelopeTypeAuth:3,envelopeTypeScpvalue:4,envelopeTypeTxFeeBump:5,envelopeTypeOpId:6,envelopeTypePoolRevokeOpId:7,envelopeTypeContractId:8,envelopeTypeSorobanAuthorization:9}),e.enum("BucketListType",{live:0,hotArchive:1}),e.enum("BucketEntryType",{metaentry:-1,liveentry:0,deadentry:1,initentry:2}),e.enum("HotArchiveBucketEntryType",{hotArchiveMetaentry:-1,hotArchiveArchived:0,hotArchiveLive:1}),e.union("BucketMetadataExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"bucketListType"]],arms:{bucketListType:e.lookup("BucketListType")}}),e.struct("BucketMetadata",[["ledgerVersion",e.lookup("Uint32")],["ext",e.lookup("BucketMetadataExt")]]),e.union("BucketEntry",{switchOn:e.lookup("BucketEntryType"),switchName:"type",switches:[["liveentry","liveEntry"],["initentry","liveEntry"],["deadentry","deadEntry"],["metaentry","metaEntry"]],arms:{liveEntry:e.lookup("LedgerEntry"),deadEntry:e.lookup("LedgerKey"),metaEntry:e.lookup("BucketMetadata")}}),e.union("HotArchiveBucketEntry",{switchOn:e.lookup("HotArchiveBucketEntryType"),switchName:"type",switches:[["hotArchiveArchived","archivedEntry"],["hotArchiveLive","key"],["hotArchiveMetaentry","metaEntry"]],arms:{archivedEntry:e.lookup("LedgerEntry"),key:e.lookup("LedgerKey"),metaEntry:e.lookup("BucketMetadata")}}),e.typedef("UpgradeType",e.varOpaque(128)),e.enum("StellarValueType",{stellarValueBasic:0,stellarValueSigned:1}),e.struct("LedgerCloseValueSignature",[["nodeId",e.lookup("NodeId")],["signature",e.lookup("Signature")]]),e.union("StellarValueExt",{switchOn:e.lookup("StellarValueType"),switchName:"v",switches:[["stellarValueBasic",e.void()],["stellarValueSigned","lcValueSignature"]],arms:{lcValueSignature:e.lookup("LedgerCloseValueSignature")}}),e.struct("StellarValue",[["txSetHash",e.lookup("Hash")],["closeTime",e.lookup("TimePoint")],["upgrades",e.varArray(e.lookup("UpgradeType"),6)],["ext",e.lookup("StellarValueExt")]]),e.const("MASK_LEDGER_HEADER_FLAGS",7),e.enum("LedgerHeaderFlags",{disableLiquidityPoolTradingFlag:1,disableLiquidityPoolDepositFlag:2,disableLiquidityPoolWithdrawalFlag:4}),e.union("LedgerHeaderExtensionV1Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderExtensionV1",[["flags",e.lookup("Uint32")],["ext",e.lookup("LedgerHeaderExtensionV1Ext")]]),e.union("LedgerHeaderExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerHeaderExtensionV1")}}),e.struct("LedgerHeader",[["ledgerVersion",e.lookup("Uint32")],["previousLedgerHash",e.lookup("Hash")],["scpValue",e.lookup("StellarValue")],["txSetResultHash",e.lookup("Hash")],["bucketListHash",e.lookup("Hash")],["ledgerSeq",e.lookup("Uint32")],["totalCoins",e.lookup("Int64")],["feePool",e.lookup("Int64")],["inflationSeq",e.lookup("Uint32")],["idPool",e.lookup("Uint64")],["baseFee",e.lookup("Uint32")],["baseReserve",e.lookup("Uint32")],["maxTxSetSize",e.lookup("Uint32")],["skipList",e.array(e.lookup("Hash"),4)],["ext",e.lookup("LedgerHeaderExt")]]),e.enum("LedgerUpgradeType",{ledgerUpgradeVersion:1,ledgerUpgradeBaseFee:2,ledgerUpgradeMaxTxSetSize:3,ledgerUpgradeBaseReserve:4,ledgerUpgradeFlags:5,ledgerUpgradeConfig:6,ledgerUpgradeMaxSorobanTxSetSize:7}),e.struct("ConfigUpgradeSetKey",[["contractId",e.lookup("ContractId")],["contentHash",e.lookup("Hash")]]),e.union("LedgerUpgrade",{switchOn:e.lookup("LedgerUpgradeType"),switchName:"type",switches:[["ledgerUpgradeVersion","newLedgerVersion"],["ledgerUpgradeBaseFee","newBaseFee"],["ledgerUpgradeMaxTxSetSize","newMaxTxSetSize"],["ledgerUpgradeBaseReserve","newBaseReserve"],["ledgerUpgradeFlags","newFlags"],["ledgerUpgradeConfig","newConfig"],["ledgerUpgradeMaxSorobanTxSetSize","newMaxSorobanTxSetSize"]],arms:{newLedgerVersion:e.lookup("Uint32"),newBaseFee:e.lookup("Uint32"),newMaxTxSetSize:e.lookup("Uint32"),newBaseReserve:e.lookup("Uint32"),newFlags:e.lookup("Uint32"),newConfig:e.lookup("ConfigUpgradeSetKey"),newMaxSorobanTxSetSize:e.lookup("Uint32")}}),e.struct("ConfigUpgradeSet",[["updatedEntry",e.varArray(e.lookup("ConfigSettingEntry"),2147483647)]]),e.enum("TxSetComponentType",{txsetCompTxsMaybeDiscountedFee:0}),e.typedef("DependentTxCluster",e.varArray(e.lookup("TransactionEnvelope"),2147483647)),e.typedef("ParallelTxExecutionStage",e.varArray(e.lookup("DependentTxCluster"),2147483647)),e.struct("ParallelTxsComponent",[["baseFee",e.option(e.lookup("Int64"))],["executionStages",e.varArray(e.lookup("ParallelTxExecutionStage"),2147483647)]]),e.struct("TxSetComponentTxsMaybeDiscountedFee",[["baseFee",e.option(e.lookup("Int64"))],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.union("TxSetComponent",{switchOn:e.lookup("TxSetComponentType"),switchName:"type",switches:[["txsetCompTxsMaybeDiscountedFee","txsMaybeDiscountedFee"]],arms:{txsMaybeDiscountedFee:e.lookup("TxSetComponentTxsMaybeDiscountedFee")}}),e.union("TransactionPhase",{switchOn:e.int(),switchName:"v",switches:[[0,"v0Components"],[1,"parallelTxsComponent"]],arms:{v0Components:e.varArray(e.lookup("TxSetComponent"),2147483647),parallelTxsComponent:e.lookup("ParallelTxsComponent")}}),e.struct("TransactionSet",[["previousLedgerHash",e.lookup("Hash")],["txes",e.varArray(e.lookup("TransactionEnvelope"),2147483647)]]),e.struct("TransactionSetV1",[["previousLedgerHash",e.lookup("Hash")],["phases",e.varArray(e.lookup("TransactionPhase"),2147483647)]]),e.union("GeneralizedTransactionSet",{switchOn:e.int(),switchName:"v",switches:[[1,"v1TxSet"]],arms:{v1TxSet:e.lookup("TransactionSetV1")}}),e.struct("TransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("TransactionResult")]]),e.struct("TransactionResultSet",[["results",e.varArray(e.lookup("TransactionResultPair"),2147483647)]]),e.union("TransactionHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"generalizedTxSet"]],arms:{generalizedTxSet:e.lookup("GeneralizedTransactionSet")}}),e.struct("TransactionHistoryEntry",[["ledgerSeq",e.lookup("Uint32")],["txSet",e.lookup("TransactionSet")],["ext",e.lookup("TransactionHistoryEntryExt")]]),e.union("TransactionHistoryResultEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionHistoryResultEntry",[["ledgerSeq",e.lookup("Uint32")],["txResultSet",e.lookup("TransactionResultSet")],["ext",e.lookup("TransactionHistoryResultEntryExt")]]),e.union("LedgerHeaderHistoryEntryExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("LedgerHeaderHistoryEntry",[["hash",e.lookup("Hash")],["header",e.lookup("LedgerHeader")],["ext",e.lookup("LedgerHeaderHistoryEntryExt")]]),e.struct("LedgerScpMessages",[["ledgerSeq",e.lookup("Uint32")],["messages",e.varArray(e.lookup("ScpEnvelope"),2147483647)]]),e.struct("ScpHistoryEntryV0",[["quorumSets",e.varArray(e.lookup("ScpQuorumSet"),2147483647)],["ledgerMessages",e.lookup("LedgerScpMessages")]]),e.union("ScpHistoryEntry",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ScpHistoryEntryV0")}}),e.enum("LedgerEntryChangeType",{ledgerEntryCreated:0,ledgerEntryUpdated:1,ledgerEntryRemoved:2,ledgerEntryState:3,ledgerEntryRestored:4}),e.union("LedgerEntryChange",{switchOn:e.lookup("LedgerEntryChangeType"),switchName:"type",switches:[["ledgerEntryCreated","created"],["ledgerEntryUpdated","updated"],["ledgerEntryRemoved","removed"],["ledgerEntryState","state"],["ledgerEntryRestored","restored"]],arms:{created:e.lookup("LedgerEntry"),updated:e.lookup("LedgerEntry"),removed:e.lookup("LedgerKey"),state:e.lookup("LedgerEntry"),restored:e.lookup("LedgerEntry")}}),e.typedef("LedgerEntryChanges",e.varArray(e.lookup("LedgerEntryChange"),2147483647)),e.struct("OperationMeta",[["changes",e.lookup("LedgerEntryChanges")]]),e.struct("TransactionMetaV1",[["txChanges",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)]]),e.struct("TransactionMetaV2",[["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")]]),e.enum("ContractEventType",{system:0,contract:1,diagnostic:2}),e.struct("ContractEventV0",[["topics",e.varArray(e.lookup("ScVal"),2147483647)],["data",e.lookup("ScVal")]]),e.union("ContractEventBody",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("ContractEventV0")}}),e.struct("ContractEvent",[["ext",e.lookup("ExtensionPoint")],["contractId",e.option(e.lookup("ContractId"))],["type",e.lookup("ContractEventType")],["body",e.lookup("ContractEventBody")]]),e.struct("DiagnosticEvent",[["inSuccessfulContractCall",e.bool()],["event",e.lookup("ContractEvent")]]),e.struct("SorobanTransactionMetaExtV1",[["ext",e.lookup("ExtensionPoint")],["totalNonRefundableResourceFeeCharged",e.lookup("Int64")],["totalRefundableResourceFeeCharged",e.lookup("Int64")],["rentFeeCharged",e.lookup("Int64")]]),e.union("SorobanTransactionMetaExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("SorobanTransactionMetaExtV1")}}),e.struct("SorobanTransactionMeta",[["ext",e.lookup("SorobanTransactionMetaExt")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)],["returnValue",e.lookup("ScVal")],["diagnosticEvents",e.varArray(e.lookup("DiagnosticEvent"),2147483647)]]),e.struct("TransactionMetaV3",[["ext",e.lookup("ExtensionPoint")],["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMeta"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")],["sorobanMeta",e.option(e.lookup("SorobanTransactionMeta"))]]),e.struct("OperationMetaV2",[["ext",e.lookup("ExtensionPoint")],["changes",e.lookup("LedgerEntryChanges")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)]]),e.struct("SorobanTransactionMetaV2",[["ext",e.lookup("SorobanTransactionMetaExt")],["returnValue",e.option(e.lookup("ScVal"))]]),e.enum("TransactionEventStage",{transactionEventStageBeforeAllTxes:0,transactionEventStageAfterTx:1,transactionEventStageAfterAllTxes:2}),e.struct("TransactionEvent",[["stage",e.lookup("TransactionEventStage")],["event",e.lookup("ContractEvent")]]),e.struct("TransactionMetaV4",[["ext",e.lookup("ExtensionPoint")],["txChangesBefore",e.lookup("LedgerEntryChanges")],["operations",e.varArray(e.lookup("OperationMetaV2"),2147483647)],["txChangesAfter",e.lookup("LedgerEntryChanges")],["sorobanMeta",e.option(e.lookup("SorobanTransactionMetaV2"))],["events",e.varArray(e.lookup("TransactionEvent"),2147483647)],["diagnosticEvents",e.varArray(e.lookup("DiagnosticEvent"),2147483647)]]),e.struct("InvokeHostFunctionSuccessPreImage",[["returnValue",e.lookup("ScVal")],["events",e.varArray(e.lookup("ContractEvent"),2147483647)]]),e.union("TransactionMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"operations"],[1,"v1"],[2,"v2"],[3,"v3"],[4,"v4"]],arms:{operations:e.varArray(e.lookup("OperationMeta"),2147483647),v1:e.lookup("TransactionMetaV1"),v2:e.lookup("TransactionMetaV2"),v3:e.lookup("TransactionMetaV3"),v4:e.lookup("TransactionMetaV4")}}),e.struct("TransactionResultMeta",[["result",e.lookup("TransactionResultPair")],["feeProcessing",e.lookup("LedgerEntryChanges")],["txApplyProcessing",e.lookup("TransactionMeta")]]),e.struct("TransactionResultMetaV1",[["ext",e.lookup("ExtensionPoint")],["result",e.lookup("TransactionResultPair")],["feeProcessing",e.lookup("LedgerEntryChanges")],["txApplyProcessing",e.lookup("TransactionMeta")],["postTxApplyFeeProcessing",e.lookup("LedgerEntryChanges")]]),e.struct("UpgradeEntryMeta",[["upgrade",e.lookup("LedgerUpgrade")],["changes",e.lookup("LedgerEntryChanges")]]),e.struct("LedgerCloseMetaV0",[["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("TransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)]]),e.struct("LedgerCloseMetaExtV1",[["ext",e.lookup("ExtensionPoint")],["sorobanFeeWrite1Kb",e.lookup("Int64")]]),e.union("LedgerCloseMetaExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"v1"]],arms:{v1:e.lookup("LedgerCloseMetaExtV1")}}),e.struct("LedgerCloseMetaV1",[["ext",e.lookup("LedgerCloseMetaExt")],["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("GeneralizedTransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMeta"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)],["totalByteSizeOfLiveSorobanState",e.lookup("Uint64")],["evictedKeys",e.varArray(e.lookup("LedgerKey"),2147483647)],["unused",e.varArray(e.lookup("LedgerEntry"),2147483647)]]),e.struct("LedgerCloseMetaV2",[["ext",e.lookup("LedgerCloseMetaExt")],["ledgerHeader",e.lookup("LedgerHeaderHistoryEntry")],["txSet",e.lookup("GeneralizedTransactionSet")],["txProcessing",e.varArray(e.lookup("TransactionResultMetaV1"),2147483647)],["upgradesProcessing",e.varArray(e.lookup("UpgradeEntryMeta"),2147483647)],["scpInfo",e.varArray(e.lookup("ScpHistoryEntry"),2147483647)],["totalByteSizeOfLiveSorobanState",e.lookup("Uint64")],["evictedKeys",e.varArray(e.lookup("LedgerKey"),2147483647)]]),e.union("LedgerCloseMeta",{switchOn:e.int(),switchName:"v",switches:[[0,"v0"],[1,"v1"],[2,"v2"]],arms:{v0:e.lookup("LedgerCloseMetaV0"),v1:e.lookup("LedgerCloseMetaV1"),v2:e.lookup("LedgerCloseMetaV2")}}),e.enum("ErrorCode",{errMisc:0,errData:1,errConf:2,errAuth:3,errLoad:4}),e.struct("Error",[["code",e.lookup("ErrorCode")],["msg",e.string(100)]]),e.struct("SendMore",[["numMessages",e.lookup("Uint32")]]),e.struct("SendMoreExtended",[["numMessages",e.lookup("Uint32")],["numBytes",e.lookup("Uint32")]]),e.struct("AuthCert",[["pubkey",e.lookup("Curve25519Public")],["expiration",e.lookup("Uint64")],["sig",e.lookup("Signature")]]),e.struct("Hello",[["ledgerVersion",e.lookup("Uint32")],["overlayVersion",e.lookup("Uint32")],["overlayMinVersion",e.lookup("Uint32")],["networkId",e.lookup("Hash")],["versionStr",e.string(100)],["listeningPort",e.int()],["peerId",e.lookup("NodeId")],["cert",e.lookup("AuthCert")],["nonce",e.lookup("Uint256")]]),e.const("AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED",200),e.struct("Auth",[["flags",e.int()]]),e.enum("IpAddrType",{iPv4:0,iPv6:1}),e.union("PeerAddressIp",{switchOn:e.lookup("IpAddrType"),switchName:"type",switches:[["iPv4","ipv4"],["iPv6","ipv6"]],arms:{ipv4:e.opaque(4),ipv6:e.opaque(16)}}),e.struct("PeerAddress",[["ip",e.lookup("PeerAddressIp")],["port",e.lookup("Uint32")],["numFailures",e.lookup("Uint32")]]),e.enum("MessageType",{errorMsg:0,auth:2,dontHave:3,peers:5,getTxSet:6,txSet:7,generalizedTxSet:17,transaction:8,getScpQuorumset:9,scpQuorumset:10,scpMessage:11,getScpState:12,hello:13,sendMore:16,sendMoreExtended:20,floodAdvert:18,floodDemand:19,timeSlicedSurveyRequest:21,timeSlicedSurveyResponse:22,timeSlicedSurveyStartCollecting:23,timeSlicedSurveyStopCollecting:24}),e.struct("DontHave",[["type",e.lookup("MessageType")],["reqHash",e.lookup("Uint256")]]),e.enum("SurveyMessageCommandType",{timeSlicedSurveyTopology:1}),e.enum("SurveyMessageResponseType",{surveyTopologyResponseV2:2}),e.struct("TimeSlicedSurveyStartCollectingMessage",[["surveyorId",e.lookup("NodeId")],["nonce",e.lookup("Uint32")],["ledgerNum",e.lookup("Uint32")]]),e.struct("SignedTimeSlicedSurveyStartCollectingMessage",[["signature",e.lookup("Signature")],["startCollecting",e.lookup("TimeSlicedSurveyStartCollectingMessage")]]),e.struct("TimeSlicedSurveyStopCollectingMessage",[["surveyorId",e.lookup("NodeId")],["nonce",e.lookup("Uint32")],["ledgerNum",e.lookup("Uint32")]]),e.struct("SignedTimeSlicedSurveyStopCollectingMessage",[["signature",e.lookup("Signature")],["stopCollecting",e.lookup("TimeSlicedSurveyStopCollectingMessage")]]),e.struct("SurveyRequestMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["encryptionKey",e.lookup("Curve25519Public")],["commandType",e.lookup("SurveyMessageCommandType")]]),e.struct("TimeSlicedSurveyRequestMessage",[["request",e.lookup("SurveyRequestMessage")],["nonce",e.lookup("Uint32")],["inboundPeersIndex",e.lookup("Uint32")],["outboundPeersIndex",e.lookup("Uint32")]]),e.struct("SignedTimeSlicedSurveyRequestMessage",[["requestSignature",e.lookup("Signature")],["request",e.lookup("TimeSlicedSurveyRequestMessage")]]),e.typedef("EncryptedBody",e.varOpaque(64e3)),e.struct("SurveyResponseMessage",[["surveyorPeerId",e.lookup("NodeId")],["surveyedPeerId",e.lookup("NodeId")],["ledgerNum",e.lookup("Uint32")],["commandType",e.lookup("SurveyMessageCommandType")],["encryptedBody",e.lookup("EncryptedBody")]]),e.struct("TimeSlicedSurveyResponseMessage",[["response",e.lookup("SurveyResponseMessage")],["nonce",e.lookup("Uint32")]]),e.struct("SignedTimeSlicedSurveyResponseMessage",[["responseSignature",e.lookup("Signature")],["response",e.lookup("TimeSlicedSurveyResponseMessage")]]),e.struct("PeerStats",[["id",e.lookup("NodeId")],["versionStr",e.string(100)],["messagesRead",e.lookup("Uint64")],["messagesWritten",e.lookup("Uint64")],["bytesRead",e.lookup("Uint64")],["bytesWritten",e.lookup("Uint64")],["secondsConnected",e.lookup("Uint64")],["uniqueFloodBytesRecv",e.lookup("Uint64")],["duplicateFloodBytesRecv",e.lookup("Uint64")],["uniqueFetchBytesRecv",e.lookup("Uint64")],["duplicateFetchBytesRecv",e.lookup("Uint64")],["uniqueFloodMessageRecv",e.lookup("Uint64")],["duplicateFloodMessageRecv",e.lookup("Uint64")],["uniqueFetchMessageRecv",e.lookup("Uint64")],["duplicateFetchMessageRecv",e.lookup("Uint64")]]),e.struct("TimeSlicedNodeData",[["addedAuthenticatedPeers",e.lookup("Uint32")],["droppedAuthenticatedPeers",e.lookup("Uint32")],["totalInboundPeerCount",e.lookup("Uint32")],["totalOutboundPeerCount",e.lookup("Uint32")],["p75ScpFirstToSelfLatencyMs",e.lookup("Uint32")],["p75ScpSelfToOtherLatencyMs",e.lookup("Uint32")],["lostSyncCount",e.lookup("Uint32")],["isValidator",e.bool()],["maxInboundPeerCount",e.lookup("Uint32")],["maxOutboundPeerCount",e.lookup("Uint32")]]),e.struct("TimeSlicedPeerData",[["peerStats",e.lookup("PeerStats")],["averageLatencyMs",e.lookup("Uint32")]]),e.typedef("TimeSlicedPeerDataList",e.varArray(e.lookup("TimeSlicedPeerData"),25)),e.struct("TopologyResponseBodyV2",[["inboundPeers",e.lookup("TimeSlicedPeerDataList")],["outboundPeers",e.lookup("TimeSlicedPeerDataList")],["nodeData",e.lookup("TimeSlicedNodeData")]]),e.union("SurveyResponseBody",{switchOn:e.lookup("SurveyMessageResponseType"),switchName:"type",switches:[["surveyTopologyResponseV2","topologyResponseBodyV2"]],arms:{topologyResponseBodyV2:e.lookup("TopologyResponseBodyV2")}}),e.const("TX_ADVERT_VECTOR_MAX_SIZE",1e3),e.typedef("TxAdvertVector",e.varArray(e.lookup("Hash"),e.lookup("TX_ADVERT_VECTOR_MAX_SIZE"))),e.struct("FloodAdvert",[["txHashes",e.lookup("TxAdvertVector")]]),e.const("TX_DEMAND_VECTOR_MAX_SIZE",1e3),e.typedef("TxDemandVector",e.varArray(e.lookup("Hash"),e.lookup("TX_DEMAND_VECTOR_MAX_SIZE"))),e.struct("FloodDemand",[["txHashes",e.lookup("TxDemandVector")]]),e.union("StellarMessage",{switchOn:e.lookup("MessageType"),switchName:"type",switches:[["errorMsg","error"],["hello","hello"],["auth","auth"],["dontHave","dontHave"],["peers","peers"],["getTxSet","txSetHash"],["txSet","txSet"],["generalizedTxSet","generalizedTxSet"],["transaction","transaction"],["timeSlicedSurveyRequest","signedTimeSlicedSurveyRequestMessage"],["timeSlicedSurveyResponse","signedTimeSlicedSurveyResponseMessage"],["timeSlicedSurveyStartCollecting","signedTimeSlicedSurveyStartCollectingMessage"],["timeSlicedSurveyStopCollecting","signedTimeSlicedSurveyStopCollectingMessage"],["getScpQuorumset","qSetHash"],["scpQuorumset","qSet"],["scpMessage","envelope"],["getScpState","getScpLedgerSeq"],["sendMore","sendMoreMessage"],["sendMoreExtended","sendMoreExtendedMessage"],["floodAdvert","floodAdvert"],["floodDemand","floodDemand"]],arms:{error:e.lookup("Error"),hello:e.lookup("Hello"),auth:e.lookup("Auth"),dontHave:e.lookup("DontHave"),peers:e.varArray(e.lookup("PeerAddress"),100),txSetHash:e.lookup("Uint256"),txSet:e.lookup("TransactionSet"),generalizedTxSet:e.lookup("GeneralizedTransactionSet"),transaction:e.lookup("TransactionEnvelope"),signedTimeSlicedSurveyRequestMessage:e.lookup("SignedTimeSlicedSurveyRequestMessage"),signedTimeSlicedSurveyResponseMessage:e.lookup("SignedTimeSlicedSurveyResponseMessage"),signedTimeSlicedSurveyStartCollectingMessage:e.lookup("SignedTimeSlicedSurveyStartCollectingMessage"),signedTimeSlicedSurveyStopCollectingMessage:e.lookup("SignedTimeSlicedSurveyStopCollectingMessage"),qSetHash:e.lookup("Uint256"),qSet:e.lookup("ScpQuorumSet"),envelope:e.lookup("ScpEnvelope"),getScpLedgerSeq:e.lookup("Uint32"),sendMoreMessage:e.lookup("SendMore"),sendMoreExtendedMessage:e.lookup("SendMoreExtended"),floodAdvert:e.lookup("FloodAdvert"),floodDemand:e.lookup("FloodDemand")}}),e.struct("AuthenticatedMessageV0",[["sequence",e.lookup("Uint64")],["message",e.lookup("StellarMessage")],["mac",e.lookup("HmacSha256Mac")]]),e.union("AuthenticatedMessage",{switchOn:e.lookup("Uint32"),switchName:"v",switches:[[0,"v0"]],arms:{v0:e.lookup("AuthenticatedMessageV0")}}),e.const("MAX_OPS_PER_TX",100),e.union("LiquidityPoolParameters",{switchOn:e.lookup("LiquidityPoolType"),switchName:"type",switches:[["liquidityPoolConstantProduct","constantProduct"]],arms:{constantProduct:e.lookup("LiquidityPoolConstantProductParameters")}}),e.struct("MuxedAccountMed25519",[["id",e.lookup("Uint64")],["ed25519",e.lookup("Uint256")]]),e.union("MuxedAccount",{switchOn:e.lookup("CryptoKeyType"),switchName:"type",switches:[["keyTypeEd25519","ed25519"],["keyTypeMuxedEd25519","med25519"]],arms:{ed25519:e.lookup("Uint256"),med25519:e.lookup("MuxedAccountMed25519")}}),e.struct("DecoratedSignature",[["hint",e.lookup("SignatureHint")],["signature",e.lookup("Signature")]]),e.enum("OperationType",{createAccount:0,payment:1,pathPaymentStrictReceive:2,manageSellOffer:3,createPassiveSellOffer:4,setOptions:5,changeTrust:6,allowTrust:7,accountMerge:8,inflation:9,manageData:10,bumpSequence:11,manageBuyOffer:12,pathPaymentStrictSend:13,createClaimableBalance:14,claimClaimableBalance:15,beginSponsoringFutureReserves:16,endSponsoringFutureReserves:17,revokeSponsorship:18,clawback:19,clawbackClaimableBalance:20,setTrustLineFlags:21,liquidityPoolDeposit:22,liquidityPoolWithdraw:23,invokeHostFunction:24,extendFootprintTtl:25,restoreFootprint:26}),e.struct("CreateAccountOp",[["destination",e.lookup("AccountId")],["startingBalance",e.lookup("Int64")]]),e.struct("PaymentOp",[["destination",e.lookup("MuxedAccount")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveOp",[["sendAsset",e.lookup("Asset")],["sendMax",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destAmount",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("PathPaymentStrictSendOp",[["sendAsset",e.lookup("Asset")],["sendAmount",e.lookup("Int64")],["destination",e.lookup("MuxedAccount")],["destAsset",e.lookup("Asset")],["destMin",e.lookup("Int64")],["path",e.varArray(e.lookup("Asset"),5)]]),e.struct("ManageSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("ManageBuyOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["buyAmount",e.lookup("Int64")],["price",e.lookup("Price")],["offerId",e.lookup("Int64")]]),e.struct("CreatePassiveSellOfferOp",[["selling",e.lookup("Asset")],["buying",e.lookup("Asset")],["amount",e.lookup("Int64")],["price",e.lookup("Price")]]),e.struct("SetOptionsOp",[["inflationDest",e.option(e.lookup("AccountId"))],["clearFlags",e.option(e.lookup("Uint32"))],["setFlags",e.option(e.lookup("Uint32"))],["masterWeight",e.option(e.lookup("Uint32"))],["lowThreshold",e.option(e.lookup("Uint32"))],["medThreshold",e.option(e.lookup("Uint32"))],["highThreshold",e.option(e.lookup("Uint32"))],["homeDomain",e.option(e.lookup("String32"))],["signer",e.option(e.lookup("Signer"))]]),e.union("ChangeTrustAsset",{switchOn:e.lookup("AssetType"),switchName:"type",switches:[["assetTypeNative",e.void()],["assetTypeCreditAlphanum4","alphaNum4"],["assetTypeCreditAlphanum12","alphaNum12"],["assetTypePoolShare","liquidityPool"]],arms:{alphaNum4:e.lookup("AlphaNum4"),alphaNum12:e.lookup("AlphaNum12"),liquidityPool:e.lookup("LiquidityPoolParameters")}}),e.struct("ChangeTrustOp",[["line",e.lookup("ChangeTrustAsset")],["limit",e.lookup("Int64")]]),e.struct("AllowTrustOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("AssetCode")],["authorize",e.lookup("Uint32")]]),e.struct("ManageDataOp",[["dataName",e.lookup("String64")],["dataValue",e.option(e.lookup("DataValue"))]]),e.struct("BumpSequenceOp",[["bumpTo",e.lookup("SequenceNumber")]]),e.struct("CreateClaimableBalanceOp",[["asset",e.lookup("Asset")],["amount",e.lookup("Int64")],["claimants",e.varArray(e.lookup("Claimant"),10)]]),e.struct("ClaimClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("BeginSponsoringFutureReservesOp",[["sponsoredId",e.lookup("AccountId")]]),e.enum("RevokeSponsorshipType",{revokeSponsorshipLedgerEntry:0,revokeSponsorshipSigner:1}),e.struct("RevokeSponsorshipOpSigner",[["accountId",e.lookup("AccountId")],["signerKey",e.lookup("SignerKey")]]),e.union("RevokeSponsorshipOp",{switchOn:e.lookup("RevokeSponsorshipType"),switchName:"type",switches:[["revokeSponsorshipLedgerEntry","ledgerKey"],["revokeSponsorshipSigner","signer"]],arms:{ledgerKey:e.lookup("LedgerKey"),signer:e.lookup("RevokeSponsorshipOpSigner")}}),e.struct("ClawbackOp",[["asset",e.lookup("Asset")],["from",e.lookup("MuxedAccount")],["amount",e.lookup("Int64")]]),e.struct("ClawbackClaimableBalanceOp",[["balanceId",e.lookup("ClaimableBalanceId")]]),e.struct("SetTrustLineFlagsOp",[["trustor",e.lookup("AccountId")],["asset",e.lookup("Asset")],["clearFlags",e.lookup("Uint32")],["setFlags",e.lookup("Uint32")]]),e.const("LIQUIDITY_POOL_FEE_V18",30),e.struct("LiquidityPoolDepositOp",[["liquidityPoolId",e.lookup("PoolId")],["maxAmountA",e.lookup("Int64")],["maxAmountB",e.lookup("Int64")],["minPrice",e.lookup("Price")],["maxPrice",e.lookup("Price")]]),e.struct("LiquidityPoolWithdrawOp",[["liquidityPoolId",e.lookup("PoolId")],["amount",e.lookup("Int64")],["minAmountA",e.lookup("Int64")],["minAmountB",e.lookup("Int64")]]),e.enum("HostFunctionType",{hostFunctionTypeInvokeContract:0,hostFunctionTypeCreateContract:1,hostFunctionTypeUploadContractWasm:2,hostFunctionTypeCreateContractV2:3}),e.enum("ContractIdPreimageType",{contractIdPreimageFromAddress:0,contractIdPreimageFromAsset:1}),e.struct("ContractIdPreimageFromAddress",[["address",e.lookup("ScAddress")],["salt",e.lookup("Uint256")]]),e.union("ContractIdPreimage",{switchOn:e.lookup("ContractIdPreimageType"),switchName:"type",switches:[["contractIdPreimageFromAddress","fromAddress"],["contractIdPreimageFromAsset","fromAsset"]],arms:{fromAddress:e.lookup("ContractIdPreimageFromAddress"),fromAsset:e.lookup("Asset")}}),e.struct("CreateContractArgs",[["contractIdPreimage",e.lookup("ContractIdPreimage")],["executable",e.lookup("ContractExecutable")]]),e.struct("CreateContractArgsV2",[["contractIdPreimage",e.lookup("ContractIdPreimage")],["executable",e.lookup("ContractExecutable")],["constructorArgs",e.varArray(e.lookup("ScVal"),2147483647)]]),e.struct("InvokeContractArgs",[["contractAddress",e.lookup("ScAddress")],["functionName",e.lookup("ScSymbol")],["args",e.varArray(e.lookup("ScVal"),2147483647)]]),e.union("HostFunction",{switchOn:e.lookup("HostFunctionType"),switchName:"type",switches:[["hostFunctionTypeInvokeContract","invokeContract"],["hostFunctionTypeCreateContract","createContract"],["hostFunctionTypeUploadContractWasm","wasm"],["hostFunctionTypeCreateContractV2","createContractV2"]],arms:{invokeContract:e.lookup("InvokeContractArgs"),createContract:e.lookup("CreateContractArgs"),wasm:e.varOpaque(),createContractV2:e.lookup("CreateContractArgsV2")}}),e.enum("SorobanAuthorizedFunctionType",{sorobanAuthorizedFunctionTypeContractFn:0,sorobanAuthorizedFunctionTypeCreateContractHostFn:1,sorobanAuthorizedFunctionTypeCreateContractV2HostFn:2}),e.union("SorobanAuthorizedFunction",{switchOn:e.lookup("SorobanAuthorizedFunctionType"),switchName:"type",switches:[["sorobanAuthorizedFunctionTypeContractFn","contractFn"],["sorobanAuthorizedFunctionTypeCreateContractHostFn","createContractHostFn"],["sorobanAuthorizedFunctionTypeCreateContractV2HostFn","createContractV2HostFn"]],arms:{contractFn:e.lookup("InvokeContractArgs"),createContractHostFn:e.lookup("CreateContractArgs"),createContractV2HostFn:e.lookup("CreateContractArgsV2")}}),e.struct("SorobanAuthorizedInvocation",[["function",e.lookup("SorobanAuthorizedFunction")],["subInvocations",e.varArray(e.lookup("SorobanAuthorizedInvocation"),2147483647)]]),e.struct("SorobanAddressCredentials",[["address",e.lookup("ScAddress")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["signature",e.lookup("ScVal")]]),e.enum("SorobanCredentialsType",{sorobanCredentialsSourceAccount:0,sorobanCredentialsAddress:1}),e.union("SorobanCredentials",{switchOn:e.lookup("SorobanCredentialsType"),switchName:"type",switches:[["sorobanCredentialsSourceAccount",e.void()],["sorobanCredentialsAddress","address"]],arms:{address:e.lookup("SorobanAddressCredentials")}}),e.struct("SorobanAuthorizationEntry",[["credentials",e.lookup("SorobanCredentials")],["rootInvocation",e.lookup("SorobanAuthorizedInvocation")]]),e.typedef("SorobanAuthorizationEntries",e.varArray(e.lookup("SorobanAuthorizationEntry"),2147483647)),e.struct("InvokeHostFunctionOp",[["hostFunction",e.lookup("HostFunction")],["auth",e.varArray(e.lookup("SorobanAuthorizationEntry"),2147483647)]]),e.struct("ExtendFootprintTtlOp",[["ext",e.lookup("ExtensionPoint")],["extendTo",e.lookup("Uint32")]]),e.struct("RestoreFootprintOp",[["ext",e.lookup("ExtensionPoint")]]),e.union("OperationBody",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountOp"],["payment","paymentOp"],["pathPaymentStrictReceive","pathPaymentStrictReceiveOp"],["manageSellOffer","manageSellOfferOp"],["createPassiveSellOffer","createPassiveSellOfferOp"],["setOptions","setOptionsOp"],["changeTrust","changeTrustOp"],["allowTrust","allowTrustOp"],["accountMerge","destination"],["inflation",e.void()],["manageData","manageDataOp"],["bumpSequence","bumpSequenceOp"],["manageBuyOffer","manageBuyOfferOp"],["pathPaymentStrictSend","pathPaymentStrictSendOp"],["createClaimableBalance","createClaimableBalanceOp"],["claimClaimableBalance","claimClaimableBalanceOp"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesOp"],["endSponsoringFutureReserves",e.void()],["revokeSponsorship","revokeSponsorshipOp"],["clawback","clawbackOp"],["clawbackClaimableBalance","clawbackClaimableBalanceOp"],["setTrustLineFlags","setTrustLineFlagsOp"],["liquidityPoolDeposit","liquidityPoolDepositOp"],["liquidityPoolWithdraw","liquidityPoolWithdrawOp"],["invokeHostFunction","invokeHostFunctionOp"],["extendFootprintTtl","extendFootprintTtlOp"],["restoreFootprint","restoreFootprintOp"]],arms:{createAccountOp:e.lookup("CreateAccountOp"),paymentOp:e.lookup("PaymentOp"),pathPaymentStrictReceiveOp:e.lookup("PathPaymentStrictReceiveOp"),manageSellOfferOp:e.lookup("ManageSellOfferOp"),createPassiveSellOfferOp:e.lookup("CreatePassiveSellOfferOp"),setOptionsOp:e.lookup("SetOptionsOp"),changeTrustOp:e.lookup("ChangeTrustOp"),allowTrustOp:e.lookup("AllowTrustOp"),destination:e.lookup("MuxedAccount"),manageDataOp:e.lookup("ManageDataOp"),bumpSequenceOp:e.lookup("BumpSequenceOp"),manageBuyOfferOp:e.lookup("ManageBuyOfferOp"),pathPaymentStrictSendOp:e.lookup("PathPaymentStrictSendOp"),createClaimableBalanceOp:e.lookup("CreateClaimableBalanceOp"),claimClaimableBalanceOp:e.lookup("ClaimClaimableBalanceOp"),beginSponsoringFutureReservesOp:e.lookup("BeginSponsoringFutureReservesOp"),revokeSponsorshipOp:e.lookup("RevokeSponsorshipOp"),clawbackOp:e.lookup("ClawbackOp"),clawbackClaimableBalanceOp:e.lookup("ClawbackClaimableBalanceOp"),setTrustLineFlagsOp:e.lookup("SetTrustLineFlagsOp"),liquidityPoolDepositOp:e.lookup("LiquidityPoolDepositOp"),liquidityPoolWithdrawOp:e.lookup("LiquidityPoolWithdrawOp"),invokeHostFunctionOp:e.lookup("InvokeHostFunctionOp"),extendFootprintTtlOp:e.lookup("ExtendFootprintTtlOp"),restoreFootprintOp:e.lookup("RestoreFootprintOp")}}),e.struct("Operation",[["sourceAccount",e.option(e.lookup("MuxedAccount"))],["body",e.lookup("OperationBody")]]),e.struct("HashIdPreimageOperationId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")]]),e.struct("HashIdPreimageRevokeId",[["sourceAccount",e.lookup("AccountId")],["seqNum",e.lookup("SequenceNumber")],["opNum",e.lookup("Uint32")],["liquidityPoolId",e.lookup("PoolId")],["asset",e.lookup("Asset")]]),e.struct("HashIdPreimageContractId",[["networkId",e.lookup("Hash")],["contractIdPreimage",e.lookup("ContractIdPreimage")]]),e.struct("HashIdPreimageSorobanAuthorization",[["networkId",e.lookup("Hash")],["nonce",e.lookup("Int64")],["signatureExpirationLedger",e.lookup("Uint32")],["invocation",e.lookup("SorobanAuthorizedInvocation")]]),e.union("HashIdPreimage",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeOpId","operationId"],["envelopeTypePoolRevokeOpId","revokeId"],["envelopeTypeContractId","contractId"],["envelopeTypeSorobanAuthorization","sorobanAuthorization"]],arms:{operationId:e.lookup("HashIdPreimageOperationId"),revokeId:e.lookup("HashIdPreimageRevokeId"),contractId:e.lookup("HashIdPreimageContractId"),sorobanAuthorization:e.lookup("HashIdPreimageSorobanAuthorization")}}),e.enum("MemoType",{memoNone:0,memoText:1,memoId:2,memoHash:3,memoReturn:4}),e.union("Memo",{switchOn:e.lookup("MemoType"),switchName:"type",switches:[["memoNone",e.void()],["memoText","text"],["memoId","id"],["memoHash","hash"],["memoReturn","retHash"]],arms:{text:e.string(28),id:e.lookup("Uint64"),hash:e.lookup("Hash"),retHash:e.lookup("Hash")}}),e.struct("TimeBounds",[["minTime",e.lookup("TimePoint")],["maxTime",e.lookup("TimePoint")]]),e.struct("LedgerBounds",[["minLedger",e.lookup("Uint32")],["maxLedger",e.lookup("Uint32")]]),e.struct("PreconditionsV2",[["timeBounds",e.option(e.lookup("TimeBounds"))],["ledgerBounds",e.option(e.lookup("LedgerBounds"))],["minSeqNum",e.option(e.lookup("SequenceNumber"))],["minSeqAge",e.lookup("Duration")],["minSeqLedgerGap",e.lookup("Uint32")],["extraSigners",e.varArray(e.lookup("SignerKey"),2)]]),e.enum("PreconditionType",{precondNone:0,precondTime:1,precondV2:2}),e.union("Preconditions",{switchOn:e.lookup("PreconditionType"),switchName:"type",switches:[["precondNone",e.void()],["precondTime","timeBounds"],["precondV2","v2"]],arms:{timeBounds:e.lookup("TimeBounds"),v2:e.lookup("PreconditionsV2")}}),e.struct("LedgerFootprint",[["readOnly",e.varArray(e.lookup("LedgerKey"),2147483647)],["readWrite",e.varArray(e.lookup("LedgerKey"),2147483647)]]),e.struct("SorobanResources",[["footprint",e.lookup("LedgerFootprint")],["instructions",e.lookup("Uint32")],["diskReadBytes",e.lookup("Uint32")],["writeBytes",e.lookup("Uint32")]]),e.struct("SorobanResourcesExtV0",[["archivedSorobanEntries",e.varArray(e.lookup("Uint32"),2147483647)]]),e.union("SorobanTransactionDataExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"resourceExt"]],arms:{resourceExt:e.lookup("SorobanResourcesExtV0")}}),e.struct("SorobanTransactionData",[["ext",e.lookup("SorobanTransactionDataExt")],["resources",e.lookup("SorobanResources")],["resourceFee",e.lookup("Int64")]]),e.union("TransactionV0Ext",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionV0",[["sourceAccountEd25519",e.lookup("Uint256")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["timeBounds",e.option(e.lookup("TimeBounds"))],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionV0Ext")]]),e.struct("TransactionV0Envelope",[["tx",e.lookup("TransactionV0")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()],[1,"sorobanData"]],arms:{sorobanData:e.lookup("SorobanTransactionData")}}),e.struct("Transaction",[["sourceAccount",e.lookup("MuxedAccount")],["fee",e.lookup("Uint32")],["seqNum",e.lookup("SequenceNumber")],["cond",e.lookup("Preconditions")],["memo",e.lookup("Memo")],["operations",e.varArray(e.lookup("Operation"),e.lookup("MAX_OPS_PER_TX"))],["ext",e.lookup("TransactionExt")]]),e.struct("TransactionV1Envelope",[["tx",e.lookup("Transaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("FeeBumpTransactionInnerTx",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","v1"]],arms:{v1:e.lookup("TransactionV1Envelope")}}),e.union("FeeBumpTransactionExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("FeeBumpTransaction",[["feeSource",e.lookup("MuxedAccount")],["fee",e.lookup("Int64")],["innerTx",e.lookup("FeeBumpTransactionInnerTx")],["ext",e.lookup("FeeBumpTransactionExt")]]),e.struct("FeeBumpTransactionEnvelope",[["tx",e.lookup("FeeBumpTransaction")],["signatures",e.varArray(e.lookup("DecoratedSignature"),20)]]),e.union("TransactionEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTxV0","v0"],["envelopeTypeTx","v1"],["envelopeTypeTxFeeBump","feeBump"]],arms:{v0:e.lookup("TransactionV0Envelope"),v1:e.lookup("TransactionV1Envelope"),feeBump:e.lookup("FeeBumpTransactionEnvelope")}}),e.union("TransactionSignaturePayloadTaggedTransaction",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeTx","tx"],["envelopeTypeTxFeeBump","feeBump"]],arms:{tx:e.lookup("Transaction"),feeBump:e.lookup("FeeBumpTransaction")}}),e.struct("TransactionSignaturePayload",[["networkId",e.lookup("Hash")],["taggedTransaction",e.lookup("TransactionSignaturePayloadTaggedTransaction")]]),e.enum("ClaimAtomType",{claimAtomTypeV0:0,claimAtomTypeOrderBook:1,claimAtomTypeLiquidityPool:2}),e.struct("ClaimOfferAtomV0",[["sellerEd25519",e.lookup("Uint256")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimOfferAtom",[["sellerId",e.lookup("AccountId")],["offerId",e.lookup("Int64")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.struct("ClaimLiquidityAtom",[["liquidityPoolId",e.lookup("PoolId")],["assetSold",e.lookup("Asset")],["amountSold",e.lookup("Int64")],["assetBought",e.lookup("Asset")],["amountBought",e.lookup("Int64")]]),e.union("ClaimAtom",{switchOn:e.lookup("ClaimAtomType"),switchName:"type",switches:[["claimAtomTypeV0","v0"],["claimAtomTypeOrderBook","orderBook"],["claimAtomTypeLiquidityPool","liquidityPool"]],arms:{v0:e.lookup("ClaimOfferAtomV0"),orderBook:e.lookup("ClaimOfferAtom"),liquidityPool:e.lookup("ClaimLiquidityAtom")}}),e.enum("CreateAccountResultCode",{createAccountSuccess:0,createAccountMalformed:-1,createAccountUnderfunded:-2,createAccountLowReserve:-3,createAccountAlreadyExist:-4}),e.union("CreateAccountResult",{switchOn:e.lookup("CreateAccountResultCode"),switchName:"code",switches:[["createAccountSuccess",e.void()],["createAccountMalformed",e.void()],["createAccountUnderfunded",e.void()],["createAccountLowReserve",e.void()],["createAccountAlreadyExist",e.void()]],arms:{}}),e.enum("PaymentResultCode",{paymentSuccess:0,paymentMalformed:-1,paymentUnderfunded:-2,paymentSrcNoTrust:-3,paymentSrcNotAuthorized:-4,paymentNoDestination:-5,paymentNoTrust:-6,paymentNotAuthorized:-7,paymentLineFull:-8,paymentNoIssuer:-9}),e.union("PaymentResult",{switchOn:e.lookup("PaymentResultCode"),switchName:"code",switches:[["paymentSuccess",e.void()],["paymentMalformed",e.void()],["paymentUnderfunded",e.void()],["paymentSrcNoTrust",e.void()],["paymentSrcNotAuthorized",e.void()],["paymentNoDestination",e.void()],["paymentNoTrust",e.void()],["paymentNotAuthorized",e.void()],["paymentLineFull",e.void()],["paymentNoIssuer",e.void()]],arms:{}}),e.enum("PathPaymentStrictReceiveResultCode",{pathPaymentStrictReceiveSuccess:0,pathPaymentStrictReceiveMalformed:-1,pathPaymentStrictReceiveUnderfunded:-2,pathPaymentStrictReceiveSrcNoTrust:-3,pathPaymentStrictReceiveSrcNotAuthorized:-4,pathPaymentStrictReceiveNoDestination:-5,pathPaymentStrictReceiveNoTrust:-6,pathPaymentStrictReceiveNotAuthorized:-7,pathPaymentStrictReceiveLineFull:-8,pathPaymentStrictReceiveNoIssuer:-9,pathPaymentStrictReceiveTooFewOffers:-10,pathPaymentStrictReceiveOfferCrossSelf:-11,pathPaymentStrictReceiveOverSendmax:-12}),e.struct("SimplePaymentResult",[["destination",e.lookup("AccountId")],["asset",e.lookup("Asset")],["amount",e.lookup("Int64")]]),e.struct("PathPaymentStrictReceiveResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictReceiveResult",{switchOn:e.lookup("PathPaymentStrictReceiveResultCode"),switchName:"code",switches:[["pathPaymentStrictReceiveSuccess","success"],["pathPaymentStrictReceiveMalformed",e.void()],["pathPaymentStrictReceiveUnderfunded",e.void()],["pathPaymentStrictReceiveSrcNoTrust",e.void()],["pathPaymentStrictReceiveSrcNotAuthorized",e.void()],["pathPaymentStrictReceiveNoDestination",e.void()],["pathPaymentStrictReceiveNoTrust",e.void()],["pathPaymentStrictReceiveNotAuthorized",e.void()],["pathPaymentStrictReceiveLineFull",e.void()],["pathPaymentStrictReceiveNoIssuer","noIssuer"],["pathPaymentStrictReceiveTooFewOffers",e.void()],["pathPaymentStrictReceiveOfferCrossSelf",e.void()],["pathPaymentStrictReceiveOverSendmax",e.void()]],arms:{success:e.lookup("PathPaymentStrictReceiveResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("PathPaymentStrictSendResultCode",{pathPaymentStrictSendSuccess:0,pathPaymentStrictSendMalformed:-1,pathPaymentStrictSendUnderfunded:-2,pathPaymentStrictSendSrcNoTrust:-3,pathPaymentStrictSendSrcNotAuthorized:-4,pathPaymentStrictSendNoDestination:-5,pathPaymentStrictSendNoTrust:-6,pathPaymentStrictSendNotAuthorized:-7,pathPaymentStrictSendLineFull:-8,pathPaymentStrictSendNoIssuer:-9,pathPaymentStrictSendTooFewOffers:-10,pathPaymentStrictSendOfferCrossSelf:-11,pathPaymentStrictSendUnderDestmin:-12}),e.struct("PathPaymentStrictSendResultSuccess",[["offers",e.varArray(e.lookup("ClaimAtom"),2147483647)],["last",e.lookup("SimplePaymentResult")]]),e.union("PathPaymentStrictSendResult",{switchOn:e.lookup("PathPaymentStrictSendResultCode"),switchName:"code",switches:[["pathPaymentStrictSendSuccess","success"],["pathPaymentStrictSendMalformed",e.void()],["pathPaymentStrictSendUnderfunded",e.void()],["pathPaymentStrictSendSrcNoTrust",e.void()],["pathPaymentStrictSendSrcNotAuthorized",e.void()],["pathPaymentStrictSendNoDestination",e.void()],["pathPaymentStrictSendNoTrust",e.void()],["pathPaymentStrictSendNotAuthorized",e.void()],["pathPaymentStrictSendLineFull",e.void()],["pathPaymentStrictSendNoIssuer","noIssuer"],["pathPaymentStrictSendTooFewOffers",e.void()],["pathPaymentStrictSendOfferCrossSelf",e.void()],["pathPaymentStrictSendUnderDestmin",e.void()]],arms:{success:e.lookup("PathPaymentStrictSendResultSuccess"),noIssuer:e.lookup("Asset")}}),e.enum("ManageSellOfferResultCode",{manageSellOfferSuccess:0,manageSellOfferMalformed:-1,manageSellOfferSellNoTrust:-2,manageSellOfferBuyNoTrust:-3,manageSellOfferSellNotAuthorized:-4,manageSellOfferBuyNotAuthorized:-5,manageSellOfferLineFull:-6,manageSellOfferUnderfunded:-7,manageSellOfferCrossSelf:-8,manageSellOfferSellNoIssuer:-9,manageSellOfferBuyNoIssuer:-10,manageSellOfferNotFound:-11,manageSellOfferLowReserve:-12}),e.enum("ManageOfferEffect",{manageOfferCreated:0,manageOfferUpdated:1,manageOfferDeleted:2}),e.union("ManageOfferSuccessResultOffer",{switchOn:e.lookup("ManageOfferEffect"),switchName:"effect",switches:[["manageOfferCreated","offer"],["manageOfferUpdated","offer"],["manageOfferDeleted",e.void()]],arms:{offer:e.lookup("OfferEntry")}}),e.struct("ManageOfferSuccessResult",[["offersClaimed",e.varArray(e.lookup("ClaimAtom"),2147483647)],["offer",e.lookup("ManageOfferSuccessResultOffer")]]),e.union("ManageSellOfferResult",{switchOn:e.lookup("ManageSellOfferResultCode"),switchName:"code",switches:[["manageSellOfferSuccess","success"],["manageSellOfferMalformed",e.void()],["manageSellOfferSellNoTrust",e.void()],["manageSellOfferBuyNoTrust",e.void()],["manageSellOfferSellNotAuthorized",e.void()],["manageSellOfferBuyNotAuthorized",e.void()],["manageSellOfferLineFull",e.void()],["manageSellOfferUnderfunded",e.void()],["manageSellOfferCrossSelf",e.void()],["manageSellOfferSellNoIssuer",e.void()],["manageSellOfferBuyNoIssuer",e.void()],["manageSellOfferNotFound",e.void()],["manageSellOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("ManageBuyOfferResultCode",{manageBuyOfferSuccess:0,manageBuyOfferMalformed:-1,manageBuyOfferSellNoTrust:-2,manageBuyOfferBuyNoTrust:-3,manageBuyOfferSellNotAuthorized:-4,manageBuyOfferBuyNotAuthorized:-5,manageBuyOfferLineFull:-6,manageBuyOfferUnderfunded:-7,manageBuyOfferCrossSelf:-8,manageBuyOfferSellNoIssuer:-9,manageBuyOfferBuyNoIssuer:-10,manageBuyOfferNotFound:-11,manageBuyOfferLowReserve:-12}),e.union("ManageBuyOfferResult",{switchOn:e.lookup("ManageBuyOfferResultCode"),switchName:"code",switches:[["manageBuyOfferSuccess","success"],["manageBuyOfferMalformed",e.void()],["manageBuyOfferSellNoTrust",e.void()],["manageBuyOfferBuyNoTrust",e.void()],["manageBuyOfferSellNotAuthorized",e.void()],["manageBuyOfferBuyNotAuthorized",e.void()],["manageBuyOfferLineFull",e.void()],["manageBuyOfferUnderfunded",e.void()],["manageBuyOfferCrossSelf",e.void()],["manageBuyOfferSellNoIssuer",e.void()],["manageBuyOfferBuyNoIssuer",e.void()],["manageBuyOfferNotFound",e.void()],["manageBuyOfferLowReserve",e.void()]],arms:{success:e.lookup("ManageOfferSuccessResult")}}),e.enum("SetOptionsResultCode",{setOptionsSuccess:0,setOptionsLowReserve:-1,setOptionsTooManySigners:-2,setOptionsBadFlags:-3,setOptionsInvalidInflation:-4,setOptionsCantChange:-5,setOptionsUnknownFlag:-6,setOptionsThresholdOutOfRange:-7,setOptionsBadSigner:-8,setOptionsInvalidHomeDomain:-9,setOptionsAuthRevocableRequired:-10}),e.union("SetOptionsResult",{switchOn:e.lookup("SetOptionsResultCode"),switchName:"code",switches:[["setOptionsSuccess",e.void()],["setOptionsLowReserve",e.void()],["setOptionsTooManySigners",e.void()],["setOptionsBadFlags",e.void()],["setOptionsInvalidInflation",e.void()],["setOptionsCantChange",e.void()],["setOptionsUnknownFlag",e.void()],["setOptionsThresholdOutOfRange",e.void()],["setOptionsBadSigner",e.void()],["setOptionsInvalidHomeDomain",e.void()],["setOptionsAuthRevocableRequired",e.void()]],arms:{}}),e.enum("ChangeTrustResultCode",{changeTrustSuccess:0,changeTrustMalformed:-1,changeTrustNoIssuer:-2,changeTrustInvalidLimit:-3,changeTrustLowReserve:-4,changeTrustSelfNotAllowed:-5,changeTrustTrustLineMissing:-6,changeTrustCannotDelete:-7,changeTrustNotAuthMaintainLiabilities:-8}),e.union("ChangeTrustResult",{switchOn:e.lookup("ChangeTrustResultCode"),switchName:"code",switches:[["changeTrustSuccess",e.void()],["changeTrustMalformed",e.void()],["changeTrustNoIssuer",e.void()],["changeTrustInvalidLimit",e.void()],["changeTrustLowReserve",e.void()],["changeTrustSelfNotAllowed",e.void()],["changeTrustTrustLineMissing",e.void()],["changeTrustCannotDelete",e.void()],["changeTrustNotAuthMaintainLiabilities",e.void()]],arms:{}}),e.enum("AllowTrustResultCode",{allowTrustSuccess:0,allowTrustMalformed:-1,allowTrustNoTrustLine:-2,allowTrustTrustNotRequired:-3,allowTrustCantRevoke:-4,allowTrustSelfNotAllowed:-5,allowTrustLowReserve:-6}),e.union("AllowTrustResult",{switchOn:e.lookup("AllowTrustResultCode"),switchName:"code",switches:[["allowTrustSuccess",e.void()],["allowTrustMalformed",e.void()],["allowTrustNoTrustLine",e.void()],["allowTrustTrustNotRequired",e.void()],["allowTrustCantRevoke",e.void()],["allowTrustSelfNotAllowed",e.void()],["allowTrustLowReserve",e.void()]],arms:{}}),e.enum("AccountMergeResultCode",{accountMergeSuccess:0,accountMergeMalformed:-1,accountMergeNoAccount:-2,accountMergeImmutableSet:-3,accountMergeHasSubEntries:-4,accountMergeSeqnumTooFar:-5,accountMergeDestFull:-6,accountMergeIsSponsor:-7}),e.union("AccountMergeResult",{switchOn:e.lookup("AccountMergeResultCode"),switchName:"code",switches:[["accountMergeSuccess","sourceAccountBalance"],["accountMergeMalformed",e.void()],["accountMergeNoAccount",e.void()],["accountMergeImmutableSet",e.void()],["accountMergeHasSubEntries",e.void()],["accountMergeSeqnumTooFar",e.void()],["accountMergeDestFull",e.void()],["accountMergeIsSponsor",e.void()]],arms:{sourceAccountBalance:e.lookup("Int64")}}),e.enum("InflationResultCode",{inflationSuccess:0,inflationNotTime:-1}),e.struct("InflationPayout",[["destination",e.lookup("AccountId")],["amount",e.lookup("Int64")]]),e.union("InflationResult",{switchOn:e.lookup("InflationResultCode"),switchName:"code",switches:[["inflationSuccess","payouts"],["inflationNotTime",e.void()]],arms:{payouts:e.varArray(e.lookup("InflationPayout"),2147483647)}}),e.enum("ManageDataResultCode",{manageDataSuccess:0,manageDataNotSupportedYet:-1,manageDataNameNotFound:-2,manageDataLowReserve:-3,manageDataInvalidName:-4}),e.union("ManageDataResult",{switchOn:e.lookup("ManageDataResultCode"),switchName:"code",switches:[["manageDataSuccess",e.void()],["manageDataNotSupportedYet",e.void()],["manageDataNameNotFound",e.void()],["manageDataLowReserve",e.void()],["manageDataInvalidName",e.void()]],arms:{}}),e.enum("BumpSequenceResultCode",{bumpSequenceSuccess:0,bumpSequenceBadSeq:-1}),e.union("BumpSequenceResult",{switchOn:e.lookup("BumpSequenceResultCode"),switchName:"code",switches:[["bumpSequenceSuccess",e.void()],["bumpSequenceBadSeq",e.void()]],arms:{}}),e.enum("CreateClaimableBalanceResultCode",{createClaimableBalanceSuccess:0,createClaimableBalanceMalformed:-1,createClaimableBalanceLowReserve:-2,createClaimableBalanceNoTrust:-3,createClaimableBalanceNotAuthorized:-4,createClaimableBalanceUnderfunded:-5}),e.union("CreateClaimableBalanceResult",{switchOn:e.lookup("CreateClaimableBalanceResultCode"),switchName:"code",switches:[["createClaimableBalanceSuccess","balanceId"],["createClaimableBalanceMalformed",e.void()],["createClaimableBalanceLowReserve",e.void()],["createClaimableBalanceNoTrust",e.void()],["createClaimableBalanceNotAuthorized",e.void()],["createClaimableBalanceUnderfunded",e.void()]],arms:{balanceId:e.lookup("ClaimableBalanceId")}}),e.enum("ClaimClaimableBalanceResultCode",{claimClaimableBalanceSuccess:0,claimClaimableBalanceDoesNotExist:-1,claimClaimableBalanceCannotClaim:-2,claimClaimableBalanceLineFull:-3,claimClaimableBalanceNoTrust:-4,claimClaimableBalanceNotAuthorized:-5}),e.union("ClaimClaimableBalanceResult",{switchOn:e.lookup("ClaimClaimableBalanceResultCode"),switchName:"code",switches:[["claimClaimableBalanceSuccess",e.void()],["claimClaimableBalanceDoesNotExist",e.void()],["claimClaimableBalanceCannotClaim",e.void()],["claimClaimableBalanceLineFull",e.void()],["claimClaimableBalanceNoTrust",e.void()],["claimClaimableBalanceNotAuthorized",e.void()]],arms:{}}),e.enum("BeginSponsoringFutureReservesResultCode",{beginSponsoringFutureReservesSuccess:0,beginSponsoringFutureReservesMalformed:-1,beginSponsoringFutureReservesAlreadySponsored:-2,beginSponsoringFutureReservesRecursive:-3}),e.union("BeginSponsoringFutureReservesResult",{switchOn:e.lookup("BeginSponsoringFutureReservesResultCode"),switchName:"code",switches:[["beginSponsoringFutureReservesSuccess",e.void()],["beginSponsoringFutureReservesMalformed",e.void()],["beginSponsoringFutureReservesAlreadySponsored",e.void()],["beginSponsoringFutureReservesRecursive",e.void()]],arms:{}}),e.enum("EndSponsoringFutureReservesResultCode",{endSponsoringFutureReservesSuccess:0,endSponsoringFutureReservesNotSponsored:-1}),e.union("EndSponsoringFutureReservesResult",{switchOn:e.lookup("EndSponsoringFutureReservesResultCode"),switchName:"code",switches:[["endSponsoringFutureReservesSuccess",e.void()],["endSponsoringFutureReservesNotSponsored",e.void()]],arms:{}}),e.enum("RevokeSponsorshipResultCode",{revokeSponsorshipSuccess:0,revokeSponsorshipDoesNotExist:-1,revokeSponsorshipNotSponsor:-2,revokeSponsorshipLowReserve:-3,revokeSponsorshipOnlyTransferable:-4,revokeSponsorshipMalformed:-5}),e.union("RevokeSponsorshipResult",{switchOn:e.lookup("RevokeSponsorshipResultCode"),switchName:"code",switches:[["revokeSponsorshipSuccess",e.void()],["revokeSponsorshipDoesNotExist",e.void()],["revokeSponsorshipNotSponsor",e.void()],["revokeSponsorshipLowReserve",e.void()],["revokeSponsorshipOnlyTransferable",e.void()],["revokeSponsorshipMalformed",e.void()]],arms:{}}),e.enum("ClawbackResultCode",{clawbackSuccess:0,clawbackMalformed:-1,clawbackNotClawbackEnabled:-2,clawbackNoTrust:-3,clawbackUnderfunded:-4}),e.union("ClawbackResult",{switchOn:e.lookup("ClawbackResultCode"),switchName:"code",switches:[["clawbackSuccess",e.void()],["clawbackMalformed",e.void()],["clawbackNotClawbackEnabled",e.void()],["clawbackNoTrust",e.void()],["clawbackUnderfunded",e.void()]],arms:{}}),e.enum("ClawbackClaimableBalanceResultCode",{clawbackClaimableBalanceSuccess:0,clawbackClaimableBalanceDoesNotExist:-1,clawbackClaimableBalanceNotIssuer:-2,clawbackClaimableBalanceNotClawbackEnabled:-3}),e.union("ClawbackClaimableBalanceResult",{switchOn:e.lookup("ClawbackClaimableBalanceResultCode"),switchName:"code",switches:[["clawbackClaimableBalanceSuccess",e.void()],["clawbackClaimableBalanceDoesNotExist",e.void()],["clawbackClaimableBalanceNotIssuer",e.void()],["clawbackClaimableBalanceNotClawbackEnabled",e.void()]],arms:{}}),e.enum("SetTrustLineFlagsResultCode",{setTrustLineFlagsSuccess:0,setTrustLineFlagsMalformed:-1,setTrustLineFlagsNoTrustLine:-2,setTrustLineFlagsCantRevoke:-3,setTrustLineFlagsInvalidState:-4,setTrustLineFlagsLowReserve:-5}),e.union("SetTrustLineFlagsResult",{switchOn:e.lookup("SetTrustLineFlagsResultCode"),switchName:"code",switches:[["setTrustLineFlagsSuccess",e.void()],["setTrustLineFlagsMalformed",e.void()],["setTrustLineFlagsNoTrustLine",e.void()],["setTrustLineFlagsCantRevoke",e.void()],["setTrustLineFlagsInvalidState",e.void()],["setTrustLineFlagsLowReserve",e.void()]],arms:{}}),e.enum("LiquidityPoolDepositResultCode",{liquidityPoolDepositSuccess:0,liquidityPoolDepositMalformed:-1,liquidityPoolDepositNoTrust:-2,liquidityPoolDepositNotAuthorized:-3,liquidityPoolDepositUnderfunded:-4,liquidityPoolDepositLineFull:-5,liquidityPoolDepositBadPrice:-6,liquidityPoolDepositPoolFull:-7}),e.union("LiquidityPoolDepositResult",{switchOn:e.lookup("LiquidityPoolDepositResultCode"),switchName:"code",switches:[["liquidityPoolDepositSuccess",e.void()],["liquidityPoolDepositMalformed",e.void()],["liquidityPoolDepositNoTrust",e.void()],["liquidityPoolDepositNotAuthorized",e.void()],["liquidityPoolDepositUnderfunded",e.void()],["liquidityPoolDepositLineFull",e.void()],["liquidityPoolDepositBadPrice",e.void()],["liquidityPoolDepositPoolFull",e.void()]],arms:{}}),e.enum("LiquidityPoolWithdrawResultCode",{liquidityPoolWithdrawSuccess:0,liquidityPoolWithdrawMalformed:-1,liquidityPoolWithdrawNoTrust:-2,liquidityPoolWithdrawUnderfunded:-3,liquidityPoolWithdrawLineFull:-4,liquidityPoolWithdrawUnderMinimum:-5}),e.union("LiquidityPoolWithdrawResult",{switchOn:e.lookup("LiquidityPoolWithdrawResultCode"),switchName:"code",switches:[["liquidityPoolWithdrawSuccess",e.void()],["liquidityPoolWithdrawMalformed",e.void()],["liquidityPoolWithdrawNoTrust",e.void()],["liquidityPoolWithdrawUnderfunded",e.void()],["liquidityPoolWithdrawLineFull",e.void()],["liquidityPoolWithdrawUnderMinimum",e.void()]],arms:{}}),e.enum("InvokeHostFunctionResultCode",{invokeHostFunctionSuccess:0,invokeHostFunctionMalformed:-1,invokeHostFunctionTrapped:-2,invokeHostFunctionResourceLimitExceeded:-3,invokeHostFunctionEntryArchived:-4,invokeHostFunctionInsufficientRefundableFee:-5}),e.union("InvokeHostFunctionResult",{switchOn:e.lookup("InvokeHostFunctionResultCode"),switchName:"code",switches:[["invokeHostFunctionSuccess","success"],["invokeHostFunctionMalformed",e.void()],["invokeHostFunctionTrapped",e.void()],["invokeHostFunctionResourceLimitExceeded",e.void()],["invokeHostFunctionEntryArchived",e.void()],["invokeHostFunctionInsufficientRefundableFee",e.void()]],arms:{success:e.lookup("Hash")}}),e.enum("ExtendFootprintTtlResultCode",{extendFootprintTtlSuccess:0,extendFootprintTtlMalformed:-1,extendFootprintTtlResourceLimitExceeded:-2,extendFootprintTtlInsufficientRefundableFee:-3}),e.union("ExtendFootprintTtlResult",{switchOn:e.lookup("ExtendFootprintTtlResultCode"),switchName:"code",switches:[["extendFootprintTtlSuccess",e.void()],["extendFootprintTtlMalformed",e.void()],["extendFootprintTtlResourceLimitExceeded",e.void()],["extendFootprintTtlInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("RestoreFootprintResultCode",{restoreFootprintSuccess:0,restoreFootprintMalformed:-1,restoreFootprintResourceLimitExceeded:-2,restoreFootprintInsufficientRefundableFee:-3}),e.union("RestoreFootprintResult",{switchOn:e.lookup("RestoreFootprintResultCode"),switchName:"code",switches:[["restoreFootprintSuccess",e.void()],["restoreFootprintMalformed",e.void()],["restoreFootprintResourceLimitExceeded",e.void()],["restoreFootprintInsufficientRefundableFee",e.void()]],arms:{}}),e.enum("OperationResultCode",{opInner:0,opBadAuth:-1,opNoAccount:-2,opNotSupported:-3,opTooManySubentries:-4,opExceededWorkLimit:-5,opTooManySponsoring:-6}),e.union("OperationResultTr",{switchOn:e.lookup("OperationType"),switchName:"type",switches:[["createAccount","createAccountResult"],["payment","paymentResult"],["pathPaymentStrictReceive","pathPaymentStrictReceiveResult"],["manageSellOffer","manageSellOfferResult"],["createPassiveSellOffer","createPassiveSellOfferResult"],["setOptions","setOptionsResult"],["changeTrust","changeTrustResult"],["allowTrust","allowTrustResult"],["accountMerge","accountMergeResult"],["inflation","inflationResult"],["manageData","manageDataResult"],["bumpSequence","bumpSeqResult"],["manageBuyOffer","manageBuyOfferResult"],["pathPaymentStrictSend","pathPaymentStrictSendResult"],["createClaimableBalance","createClaimableBalanceResult"],["claimClaimableBalance","claimClaimableBalanceResult"],["beginSponsoringFutureReserves","beginSponsoringFutureReservesResult"],["endSponsoringFutureReserves","endSponsoringFutureReservesResult"],["revokeSponsorship","revokeSponsorshipResult"],["clawback","clawbackResult"],["clawbackClaimableBalance","clawbackClaimableBalanceResult"],["setTrustLineFlags","setTrustLineFlagsResult"],["liquidityPoolDeposit","liquidityPoolDepositResult"],["liquidityPoolWithdraw","liquidityPoolWithdrawResult"],["invokeHostFunction","invokeHostFunctionResult"],["extendFootprintTtl","extendFootprintTtlResult"],["restoreFootprint","restoreFootprintResult"]],arms:{createAccountResult:e.lookup("CreateAccountResult"),paymentResult:e.lookup("PaymentResult"),pathPaymentStrictReceiveResult:e.lookup("PathPaymentStrictReceiveResult"),manageSellOfferResult:e.lookup("ManageSellOfferResult"),createPassiveSellOfferResult:e.lookup("ManageSellOfferResult"),setOptionsResult:e.lookup("SetOptionsResult"),changeTrustResult:e.lookup("ChangeTrustResult"),allowTrustResult:e.lookup("AllowTrustResult"),accountMergeResult:e.lookup("AccountMergeResult"),inflationResult:e.lookup("InflationResult"),manageDataResult:e.lookup("ManageDataResult"),bumpSeqResult:e.lookup("BumpSequenceResult"),manageBuyOfferResult:e.lookup("ManageBuyOfferResult"),pathPaymentStrictSendResult:e.lookup("PathPaymentStrictSendResult"),createClaimableBalanceResult:e.lookup("CreateClaimableBalanceResult"),claimClaimableBalanceResult:e.lookup("ClaimClaimableBalanceResult"),beginSponsoringFutureReservesResult:e.lookup("BeginSponsoringFutureReservesResult"),endSponsoringFutureReservesResult:e.lookup("EndSponsoringFutureReservesResult"),revokeSponsorshipResult:e.lookup("RevokeSponsorshipResult"),clawbackResult:e.lookup("ClawbackResult"),clawbackClaimableBalanceResult:e.lookup("ClawbackClaimableBalanceResult"),setTrustLineFlagsResult:e.lookup("SetTrustLineFlagsResult"),liquidityPoolDepositResult:e.lookup("LiquidityPoolDepositResult"),liquidityPoolWithdrawResult:e.lookup("LiquidityPoolWithdrawResult"),invokeHostFunctionResult:e.lookup("InvokeHostFunctionResult"),extendFootprintTtlResult:e.lookup("ExtendFootprintTtlResult"),restoreFootprintResult:e.lookup("RestoreFootprintResult")}}),e.union("OperationResult",{switchOn:e.lookup("OperationResultCode"),switchName:"code",switches:[["opInner","tr"],["opBadAuth",e.void()],["opNoAccount",e.void()],["opNotSupported",e.void()],["opTooManySubentries",e.void()],["opExceededWorkLimit",e.void()],["opTooManySponsoring",e.void()]],arms:{tr:e.lookup("OperationResultTr")}}),e.enum("TransactionResultCode",{txFeeBumpInnerSuccess:1,txSuccess:0,txFailed:-1,txTooEarly:-2,txTooLate:-3,txMissingOperation:-4,txBadSeq:-5,txBadAuth:-6,txInsufficientBalance:-7,txNoAccount:-8,txInsufficientFee:-9,txBadAuthExtra:-10,txInternalError:-11,txNotSupported:-12,txFeeBumpInnerFailed:-13,txBadSponsorship:-14,txBadMinSeqAgeOrGap:-15,txMalformed:-16,txSorobanInvalid:-17}),e.union("InnerTransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("InnerTransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("InnerTransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("InnerTransactionResultResult")],["ext",e.lookup("InnerTransactionResultExt")]]),e.struct("InnerTransactionResultPair",[["transactionHash",e.lookup("Hash")],["result",e.lookup("InnerTransactionResult")]]),e.union("TransactionResultResult",{switchOn:e.lookup("TransactionResultCode"),switchName:"code",switches:[["txFeeBumpInnerSuccess","innerResultPair"],["txFeeBumpInnerFailed","innerResultPair"],["txSuccess","results"],["txFailed","results"],["txTooEarly",e.void()],["txTooLate",e.void()],["txMissingOperation",e.void()],["txBadSeq",e.void()],["txBadAuth",e.void()],["txInsufficientBalance",e.void()],["txNoAccount",e.void()],["txInsufficientFee",e.void()],["txBadAuthExtra",e.void()],["txInternalError",e.void()],["txNotSupported",e.void()],["txBadSponsorship",e.void()],["txBadMinSeqAgeOrGap",e.void()],["txMalformed",e.void()],["txSorobanInvalid",e.void()]],arms:{innerResultPair:e.lookup("InnerTransactionResultPair"),results:e.varArray(e.lookup("OperationResult"),2147483647)}}),e.union("TransactionResultExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("TransactionResult",[["feeCharged",e.lookup("Int64")],["result",e.lookup("TransactionResultResult")],["ext",e.lookup("TransactionResultExt")]]),e.typedef("Hash",e.opaque(32)),e.typedef("Uint256",e.opaque(32)),e.typedef("Uint32",e.uint()),e.typedef("Int32",e.int()),e.typedef("Uint64",e.uhyper()),e.typedef("Int64",e.hyper()),e.typedef("TimePoint",e.lookup("Uint64")),e.typedef("Duration",e.lookup("Uint64")),e.union("ExtensionPoint",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.enum("CryptoKeyType",{keyTypeEd25519:0,keyTypePreAuthTx:1,keyTypeHashX:2,keyTypeEd25519SignedPayload:3,keyTypeMuxedEd25519:256}),e.enum("PublicKeyType",{publicKeyTypeEd25519:0}),e.enum("SignerKeyType",{signerKeyTypeEd25519:0,signerKeyTypePreAuthTx:1,signerKeyTypeHashX:2,signerKeyTypeEd25519SignedPayload:3}),e.union("PublicKey",{switchOn:e.lookup("PublicKeyType"),switchName:"type",switches:[["publicKeyTypeEd25519","ed25519"]],arms:{ed25519:e.lookup("Uint256")}}),e.struct("SignerKeyEd25519SignedPayload",[["ed25519",e.lookup("Uint256")],["payload",e.varOpaque(64)]]),e.union("SignerKey",{switchOn:e.lookup("SignerKeyType"),switchName:"type",switches:[["signerKeyTypeEd25519","ed25519"],["signerKeyTypePreAuthTx","preAuthTx"],["signerKeyTypeHashX","hashX"],["signerKeyTypeEd25519SignedPayload","ed25519SignedPayload"]],arms:{ed25519:e.lookup("Uint256"),preAuthTx:e.lookup("Uint256"),hashX:e.lookup("Uint256"),ed25519SignedPayload:e.lookup("SignerKeyEd25519SignedPayload")}}),e.typedef("Signature",e.varOpaque(64)),e.typedef("SignatureHint",e.opaque(4)),e.typedef("NodeId",e.lookup("PublicKey")),e.typedef("AccountId",e.lookup("PublicKey")),e.typedef("ContractId",e.lookup("Hash")),e.struct("Curve25519Secret",[["key",e.opaque(32)]]),e.struct("Curve25519Public",[["key",e.opaque(32)]]),e.struct("HmacSha256Key",[["key",e.opaque(32)]]),e.struct("HmacSha256Mac",[["mac",e.opaque(32)]]),e.struct("ShortHashSeed",[["seed",e.opaque(16)]]),e.enum("BinaryFuseFilterType",{binaryFuseFilter8Bit:0,binaryFuseFilter16Bit:1,binaryFuseFilter32Bit:2}),e.struct("SerializedBinaryFuseFilter",[["type",e.lookup("BinaryFuseFilterType")],["inputHashSeed",e.lookup("ShortHashSeed")],["filterSeed",e.lookup("ShortHashSeed")],["segmentLength",e.lookup("Uint32")],["segementLengthMask",e.lookup("Uint32")],["segmentCount",e.lookup("Uint32")],["segmentCountLength",e.lookup("Uint32")],["fingerprintLength",e.lookup("Uint32")],["fingerprints",e.varOpaque()]]),e.typedef("PoolId",e.lookup("Hash")),e.enum("ClaimableBalanceIdType",{claimableBalanceIdTypeV0:0}),e.union("ClaimableBalanceId",{switchOn:e.lookup("ClaimableBalanceIdType"),switchName:"type",switches:[["claimableBalanceIdTypeV0","v0"]],arms:{v0:e.lookup("Hash")}}),e.enum("ScValType",{scvBool:0,scvVoid:1,scvError:2,scvU32:3,scvI32:4,scvU64:5,scvI64:6,scvTimepoint:7,scvDuration:8,scvU128:9,scvI128:10,scvU256:11,scvI256:12,scvBytes:13,scvString:14,scvSymbol:15,scvVec:16,scvMap:17,scvAddress:18,scvContractInstance:19,scvLedgerKeyContractInstance:20,scvLedgerKeyNonce:21}),e.enum("ScErrorType",{sceContract:0,sceWasmVm:1,sceContext:2,sceStorage:3,sceObject:4,sceCrypto:5,sceEvents:6,sceBudget:7,sceValue:8,sceAuth:9}),e.enum("ScErrorCode",{scecArithDomain:0,scecIndexBounds:1,scecInvalidInput:2,scecMissingValue:3,scecExistingValue:4,scecExceededLimit:5,scecInvalidAction:6,scecInternalError:7,scecUnexpectedType:8,scecUnexpectedSize:9}),e.union("ScError",{switchOn:e.lookup("ScErrorType"),switchName:"type",switches:[["sceContract","contractCode"],["sceWasmVm","code"],["sceContext","code"],["sceStorage","code"],["sceObject","code"],["sceCrypto","code"],["sceEvents","code"],["sceBudget","code"],["sceValue","code"],["sceAuth","code"]],arms:{contractCode:e.lookup("Uint32"),code:e.lookup("ScErrorCode")}}),e.struct("UInt128Parts",[["hi",e.lookup("Uint64")],["lo",e.lookup("Uint64")]]),e.struct("Int128Parts",[["hi",e.lookup("Int64")],["lo",e.lookup("Uint64")]]),e.struct("UInt256Parts",[["hiHi",e.lookup("Uint64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.struct("Int256Parts",[["hiHi",e.lookup("Int64")],["hiLo",e.lookup("Uint64")],["loHi",e.lookup("Uint64")],["loLo",e.lookup("Uint64")]]),e.enum("ContractExecutableType",{contractExecutableWasm:0,contractExecutableStellarAsset:1}),e.union("ContractExecutable",{switchOn:e.lookup("ContractExecutableType"),switchName:"type",switches:[["contractExecutableWasm","wasmHash"],["contractExecutableStellarAsset",e.void()]],arms:{wasmHash:e.lookup("Hash")}}),e.enum("ScAddressType",{scAddressTypeAccount:0,scAddressTypeContract:1,scAddressTypeMuxedAccount:2,scAddressTypeClaimableBalance:3,scAddressTypeLiquidityPool:4}),e.struct("MuxedEd25519Account",[["id",e.lookup("Uint64")],["ed25519",e.lookup("Uint256")]]),e.union("ScAddress",{switchOn:e.lookup("ScAddressType"),switchName:"type",switches:[["scAddressTypeAccount","accountId"],["scAddressTypeContract","contractId"],["scAddressTypeMuxedAccount","muxedAccount"],["scAddressTypeClaimableBalance","claimableBalanceId"],["scAddressTypeLiquidityPool","liquidityPoolId"]],arms:{accountId:e.lookup("AccountId"),contractId:e.lookup("ContractId"),muxedAccount:e.lookup("MuxedEd25519Account"),claimableBalanceId:e.lookup("ClaimableBalanceId"),liquidityPoolId:e.lookup("PoolId")}}),e.const("SCSYMBOL_LIMIT",32),e.typedef("ScVec",e.varArray(e.lookup("ScVal"),2147483647)),e.typedef("ScMap",e.varArray(e.lookup("ScMapEntry"),2147483647)),e.typedef("ScBytes",e.varOpaque()),e.typedef("ScString",e.string()),e.typedef("ScSymbol",e.string(32)),e.struct("ScNonceKey",[["nonce",e.lookup("Int64")]]),e.struct("ScContractInstance",[["executable",e.lookup("ContractExecutable")],["storage",e.option(e.lookup("ScMap"))]]),e.union("ScVal",{switchOn:e.lookup("ScValType"),switchName:"type",switches:[["scvBool","b"],["scvVoid",e.void()],["scvError","error"],["scvU32","u32"],["scvI32","i32"],["scvU64","u64"],["scvI64","i64"],["scvTimepoint","timepoint"],["scvDuration","duration"],["scvU128","u128"],["scvI128","i128"],["scvU256","u256"],["scvI256","i256"],["scvBytes","bytes"],["scvString","str"],["scvSymbol","sym"],["scvVec","vec"],["scvMap","map"],["scvAddress","address"],["scvContractInstance","instance"],["scvLedgerKeyContractInstance",e.void()],["scvLedgerKeyNonce","nonceKey"]],arms:{b:e.bool(),error:e.lookup("ScError"),u32:e.lookup("Uint32"),i32:e.lookup("Int32"),u64:e.lookup("Uint64"),i64:e.lookup("Int64"),timepoint:e.lookup("TimePoint"),duration:e.lookup("Duration"),u128:e.lookup("UInt128Parts"),i128:e.lookup("Int128Parts"),u256:e.lookup("UInt256Parts"),i256:e.lookup("Int256Parts"),bytes:e.lookup("ScBytes"),str:e.lookup("ScString"),sym:e.lookup("ScSymbol"),vec:e.option(e.lookup("ScVec")),map:e.option(e.lookup("ScMap")),address:e.lookup("ScAddress"),instance:e.lookup("ScContractInstance"),nonceKey:e.lookup("ScNonceKey")}}),e.struct("ScMapEntry",[["key",e.lookup("ScVal")],["val",e.lookup("ScVal")]]),e.enum("ScEnvMetaKind",{scEnvMetaKindInterfaceVersion:0}),e.struct("ScEnvMetaEntryInterfaceVersion",[["protocol",e.lookup("Uint32")],["preRelease",e.lookup("Uint32")]]),e.union("ScEnvMetaEntry",{switchOn:e.lookup("ScEnvMetaKind"),switchName:"kind",switches:[["scEnvMetaKindInterfaceVersion","interfaceVersion"]],arms:{interfaceVersion:e.lookup("ScEnvMetaEntryInterfaceVersion")}}),e.struct("ScMetaV0",[["key",e.string()],["val",e.string()]]),e.enum("ScMetaKind",{scMetaV0:0}),e.union("ScMetaEntry",{switchOn:e.lookup("ScMetaKind"),switchName:"kind",switches:[["scMetaV0","v0"]],arms:{v0:e.lookup("ScMetaV0")}}),e.const("SC_SPEC_DOC_LIMIT",1024),e.enum("ScSpecType",{scSpecTypeVal:0,scSpecTypeBool:1,scSpecTypeVoid:2,scSpecTypeError:3,scSpecTypeU32:4,scSpecTypeI32:5,scSpecTypeU64:6,scSpecTypeI64:7,scSpecTypeTimepoint:8,scSpecTypeDuration:9,scSpecTypeU128:10,scSpecTypeI128:11,scSpecTypeU256:12,scSpecTypeI256:13,scSpecTypeBytes:14,scSpecTypeString:16,scSpecTypeSymbol:17,scSpecTypeAddress:19,scSpecTypeMuxedAddress:20,scSpecTypeOption:1e3,scSpecTypeResult:1001,scSpecTypeVec:1002,scSpecTypeMap:1004,scSpecTypeTuple:1005,scSpecTypeBytesN:1006,scSpecTypeUdt:2e3}),e.struct("ScSpecTypeOption",[["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeResult",[["okType",e.lookup("ScSpecTypeDef")],["errorType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeVec",[["elementType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeMap",[["keyType",e.lookup("ScSpecTypeDef")],["valueType",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecTypeTuple",[["valueTypes",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.struct("ScSpecTypeBytesN",[["n",e.lookup("Uint32")]]),e.struct("ScSpecTypeUdt",[["name",e.string(60)]]),e.union("ScSpecTypeDef",{switchOn:e.lookup("ScSpecType"),switchName:"type",switches:[["scSpecTypeVal",e.void()],["scSpecTypeBool",e.void()],["scSpecTypeVoid",e.void()],["scSpecTypeError",e.void()],["scSpecTypeU32",e.void()],["scSpecTypeI32",e.void()],["scSpecTypeU64",e.void()],["scSpecTypeI64",e.void()],["scSpecTypeTimepoint",e.void()],["scSpecTypeDuration",e.void()],["scSpecTypeU128",e.void()],["scSpecTypeI128",e.void()],["scSpecTypeU256",e.void()],["scSpecTypeI256",e.void()],["scSpecTypeBytes",e.void()],["scSpecTypeString",e.void()],["scSpecTypeSymbol",e.void()],["scSpecTypeAddress",e.void()],["scSpecTypeMuxedAddress",e.void()],["scSpecTypeOption","option"],["scSpecTypeResult","result"],["scSpecTypeVec","vec"],["scSpecTypeMap","map"],["scSpecTypeTuple","tuple"],["scSpecTypeBytesN","bytesN"],["scSpecTypeUdt","udt"]],arms:{option:e.lookup("ScSpecTypeOption"),result:e.lookup("ScSpecTypeResult"),vec:e.lookup("ScSpecTypeVec"),map:e.lookup("ScSpecTypeMap"),tuple:e.lookup("ScSpecTypeTuple"),bytesN:e.lookup("ScSpecTypeBytesN"),udt:e.lookup("ScSpecTypeUdt")}}),e.struct("ScSpecUdtStructFieldV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecUdtStructV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["fields",e.varArray(e.lookup("ScSpecUdtStructFieldV0"),40)]]),e.struct("ScSpecUdtUnionCaseVoidV0",[["doc",e.string(t)],["name",e.string(60)]]),e.struct("ScSpecUdtUnionCaseTupleV0",[["doc",e.string(t)],["name",e.string(60)],["type",e.varArray(e.lookup("ScSpecTypeDef"),12)]]),e.enum("ScSpecUdtUnionCaseV0Kind",{scSpecUdtUnionCaseVoidV0:0,scSpecUdtUnionCaseTupleV0:1}),e.union("ScSpecUdtUnionCaseV0",{switchOn:e.lookup("ScSpecUdtUnionCaseV0Kind"),switchName:"kind",switches:[["scSpecUdtUnionCaseVoidV0","voidCase"],["scSpecUdtUnionCaseTupleV0","tupleCase"]],arms:{voidCase:e.lookup("ScSpecUdtUnionCaseVoidV0"),tupleCase:e.lookup("ScSpecUdtUnionCaseTupleV0")}}),e.struct("ScSpecUdtUnionV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtUnionCaseV0"),50)]]),e.struct("ScSpecUdtEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtEnumCaseV0"),50)]]),e.struct("ScSpecUdtErrorEnumCaseV0",[["doc",e.string(t)],["name",e.string(60)],["value",e.lookup("Uint32")]]),e.struct("ScSpecUdtErrorEnumV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.string(60)],["cases",e.varArray(e.lookup("ScSpecUdtErrorEnumCaseV0"),50)]]),e.struct("ScSpecFunctionInputV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")]]),e.struct("ScSpecFunctionV0",[["doc",e.string(t)],["name",e.lookup("ScSymbol")],["inputs",e.varArray(e.lookup("ScSpecFunctionInputV0"),10)],["outputs",e.varArray(e.lookup("ScSpecTypeDef"),1)]]),e.enum("ScSpecEventParamLocationV0",{scSpecEventParamLocationData:0,scSpecEventParamLocationTopicList:1}),e.struct("ScSpecEventParamV0",[["doc",e.string(t)],["name",e.string(30)],["type",e.lookup("ScSpecTypeDef")],["location",e.lookup("ScSpecEventParamLocationV0")]]),e.enum("ScSpecEventDataFormat",{scSpecEventDataFormatSingleValue:0,scSpecEventDataFormatVec:1,scSpecEventDataFormatMap:2}),e.struct("ScSpecEventV0",[["doc",e.string(t)],["lib",e.string(80)],["name",e.lookup("ScSymbol")],["prefixTopics",e.varArray(e.lookup("ScSymbol"),2)],["params",e.varArray(e.lookup("ScSpecEventParamV0"),50)],["dataFormat",e.lookup("ScSpecEventDataFormat")]]),e.enum("ScSpecEntryKind",{scSpecEntryFunctionV0:0,scSpecEntryUdtStructV0:1,scSpecEntryUdtUnionV0:2,scSpecEntryUdtEnumV0:3,scSpecEntryUdtErrorEnumV0:4,scSpecEntryEventV0:5}),e.union("ScSpecEntry",{switchOn:e.lookup("ScSpecEntryKind"),switchName:"kind",switches:[["scSpecEntryFunctionV0","functionV0"],["scSpecEntryUdtStructV0","udtStructV0"],["scSpecEntryUdtUnionV0","udtUnionV0"],["scSpecEntryUdtEnumV0","udtEnumV0"],["scSpecEntryUdtErrorEnumV0","udtErrorEnumV0"],["scSpecEntryEventV0","eventV0"]],arms:{functionV0:e.lookup("ScSpecFunctionV0"),udtStructV0:e.lookup("ScSpecUdtStructV0"),udtUnionV0:e.lookup("ScSpecUdtUnionV0"),udtEnumV0:e.lookup("ScSpecUdtEnumV0"),udtErrorEnumV0:e.lookup("ScSpecUdtErrorEnumV0"),eventV0:e.lookup("ScSpecEventV0")}}),e.struct("ConfigSettingContractExecutionLanesV0",[["ledgerMaxTxCount",e.lookup("Uint32")]]),e.struct("ConfigSettingContractComputeV0",[["ledgerMaxInstructions",e.lookup("Int64")],["txMaxInstructions",e.lookup("Int64")],["feeRatePerInstructionsIncrement",e.lookup("Int64")],["txMemoryLimit",e.lookup("Uint32")]]),e.struct("ConfigSettingContractParallelComputeV0",[["ledgerMaxDependentTxClusters",e.lookup("Uint32")]]),e.struct("ConfigSettingContractLedgerCostV0",[["ledgerMaxDiskReadEntries",e.lookup("Uint32")],["ledgerMaxDiskReadBytes",e.lookup("Uint32")],["ledgerMaxWriteLedgerEntries",e.lookup("Uint32")],["ledgerMaxWriteBytes",e.lookup("Uint32")],["txMaxDiskReadEntries",e.lookup("Uint32")],["txMaxDiskReadBytes",e.lookup("Uint32")],["txMaxWriteLedgerEntries",e.lookup("Uint32")],["txMaxWriteBytes",e.lookup("Uint32")],["feeDiskReadLedgerEntry",e.lookup("Int64")],["feeWriteLedgerEntry",e.lookup("Int64")],["feeDiskRead1Kb",e.lookup("Int64")],["sorobanStateTargetSizeBytes",e.lookup("Int64")],["rentFee1KbSorobanStateSizeLow",e.lookup("Int64")],["rentFee1KbSorobanStateSizeHigh",e.lookup("Int64")],["sorobanStateRentFeeGrowthFactor",e.lookup("Uint32")]]),e.struct("ConfigSettingContractLedgerCostExtV0",[["txMaxFootprintEntries",e.lookup("Uint32")],["feeWrite1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractHistoricalDataV0",[["feeHistorical1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractEventsV0",[["txMaxContractEventsSizeBytes",e.lookup("Uint32")],["feeContractEvents1Kb",e.lookup("Int64")]]),e.struct("ConfigSettingContractBandwidthV0",[["ledgerMaxTxsSizeBytes",e.lookup("Uint32")],["txMaxSizeBytes",e.lookup("Uint32")],["feeTxSize1Kb",e.lookup("Int64")]]),e.enum("ContractCostType",{wasmInsnExec:0,memAlloc:1,memCpy:2,memCmp:3,dispatchHostFunction:4,visitObject:5,valSer:6,valDeser:7,computeSha256Hash:8,computeEd25519PubKey:9,verifyEd25519Sig:10,vmInstantiation:11,vmCachedInstantiation:12,invokeVmFunction:13,computeKeccak256Hash:14,decodeEcdsaCurve256Sig:15,recoverEcdsaSecp256k1Key:16,int256AddSub:17,int256Mul:18,int256Div:19,int256Pow:20,int256Shift:21,chaCha20DrawBytes:22,parseWasmInstructions:23,parseWasmFunctions:24,parseWasmGlobals:25,parseWasmTableEntries:26,parseWasmTypes:27,parseWasmDataSegments:28,parseWasmElemSegments:29,parseWasmImports:30,parseWasmExports:31,parseWasmDataSegmentBytes:32,instantiateWasmInstructions:33,instantiateWasmFunctions:34,instantiateWasmGlobals:35,instantiateWasmTableEntries:36,instantiateWasmTypes:37,instantiateWasmDataSegments:38,instantiateWasmElemSegments:39,instantiateWasmImports:40,instantiateWasmExports:41,instantiateWasmDataSegmentBytes:42,sec1DecodePointUncompressed:43,verifyEcdsaSecp256r1Sig:44,bls12381EncodeFp:45,bls12381DecodeFp:46,bls12381G1CheckPointOnCurve:47,bls12381G1CheckPointInSubgroup:48,bls12381G2CheckPointOnCurve:49,bls12381G2CheckPointInSubgroup:50,bls12381G1ProjectiveToAffine:51,bls12381G2ProjectiveToAffine:52,bls12381G1Add:53,bls12381G1Mul:54,bls12381G1Msm:55,bls12381MapFpToG1:56,bls12381HashToG1:57,bls12381G2Add:58,bls12381G2Mul:59,bls12381G2Msm:60,bls12381MapFp2ToG2:61,bls12381HashToG2:62,bls12381Pairing:63,bls12381FrFromU256:64,bls12381FrToU256:65,bls12381FrAddSub:66,bls12381FrMul:67,bls12381FrPow:68,bls12381FrInv:69}),e.struct("ContractCostParamEntry",[["ext",e.lookup("ExtensionPoint")],["constTerm",e.lookup("Int64")],["linearTerm",e.lookup("Int64")]]),e.struct("StateArchivalSettings",[["maxEntryTtl",e.lookup("Uint32")],["minTemporaryTtl",e.lookup("Uint32")],["minPersistentTtl",e.lookup("Uint32")],["persistentRentRateDenominator",e.lookup("Int64")],["tempRentRateDenominator",e.lookup("Int64")],["maxEntriesToArchive",e.lookup("Uint32")],["liveSorobanStateSizeWindowSampleSize",e.lookup("Uint32")],["liveSorobanStateSizeWindowSamplePeriod",e.lookup("Uint32")],["evictionScanSize",e.lookup("Uint32")],["startingEvictionScanLevel",e.lookup("Uint32")]]),e.struct("EvictionIterator",[["bucketListLevel",e.lookup("Uint32")],["isCurrBucket",e.bool()],["bucketFileOffset",e.lookup("Uint64")]]),e.struct("ConfigSettingScpTiming",[["ledgerTargetCloseTimeMilliseconds",e.lookup("Uint32")],["nominationTimeoutInitialMilliseconds",e.lookup("Uint32")],["nominationTimeoutIncrementMilliseconds",e.lookup("Uint32")],["ballotTimeoutInitialMilliseconds",e.lookup("Uint32")],["ballotTimeoutIncrementMilliseconds",e.lookup("Uint32")]]),e.const("CONTRACT_COST_COUNT_LIMIT",1024),e.typedef("ContractCostParams",e.varArray(e.lookup("ContractCostParamEntry"),e.lookup("CONTRACT_COST_COUNT_LIMIT"))),e.enum("ConfigSettingId",{configSettingContractMaxSizeBytes:0,configSettingContractComputeV0:1,configSettingContractLedgerCostV0:2,configSettingContractHistoricalDataV0:3,configSettingContractEventsV0:4,configSettingContractBandwidthV0:5,configSettingContractCostParamsCpuInstructions:6,configSettingContractCostParamsMemoryBytes:7,configSettingContractDataKeySizeBytes:8,configSettingContractDataEntrySizeBytes:9,configSettingStateArchival:10,configSettingContractExecutionLanes:11,configSettingLiveSorobanStateSizeWindow:12,configSettingEvictionIterator:13,configSettingContractParallelComputeV0:14,configSettingContractLedgerCostExtV0:15,configSettingScpTiming:16}),e.union("ConfigSettingEntry",{switchOn:e.lookup("ConfigSettingId"),switchName:"configSettingId",switches:[["configSettingContractMaxSizeBytes","contractMaxSizeBytes"],["configSettingContractComputeV0","contractCompute"],["configSettingContractLedgerCostV0","contractLedgerCost"],["configSettingContractHistoricalDataV0","contractHistoricalData"],["configSettingContractEventsV0","contractEvents"],["configSettingContractBandwidthV0","contractBandwidth"],["configSettingContractCostParamsCpuInstructions","contractCostParamsCpuInsns"],["configSettingContractCostParamsMemoryBytes","contractCostParamsMemBytes"],["configSettingContractDataKeySizeBytes","contractDataKeySizeBytes"],["configSettingContractDataEntrySizeBytes","contractDataEntrySizeBytes"],["configSettingStateArchival","stateArchivalSettings"],["configSettingContractExecutionLanes","contractExecutionLanes"],["configSettingLiveSorobanStateSizeWindow","liveSorobanStateSizeWindow"],["configSettingEvictionIterator","evictionIterator"],["configSettingContractParallelComputeV0","contractParallelCompute"],["configSettingContractLedgerCostExtV0","contractLedgerCostExt"],["configSettingScpTiming","contractScpTiming"]],arms:{contractMaxSizeBytes:e.lookup("Uint32"),contractCompute:e.lookup("ConfigSettingContractComputeV0"),contractLedgerCost:e.lookup("ConfigSettingContractLedgerCostV0"),contractHistoricalData:e.lookup("ConfigSettingContractHistoricalDataV0"),contractEvents:e.lookup("ConfigSettingContractEventsV0"),contractBandwidth:e.lookup("ConfigSettingContractBandwidthV0"),contractCostParamsCpuInsns:e.lookup("ContractCostParams"),contractCostParamsMemBytes:e.lookup("ContractCostParams"),contractDataKeySizeBytes:e.lookup("Uint32"),contractDataEntrySizeBytes:e.lookup("Uint32"),stateArchivalSettings:e.lookup("StateArchivalSettings"),contractExecutionLanes:e.lookup("ConfigSettingContractExecutionLanesV0"),liveSorobanStateSizeWindow:e.varArray(e.lookup("Uint64"),2147483647),evictionIterator:e.lookup("EvictionIterator"),contractParallelCompute:e.lookup("ConfigSettingContractParallelComputeV0"),contractLedgerCostExt:e.lookup("ConfigSettingContractLedgerCostExtV0"),contractScpTiming:e.lookup("ConfigSettingScpTiming")}}),e.struct("LedgerCloseMetaBatch",[["startSequence",e.lookup("Uint32")],["endSequence",e.lookup("Uint32")],["ledgerCloseMeta",e.varArray(e.lookup("LedgerCloseMeta"),2147483647)]])});const i=o,a={XdrWriter:n.XdrWriter,XdrReader:n.XdrReader};var s=r(2802);function u(e){var t=new s.sha256;return t.update(e,"utf8"),t.digest()}const c="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function l(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function f(e,...t){if(!l(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function p(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function d(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}const y="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,m=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function g(e){if(f(e),y)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=m[e[r]];return t}function v(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function b(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(y)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,o=0;t<r;t++,o+=2){const r=v(e.charCodeAt(o)),i=v(e.charCodeAt(o+1));if(void 0===r||void 0===i){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}n[t]=16*r+i}return n}function w(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function S(e){return"string"==typeof e&&(e=w(e)),f(e),e}function E(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];f(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}class T{}function k(e=32){if(c&&"function"==typeof c.getRandomValues)return c.getRandomValues(new Uint8Array(e));if(c&&"function"==typeof c.randomBytes)return Uint8Array.from(c.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}class O extends T{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=h(this.buffer)}update(e){p(this),f(e=S(e));const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){const a=Math.min(n-this.pos,o-i);if(a===n){const t=h(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){p(this),function(e,t){f(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,d(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),s=Number(r&i),u=n?4:0,c=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+c,s,n)}(r,n-8,BigInt(8*this.length),o),this.process(r,0);const a=h(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=s/4,c=this.get();if(u>c.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<u;e++)a.setUint32(4*e,c[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=a,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const A=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),_=BigInt(2**32-1),x=BigInt(32);function P(e,t=!1){return t?{h:Number(e&_),l:Number(e>>x&_)}:{h:0|Number(e>>x&_),l:0|Number(e&_)}}const I=(e,t,r)=>e>>>r,R=(e,t,r)=>e<<32-r|t>>>r,B=(e,t,r)=>e>>>r|t<<32-r,C=(e,t,r)=>e<<32-r|t>>>r,j=(e,t,r)=>e<<64-r|t>>>r-32,U=(e,t,r)=>e>>>r-32|t<<64-r;function N(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}const L=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),D=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,F=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),M=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,V=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),q=(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,H=function(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;i<r;i++){const{h:r,l:a}=P(e[i],t);[n[i],o[i]]=[r,a]}return[n,o]}(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),z=H[0],K=H[1],X=new Uint32Array(80),$=new Uint32Array(80);class G extends O{constructor(e=64){super(128,e,16,!1),this.Ah=0|A[0],this.Al=0|A[1],this.Bh=0|A[2],this.Bl=0|A[3],this.Ch=0|A[4],this.Cl=0|A[5],this.Dh=0|A[6],this.Dl=0|A[7],this.Eh=0|A[8],this.El=0|A[9],this.Fh=0|A[10],this.Fl=0|A[11],this.Gh=0|A[12],this.Gl=0|A[13],this.Hh=0|A[14],this.Hl=0|A[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:o,Cl:i,Dh:a,Dl:s,Eh:u,El:c,Fh:l,Fl:f,Gh:p,Gl:d,Hh:h,Hl:y}=this;return[e,t,r,n,o,i,a,s,u,c,l,f,p,d,h,y]}set(e,t,r,n,o,i,a,s,u,c,l,f,p,d,h,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|f,this.Gh=0|p,this.Gl=0|d,this.Hh=0|h,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)X[r]=e.getUint32(t),$[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|X[e-15],r=0|$[e-15],n=B(t,r,1)^B(t,r,8)^I(t,0,7),o=C(t,r,1)^C(t,r,8)^R(t,r,7),i=0|X[e-2],a=0|$[e-2],s=B(i,a,19)^j(i,a,61)^I(i,0,6),u=C(i,a,19)^U(i,a,61)^R(i,a,6),c=F(o,u,$[e-7],$[e-16]),l=M(c,n,s,X[e-7],X[e-16]);X[e]=0|l,$[e]=0|c}let{Ah:r,Al:n,Bh:o,Bl:i,Ch:a,Cl:s,Dh:u,Dl:c,Eh:l,El:f,Fh:p,Fl:d,Gh:h,Gl:y,Hh:m,Hl:g}=this;for(let e=0;e<80;e++){const t=B(l,f,14)^B(l,f,18)^j(l,f,41),v=C(l,f,14)^C(l,f,18)^U(l,f,41),b=l&p^~l&h,w=V(g,v,f&d^~f&y,K[e],$[e]),S=q(w,m,t,b,z[e],X[e]),E=0|w,T=B(r,n,28)^j(r,n,34)^j(r,n,39),k=C(r,n,28)^U(r,n,34)^U(r,n,39),O=r&o^r&a^o&a,A=n&i^n&s^i&s;m=0|h,g=0|y,h=0|p,y=0|d,p=0|l,d=0|f,({h:l,l:f}=N(0|u,0|c,0|S,0|E)),u=0|a,c=0|s,a=0|o,s=0|i,o=0|r,i=0|n;const _=L(E,k,A);r=D(_,S,T,O),n=0|_}({h:r,l:n}=N(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:i}=N(0|this.Bh,0|this.Bl,0|o,0|i)),({h:a,l:s}=N(0|this.Ch,0|this.Cl,0|a,0|s)),({h:u,l:c}=N(0|this.Dh,0|this.Dl,0|u,0|c)),({h:l,l:f}=N(0|this.Eh,0|this.El,0|l,0|f)),({h:p,l:d}=N(0|this.Fh,0|this.Fl,0|p,0|d)),({h,l:y}=N(0|this.Gh,0|this.Gl,0|h,0|y)),({h:m,l:g}=N(0|this.Hh,0|this.Hl,0|m,0|g)),this.set(r,n,o,i,a,s,u,c,l,f,p,d,h,y,m,g)}roundClean(){d(X,$)}destroy(){d(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const W=function(e){const t=t=>e().update(S(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}(()=>new G),Q=BigInt(0),Z=BigInt(1);function Y(e,t=""){if("boolean"!=typeof e)throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e}function J(e,t,r=""){const n=l(e),o=e?.length,i=void 0!==t;if(!n||i&&o!==t)throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(i?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e));return e}function ee(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?Q:BigInt("0x"+e)}function te(e){return f(e),ee(g(Uint8Array.from(e).reverse()))}function re(e,t){return b(e.toString(16).padStart(2*t,"0"))}function ne(e,t,r){let n;if("string"==typeof t)try{n=b(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!l(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const o=n.length;if("number"==typeof r&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function oe(e){return Uint8Array.from(e)}const ie=e=>"bigint"==typeof e&&Q<=e;function ae(e,t,r,n){if(!function(e,t,r){return ie(e)&&ie(t)&&ie(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}const se=e=>(Z<<BigInt(e))-Z;function ue(e,t,r={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function n(t,r,n){const o=e[t];if(n&&void 0===o)return;const i=typeof o;if(i!==r||null===o)throw new Error(`param "${t}" is invalid: expected ${r}, got ${i}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}const ce=()=>{throw new Error("not implemented")};function le(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(void 0!==o)return o;const i=e(r,...n);return t.set(r,i),i}}const fe=BigInt(0),pe=BigInt(1),de=BigInt(2),he=BigInt(3),ye=BigInt(4),me=BigInt(5),ge=BigInt(7),ve=BigInt(8),be=BigInt(9),we=BigInt(16);function Se(e,t){const r=e%t;return r>=fe?r:t+r}function Ee(e,t,r){let n=e;for(;t-- >fe;)n*=n,n%=r;return n}function Te(e,t){if(e===fe)throw new Error("invert: expected non-zero number");if(t<=fe)throw new Error("invert: expected positive modulus, got "+t);let r=Se(e,t),n=t,o=fe,i=pe,a=pe,s=fe;for(;r!==fe;){const e=n/r,t=n%r,u=o-a*e,c=i-s*e;n=r,r=t,o=a,i=s,a=u,s=c}if(n!==pe)throw new Error("invert: does not exist");return Se(o,t)}function ke(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function Oe(e,t){const r=(e.ORDER+pe)/ye,n=e.pow(t,r);return ke(e,n,t),n}function Ae(e,t){const r=(e.ORDER-me)/ve,n=e.mul(t,de),o=e.pow(n,r),i=e.mul(t,o),a=e.mul(e.mul(i,de),o),s=e.mul(i,e.sub(a,e.ONE));return ke(e,s,t),s}function _e(e){if(e<he)throw new Error("sqrt is not defined for small field");let t=e-pe,r=0;for(;t%de===fe;)t/=de,r++;let n=de;const o=Ce(e);for(;1===Re(o,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return Oe;let i=o.pow(n,t);const a=(t+pe)/de;return function(e,n){if(e.is0(n))return n;if(1!==Re(e,n))throw new Error("Cannot find square root");let o=r,s=e.mul(e.ONE,i),u=e.pow(n,t),c=e.pow(n,a);for(;!e.eql(u,e.ONE);){if(e.is0(u))return e.ZERO;let t=1,r=e.sqr(u);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===o)throw new Error("Cannot find square root");const n=pe<<BigInt(o-t-1),i=e.pow(s,n);o=t,s=e.sqr(i),u=e.mul(u,s),c=e.mul(c,i)}return c}}const xe=(e,t)=>(Se(e,t)&pe)===pe,Pe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ie(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((t,r,o)=>e.is0(r)?t:(n[o]=t,e.mul(t,r)),e.ONE),i=e.inv(o);return t.reduceRight((t,r,o)=>e.is0(r)?t:(n[o]=e.mul(t,n[o]),e.mul(t,r)),i),n}function Re(e,t){const r=(e.ORDER-pe)/de,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),a=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!a)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function Be(e,t){void 0!==t&&function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Ce(e,t,r=!1,n={}){if(e<=fe)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,i,a,s=!1;if("object"==typeof t&&null!=t){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(o=e.BITS),e.sqrt&&(i=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE),"boolean"==typeof e.modFromBytes&&(s=e.modFromBytes),a=e.allowedLengths}else"number"==typeof t&&(o=t),n.sqrt&&(i=n.sqrt);const{nBitLength:u,nByteLength:c}=Be(e,o);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const f=Object.freeze({ORDER:e,isLE:r,BITS:u,BYTES:c,MASK:se(u),ZERO:fe,ONE:pe,allowedLengths:a,create:t=>Se(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return fe<=t&&t<e},is0:e=>e===fe,isValidNot0:e=>!f.is0(e)&&f.isValid(e),isOdd:e=>(e&pe)===pe,neg:t=>Se(-t,e),eql:(e,t)=>e===t,sqr:t=>Se(t*t,e),add:(t,r)=>Se(t+r,e),sub:(t,r)=>Se(t-r,e),mul:(t,r)=>Se(t*r,e),pow:(e,t)=>function(e,t,r){if(r<fe)throw new Error("invalid exponent, negatives unsupported");if(r===fe)return e.ONE;if(r===pe)return t;let n=e.ONE,o=t;for(;r>fe;)r&pe&&(n=e.mul(n,o)),o=e.sqr(o),r>>=pe;return n}(f,e,t),div:(t,r)=>Se(t*Te(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Te(t,e),sqrt:i||(t=>(l||(l=function(e){return e%ye===he?Oe:e%ve===me?Ae:e%we===be?function(e){const t=Ce(e),r=_e(e),n=r(t,t.neg(t.ONE)),o=r(t,n),i=r(t,t.neg(n)),a=(e+ge)/we;return(e,t)=>{let r=e.pow(t,a),s=e.mul(r,n);const u=e.mul(r,o),c=e.mul(r,i),l=e.eql(e.sqr(s),t),f=e.eql(e.sqr(u),t);r=e.cmov(r,s,l),s=e.cmov(c,u,f);const p=e.eql(e.sqr(s),t),d=e.cmov(r,s,p);return ke(e,d,t),d}}(e):_e(e)}(e)),l(f,t))),toBytes:e=>r?re(e,c).reverse():re(e,c),fromBytes:(t,n=!0)=>{if(a){if(!a.includes(t.length)||t.length>c)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+t.length);const e=new Uint8Array(c);e.set(t,r?0:e.length-t.length),t=e}if(t.length!==c)throw new Error("Field.fromBytes: expected "+c+" bytes, got "+t.length);let o=r?te(t):function(e){return ee(g(e))}(t);if(s&&(o=Se(o,e)),!n&&!f.isValid(o))throw new Error("invalid field element: outside of range 0..ORDER");return o},invertBatch:e=>Ie(f,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(f)}const je=BigInt(0),Ue=BigInt(1);function Ne(e,t){const r=t.negate();return e?r:t}function Le(e,t){const r=Ie(e.Fp,t.map(e=>e.Z));return t.map((t,n)=>e.fromAffine(t.toAffine(r[n])))}function De(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Fe(e,t){De(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:se(e),maxNumber:r,shiftBy:BigInt(e)}}function Me(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:a}=r;let s=Number(e&o),u=e>>a;s>n&&(s-=i,u+=Ue);const c=t*n;return{nextN:u,offset:c+Math.abs(s)-1,isZero:0===s,isNeg:s<0,isNegF:t%2!=0,offsetF:c}}const Ve=new WeakMap,qe=new WeakMap;function He(e){return qe.get(e)||1}function ze(e){if(e!==je)throw new Error("invalid wNAF")}class Ke{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>je;)t&Ue&&(r=r.add(n)),n=n.double(),t>>=Ue;return r}precomputeWindow(e,t){const{windows:r,windowSize:n}=Fe(t,this.bits),o=[];let i=e,a=i;for(let e=0;e<r;e++){a=i,o.push(a);for(let e=1;e<n;e++)a=a.add(i),o.push(a);i=a.double()}return o}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE;const i=Fe(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:a,offset:s,isZero:u,isNeg:c,isNegF:l,offsetF:f}=Me(r,e,i);r=a,u?o=o.add(Ne(l,t[f])):n=n.add(Ne(c,t[s]))}return ze(r),{p:n,f:o}}wNAFUnsafe(e,t,r,n=this.ZERO){const o=Fe(e,this.bits);for(let e=0;e<o.windows&&r!==je;e++){const{nextN:i,offset:a,isZero:s,isNeg:u}=Me(r,e,o);if(r=i,!s){const e=t[a];n=n.add(u?e.negate():e)}}return ze(r),n}getPrecomputes(e,t,r){let n=Ve.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),Ve.set(t,n))),n}cached(e,t,r){const n=He(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){const o=He(e);return 1===o?this._unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)}createCache(e,t){De(t,this.bits),qe.set(e,t),Ve.delete(e)}hasCache(e){return 1!==He(e)}}function Xe(e,t,r,n){(function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})})(r,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}(n,t);const o=r.length,i=n.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,s=function(e){let t;for(t=0;e>Q;e>>=Z,t+=1);return t}(BigInt(o));let u=1;s>12?u=s-3:s>4?u=s-2:s>0&&(u=2);const c=se(u),l=new Array(Number(c)+1).fill(a);let f=a;for(let e=Math.floor((t.BITS-1)/u)*u;e>=0;e-=u){l.fill(a);for(let t=0;t<i;t++){const o=n[t],i=Number(o>>BigInt(e)&c);l[i]=l[i].add(r[t])}let t=a;for(let e=l.length-1,r=a;e>0;e--)r=r.add(l[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<u;e++)f=f.double()}return f}function $e(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){ue(e,Pe.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"}))}(t),t}return Ce(e,{isLE:r})}const Ge=BigInt(0),We=BigInt(1),Qe=BigInt(2),Ze=BigInt(8);class Ye{constructor(e){this.ep=e}static fromBytes(e){ce()}static fromHex(e){ce()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return g(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.init(this.ep.precompute(e,t))}toRawBytes(){return this.toBytes()}}function Je(e){const{CURVE:t,curveOpts:r,hash:n,eddsaOpts:o}=function(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r={Fp:e.Fp,Fn:Ce(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},n={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:r,hash:e.hash,eddsaOpts:n}}(e);return function(e,t){const r=t.Point;return Object.assign({},t,{ExtendedPoint:r,CURVE:e,nBitLength:r.Fn.BITS,nByteLength:r.Fn.BYTES})}(e,function(e,t,r={}){if("function"!=typeof t)throw new Error('"hash" function param is required');ue(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:n}=r,{BASE:o,Fp:i,Fn:a}=e,s=r.randomBytes||k,u=r.adjustScalarBytes||(e=>e),c=r.domain||((e,t,r)=>{if(Y(r,"phflag"),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function f(e){return a.create(te(e))}function p(e){const{head:r,prefix:n,scalar:i}=function(e){const r=g.secretKey;e=ne("private key",e,r);const n=ne("hashed private key",t(e),2*r),o=u(n.slice(0,r));return{head:o,prefix:n.slice(r,2*r),scalar:f(o)}}(e),a=o.multiply(i),s=a.toBytes();return{head:r,prefix:n,scalar:i,point:a,pointBytes:s}}function d(e){return p(e).pointBytes}function h(e=Uint8Array.of(),...r){const o=E(...r);return f(t(c(o,ne("context",e),!!n)))}const y={zip215:!0},m=i.BYTES,g={secretKey:m,publicKey:m,signature:2*m,seed:m};function v(e=s(g.seed)){return J(e,g.seed,"seed")}const b={getExtendedPublicKey:p,randomSecretKey:v,isValidSecretKey:function(e){return l(e)&&e.length===a.BYTES},isValidPublicKey:function(t,r){try{return!!e.fromBytes(t,r)}catch(e){return!1}},toMontgomery(t){const{y:r}=e.fromBytes(t),n=g.publicKey,o=32===n;if(!o&&57!==n)throw new Error("only defined for 25519 and 448");const a=o?i.div(We+r,We-r):i.div(r-We,r+We);return i.toBytes(a)},toMontgomeryPriv(e){const r=g.secretKey;J(e,r);const n=t(e.subarray(0,r));return u(n).subarray(0,r)},randomPrivateKey:v,precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)};return Object.freeze({keygen:function(e){const t=b.randomSecretKey(e);return{secretKey:t,publicKey:d(t)}},getPublicKey:d,sign:function(e,t,r={}){e=ne("message",e),n&&(e=n(e));const{prefix:i,scalar:s,pointBytes:u}=p(t),c=h(r.context,i,e),l=o.multiply(c).toBytes(),f=h(r.context,l,u,e),d=a.create(c+f*s);if(!a.isValid(d))throw new Error("sign failed: invalid s");return J(E(l,a.toBytes(d)),g.signature,"result")},verify:function(t,r,i,a=y){const{context:s,zip215:u}=a,c=g.signature;t=ne("signature",t,c),r=ne("message",r),i=ne("publicKey",i,g.publicKey),void 0!==u&&Y(u,"zip215"),n&&(r=n(r));const l=c/2,f=t.subarray(0,l),p=te(t.subarray(l,c));let d,m,v;try{d=e.fromBytes(i,u),m=e.fromBytes(f,u),v=o.multiplyUnsafe(p)}catch(e){return!1}if(!u&&d.isSmallOrder())return!1;const b=h(s,m.toBytes(),d.toBytes(),r);return m.add(d.multiplyUnsafe(b)).subtract(v).clearCofactor().is0()},utils:b,Point:e,lengths:g})}(function(e,t={}){const r=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>je))throw new Error(`CURVE.${e} must be positive bigint`)}const o=$e(t.p,r.Fp,n),i=$e(t.n,r.Fn,n),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}}("edwards",e,t,t.FpFnLE),{Fp:n,Fn:o}=r;let i=r.CURVE;const{h:a}=i;ue(t,{},{uvRatio:"function"});const s=Qe<<BigInt(8*o.BYTES)-We,u=e=>n.create(e),c=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(n.div(e,t))}}catch(e){return{isValid:!1,value:Ge}}});if(!function(e,t,r,n){const o=e.sqr(r),i=e.sqr(n),a=e.add(e.mul(t.a,o),i),s=e.add(e.ONE,e.mul(t.d,e.mul(o,i)));return e.eql(a,s)}(n,i,i.Gx,i.Gy))throw new Error("bad curve params: generator point");function l(e,t,r=!1){return ae("coordinate "+e,t,r?We:Ge,s),t}function f(e){if(!(e instanceof h))throw new Error("ExtendedPoint expected")}const p=le((e,t)=>{const{X:r,Y:o,Z:i}=e,a=e.is0();null==t&&(t=a?Ze:n.inv(i));const s=u(r*t),c=u(o*t),l=n.mul(i,t);if(a)return{x:Ge,y:We};if(l!==We)throw new Error("invZ was invalid");return{x:s,y:c}}),d=le(e=>{const{a:t,d:r}=i;if(e.is0())throw new Error("bad point: ZERO");const{X:n,Y:o,Z:a,T:s}=e,c=u(n*n),l=u(o*o),f=u(a*a),p=u(f*f),d=u(c*t);if(u(f*u(d+l))!==u(p+u(r*u(c*l))))throw new Error("bad point: equation left != right (1)");if(u(n*o)!==u(a*s))throw new Error("bad point: equation left != right (2)");return!0});class h{constructor(e,t,r,n){this.X=l("x",e),this.Y=l("y",t),this.Z=l("z",r,!0),this.T=l("t",n),Object.freeze(this)}static CURVE(){return i}static fromAffine(e){if(e instanceof h)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return l("x",t),l("y",r),new h(t,r,We,u(t*r))}static fromBytes(e,t=!1){const r=n.BYTES,{a:o,d:a}=i;e=oe(J(e,r,"point")),Y(t,"zip215");const l=oe(e),f=e[r-1];l[r-1]=-129&f;const p=te(l),d=t?s:n.ORDER;ae("point.y",p,Ge,d);const y=u(p*p),m=u(y-We),g=u(a*y-o);let{isValid:v,value:b}=c(m,g);if(!v)throw new Error("bad point: invalid y coordinate");const w=(b&We)===We,S=!!(128&f);if(!t&&b===Ge&&S)throw new Error("bad point: x=0 and x_0=1");return S!==w&&(b=u(-b)),h.fromAffine({x:b,y:p})}static fromHex(e,t=!1){return h.fromBytes(ne("point",e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return y.createCache(this,e),t||this.multiply(Qe),this}assertValidity(){d(this)}equals(e){f(e);const{X:t,Y:r,Z:n}=this,{X:o,Y:i,Z:a}=e,s=u(t*a),c=u(o*n),l=u(r*a),p=u(i*n);return s===c&&l===p}is0(){return this.equals(h.ZERO)}negate(){return new h(u(-this.X),this.Y,this.Z,u(-this.T))}double(){const{a:e}=i,{X:t,Y:r,Z:n}=this,o=u(t*t),a=u(r*r),s=u(Qe*u(n*n)),c=u(e*o),l=t+r,f=u(u(l*l)-o-a),p=c+a,d=p-s,y=c-a,m=u(f*d),g=u(p*y),v=u(f*y),b=u(d*p);return new h(m,g,b,v)}add(e){f(e);const{a:t,d:r}=i,{X:n,Y:o,Z:a,T:s}=this,{X:c,Y:l,Z:p,T:d}=e,y=u(n*c),m=u(o*l),g=u(s*r*d),v=u(a*p),b=u((n+o)*(c+l)-y-m),w=v-g,S=v+g,E=u(m-t*y),T=u(b*w),k=u(S*E),O=u(b*E),A=u(w*S);return new h(T,k,A,O)}subtract(e){return this.add(e.negate())}multiply(e){if(!o.isValidNot0(e))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:t,f:r}=y.cached(this,e,e=>Le(h,e));return Le(h,[t,r])[0]}multiplyUnsafe(e,t=h.ZERO){if(!o.isValid(e))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return e===Ge?h.ZERO:this.is0()||e===We?this:y.unsafe(this,e,e=>Le(h,e),t)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return y.unsafe(this,i.n).is0()}toAffine(e){return p(this,e)}clearCofactor(){return a===We?this:this.multiplyUnsafe(a)}toBytes(){const{x:e,y:t}=this.toAffine(),r=n.toBytes(t);return r[r.length-1]|=e&We?128:0,r}toHex(){return g(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(e){return Le(h,e)}static msm(e,t){return Xe(h,o,e,t)}_setWindowSize(e){this.precompute(e)}toRawBytes(){return this.toBytes()}}h.BASE=new h(i.Gx,i.Gy,We,u(i.Gx*i.Gy)),h.ZERO=new h(Ge,We,We,Ge),h.Fp=n,h.Fn=o;const y=new Ke(h,o.BITS);return h.BASE.precompute(8),h}(t,r),n,o))}w("HashToScalar-");const et=BigInt(0),tt=BigInt(1),rt=BigInt(2),nt=(BigInt(3),BigInt(5)),ot=BigInt(8),it=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),at={p:it,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:ot,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function st(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const ut=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function ct(e,t){const r=it,n=Se(t*t*t,r),o=Se(n*n*t,r);let i=Se(e*n*function(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),i=it,a=e*e%i*e%i,s=Ee(a,rt,i)*a%i,u=Ee(s,tt,i)*e%i,c=Ee(u,nt,i)*u%i,l=Ee(c,t,i)*c%i,f=Ee(l,r,i)*l%i,p=Ee(f,n,i)*f%i,d=Ee(p,o,i)*p%i,h=Ee(d,o,i)*p%i,y=Ee(h,t,i)*c%i;return{pow_p_5_8:Ee(y,rt,i)*e%i,b2:a}}(e*o).pow_p_5_8,r);const a=Se(t*i*i,r),s=i,u=Se(i*ut,r),c=a===e,l=a===Se(-e,r),f=a===Se(-e*ut,r);return c&&(i=s),(l||f)&&(i=u),xe(i,r)&&(i=Se(-i,r)),{isValid:c||l,value:i}}const lt=Ce(at.p,{isLE:!0}),ft=Ce(at.n,{isLE:!0}),pt=Je({...at,Fp:lt,hash:W,adjustScalarBytes:st,uvRatio:ct}),dt=ut,ht=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),yt=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),mt=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),gt=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),vt=e=>ct(tt,e),bt=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),wt=e=>pt.Point.Fp.create(te(e)&bt);function St(e){const{d:t}=at,r=it,n=e=>lt.create(e),o=n(dt*e*e),i=n((o+tt)*mt);let a=BigInt(-1);const s=n((a-t*o)*n(o+t));let{isValid:u,value:c}=ct(i,s),l=n(c*e);xe(l,r)||(l=n(-l)),u||(c=l),u||(a=o);const f=n(a*(o-tt)*gt-s),p=c*c,d=n((c+c)*s),h=n(f*ht),y=n(tt-p),m=n(tt+p);return new pt.Point(n(d*m),n(y*h),n(h*m),n(d*y))}class Et extends Ye{constructor(e){super(e)}static fromAffine(e){return new Et(pt.Point.fromAffine(e))}assertSame(e){if(!(e instanceof Et))throw new Error("RistrettoPoint expected")}init(e){return new Et(e)}static hashToCurve(e){return function(e){f(e,64);const t=St(wt(e.subarray(0,32))),r=St(wt(e.subarray(32,64)));return new Et(t.add(r))}(ne("ristrettoHash",e,64))}static fromBytes(e){f(e,32);const{a:t,d:r}=at,n=it,o=e=>lt.create(e),i=wt(e);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(lt.toBytes(i),e)||xe(i,n))throw new Error("invalid ristretto255 encoding 1");const a=o(i*i),s=o(tt+t*a),u=o(tt-t*a),c=o(s*s),l=o(u*u),p=o(t*r*c-l),{isValid:d,value:h}=vt(o(p*l)),y=o(h*u),m=o(h*y*p);let g=o((i+i)*y);xe(g,n)&&(g=o(-g));const v=o(s*m),b=o(g*v);if(!d||xe(b,n)||v===et)throw new Error("invalid ristretto255 encoding 2");return new Et(new pt.Point(g,v,tt,b))}static fromHex(e){return Et.fromBytes(ne("ristrettoHex",e,32))}static msm(e,t){return Xe(Et,pt.Point.Fn,e,t)}toBytes(){let{X:e,Y:t,Z:r,T:n}=this.ep;const o=it,i=e=>lt.create(e),a=i(i(r+t)*i(r-t)),s=i(e*t),u=i(s*s),{value:c}=vt(i(a*u)),l=i(c*a),f=i(c*s),p=i(l*f*n);let d;if(xe(n*p,o)){let r=i(t*dt),n=i(e*dt);e=r,t=n,d=i(l*yt)}else d=f;xe(e*p,o)&&(t=i(-t));let h=i((r-t)*d);return xe(h,o)&&(h=i(-h)),lt.toBytes(h)}equals(e){this.assertSame(e);const{X:t,Y:r}=this.ep,{X:n,Y:o}=e.ep,i=e=>lt.create(e),a=i(t*o)===i(r*n),s=i(r*o)===i(t*n);return a||s}is0(){return this.equals(Et.ZERO)}}Et.BASE=new Et(pt.Point.BASE),Et.ZERO=new Et(pt.Point.ZERO),Et.Fp=lt,Et.Fn=ft;var Tt=r(8287).Buffer;function kt(e,t){return Tt.from(pt.sign(Tt.from(e),t))}function Ot(e,t,r){return pt.verify(Tt.from(t),Tt.from(e),Tt.from(r),{zip215:!1})}var At=function(e,t){for(var r="number"==typeof e,n=String(e);n.endsWith(t);)n=n.slice(0,-1);return r?Number(n):n},_t=r(5360),xt=r(8287).Buffer;function Pt(e){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(e)}function It(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rt(n.key),n)}}function Rt(e){var t=function(e){if("object"!=Pt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Pt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pt(t)?t:t+""}var Bt,Ct,jt,Ut={ed25519PublicKey:48,ed25519SecretSeed:144,med25519PublicKey:96,preAuthTx:152,sha256Hash:184,signedPayload:120,contract:16,liquidityPool:88,claimableBalance:8},Nt={G:"ed25519PublicKey",S:"ed25519SecretSeed",M:"med25519PublicKey",T:"preAuthTx",X:"sha256Hash",P:"signedPayload",C:"contract",L:"liquidityPool",B:"claimableBalance"},Lt=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"encodeEd25519PublicKey",value:function(e){return Mt("ed25519PublicKey",e)}},{key:"decodeEd25519PublicKey",value:function(e){return Ft("ed25519PublicKey",e)}},{key:"isValidEd25519PublicKey",value:function(e){return Dt("ed25519PublicKey",e)}},{key:"encodeEd25519SecretSeed",value:function(e){return Mt("ed25519SecretSeed",e)}},{key:"decodeEd25519SecretSeed",value:function(e){return Ft("ed25519SecretSeed",e)}},{key:"isValidEd25519SecretSeed",value:function(e){return Dt("ed25519SecretSeed",e)}},{key:"encodeMed25519PublicKey",value:function(e){return Mt("med25519PublicKey",e)}},{key:"decodeMed25519PublicKey",value:function(e){return Ft("med25519PublicKey",e)}},{key:"isValidMed25519PublicKey",value:function(e){return Dt("med25519PublicKey",e)}},{key:"encodePreAuthTx",value:function(e){return Mt("preAuthTx",e)}},{key:"decodePreAuthTx",value:function(e){return Ft("preAuthTx",e)}},{key:"encodeSha256Hash",value:function(e){return Mt("sha256Hash",e)}},{key:"decodeSha256Hash",value:function(e){return Ft("sha256Hash",e)}},{key:"encodeSignedPayload",value:function(e){return Mt("signedPayload",e)}},{key:"decodeSignedPayload",value:function(e){return Ft("signedPayload",e)}},{key:"isValidSignedPayload",value:function(e){return Dt("signedPayload",e)}},{key:"encodeContract",value:function(e){return Mt("contract",e)}},{key:"decodeContract",value:function(e){return Ft("contract",e)}},{key:"isValidContract",value:function(e){return Dt("contract",e)}},{key:"encodeClaimableBalance",value:function(e){return Mt("claimableBalance",e)}},{key:"decodeClaimableBalance",value:function(e){return Ft("claimableBalance",e)}},{key:"isValidClaimableBalance",value:function(e){return Dt("claimableBalance",e)}},{key:"encodeLiquidityPool",value:function(e){return Mt("liquidityPool",e)}},{key:"decodeLiquidityPool",value:function(e){return Ft("liquidityPool",e)}},{key:"isValidLiquidityPool",value:function(e){return Dt("liquidityPool",e)}},{key:"getVersionByteForPrefix",value:function(e){return Nt[e[0]]}}],t&&It(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Dt(e,t){if("string"!=typeof t)return!1;switch(e){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":case"liquidityPool":if(56!==t.length)return!1;break;case"claimableBalance":if(58!==t.length)return!1;break;case"med25519PublicKey":if(69!==t.length)return!1;break;case"signedPayload":if(t.length<56||t.length>165)return!1;break;default:return!1}var r="";try{r=Ft(e,t)}catch(e){return!1}switch(e){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":case"liquidityPool":return 32===r.length;case"claimableBalance":return 33===r.length;case"med25519PublicKey":return 40===r.length;case"signedPayload":return r.length>=40&&r.length<=100;default:return!1}}function Ft(e,t){if("string"!=typeof t)throw new TypeError("encoded argument must be of type String");var r=_t.decode(t),n=r[0],o=r.slice(0,-2),i=o.slice(1),a=r.slice(-2);if(t!==_t.encode(r))throw new Error("invalid encoded string");var s=Ut[e];if(void 0===s)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(Ut).join(", ")));if(n!==s)throw new Error("invalid version byte. expected ".concat(s,", got ").concat(n));if(!function(e,t){if(e.length!==t.length)return!1;if(0===e.length)return!0;for(var r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}(Vt(o),a))throw new Error("invalid checksum");return xt.from(i)}function Mt(e,t){if(null==t)throw new Error("cannot encode null data");var r=Ut[e];if(void 0===r)throw new Error("".concat(e," is not a valid version byte name. ")+"Expected one of ".concat(Object.keys(Ut).join(", ")));t=xt.from(t);var n=xt.from([r]),o=xt.concat([n,t]),i=xt.from(Vt(o)),a=xt.concat([o,i]);return _t.encode(a)}function Vt(e){for(var t=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],r=0,n=0;n<e.length;n+=1)r=r<<8^t[r>>8^e[n]],r&=65535;var o=new Uint8Array(2);return o[0]=255&r,o[1]=r>>8&255,o}Bt=Lt,jt=Nt,(Ct=Rt(Ct="types"))in Bt?Object.defineProperty(Bt,Ct,{value:jt,enumerable:!0,configurable:!0,writable:!0}):Bt[Ct]=jt;var qt=r(8287).Buffer;function Ht(e){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ht(e)}function zt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Kt(n.key),n)}}function Kt(e){var t=function(e){if("object"!=Ht(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ht(t)?t:t+""}var Xt=function(e,t,r){return t&&zt(e.prototype,t),r&&zt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"ed25519"!==t.type)throw new Error("Invalid keys type");if(this.type=t.type,t.secretKey){if(t.secretKey=qt.from(t.secretKey),32!==t.secretKey.length)throw new Error("secretKey length is invalid");if(this._secretSeed=t.secretKey,this._publicKey=(r=t.secretKey,Tt.from(pt.getPublicKey(r))),this._secretKey=t.secretKey,t.publicKey&&!this._publicKey.equals(qt.from(t.publicKey)))throw new Error("secretKey does not match publicKey")}else if(this._publicKey=qt.from(t.publicKey),32!==this._publicKey.length)throw new Error("publicKey length is invalid");var r},[{key:"xdrAccountId",value:function(){return new i.AccountId.publicKeyTypeEd25519(this._publicKey)}},{key:"xdrPublicKey",value:function(){return new i.PublicKey.publicKeyTypeEd25519(this._publicKey)}},{key:"xdrMuxedAccount",value:function(e){if(void 0!==e){if("string"!=typeof e)throw new TypeError("expected string for ID, got ".concat(Ht(e)));return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromString(e),ed25519:this._publicKey}))}return new i.MuxedAccount.keyTypeEd25519(this._publicKey)}},{key:"rawPublicKey",value:function(){return this._publicKey}},{key:"signatureHint",value:function(){var e=this.xdrAccountId().toXDR();return e.slice(e.length-4)}},{key:"publicKey",value:function(){return Lt.encodeEd25519PublicKey(this._publicKey)}},{key:"secret",value:function(){if(!this._secretSeed)throw new Error("no secret key available");if("ed25519"===this.type)return Lt.encodeEd25519SecretSeed(this._secretSeed);throw new Error("Invalid Keypair type")}},{key:"rawSecretKey",value:function(){return this._secretSeed}},{key:"canSign",value:function(){return!!this._secretKey}},{key:"sign",value:function(e){if(!this.canSign())throw new Error("cannot sign: no secret key available");return kt(e,this._secretKey)}},{key:"verify",value:function(e,t){return Ot(e,t,this._publicKey)}},{key:"signDecorated",value:function(e){var t=this.sign(e),r=this.signatureHint();return new i.DecoratedSignature({hint:r,signature:t})}},{key:"signPayloadDecorated",value:function(e){var t=this.sign(e),r=this.signatureHint(),n=qt.from(e.slice(-4));return n.length<4&&(n=qt.concat([n,qt.alloc(4-e.length,0)])),new i.DecoratedSignature({hint:n.map(function(e,t){return e^r[t]}),signature:t})}}],[{key:"fromSecret",value:function(e){var t=Lt.decodeEd25519SecretSeed(e);return this.fromRawEd25519Seed(t)}},{key:"fromRawEd25519Seed",value:function(e){return new this({type:"ed25519",secretKey:e})}},{key:"master",value:function(e){if(!e)throw new Error("No network selected. Please pass a network argument, e.g. `Keypair.master(Networks.PUBLIC)`.");return this.fromRawEd25519Seed(u(e))}},{key:"fromPublicKey",value:function(e){if(32!==(e=Lt.decodeEd25519PublicKey(e)).length)throw new Error("Invalid Stellar public key");return new this({type:"ed25519",publicKey:e})}},{key:"random",value:function(){var e=pt.utils.randomPrivateKey();return this.fromRawEd25519Seed(e)}}]),$t=r(8287).Buffer;function Gt(e){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gt(e)}function Wt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qt(n.key),n)}}function Qt(e){var t=function(e){if("object"!=Gt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gt(t)?t:t+""}var Zt=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!/^[a-zA-Z0-9]{1,12}$/.test(t))throw new Error("Asset code is invalid (maximum alphanumeric, 12 characters at max)");if("xlm"!==String(t).toLowerCase()&&!r)throw new Error("Issuer cannot be null");if(r&&!Lt.isValidEd25519PublicKey(r))throw new Error("Issuer is invalid");"xlm"===String(t).toLowerCase()?this.code="XLM":this.code=t,this.issuer=r}return function(e,t,r){return t&&Wt(e.prototype,t),r&&Wt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"toXDRObject",value:function(){return this._toXDRObject(i.Asset)}},{key:"toChangeTrustXDRObject",value:function(){return this._toXDRObject(i.ChangeTrustAsset)}},{key:"toTrustLineXDRObject",value:function(){return this._toXDRObject(i.TrustLineAsset)}},{key:"contractId",value:function(e){var t=u($t.from(e)),r=i.HashIdPreimage.envelopeTypeContractId(new i.HashIdPreimageContractId({networkId:t,contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAsset(this.toXDRObject())}));return Lt.encodeContract(u(r.toXDR()))}},{key:"_toXDRObject",value:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.Asset;if(this.isNative())return r.assetTypeNative();this.code.length<=4?(e=i.AlphaNum4,t="assetTypeCreditAlphanum4"):(e=i.AlphaNum12,t="assetTypeCreditAlphanum12");var n=this.code.length<=4?4:12;return new r(t,new e({assetCode:this.code.padEnd(n,"\0"),issuer:Xt.fromPublicKey(this.issuer).xdrAccountId()}))}},{key:"getCode",value:function(){if(void 0!==this.code)return String(this.code)}},{key:"getIssuer",value:function(){if(void 0!==this.issuer)return String(this.issuer)}},{key:"getAssetType",value:function(){switch(this.getRawAssetType().value){case i.AssetType.assetTypeNative().value:return"native";case i.AssetType.assetTypeCreditAlphanum4().value:return"credit_alphanum4";case i.AssetType.assetTypeCreditAlphanum12().value:return"credit_alphanum12";default:return"unknown"}}},{key:"getRawAssetType",value:function(){return this.isNative()?i.AssetType.assetTypeNative():this.code.length<=4?i.AssetType.assetTypeCreditAlphanum4():i.AssetType.assetTypeCreditAlphanum12()}},{key:"isNative",value:function(){return!this.issuer}},{key:"equals",value:function(e){return this.code===e.getCode()&&this.issuer===e.getIssuer()}},{key:"toString",value:function(){return this.isNative()?"native":"".concat(this.getCode(),":").concat(this.getIssuer())}}],[{key:"native",value:function(){return new e("XLM")}},{key:"fromOperation",value:function(e){var t,r;switch(e.switch()){case i.AssetType.assetTypeNative():return this.native();case i.AssetType.assetTypeCreditAlphanum4():t=e.alphaNum4();case i.AssetType.assetTypeCreditAlphanum12():return t=t||e.alphaNum12(),r=Lt.encodeEd25519PublicKey(t.issuer().ed25519()),new this(At(t.assetCode(),"\0"),r);default:throw new Error("Invalid asset type: ".concat(e.switch().name))}}},{key:"compare",value:function(t,r){if(!(t&&t instanceof e))throw new Error("assetA is invalid");if(!(r&&r instanceof e))throw new Error("assetB is invalid");if(t.equals(r))return 0;var n=t.getRawAssetType().value,o=r.getRawAssetType().value;if(n!==o)return n<o?-1:1;var i=Yt(t.getCode(),r.getCode());return 0!==i?i:Yt(t.getIssuer(),r.getIssuer())}}])}();function Yt(e,t){return $t.compare($t.from(e,"ascii"),$t.from(t,"ascii"))}var Jt=r(8287).Buffer,er=30;function tr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("constant_product"!==e)throw new Error("liquidityPoolType is invalid");var r=t.assetA,n=t.assetB,o=t.fee;if(!(r&&r instanceof Zt))throw new Error("assetA is invalid");if(!(n&&n instanceof Zt))throw new Error("assetB is invalid");if(!o||o!==er)throw new Error("fee is invalid");if(-1!==Zt.compare(r,n))throw new Error("Assets are not in lexicographic order");var a=i.LiquidityPoolType.liquidityPoolConstantProduct().toXDR(),s=new i.LiquidityPoolConstantProductParameters({assetA:r.toXDRObject(),assetB:n.toXDRObject(),fee:o}).toXDR();return u(Jt.concat([a,s]))}var rr=r(8287).Buffer;function nr(e){return nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nr(e)}function or(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ir(n.key),n)}}function ir(e){var t=function(e){if("object"!=nr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=nr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nr(t)?t:t+""}var ar=function(e,t){return t&&or(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r,n,o){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof o)throw new Error("Invalid passphrase provided to Transaction: expected a string but got a ".concat(nr(o)));this._networkPassphrase=o,this._tx=t,this._signatures=r,this._fee=n},[{key:"signatures",get:function(){return this._signatures},set:function(e){throw new Error("Transaction is immutable")}},{key:"tx",get:function(){return this._tx},set:function(e){throw new Error("Transaction is immutable")}},{key:"fee",get:function(){return this._fee},set:function(e){throw new Error("Transaction is immutable")}},{key:"networkPassphrase",get:function(){return this._networkPassphrase},set:function(e){this._networkPassphrase=e}},{key:"sign",value:function(){for(var e=this,t=this.hash(),r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];n.forEach(function(r){var n=r.signDecorated(t);e.signatures.push(n)})}},{key:"getKeypairSignature",value:function(e){return e.sign(this.hash()).toString("base64")}},{key:"addSignature",value:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!n||"string"!=typeof n)throw new Error("Invalid signature");if(!r||"string"!=typeof r)throw new Error("Invalid publicKey");var o=rr.from(n,"base64");try{t=(e=Xt.fromPublicKey(r)).signatureHint()}catch(e){throw new Error("Invalid publicKey")}if(!e.verify(this.hash(),o))throw new Error("Invalid signature");this.signatures.push(new i.DecoratedSignature({hint:t,signature:o}))}},{key:"addDecoratedSignature",value:function(e){this.signatures.push(e)}},{key:"signHashX",value:function(e){if("string"==typeof e&&(e=rr.from(e,"hex")),e.length>64)throw new Error("preimage cannnot be longer than 64 bytes");var t=e,r=u(e),n=r.slice(r.length-4);this.signatures.push(new i.DecoratedSignature({hint:n,signature:t}))}},{key:"hash",value:function(){return u(this.signatureBase())}},{key:"signatureBase",value:function(){throw new Error("Implement in subclass")}},{key:"toEnvelope",value:function(){throw new Error("Implement in subclass")}},{key:"toXDR",value:function(){return this.toEnvelope().toXDR().toString("base64")}}]),sr=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ur=Math.ceil,cr=Math.floor,lr="[BigNumber Error] ",fr=lr+"Number primitive has more than 15 significant digits: ",pr=1e14,dr=14,hr=9007199254740991,yr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],mr=1e7,gr=1e9;function vr(e){var t=0|e;return e>0||e===t?t:t-1}function br(e){for(var t,r,n=1,o=e.length,i=e[0]+"";n<o;){for(t=e[n++]+"",r=dr-t.length;r--;t="0"+t);i+=t}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function wr(e,t){var r,n,o=e.c,i=t.c,a=e.s,s=t.s,u=e.e,c=t.e;if(!a||!s)return null;if(r=o&&!o[0],n=i&&!i[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==c,!o||!i)return n?0:!o^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;a<s;a++)if(o[a]!=i[a])return o[a]>i[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function Sr(e,t,r,n){if(e<t||e>r||e!==cr(e))throw Error(lr+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Er(e){var t=e.c.length-1;return vr(e.e/dr)==t&&e.c[t]%2!=0}function Tr(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function kr(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Or=function e(t){var r,n,o,i,a,s,u,c,l,f,p=A.prototype={constructor:A,toString:null,valueOf:null},d=new A(1),h=20,y=4,m=-7,g=21,v=-1e7,b=1e7,w=!1,S=1,E=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz",O=!0;function A(e,t){var r,i,a,s,u,c,l,f,p=this;if(!(p instanceof A))return new A(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>b?p.c=p.e=null:e.e<v?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((c="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,u=e;u>=10;u/=10,s++);return void(s>b?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!sr.test(f=String(e)))return o(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(u=f.search(/e/i))>0?(s<0&&(s=u),s+=+f.slice(u+1),f=f.substring(0,u)):s<0&&(s=f.length)}else{if(Sr(t,2,k.length,"Base"),10==t&&O)return I(p=new A(e),h+p.e+1,y);if(f=String(e),c="number"==typeof e){if(0*e!=0)return o(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,A.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(fr+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=k.slice(0,t),s=u=0,l=f.length;u<l;u++)if(r.indexOf(i=f.charAt(u))<0){if("."==i){if(u>s){s=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,u=-1,s=0;continue}return o(p,String(e),c,t)}c=!1,(s=(f=n(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(u=0;48===f.charCodeAt(u);u++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(u,++l)){if(l-=u,c&&A.DEBUG&&l>15&&(e>hr||e!==cr(e)))throw Error(fr+p.s*e);if((s=s-u-1)>b)p.c=p.e=null;else if(s<v)p.c=[p.e=0];else{if(p.e=s,p.c=[],u=(s+1)%dr,s<0&&(u+=dr),u<l){for(u&&p.c.push(+f.slice(0,u)),l-=dr;u<l;)p.c.push(+f.slice(u,u+=dr));u=dr-(f=f.slice(u)).length}else u-=l;for(;u--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function _(e,t,r,n){var o,i,a,s,u;if(null==r?r=y:Sr(r,0,8),!e.c)return e.toString();if(o=e.c[0],a=e.e,null==t)u=br(e.c),u=1==n||2==n&&(a<=m||a>=g)?Tr(u,a):kr(u,a,"0");else if(i=(e=I(new A(e),t,r)).e,s=(u=br(e.c)).length,1==n||2==n&&(t<=i||i<=m)){for(;s<t;u+="0",s++);u=Tr(u,i)}else if(t-=a+(2===n&&i>a),u=kr(u,i,"0"),i+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=i-s)>0)for(i+1==s&&(u+=".");t--;u+="0");return e.s<0&&o?"-"+u:u}function x(e,t){for(var r,n,o=1,i=new A(e[0]);o<e.length;o++)(!(n=new A(e[o])).s||(r=wr(i,n))===t||0===r&&i.s===t)&&(i=n);return i}function P(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*dr-1)>b?e.c=e.e=null:r<v?e.c=[e.e=0]:(e.e=r,e.c=t),e}function I(e,t,r,n){var o,i,a,s,u,c,l,f=e.c,p=yr;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((i=t-o)<0)i+=dr,a=t,u=f[c=0],l=cr(u/p[o-a-1]%10);else if((c=ur((i+1)/dr))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));u=l=0,o=1,a=(i%=dr)-dr+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);l=(a=(i%=dr)-dr+o)<0?0:cr(u/p[o-a-1]%10)}if(n=n||t<0||null!=f[c+1]||(a<0?u:u%p[o-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(dr-t%dr)%dr],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[dr-i],f[c]=a>0?cr(u/p[o-a]%p[a])*s:0),n)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(e.e++,f[0]==pr&&(f[0]=1));break}if(f[c]+=s,f[c]!=pr)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}e.e>b?e.c=e.e=null:e.e<v&&(e.c=[e.e=0])}return e}function R(e){var t,r=e.e;return null===r?e.toString():(t=br(e.c),t=r<=m||r>=g?Tr(t,r):kr(t,r,"0"),e.s<0?"-"+t:t)}return A.clone=e,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(lr+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(Sr(r=e[t],0,gr,t),h=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(Sr(r=e[t],0,8,t),y=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(Sr(r[0],-gr,0,t),Sr(r[1],0,gr,t),m=r[0],g=r[1]):(Sr(r,-gr,gr,t),m=-(g=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)Sr(r[0],-gr,-1,t),Sr(r[1],1,gr,t),v=r[0],b=r[1];else{if(Sr(r,-gr,gr,t),!r)throw Error(lr+t+" cannot be zero: "+r);v=-(b=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(lr+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!r,Error(lr+"crypto unavailable");w=r}else w=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(Sr(r=e[t],0,9,t),S=r),e.hasOwnProperty(t="POW_PRECISION")&&(Sr(r=e[t],0,gr,t),E=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(lr+t+" not an object: "+r);T=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(lr+t+" invalid: "+r);O="0123456789"==r.slice(0,10),k=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:y,EXPONENTIAL_AT:[m,g],RANGE:[v,b],CRYPTO:w,MODULO_MODE:S,POW_PRECISION:E,FORMAT:T,ALPHABET:k}},A.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!A.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-gr&&o<=gr&&o===cr(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%dr)<1&&(t+=dr),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=pr||r!==cr(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(lr+"Invalid BigNumber: "+e)},A.maximum=A.max=function(){return x(arguments,-1)},A.minimum=A.min=function(){return x(arguments,1)},A.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return cr(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,u=[],c=new A(d);if(null==e?e=h:Sr(e,0,gr),o=ur(e/dr),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(u.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw w=!1,Error(lr+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(u.push(i%1e14),s+=7);s=o/7}if(!w)for(;s<o;)(i=a())<9e15&&(u[s++]=i%1e14);for(o=u[--s],e%=dr,o&&e&&(i=yr[dr-e],u[s]=cr(o/i)*i);0===u[s];u.pop(),s--);if(s<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=dr);for(s=1,i=u[0];i>=10;i/=10,s++);s<dr&&(n-=dr-s)}return c.e=n,c.c=u,c}),A.sum=function(){for(var e=1,t=arguments,r=new A(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var o,i,a=[0],s=0,u=e.length;s<u;){for(i=a.length;i--;a[i]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),o=0;o<a.length;o++)a[o]>r-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,s){var u,c,l,f,p,d,m,g,v=n.indexOf("."),b=h,w=y;for(v>=0&&(f=E,E=0,n=n.replace(".",""),d=(g=new A(o)).pow(n.length-v),E=f,g.c=t(kr(br(d.c),d.e,"0"),10,i,e),g.e=g.c.length),l=f=(m=t(n,o,i,s?(u=k,e):(u=e,k))).length;0==m[--f];m.pop());if(!m[0])return u.charAt(0);if(v<0?--l:(d.c=m,d.e=l,d.s=a,m=(d=r(d,g,b,w,i)).c,p=d.r,l=d.e),v=m[c=l+b+1],f=i/2,p=p||c<0||null!=m[c+1],p=w<4?(null!=v||p)&&(0==w||w==(d.s<0?3:2)):v>f||v==f&&(4==w||p||6==w&&1&m[c-1]||w==(d.s<0?8:7)),c<1||!m[0])n=p?kr(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(m.length=c,p)for(--i;++m[--c]>i;)m[c]=0,c||(++l,m=[1].concat(m));for(f=m.length;!m[--f];);for(v=0,n="";v<=f;n+=u.charAt(m[v++]));n=kr(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,s=0,u=e.length,c=t%mr,l=t/mr|0;for(e=e.slice();u--;)s=((o=c*(i=e[u]%mr)+(n=l*i+(a=e[u]/mr|0)*c)%mr*mr+s)/r|0)+(n/mr|0)+l*a,e[u]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;o<r;o++)if(e[o]!=t[o]){i=e[o]>t[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,i,a,s){var u,c,l,f,p,d,h,y,m,g,v,b,w,S,E,T,k,O=n.s==o.s?1:-1,_=n.c,x=o.c;if(!(_&&_[0]&&x&&x[0]))return new A(n.s&&o.s&&(_?!x||_[0]!=x[0]:x)?_&&0==_[0]||!x?0*O:O/0:NaN);for(m=(y=new A(O)).c=[],O=i+(c=n.e-o.e)+1,s||(s=pr,c=vr(n.e/dr)-vr(o.e/dr),O=O/dr|0),l=0;x[l]==(_[l]||0);l++);if(x[l]>(_[l]||0)&&c--,O<0)m.push(1),f=!0;else{for(S=_.length,T=x.length,l=0,O+=2,(p=cr(s/(x[0]+1)))>1&&(x=e(x,p,s),_=e(_,p,s),T=x.length,S=_.length),w=T,v=(g=_.slice(0,T)).length;v<T;g[v++]=0);k=x.slice(),k=[0].concat(k),E=x[0],x[1]>=s/2&&E++;do{if(p=0,(u=t(x,g,T,v))<0){if(b=g[0],T!=v&&(b=b*s+(g[1]||0)),(p=cr(b/E))>1)for(p>=s&&(p=s-1),h=(d=e(x,p,s)).length,v=g.length;1==t(d,g,h,v);)p--,r(d,T<h?k:x,h,s),h=d.length,u=1;else 0==p&&(u=p=1),h=(d=x.slice()).length;if(h<v&&(d=[0].concat(d)),r(g,d,v,s),v=g.length,-1==u)for(;t(x,g,T,v)<1;)p++,r(g,T<v?k:x,v,s),v=g.length}else 0===u&&(p++,g=[0]);m[l++]=p,g[0]?g[v++]=_[w]||0:(g=[_[w]],v=1)}while((w++<S||null!=g[0])&&O--);f=null!=g[0],m[0]||m.splice(0,1)}if(s==pr){for(l=1,O=m[0];O>=10;O/=10,l++);I(y,i+(y.e=l+c*dr-1)+1,a,f)}else y.e=c,y.r=+f;return y}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(f,"");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(s,function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t}),n&&(o=n,i=i.replace(u,"$1").replace(c,"0.$1")),t!=i))return new A(i,o);if(A.DEBUG)throw Error(lr+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},p.absoluteValue=p.abs=function(){var e=new A(this);return e.s<0&&(e.s=1),e},p.comparedTo=function(e,t){return wr(this,new A(e,t))},p.decimalPlaces=p.dp=function(e,t){var r,n,o,i=this;if(null!=e)return Sr(e,0,gr),null==t?t=y:Sr(t,0,8),I(new A(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-vr(this.e/dr))*dr,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},p.dividedBy=p.div=function(e,t){return r(this,new A(e,t),h,y)},p.dividedToIntegerBy=p.idiv=function(e,t){return r(this,new A(e,t),0,1)},p.exponentiatedBy=p.pow=function(e,t){var r,n,o,i,a,s,u,c,l=this;if((e=new A(e)).c&&!e.isInteger())throw Error(lr+"Exponent not an integer: "+R(e));if(null!=t&&(t=new A(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new A(Math.pow(+R(l),a?e.s*(2-Er(e)):+R(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(NaN);(n=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&Er(e)?-0:0,l.e>-1&&(i=1/i),new A(s?1/i:i);E&&(i=ur(E/dr+2))}for(a?(r=new A(.5),s&&(e.s=1),u=Er(e)):u=(o=Math.abs(+R(e)))%2,c=new A(d);;){if(u){if(!(c=c.times(l)).c)break;i?c.c.length>i&&(c.c.length=i):n&&(c=c.mod(t))}if(o){if(0===(o=cr(o/2)))break;u=o%2}else if(I(e=e.times(r),e.e+1,1),e.e>14)u=Er(e);else{if(0===(o=+R(e)))break;u=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}return n?c:(s&&(c=d.div(c)),t?c.mod(t):i?I(c,E,y,void 0):c)},p.integerValue=function(e){var t=new A(this);return null==e?e=y:Sr(e,0,8),I(t,t.e+1,e)},p.isEqualTo=p.eq=function(e,t){return 0===wr(this,new A(e,t))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(e,t){return wr(this,new A(e,t))>0},p.isGreaterThanOrEqualTo=p.gte=function(e,t){return 1===(t=wr(this,new A(e,t)))||0===t},p.isInteger=function(){return!!this.c&&vr(this.e/dr)>this.c.length-2},p.isLessThan=p.lt=function(e,t){return wr(this,new A(e,t))<0},p.isLessThanOrEqualTo=p.lte=function(e,t){return-1===(t=wr(this,new A(e,t)))||0===t},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(e,t){var r,n,o,i,a=this,s=a.s;if(t=(e=new A(e,t)).s,!s||!t)return new A(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/dr,c=e.e/dr,l=a.c,f=e.c;if(!u||!c){if(!l||!f)return l?(e.s=-t,e):new A(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new A(l[0]?a:3==y?-0:0)}if(u=vr(u),c=vr(c),l=l.slice(),s=u-c){for((i=s<0)?(s=-s,o=l):(c=u,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(i=(s=l.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(l[t]!=f[t]){i=l[t]<f[t];break}if(i&&(o=l,l=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=pr-1;n>s;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=pr}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?P(e,l,c):(e.s=3==y?-1:1,e.c=[e.e=0],e)},p.modulo=p.mod=function(e,t){var n,o,i=this;return e=new A(e,t),!i.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||i.c&&!i.c[0]?new A(i):(9==S?(o=e.s,e.s=1,n=r(i,e,0,3),e.s=o,n.s*=o):n=r(i,e,0,S),(e=i.minus(n.times(e))).c[0]||1!=S||(e.s=i.s),e)},p.multipliedBy=p.times=function(e,t){var r,n,o,i,a,s,u,c,l,f,p,d,h,y,m,g=this,v=g.c,b=(e=new A(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!g.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=g.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=vr(g.e/dr)+vr(e.e/dr),e.s*=g.s,(u=v.length)<(f=b.length)&&(h=v,v=b,b=h,o=u,u=f,f=o),o=u+f,h=[];o--;h.push(0));for(y=pr,m=mr,o=f;--o>=0;){for(r=0,p=b[o]%m,d=b[o]/m|0,i=o+(a=u);i>o;)r=((c=p*(c=v[--a]%m)+(s=d*c+(l=v[a]/m|0)*p)%m*m+h[i]+r)/y|0)+(s/m|0)+d*l,h[i--]=c%y;h[i]=r}return r?++n:h.splice(0,1),P(e,h,n)},p.negated=function(){var e=new A(this);return e.s=-e.s||null,e},p.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new A(e,t)).s,!o||!t)return new A(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/dr,a=e.e/dr,s=n.c,u=e.c;if(!i||!a){if(!s||!u)return new A(o/0);if(!s[0]||!u[0])return u[0]?e:new A(s[0]?n:0*o)}if(i=vr(i),a=vr(a),s=s.slice(),o=i-a){for(o>0?(a=i,r=u):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+u[t]+o)/pr|0,s[t]=pr===s[t]?0:s[t]%pr;return o&&(s=[o].concat(s),++a),P(e,s,a)},p.precision=p.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return Sr(e,1,gr),null==t?t=y:Sr(t,0,8),I(new A(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*dr+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},p.shiftedBy=function(e){return Sr(e,-9007199254740991,hr),this.times("1e"+e)},p.squareRoot=p.sqrt=function(){var e,t,n,o,i,a=this,s=a.c,u=a.s,c=a.e,l=h+4,f=new A("0.5");if(1!==u||!s||!s[0])return new A(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+R(a)))||u==1/0?(((t=br(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=vr((c+1)/2)-(c<0||c%2),n=new A(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new A(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),br(i.c).slice(0,u)===(t=br(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(o||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(I(n,n.e+h+2,1),e=!n.times(n).eq(a));break}if(!o&&(I(i,i.e+h+2,0),i.times(i).eq(a))){n=i;break}l+=4,u+=4,o=1}return I(n,n.e+h+1,y,e)},p.toExponential=function(e,t){return null!=e&&(Sr(e,0,gr),e++),_(this,e,t,1)},p.toFixed=function(e,t){return null!=e&&(Sr(e,0,gr),e=e+this.e+1),_(this,e,t)},p.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=T;else if("object"!=typeof r)throw Error(lr+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var i,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],f=a[1],p=o.s<0,d=p?l.slice(1):l,h=d.length;if(u&&(i=s,s=u,u=i,h-=i),s>0&&h>0){for(i=h%s||s,l=d.substr(0,i);i<h;i+=s)l+=c+d.substr(i,s);u>0&&(l+=c+d.slice(i)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},p.toFraction=function(e){var t,n,o,i,a,s,u,c,l,f,p,h,m=this,g=m.c;if(null!=e&&(!(u=new A(e)).isInteger()&&(u.c||1!==u.s)||u.lt(d)))throw Error(lr+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+R(u));if(!g)return new A(m);for(t=new A(d),l=n=new A(d),o=c=new A(d),h=br(g),a=t.e=h.length-m.e-1,t.c[0]=yr[(s=a%dr)<0?dr+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=b,b=1/0,u=new A(h),c.c[0]=0;f=r(u,t,0,1),1!=(i=n.plus(f.times(o))).comparedTo(e);)n=o,o=i,l=c.plus(f.times(i=l)),c=i,t=u.minus(f.times(i=t)),u=i;return i=r(e.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=m.s,p=r(l,o,a*=2,y).minus(m).abs().comparedTo(r(c,n,a,y).minus(m).abs())<1?[l,o]:[c,n],b=s,p},p.toNumber=function(){return+R(this)},p.toPrecision=function(e,t){return null!=e&&Sr(e,1,gr),_(this,e,t,2)},p.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=m||i>=g?Tr(br(r.c),i):kr(br(r.c),i,"0"):10===e&&O?t=kr(br((r=I(new A(r),h+i+1,y)).c),r.e,"0"):(Sr(e,2,k.length,"Base"),t=n(kr(br(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},p.valueOf=p.toJSON=function(){return R(this)},p._isBigNumber=!0,p[Symbol.toStringTag]="BigNumber",p[Symbol.for("nodejs.util.inspect.custom")]=p.valueOf,null!=t&&A.set(t),A}(),Ar=Or.clone();Ar.DEBUG=!0;const _r=Ar;function xr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Pr=2147483647;function Ir(e){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ir(e)}function Rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(r),!0).forEach(function(t){Cr(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Cr(e,t,r){return(t=Ur(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ur(n.key),n)}}function Ur(e){var t=function(e){if("object"!=Ir(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ir(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ir(t)?t:t+""}var Nr=function(e,t,r){return t&&jr(e.prototype,t),r&&jr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!(t&&t instanceof Zt))throw new Error("assetA is invalid");if(!(r&&r instanceof Zt))throw new Error("assetB is invalid");if(-1!==Zt.compare(t,r))throw new Error("Assets are not in lexicographic order");if(!n||n!==er)throw new Error("fee is invalid");this.assetA=t,this.assetB=r,this.fee=n},[{key:"toXDRObject",value:function(){var e=new i.LiquidityPoolConstantProductParameters({assetA:this.assetA.toXDRObject(),assetB:this.assetB.toXDRObject(),fee:this.fee}),t=new i.LiquidityPoolParameters("liquidityPoolConstantProduct",e);return new i.ChangeTrustAsset("assetTypePoolShare",t)}},{key:"getLiquidityPoolParameters",value:function(){return Br(Br({},this),{},{assetA:this.assetA,assetB:this.assetB,fee:this.fee})}},{key:"getAssetType",value:function(){return"liquidity_pool_shares"}},{key:"equals",value:function(e){return this.assetA.equals(e.assetA)&&this.assetB.equals(e.assetB)&&this.fee===e.fee}},{key:"toString",value:function(){var e=tr("constant_product",this.getLiquidityPoolParameters()).toString("hex");return"liquidity_pool:".concat(e)}}],[{key:"fromOperation",value:function(e){var t=e.switch();if(t===i.AssetType.assetTypePoolShare()){var r=e.liquidityPool().constantProduct();return new this(Zt.fromOperation(r.assetA()),Zt.fromOperation(r.assetB()),r.fee())}throw new Error("Invalid asset type: ".concat(t.name))}}]);function Lr(e){return Lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lr(e)}function Dr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Fr(n.key),n)}}function Fr(e){var t=function(e){if("object"!=Lr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Lr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Lr(t)?t:t+""}var Mr=function(e,t,r){return t&&Dr(e.prototype,t),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&!Lt.isValidEd25519PublicKey(t))throw new Error("Destination is invalid");if(this._destination=t,r){if(!(r instanceof i.ClaimPredicate))throw new Error("Predicate should be an xdr.ClaimPredicate");this._predicate=r}else this._predicate=i.ClaimPredicate.claimPredicateUnconditional()},[{key:"toXDRObject",value:function(){var e=new i.ClaimantV0({destination:Xt.fromPublicKey(this._destination).xdrAccountId(),predicate:this._predicate});return i.Claimant.claimantTypeV0(e)}},{key:"destination",get:function(){return this._destination},set:function(e){throw new Error("Claimant is immutable")}},{key:"predicate",get:function(){return this._predicate},set:function(e){throw new Error("Claimant is immutable")}}],[{key:"predicateUnconditional",value:function(){return i.ClaimPredicate.claimPredicateUnconditional()}},{key:"predicateAnd",value:function(e,t){if(!(e instanceof i.ClaimPredicate))throw new Error("left Predicate should be an xdr.ClaimPredicate");if(!(t instanceof i.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return i.ClaimPredicate.claimPredicateAnd([e,t])}},{key:"predicateOr",value:function(e,t){if(!(e instanceof i.ClaimPredicate))throw new Error("left Predicate should be an xdr.ClaimPredicate");if(!(t instanceof i.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return i.ClaimPredicate.claimPredicateOr([e,t])}},{key:"predicateNot",value:function(e){if(!(e instanceof i.ClaimPredicate))throw new Error("right Predicate should be an xdr.ClaimPredicate");return i.ClaimPredicate.claimPredicateNot(e)}},{key:"predicateBeforeAbsoluteTime",value:function(e){return i.ClaimPredicate.claimPredicateBeforeAbsoluteTime(i.Int64.fromString(e))}},{key:"predicateBeforeRelativeTime",value:function(e){return i.ClaimPredicate.claimPredicateBeforeRelativeTime(i.Int64.fromString(e))}},{key:"fromXDR",value:function(e){var t;if(e.switch()===i.ClaimantType.claimantTypeV0())return t=e.v0(),new this(Lt.encodeEd25519PublicKey(t.destination().ed25519()),t.predicate());throw new Error("Invalid claimant type: ".concat(e.switch().name))}}]);function Vr(e){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vr(e)}function qr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hr(n.key),n)}}function Hr(e){var t=function(e){if("object"!=Vr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vr(t)?t:t+""}var zr=function(e,t,r){return t&&qr(e.prototype,t),r&&qr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("liquidityPoolId cannot be empty");if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Liquidity pool ID is not a valid hash");this.liquidityPoolId=t},[{key:"toXDRObject",value:function(){var e=i.PoolId.fromXDR(this.liquidityPoolId,"hex");return new i.TrustLineAsset("assetTypePoolShare",e)}},{key:"getLiquidityPoolId",value:function(){return String(this.liquidityPoolId)}},{key:"getAssetType",value:function(){return"liquidity_pool_shares"}},{key:"equals",value:function(e){return this.liquidityPoolId===e.getLiquidityPoolId()}},{key:"toString",value:function(){return"liquidity_pool:".concat(this.liquidityPoolId)}}],[{key:"fromOperation",value:function(e){var t=e.switch();if(t===i.AssetType.assetTypePoolShare())return new this(e.liquidityPoolId().toString("hex"));throw new Error("Invalid asset type: ".concat(t.name))}}]),Kr=r(8287).Buffer;function Xr(e){return Lt.isValidMed25519PublicKey(e)?function(e){var t=Lt.decodeMed25519PublicKey(e);return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromXDR(t.subarray(-8)),ed25519:t.subarray(0,-8)}))}(e):i.MuxedAccount.keyTypeEd25519(Lt.decodeEd25519PublicKey(e))}function $r(e){return e.switch().value===i.CryptoKeyType.keyTypeMuxedEd25519().value?function(e){if(e.switch()===i.CryptoKeyType.keyTypeEd25519())return $r(e);var t=e.med25519();return Lt.encodeMed25519PublicKey(Kr.concat([t.ed25519(),t.id().toXDR("raw")]))}(e):Lt.encodeEd25519PublicKey(e.ed25519())}function Gr(e,t){if(!Lt.isValidEd25519PublicKey(e))throw new Error("address should be a Stellar account ID (G...)");if("string"!=typeof t)throw new Error("id should be a string representing a number (uint64)");return i.MuxedAccount.keyTypeMuxedEd25519(new i.MuxedAccountMed25519({id:i.Uint64.fromString(t),ed25519:Lt.decodeEd25519PublicKey(e)}))}function Wr(e){if(Lt.isValidEd25519PublicKey(e))return e;if(!Lt.isValidMed25519PublicKey(e))throw new TypeError("expected muxed account (M...), got ".concat(e));var t=Xr(e);return Lt.encodeEd25519PublicKey(t.med25519().ed25519())}function Qr(e){if("string"!=typeof e||72!==e.length)throw new Error("must provide a valid claimable balance id")}var Zr=r(8287).Buffer,Yr=r(8287).Buffer;function Jr(e,t){if(e>=0&&e<=255)return!0;throw new Error("".concat(t," value must be between 0 and 255"))}var en=r(8287).Buffer;function tn(e){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tn(e)}var rn=r(8287).Buffer;function nn(e){return nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nn(e)}function on(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,an(n.key),n)}}function an(e){var t=function(e){if("object"!=nn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=nn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nn(t)?t:t+""}var sn=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Lt.isValidEd25519PublicKey(t))this._type="account",this._key=Lt.decodeEd25519PublicKey(t);else if(Lt.isValidContract(t))this._type="contract",this._key=Lt.decodeContract(t);else if(Lt.isValidMed25519PublicKey(t))this._type="muxedAccount",this._key=Lt.decodeMed25519PublicKey(t);else if(Lt.isValidClaimableBalance(t))this._type="claimableBalance",this._key=Lt.decodeClaimableBalance(t);else{if(!Lt.isValidLiquidityPool(t))throw new Error("Unsupported address type: ".concat(t));this._type="liquidityPool",this._key=Lt.decodeLiquidityPool(t)}}return function(e,t,r){return t&&on(e.prototype,t),r&&on(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"toString",value:function(){switch(this._type){case"account":return Lt.encodeEd25519PublicKey(this._key);case"contract":return Lt.encodeContract(this._key);case"claimableBalance":return Lt.encodeClaimableBalance(this._key);case"liquidityPool":return Lt.encodeLiquidityPool(this._key);case"muxedAccount":return Lt.encodeMed25519PublicKey(this._key);default:throw new Error("Unsupported address type")}}},{key:"toScVal",value:function(){return i.ScVal.scvAddress(this.toScAddress())}},{key:"toScAddress",value:function(){switch(this._type){case"account":return i.ScAddress.scAddressTypeAccount(i.PublicKey.publicKeyTypeEd25519(this._key));case"contract":return i.ScAddress.scAddressTypeContract(this._key);case"liquidityPool":return i.ScAddress.scAddressTypeLiquidityPool(this._key);case"claimableBalance":return i.ScAddress.scAddressTypeClaimableBalance(new i.ClaimableBalanceId("claimableBalanceIdTypeV".concat(this._key.at(0)),this._key.subarray(1)));case"muxedAccount":return i.ScAddress.scAddressTypeMuxedAccount(new i.MuxedEd25519Account({ed25519:this._key.subarray(0,32),id:i.Uint64.fromXDR(this._key.subarray(32,40),"raw")}));default:throw new Error("Unsupported address type: ".concat(this._type))}}},{key:"toBuffer",value:function(){return this._key}}],[{key:"fromString",value:function(t){return new e(t)}},{key:"account",value:function(t){return new e(Lt.encodeEd25519PublicKey(t))}},{key:"contract",value:function(t){return new e(Lt.encodeContract(t))}},{key:"claimableBalance",value:function(t){return new e(Lt.encodeClaimableBalance(t))}},{key:"liquidityPool",value:function(t){return new e(Lt.encodeLiquidityPool(t))}},{key:"muxedAccount",value:function(t){return new e(Lt.encodeMed25519PublicKey(t))}},{key:"fromScVal",value:function(t){return e.fromScAddress(t.address())}},{key:"fromScAddress",value:function(t){switch(t.switch().value){case i.ScAddressType.scAddressTypeAccount().value:return e.account(t.accountId().ed25519());case i.ScAddressType.scAddressTypeContract().value:return e.contract(t.contractId());case i.ScAddressType.scAddressTypeMuxedAccount().value:var r=rn.concat([t.muxedAccount().ed25519(),t.muxedAccount().id().toXDR("raw")]);return e.muxedAccount(r);case i.ScAddressType.scAddressTypeClaimableBalance().value:return e.claimableBalance(t.claimableBalanceId());case i.ScAddressType.scAddressTypeLiquidityPool().value:return e.liquidityPool(t.liquidityPoolId());default:throw new Error("Unsupported address type: ".concat(t.switch().name))}}}])}(),un=r(8287).Buffer;function cn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ln(e){return ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ln(e)}function fn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pn(n.key),n)}}function pn(e){var t=function(e){if("object"!=ln(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ln(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ln(t)?t:t+""}var dn=1e7,hn=1,yn=2,mn=4,gn=8,vn=function(e,t,r){return r&&fn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"setSourceAccount",value:function(e,t){if(t.source)try{e.sourceAccount=Xr(t.source)}catch(e){throw new Error("Source address is invalid")}}},{key:"fromXDRObject",value:function(e){var t={};e.sourceAccount()&&(t.source=$r(e.sourceAccount()));var r=e.body().value(),n=e.body().switch().name;switch(n){case"createAccount":t.type="createAccount",t.destination=bn(r.destination()),t.startingBalance=this._fromXDRAmount(r.startingBalance());break;case"payment":t.type="payment",t.destination=$r(r.destination()),t.asset=Zt.fromOperation(r.asset()),t.amount=this._fromXDRAmount(r.amount());break;case"pathPaymentStrictReceive":t.type="pathPaymentStrictReceive",t.sendAsset=Zt.fromOperation(r.sendAsset()),t.sendMax=this._fromXDRAmount(r.sendMax()),t.destination=$r(r.destination()),t.destAsset=Zt.fromOperation(r.destAsset()),t.destAmount=this._fromXDRAmount(r.destAmount()),t.path=[];var o=r.path();Object.keys(o).forEach(function(e){t.path.push(Zt.fromOperation(o[e]))});break;case"pathPaymentStrictSend":t.type="pathPaymentStrictSend",t.sendAsset=Zt.fromOperation(r.sendAsset()),t.sendAmount=this._fromXDRAmount(r.sendAmount()),t.destination=$r(r.destination()),t.destAsset=Zt.fromOperation(r.destAsset()),t.destMin=this._fromXDRAmount(r.destMin()),t.path=[];var a=r.path();Object.keys(a).forEach(function(e){t.path.push(Zt.fromOperation(a[e]))});break;case"changeTrust":t.type="changeTrust",r.line().switch()===i.AssetType.assetTypePoolShare()?t.line=Nr.fromOperation(r.line()):t.line=Zt.fromOperation(r.line()),t.limit=this._fromXDRAmount(r.limit());break;case"allowTrust":t.type="allowTrust",t.trustor=bn(r.trustor()),t.assetCode=r.asset().value().toString(),t.assetCode=At(t.assetCode,"\0"),t.authorize=r.authorize();break;case"setOptions":if(t.type="setOptions",r.inflationDest()&&(t.inflationDest=bn(r.inflationDest())),t.clearFlags=r.clearFlags(),t.setFlags=r.setFlags(),t.masterWeight=r.masterWeight(),t.lowThreshold=r.lowThreshold(),t.medThreshold=r.medThreshold(),t.highThreshold=r.highThreshold(),t.homeDomain=void 0!==r.homeDomain()?r.homeDomain().toString("ascii"):void 0,r.signer()){var s={},u=r.signer().key().arm();if("ed25519"===u)s.ed25519PublicKey=bn(r.signer().key());else if("preAuthTx"===u)s.preAuthTx=r.signer().key().preAuthTx();else if("hashX"===u)s.sha256Hash=r.signer().key().hashX();else if("ed25519SignedPayload"===u){var c=r.signer().key().ed25519SignedPayload();s.ed25519SignedPayload=Lt.encodeSignedPayload(c.toXDR())}s.weight=r.signer().weight(),t.signer=s}break;case"manageOffer":case"manageSellOffer":t.type="manageSellOffer",t.selling=Zt.fromOperation(r.selling()),t.buying=Zt.fromOperation(r.buying()),t.amount=this._fromXDRAmount(r.amount()),t.price=this._fromXDRPrice(r.price()),t.offerId=r.offerId().toString();break;case"manageBuyOffer":t.type="manageBuyOffer",t.selling=Zt.fromOperation(r.selling()),t.buying=Zt.fromOperation(r.buying()),t.buyAmount=this._fromXDRAmount(r.buyAmount()),t.price=this._fromXDRPrice(r.price()),t.offerId=r.offerId().toString();break;case"createPassiveOffer":case"createPassiveSellOffer":t.type="createPassiveSellOffer",t.selling=Zt.fromOperation(r.selling()),t.buying=Zt.fromOperation(r.buying()),t.amount=this._fromXDRAmount(r.amount()),t.price=this._fromXDRPrice(r.price());break;case"accountMerge":t.type="accountMerge",t.destination=$r(r);break;case"manageData":t.type="manageData",t.name=r.dataName().toString("ascii"),t.value=r.dataValue();break;case"inflation":t.type="inflation";break;case"bumpSequence":t.type="bumpSequence",t.bumpTo=r.bumpTo().toString();break;case"createClaimableBalance":t.type="createClaimableBalance",t.asset=Zt.fromOperation(r.asset()),t.amount=this._fromXDRAmount(r.amount()),t.claimants=[],r.claimants().forEach(function(e){t.claimants.push(Mr.fromXDR(e))});break;case"claimClaimableBalance":t.type="claimClaimableBalance",t.balanceId=r.toXDR("hex");break;case"beginSponsoringFutureReserves":t.type="beginSponsoringFutureReserves",t.sponsoredId=bn(r.sponsoredId());break;case"endSponsoringFutureReserves":t.type="endSponsoringFutureReserves";break;case"revokeSponsorship":!function(e,t){switch(e.switch().name){case"revokeSponsorshipLedgerEntry":var r=e.ledgerKey();switch(r.switch().name){case i.LedgerEntryType.account().name:t.type="revokeAccountSponsorship",t.account=bn(r.account().accountId());break;case i.LedgerEntryType.trustline().name:t.type="revokeTrustlineSponsorship",t.account=bn(r.trustLine().accountId());var n=r.trustLine().asset();n.switch()===i.AssetType.assetTypePoolShare()?t.asset=zr.fromOperation(n):t.asset=Zt.fromOperation(n);break;case i.LedgerEntryType.offer().name:t.type="revokeOfferSponsorship",t.seller=bn(r.offer().sellerId()),t.offerId=r.offer().offerId().toString();break;case i.LedgerEntryType.data().name:t.type="revokeDataSponsorship",t.account=bn(r.data().accountId()),t.name=r.data().dataName().toString("ascii");break;case i.LedgerEntryType.claimableBalance().name:t.type="revokeClaimableBalanceSponsorship",t.balanceId=r.claimableBalance().balanceId().toXDR("hex");break;case i.LedgerEntryType.liquidityPool().name:t.type="revokeLiquidityPoolSponsorship",t.liquidityPoolId=r.liquidityPool().liquidityPoolId().toString("hex");break;default:throw new Error("Unknown ledgerKey: ".concat(e.switch().name))}break;case"revokeSponsorshipSigner":t.type="revokeSignerSponsorship",t.account=bn(e.signer().accountId()),t.signer=function(e){var t={};switch(e.switch().name){case i.SignerKeyType.signerKeyTypeEd25519().name:t.ed25519PublicKey=Lt.encodeEd25519PublicKey(e.ed25519());break;case i.SignerKeyType.signerKeyTypePreAuthTx().name:t.preAuthTx=e.preAuthTx().toString("hex");break;case i.SignerKeyType.signerKeyTypeHashX().name:t.sha256Hash=e.hashX().toString("hex");break;default:throw new Error("Unknown signerKey: ".concat(e.switch().name))}return t}(e.signer().signerKey());break;default:throw new Error("Unknown revokeSponsorship: ".concat(e.switch().name))}}(r,t);break;case"clawback":t.type="clawback",t.amount=this._fromXDRAmount(r.amount()),t.from=$r(r.from()),t.asset=Zt.fromOperation(r.asset());break;case"clawbackClaimableBalance":t.type="clawbackClaimableBalance",t.balanceId=r.toXDR("hex");break;case"setTrustLineFlags":t.type="setTrustLineFlags",t.asset=Zt.fromOperation(r.asset()),t.trustor=bn(r.trustor());var l=r.clearFlags(),f=r.setFlags(),p={authorized:i.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:i.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:i.TrustLineFlags.trustlineClawbackEnabledFlag()};t.flags={},Object.keys(p).forEach(function(e){var r;t.flags[e]=(r=p[e].value,!!(f&r)||!(l&r)&&void 0)});break;case"liquidityPoolDeposit":t.type="liquidityPoolDeposit",t.liquidityPoolId=r.liquidityPoolId().toString("hex"),t.maxAmountA=this._fromXDRAmount(r.maxAmountA()),t.maxAmountB=this._fromXDRAmount(r.maxAmountB()),t.minPrice=this._fromXDRPrice(r.minPrice()),t.maxPrice=this._fromXDRPrice(r.maxPrice());break;case"liquidityPoolWithdraw":t.type="liquidityPoolWithdraw",t.liquidityPoolId=r.liquidityPoolId().toString("hex"),t.amount=this._fromXDRAmount(r.amount()),t.minAmountA=this._fromXDRAmount(r.minAmountA()),t.minAmountB=this._fromXDRAmount(r.minAmountB());break;case"invokeHostFunction":var d;t.type="invokeHostFunction",t.func=r.hostFunction(),t.auth=null!==(d=r.auth())&&void 0!==d?d:[];break;case"extendFootprintTtl":t.type="extendFootprintTtl",t.extendTo=r.extendTo();break;case"restoreFootprint":t.type="restoreFootprint";break;default:throw new Error("Unknown operation: ".concat(n))}return t}},{key:"isValidAmount",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"!=typeof e)return!1;try{t=new _r(e)}catch(e){return!1}return!(!r&&t.isZero()||t.isNegative()||t.times(dn).gt(new _r("9223372036854775807").toString())||t.decimalPlaces()>7||t.isNaN()||!t.isFinite())}},{key:"constructAmountRequirementsError",value:function(e){return"".concat(e," argument must be of type String, represent a positive number and have at most 7 digits after the decimal")}},{key:"_checkUnsignedIntValue",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0!==t)switch("string"==typeof t&&(t=parseFloat(t)),!0){case"number"!=typeof t||!Number.isFinite(t)||t%1!=0:throw new Error("".concat(e," value is invalid"));case t<0:throw new Error("".concat(e," value must be unsigned"));case!r||r&&r(t,e):return t;default:throw new Error("".concat(e," value is invalid"))}}},{key:"_toXDRAmount",value:function(e){var t=new _r(e).times(dn);return n.Hyper.fromString(t.toString())}},{key:"_fromXDRAmount",value:function(e){return new _r(e).div(dn).toFixed(7)}},{key:"_fromXDRPrice",value:function(e){return new _r(e.n()).div(new _r(e.d())).toString()}},{key:"_toXDRPrice",value:function(e){var t;if(e.n&&e.d)t=new i.Price(e);else{var r=function(e){for(var t,r,n=new _r(e),o=[[new _r(0),new _r(1)],[new _r(1),new _r(0)]],i=2;!n.gt(Pr);){t=n.integerValue(_r.ROUND_FLOOR),r=n.minus(t);var a=t.times(o[i-1][0]).plus(o[i-2][0]),s=t.times(o[i-1][1]).plus(o[i-2][1]);if(a.gt(Pr)||s.gt(Pr))break;if(o.push([a,s]),r.eq(0))break;n=new _r(1).div(r),i+=1}var u=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xr(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o[o.length-1],2),c=u[0],l=u[1];if(c.isZero()||l.isZero())throw new Error("Couldn't find approximation");return[c.toNumber(),l.toNumber()]}(e);t=new i.Price({n:parseInt(r[0],10),d:parseInt(r[1],10)})}if(t.n()<0||t.d()<0)throw new Error("price must be positive");return t}}]);function bn(e){return Lt.encodeEd25519PublicKey(e.ed25519())}vn.accountMerge=function(e){var t={};try{t.body=i.OperationBody.accountMerge(Xr(e.destination))}catch(e){throw new Error("destination is invalid")}return this.setSourceAccount(t,e),new i.Operation(t)},vn.allowTrust=function(e){if(!Lt.isValidEd25519PublicKey(e.trustor))throw new Error("trustor is invalid");var t={};if(t.trustor=Xt.fromPublicKey(e.trustor).xdrAccountId(),e.assetCode.length<=4){var r=e.assetCode.padEnd(4,"\0");t.asset=i.AssetCode.assetTypeCreditAlphanum4(r)}else{if(!(e.assetCode.length<=12))throw new Error("Asset code must be 12 characters at max.");var n=e.assetCode.padEnd(12,"\0");t.asset=i.AssetCode.assetTypeCreditAlphanum12(n)}"boolean"==typeof e.authorize?e.authorize?t.authorize=i.TrustLineFlags.authorizedFlag().value:t.authorize=0:t.authorize=e.authorize;var o=new i.AllowTrustOp(t),a={};return a.body=i.OperationBody.allowTrust(o),this.setSourceAccount(a,e),new i.Operation(a)},vn.bumpSequence=function(e){var t={};if("string"!=typeof e.bumpTo)throw new Error("bumpTo must be a string");try{new _r(e.bumpTo)}catch(e){throw new Error("bumpTo must be a stringified number")}t.bumpTo=n.Hyper.fromString(e.bumpTo);var r=new i.BumpSequenceOp(t),o={};return o.body=i.OperationBody.bumpSequence(r),this.setSourceAccount(o,e),new i.Operation(o)},vn.changeTrust=function(e){var t={};if(e.asset instanceof Zt)t.line=e.asset.toChangeTrustXDRObject();else{if(!(e.asset instanceof Nr))throw new TypeError("asset must be Asset or LiquidityPoolAsset");t.line=e.asset.toXDRObject()}if(void 0!==e.limit&&!this.isValidAmount(e.limit,!0))throw new TypeError(this.constructAmountRequirementsError("limit"));e.limit?t.limit=this._toXDRAmount(e.limit):t.limit=n.Hyper.fromString(new _r("9223372036854775807").toString()),e.source&&(t.source=e.source.masterKeypair);var r=new i.ChangeTrustOp(t),o={};return o.body=i.OperationBody.changeTrust(r),this.setSourceAccount(o,e),new i.Operation(o)},vn.createAccount=function(e){if(!Lt.isValidEd25519PublicKey(e.destination))throw new Error("destination is invalid");if(!this.isValidAmount(e.startingBalance,!0))throw new TypeError(this.constructAmountRequirementsError("startingBalance"));var t={};t.destination=Xt.fromPublicKey(e.destination).xdrAccountId(),t.startingBalance=this._toXDRAmount(e.startingBalance);var r=new i.CreateAccountOp(t),n={};return n.body=i.OperationBody.createAccount(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.createClaimableBalance=function(e){if(!(e.asset instanceof Zt))throw new Error("must provide an asset for create claimable balance operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(!Array.isArray(e.claimants)||0===e.claimants.length)throw new Error("must provide at least one claimant");var t={};t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount),t.claimants=Object.values(e.claimants).map(function(e){return e.toXDRObject()});var r=new i.CreateClaimableBalanceOp(t),n={};return n.body=i.OperationBody.createClaimableBalance(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.claimClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Qr(e.balanceId);var t={};t.balanceId=i.ClaimableBalanceId.fromXDR(e.balanceId,"hex");var r=new i.ClaimClaimableBalanceOp(t),n={};return n.body=i.OperationBody.claimClaimableBalance(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.clawbackClaimableBalance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Qr(e.balanceId);var t={balanceId:i.ClaimableBalanceId.fromXDR(e.balanceId,"hex")},r={body:i.OperationBody.clawbackClaimableBalance(new i.ClawbackClaimableBalanceOp(t))};return this.setSourceAccount(r,e),new i.Operation(r)},vn.createPassiveSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price);var r=new i.CreatePassiveSellOfferOp(t),n={};return n.body=i.OperationBody.createPassiveSellOffer(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.inflation=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=i.OperationBody.inflation(),this.setSourceAccount(t,e),new i.Operation(t)},vn.manageData=function(e){var t={};if(!("string"==typeof e.name&&e.name.length<=64))throw new Error("name must be a string, up to 64 characters");if(t.dataName=e.name,"string"!=typeof e.value&&!Zr.isBuffer(e.value)&&null!==e.value)throw new Error("value must be a string, Buffer or null");if("string"==typeof e.value?t.dataValue=Zr.from(e.value):t.dataValue=e.value,null!==t.dataValue&&t.dataValue.length>64)throw new Error("value cannot be longer that 64 bytes");var r=new i.ManageDataOp(t),n={};return n.body=i.OperationBody.manageData(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.manageSellOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.amount,!0))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0",t.offerId=n.Hyper.fromString(e.offerId);var r=new i.ManageSellOfferOp(t),o={};return o.body=i.OperationBody.manageSellOffer(r),this.setSourceAccount(o,e),new i.Operation(o)},vn.manageBuyOffer=function(e){var t={};if(t.selling=e.selling.toXDRObject(),t.buying=e.buying.toXDRObject(),!this.isValidAmount(e.buyAmount,!0))throw new TypeError(this.constructAmountRequirementsError("buyAmount"));if(t.buyAmount=this._toXDRAmount(e.buyAmount),void 0===e.price)throw new TypeError("price argument is required");t.price=this._toXDRPrice(e.price),void 0!==e.offerId?e.offerId=e.offerId.toString():e.offerId="0",t.offerId=n.Hyper.fromString(e.offerId);var r=new i.ManageBuyOfferOp(t),o={};return o.body=i.OperationBody.manageBuyOffer(r),this.setSourceAccount(o,e),new i.Operation(o)},vn.pathPaymentStrictReceive=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendMax):throw new TypeError(this.constructAmountRequirementsError("sendMax"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destAmount):throw new TypeError(this.constructAmountRequirementsError("destAmount"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendMax=this._toXDRAmount(e.sendMax);try{t.destination=Xr(e.destination)}catch(e){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destAmount=this._toXDRAmount(e.destAmount);var r=e.path?e.path:[];t.path=r.map(function(e){return e.toXDRObject()});var n=new i.PathPaymentStrictReceiveOp(t),o={};return o.body=i.OperationBody.pathPaymentStrictReceive(n),this.setSourceAccount(o,e),new i.Operation(o)},vn.pathPaymentStrictSend=function(e){switch(!0){case!e.sendAsset:throw new Error("Must specify a send asset");case!this.isValidAmount(e.sendAmount):throw new TypeError(this.constructAmountRequirementsError("sendAmount"));case!e.destAsset:throw new Error("Must provide a destAsset for a payment operation");case!this.isValidAmount(e.destMin):throw new TypeError(this.constructAmountRequirementsError("destMin"))}var t={};t.sendAsset=e.sendAsset.toXDRObject(),t.sendAmount=this._toXDRAmount(e.sendAmount);try{t.destination=Xr(e.destination)}catch(e){throw new Error("destination is invalid")}t.destAsset=e.destAsset.toXDRObject(),t.destMin=this._toXDRAmount(e.destMin);var r=e.path?e.path:[];t.path=r.map(function(e){return e.toXDRObject()});var n=new i.PathPaymentStrictSendOp(t),o={};return o.body=i.OperationBody.pathPaymentStrictSend(n),this.setSourceAccount(o,e),new i.Operation(o)},vn.payment=function(e){if(!e.asset)throw new Error("Must provide an asset for a payment operation");if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));var t={};try{t.destination=Xr(e.destination)}catch(e){throw new Error("destination is invalid")}t.asset=e.asset.toXDRObject(),t.amount=this._toXDRAmount(e.amount);var r=new i.PaymentOp(t),n={};return n.body=i.OperationBody.payment(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.setOptions=function(e){var t={};if(e.inflationDest){if(!Lt.isValidEd25519PublicKey(e.inflationDest))throw new Error("inflationDest is invalid");t.inflationDest=Xt.fromPublicKey(e.inflationDest).xdrAccountId()}if(t.clearFlags=this._checkUnsignedIntValue("clearFlags",e.clearFlags),t.setFlags=this._checkUnsignedIntValue("setFlags",e.setFlags),t.masterWeight=this._checkUnsignedIntValue("masterWeight",e.masterWeight,Jr),t.lowThreshold=this._checkUnsignedIntValue("lowThreshold",e.lowThreshold,Jr),t.medThreshold=this._checkUnsignedIntValue("medThreshold",e.medThreshold,Jr),t.highThreshold=this._checkUnsignedIntValue("highThreshold",e.highThreshold,Jr),void 0!==e.homeDomain&&"string"!=typeof e.homeDomain)throw new TypeError("homeDomain argument must be of type String");if(t.homeDomain=e.homeDomain,e.signer){var r,n=this._checkUnsignedIntValue("signer.weight",e.signer.weight,Jr),o=0;if(e.signer.ed25519PublicKey){if(!Lt.isValidEd25519PublicKey(e.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var a=Lt.decodeEd25519PublicKey(e.signer.ed25519PublicKey);r=new i.SignerKey.signerKeyTypeEd25519(a),o+=1}if(e.signer.preAuthTx){if("string"==typeof e.signer.preAuthTx&&(e.signer.preAuthTx=Yr.from(e.signer.preAuthTx,"hex")),!Yr.isBuffer(e.signer.preAuthTx)||32!==e.signer.preAuthTx.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");r=new i.SignerKey.signerKeyTypePreAuthTx(e.signer.preAuthTx),o+=1}if(e.signer.sha256Hash){if("string"==typeof e.signer.sha256Hash&&(e.signer.sha256Hash=Yr.from(e.signer.sha256Hash,"hex")),!Yr.isBuffer(e.signer.sha256Hash)||32!==e.signer.sha256Hash.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");r=new i.SignerKey.signerKeyTypeHashX(e.signer.sha256Hash),o+=1}if(e.signer.ed25519SignedPayload){if(!Lt.isValidSignedPayload(e.signer.ed25519SignedPayload))throw new Error("signer.ed25519SignedPayload is invalid.");var s=Lt.decodeSignedPayload(e.signer.ed25519SignedPayload),u=i.SignerKeyEd25519SignedPayload.fromXDR(s);r=i.SignerKey.signerKeyTypeEd25519SignedPayload(u),o+=1}if(1!==o)throw new Error("Signer object must contain exactly one of signer.ed25519PublicKey, signer.sha256Hash, signer.preAuthTx.");t.signer=new i.Signer({key:r,weight:n})}var c=new i.SetOptionsOp(t),l={};return l.body=i.OperationBody.setOptions(c),this.setSourceAccount(l,e),new i.Operation(l)},vn.beginSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(e.sponsoredId))throw new Error("sponsoredId is invalid");var t=new i.BeginSponsoringFutureReservesOp({sponsoredId:Xt.fromPublicKey(e.sponsoredId).xdrAccountId()}),r={};return r.body=i.OperationBody.beginSponsoringFutureReserves(t),this.setSourceAccount(r,e),new i.Operation(r)},vn.endSponsoringFutureReserves=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return t.body=i.OperationBody.endSponsoringFutureReserves(),this.setSourceAccount(t,e),new i.Operation(t)},vn.revokeAccountSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");var t=i.LedgerKey.account(new i.LedgerKeyAccount({accountId:Xt.fromPublicKey(e.account).xdrAccountId()})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeTrustlineSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.asset instanceof Zt)e=t.asset.toTrustLineXDRObject();else{if(!(t.asset instanceof zr))throw new TypeError("asset must be an Asset or LiquidityPoolId");e=t.asset.toXDRObject()}var r=i.LedgerKey.trustline(new i.LedgerKeyTrustLine({accountId:Xt.fromPublicKey(t.account).xdrAccountId(),asset:e})),n=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(r),o={};return o.body=i.OperationBody.revokeSponsorship(n),this.setSourceAccount(o,t),new i.Operation(o)},vn.revokeOfferSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(e.seller))throw new Error("seller is invalid");if("string"!=typeof e.offerId)throw new Error("offerId is invalid");var t=i.LedgerKey.offer(new i.LedgerKeyOffer({sellerId:Xt.fromPublicKey(e.seller).xdrAccountId(),offerId:i.Int64.fromString(e.offerId)})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeDataSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(e.account))throw new Error("account is invalid");if("string"!=typeof e.name||e.name.length>64)throw new Error("name must be a string, up to 64 characters");var t=i.LedgerKey.data(new i.LedgerKeyData({accountId:Xt.fromPublicKey(e.account).xdrAccountId(),dataName:e.name})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeClaimableBalanceSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!=typeof e.balanceId)throw new Error("balanceId is invalid");var t=i.LedgerKey.claimableBalance(new i.LedgerKeyClaimableBalance({balanceId:i.ClaimableBalanceId.fromXDR(e.balanceId,"hex")})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={};return n.body=i.OperationBody.revokeSponsorship(r),this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeLiquidityPoolSponsorship=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"!=typeof e.liquidityPoolId)throw new Error("liquidityPoolId is invalid");var t=i.LedgerKey.liquidityPool(new i.LedgerKeyLiquidityPool({liquidityPoolId:i.PoolId.fromXDR(e.liquidityPoolId,"hex")})),r=i.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(t),n={body:i.OperationBody.revokeSponsorship(r)};return this.setSourceAccount(n,e),new i.Operation(n)},vn.revokeSignerSponsorship=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Lt.isValidEd25519PublicKey(t.account))throw new Error("account is invalid");if(t.signer.ed25519PublicKey){if(!Lt.isValidEd25519PublicKey(t.signer.ed25519PublicKey))throw new Error("signer.ed25519PublicKey is invalid.");var r=Lt.decodeEd25519PublicKey(t.signer.ed25519PublicKey);e=new i.SignerKey.signerKeyTypeEd25519(r)}else if(t.signer.preAuthTx){var n;if(n="string"==typeof t.signer.preAuthTx?en.from(t.signer.preAuthTx,"hex"):t.signer.preAuthTx,!en.isBuffer(n)||32!==n.length)throw new Error("signer.preAuthTx must be 32 bytes Buffer.");e=new i.SignerKey.signerKeyTypePreAuthTx(n)}else{if(!t.signer.sha256Hash)throw new Error("signer is invalid");var o;if(o="string"==typeof t.signer.sha256Hash?en.from(t.signer.sha256Hash,"hex"):t.signer.sha256Hash,!en.isBuffer(o)||32!==o.length)throw new Error("signer.sha256Hash must be 32 bytes Buffer.");e=new i.SignerKey.signerKeyTypeHashX(o)}var a=new i.RevokeSponsorshipOpSigner({accountId:Xt.fromPublicKey(t.account).xdrAccountId(),signerKey:e}),s=i.RevokeSponsorshipOp.revokeSponsorshipSigner(a),u={};return u.body=i.OperationBody.revokeSponsorship(s),this.setSourceAccount(u,t),new i.Operation(u)},vn.clawback=function(e){var t={};if(!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));t.amount=this._toXDRAmount(e.amount),t.asset=e.asset.toXDRObject();try{t.from=Xr(e.from)}catch(e){throw new Error("from address is invalid")}var r={body:i.OperationBody.clawback(new i.ClawbackOp(t))};return this.setSourceAccount(r,e),new i.Operation(r)},vn.setTrustLineFlags=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if("object"!==tn(e.flags)||0===Object.keys(e.flags).length)throw new Error("opts.flags must be a map of boolean flags to modify");var r={authorized:i.TrustLineFlags.authorizedFlag(),authorizedToMaintainLiabilities:i.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),clawbackEnabled:i.TrustLineFlags.trustlineClawbackEnabledFlag()},n=0,o=0;Object.keys(e.flags).forEach(function(t){if(!Object.prototype.hasOwnProperty.call(r,t))throw new Error("unsupported flag name specified: ".concat(t));var i=e.flags[t],a=r[t].value;!0===i?o|=a:!1===i&&(n|=a)}),t.trustor=Xt.fromPublicKey(e.trustor).xdrAccountId(),t.asset=e.asset.toXDRObject(),t.clearFlags=n,t.setFlags=o;var a={body:i.OperationBody.setTrustLineFlags(new i.SetTrustLineFlagsOp(t))};return this.setSourceAccount(a,e),new i.Operation(a)},vn.liquidityPoolDeposit=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.liquidityPoolId,r=e.maxAmountA,n=e.maxAmountB,o=e.minPrice,a=e.maxPrice,s={};if(!t)throw new TypeError("liquidityPoolId argument is required");if(s.liquidityPoolId=i.PoolId.fromXDR(t,"hex"),!this.isValidAmount(r,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountA"));if(s.maxAmountA=this._toXDRAmount(r),!this.isValidAmount(n,!0))throw new TypeError(this.constructAmountRequirementsError("maxAmountB"));if(s.maxAmountB=this._toXDRAmount(n),void 0===o)throw new TypeError("minPrice argument is required");if(s.minPrice=this._toXDRPrice(o),void 0===a)throw new TypeError("maxPrice argument is required");s.maxPrice=this._toXDRPrice(a);var u=new i.LiquidityPoolDepositOp(s),c={body:i.OperationBody.liquidityPoolDeposit(u)};return this.setSourceAccount(c,e),new i.Operation(c)},vn.liquidityPoolWithdraw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};if(!e.liquidityPoolId)throw new TypeError("liquidityPoolId argument is required");if(t.liquidityPoolId=i.PoolId.fromXDR(e.liquidityPoolId,"hex"),!this.isValidAmount(e.amount))throw new TypeError(this.constructAmountRequirementsError("amount"));if(t.amount=this._toXDRAmount(e.amount),!this.isValidAmount(e.minAmountA,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountA"));if(t.minAmountA=this._toXDRAmount(e.minAmountA),!this.isValidAmount(e.minAmountB,!0))throw new TypeError(this.constructAmountRequirementsError("minAmountB"));t.minAmountB=this._toXDRAmount(e.minAmountB);var r=new i.LiquidityPoolWithdrawOp(t),n={body:i.OperationBody.liquidityPoolWithdraw(r)};return this.setSourceAccount(n,e),new i.Operation(n)},vn.invokeHostFunction=function(e){if(!e.func)throw new TypeError("host function invocation ('func') required (got ".concat(JSON.stringify(e),")"));e.func.switch().value===i.HostFunctionType.hostFunctionTypeInvokeContract().value&&e.func.invokeContract().args().forEach(function(e){var t;try{t=sn.fromScVal(e)}catch(e){return}switch(t._type){case"claimableBalance":case"liquidityPool":throw new TypeError("claimable balances and liquidity pools cannot be arguments to invokeHostFunction")}});var t=new i.InvokeHostFunctionOp({hostFunction:e.func,auth:e.auth||[]}),r={body:i.OperationBody.invokeHostFunction(t)};return this.setSourceAccount(r,e),new i.Operation(r)},vn.extendFootprintTtl=function(e){var t;if((null!==(t=e.extendTo)&&void 0!==t?t:-1)<=0)throw new RangeError("extendTo has to be positive");var r=new i.ExtendFootprintTtlOp({ext:new i.ExtensionPoint(0),extendTo:e.extendTo}),n={body:i.OperationBody.extendFootprintTtl(r)};return this.setSourceAccount(n,e),new i.Operation(n)},vn.restoreFootprint=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new i.RestoreFootprintOp({ext:new i.ExtensionPoint(0)}),r={body:i.OperationBody.restoreFootprint(t)};return this.setSourceAccount(r,null!=e?e:{}),new i.Operation(r)},vn.createStellarAssetContract=function(e){var t=e.asset;if("string"==typeof t){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cn(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.split(":"),2),n=r[0],o=r[1];t=new Zt(n,o)}if(!(t instanceof Zt))throw new TypeError("expected Asset in 'opts.asset', got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeCreateContract(new i.CreateContractArgs({executable:i.ContractExecutable.contractExecutableStellarAsset(),contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAsset(t.toXDRObject())}))})},vn.invokeContractFunction=function(e){var t=new sn(e.contract);if("contract"!==t._type)throw new TypeError("expected contract strkey instance, got ".concat(t));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeInvokeContract(new i.InvokeContractArgs({contractAddress:t.toScAddress(),functionName:e.function,args:e.args}))})},vn.createCustomContract=function(e){var t,r=un.from(e.salt||Xt.random().xdrPublicKey().value());if(!e.wasmHash||32!==e.wasmHash.length)throw new TypeError("expected hash(contract WASM) in 'opts.wasmHash', got ".concat(e.wasmHash));if(32!==r.length)throw new TypeError("expected 32-byte salt in 'opts.salt', got ".concat(e.wasmHash));return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeCreateContractV2(new i.CreateContractArgsV2({executable:i.ContractExecutable.contractExecutableWasm(un.from(e.wasmHash)),contractIdPreimage:i.ContractIdPreimage.contractIdPreimageFromAddress(new i.ContractIdPreimageFromAddress({address:e.address.toScAddress(),salt:r})),constructorArgs:null!==(t=e.constructorArgs)&&void 0!==t?t:[]}))})},vn.uploadContractWasm=function(e){return this.invokeHostFunction({source:e.source,auth:e.auth,func:i.HostFunction.hostFunctionTypeUploadContractWasm(un.from(e.wasm))})};var wn=r(8287).Buffer;function Sn(e){return Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sn(e)}function En(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tn(n.key),n)}}function Tn(e){var t=function(e){if("object"!=Sn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Sn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Sn(t)?t:t+""}var kn="none",On="id",An="text",_n="hash",xn="return",Pn=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._type=t,this._value=r,this._type){case kn:break;case On:e._validateIdValue(r);break;case An:e._validateTextValue(r);break;case _n:case xn:e._validateHashValue(r),"string"==typeof r&&(this._value=wn.from(r,"hex"));break;default:throw new Error("Invalid memo type")}}return function(e,t,r){return t&&En(e.prototype,t),r&&En(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"type",get:function(){return this._type},set:function(e){throw new Error("Memo is immutable")}},{key:"value",get:function(){switch(this._type){case kn:return null;case On:case An:return this._value;case _n:case xn:return wn.from(this._value);default:throw new Error("Invalid memo type")}},set:function(e){throw new Error("Memo is immutable")}},{key:"toXDRObject",value:function(){switch(this._type){case kn:return i.Memo.memoNone();case On:return i.Memo.memoId(n.UnsignedHyper.fromString(this._value));case An:return i.Memo.memoText(this._value);case _n:return i.Memo.memoHash(this._value);case xn:return i.Memo.memoReturn(this._value);default:return null}}}],[{key:"_validateIdValue",value:function(e){var t,r=new Error("Expects a int64 as a string. Got ".concat(e));if("string"!=typeof e)throw r;try{t=new _r(e)}catch(e){throw r}if(!t.isFinite())throw r;if(t.isNaN())throw r}},{key:"_validateTextValue",value:function(e){if(!i.Memo.armTypeForArm("text").isValid(e))throw new Error("Expects string, array or buffer, max 28 bytes")}},{key:"_validateHashValue",value:function(e){var t,r=new Error("Expects a 32 byte hash value or hex encoded string. Got ".concat(e));if(null==e)throw r;if("string"==typeof e){if(!/^[0-9A-Fa-f]{64}$/g.test(e))throw r;t=wn.from(e,"hex")}else{if(!wn.isBuffer(e))throw r;t=wn.from(e)}if(!t.length||32!==t.length)throw r}},{key:"none",value:function(){return new e(kn)}},{key:"text",value:function(t){return new e(An,t)}},{key:"id",value:function(t){return new e(On,t)}},{key:"hash",value:function(t){return new e(_n,t)}},{key:"return",value:function(t){return new e(xn,t)}},{key:"fromXDRObject",value:function(t){switch(t.arm()){case"id":return e.id(t.value().toString());case"text":return e.text(t.value());case"hash":return e.hash(t.value());case"retHash":return e.return(t.value())}if(void 0===t.value())return e.none();throw new Error("Unknown type")}}])}(),In=r(8287).Buffer;function Rn(e){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rn(e)}function Bn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cn(n.key),n)}}function Cn(e){var t=function(e){if("object"!=Rn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Rn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rn(t)?t:t+""}function jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jn=function(){return!!e})()}function Un(e){return Un=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Un(e)}function Nn(e,t){return Nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nn(e,t)}var Ln=function(e){function t(e,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e){var o=In.from(e,"base64");e=i.TransactionEnvelope.fromXDR(o)}var a=e.switch();if(a!==i.EnvelopeType.envelopeTypeTxV0()&&a!==i.EnvelopeType.envelopeTypeTx())throw new Error("Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an ".concat(a.name,"."));var s=e.value(),u=s.tx(),c=u.fee().toString();(n=function(e,t,r){return t=Un(t),function(e,t){if(t&&("object"==Rn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jn()?Reflect.construct(t,r||[],Un(e).constructor):t.apply(e,r))}(this,t,[u,(s.signatures()||[]).slice(),c,r]))._envelopeType=a,n._memo=u.memo(),n._sequence=u.seqNum().toString(),n._envelopeType===i.EnvelopeType.envelopeTypeTxV0()?n._source=Lt.encodeEd25519PublicKey(n.tx.sourceAccountEd25519()):n._source=$r(n.tx.sourceAccount());var l=null,f=null;switch(n._envelopeType){case i.EnvelopeType.envelopeTypeTxV0():f=u.timeBounds();break;case i.EnvelopeType.envelopeTypeTx():switch(u.cond().switch()){case i.PreconditionType.precondTime():f=u.cond().timeBounds();break;case i.PreconditionType.precondV2():f=(l=u.cond().v2()).timeBounds()}}if(f&&(n._timeBounds={minTime:f.minTime().toString(),maxTime:f.maxTime().toString()}),l){var p=l.ledgerBounds();p&&(n._ledgerBounds={minLedger:p.minLedger(),maxLedger:p.maxLedger()});var d=l.minSeqNum();d&&(n._minAccountSequence=d.toString()),n._minAccountSequenceAge=l.minSeqAge(),n._minAccountSequenceLedgerGap=l.minSeqLedgerGap(),n._extraSigners=l.extraSigners()}var h=u.operations()||[];return n._operations=h.map(function(e){return vn.fromXDRObject(e)}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nn(e,t)}(t,e),function(e,t){return t&&Bn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"timeBounds",get:function(){return this._timeBounds},set:function(e){throw new Error("Transaction is immutable")}},{key:"ledgerBounds",get:function(){return this._ledgerBounds},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequence",get:function(){return this._minAccountSequence},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequenceAge",get:function(){return this._minAccountSequenceAge},set:function(e){throw new Error("Transaction is immutable")}},{key:"minAccountSequenceLedgerGap",get:function(){return this._minAccountSequenceLedgerGap},set:function(e){throw new Error("Transaction is immutable")}},{key:"extraSigners",get:function(){return this._extraSigners},set:function(e){throw new Error("Transaction is immutable")}},{key:"sequence",get:function(){return this._sequence},set:function(e){throw new Error("Transaction is immutable")}},{key:"source",get:function(){return this._source},set:function(e){throw new Error("Transaction is immutable")}},{key:"operations",get:function(){return this._operations},set:function(e){throw new Error("Transaction is immutable")}},{key:"memo",get:function(){return Pn.fromXDRObject(this._memo)},set:function(e){throw new Error("Transaction is immutable")}},{key:"signatureBase",value:function(){var e=this.tx;this._envelopeType===i.EnvelopeType.envelopeTypeTxV0()&&(e=i.Transaction.fromXDR(In.concat([i.PublicKeyType.publicKeyTypeEd25519().toXDR(),e.toXDR()])));var t=new i.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTx(e);return new i.TransactionSignaturePayload({networkId:i.Hash.fromXDR(u(this.networkPassphrase)),taggedTransaction:t}).toXDR()}},{key:"toEnvelope",value:function(){var e,t=this.tx.toXDR(),r=this.signatures.slice();switch(this._envelopeType){case i.EnvelopeType.envelopeTypeTxV0():e=new i.TransactionEnvelope.envelopeTypeTxV0(new i.TransactionV0Envelope({tx:i.TransactionV0.fromXDR(t),signatures:r}));break;case i.EnvelopeType.envelopeTypeTx():e=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:i.Transaction.fromXDR(t),signatures:r}));break;default:throw new Error("Invalid TransactionEnvelope: expected an envelopeTypeTxV0 or envelopeTypeTx but received an ".concat(this._envelopeType.name,"."))}return e}},{key:"getClaimableBalanceId",value:function(e){if(!Number.isInteger(e)||e<0||e>=this.operations.length)throw new RangeError("invalid operation index");var t=this.operations[e];try{t=vn.createClaimableBalance(t)}catch(e){throw new TypeError("expected createClaimableBalance, got ".concat(t.type,": ").concat(e))}var r=Lt.decodeEd25519PublicKey(Wr(this.source)),n=u(i.HashIdPreimage.envelopeTypeOpId(new i.HashIdPreimageOperationId({sourceAccount:i.AccountId.publicKeyTypeEd25519(r),seqNum:i.SequenceNumber.fromString(this.sequence),opNum:e})).toXDR("raw"));return i.ClaimableBalanceId.claimableBalanceIdTypeV0(n).toXDR("hex")}}])}(ar),Dn=r(8287).Buffer;function Fn(e){return Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fn(e)}function Mn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vn(n.key),n)}}function Vn(e){var t=function(e){if("object"!=Fn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Fn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fn(t)?t:t+""}function qn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(qn=function(){return!!e})()}function Hn(e){return Hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hn(e)}function zn(e,t){return zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zn(e,t)}var Kn=function(e){function t(e,r){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e){var o=Dn.from(e,"base64");e=i.TransactionEnvelope.fromXDR(o)}var a=e.switch();if(a!==i.EnvelopeType.envelopeTypeTxFeeBump())throw new Error("Invalid TransactionEnvelope: expected an envelopeTypeTxFeeBump but received an ".concat(a.name,"."));var s=e.value(),u=s.tx(),c=u.fee().toString();n=function(e,t,r){return t=Hn(t),function(e,t){if(t&&("object"==Fn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qn()?Reflect.construct(t,r||[],Hn(e).constructor):t.apply(e,r))}(this,t,[u,(s.signatures()||[]).slice(),c,r]);var l=i.TransactionEnvelope.envelopeTypeTx(u.innerTx().v1());return n._feeSource=$r(n.tx.feeSource()),n._innerTransaction=new Ln(l,r),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zn(e,t)}(t,e),function(e,t){return t&&Mn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"innerTransaction",get:function(){return this._innerTransaction}},{key:"operations",get:function(){return this._innerTransaction.operations}},{key:"feeSource",get:function(){return this._feeSource}},{key:"signatureBase",value:function(){var e=new i.TransactionSignaturePayloadTaggedTransaction.envelopeTypeTxFeeBump(this.tx);return new i.TransactionSignaturePayload({networkId:i.Hash.fromXDR(u(this.networkPassphrase)),taggedTransaction:e}).toXDR()}},{key:"toEnvelope",value:function(){var e=new i.FeeBumpTransactionEnvelope({tx:i.FeeBumpTransaction.fromXDR(this.tx.toXDR()),signatures:this.signatures.slice()});return new i.TransactionEnvelope.envelopeTypeTxFeeBump(e)}}])}(ar);function Xn(e){return Xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xn(e)}function $n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Gn(n.key),n)}}function Gn(e){var t=function(e){if("object"!=Xn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Xn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xn(t)?t:t+""}var Wn=function(e,t){return t&&$n(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Lt.isValidMed25519PublicKey(t))throw new Error("accountId is an M-address; use MuxedAccount instead");if(!Lt.isValidEd25519PublicKey(t))throw new Error("accountId is invalid");if("string"!=typeof r)throw new Error("sequence must be of type string");this._accountId=t,this.sequence=new _r(r)},[{key:"accountId",value:function(){return this._accountId}},{key:"sequenceNumber",value:function(){return this.sequence.toString()}},{key:"incrementSequenceNumber",value:function(){this.sequence=this.sequence.plus(1)}}]);function Qn(e){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(e)}function Zn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yn(n.key),n)}}function Yn(e){var t=function(e){if("object"!=Qn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Qn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qn(t)?t:t+""}var Jn=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.accountId();if(!Lt.isValidEd25519PublicKey(n))throw new Error("accountId is invalid");this.account=t,this._muxedXdr=Gr(n,r),this._mAddress=$r(this._muxedXdr),this._id=r}return function(e,t,r){return t&&Zn(e.prototype,t),r&&Zn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"baseAccount",value:function(){return this.account}},{key:"accountId",value:function(){return this._mAddress}},{key:"id",value:function(){return this._id}},{key:"setId",value:function(e){if("string"!=typeof e)throw new Error("id should be a string representing a number (uint64)");return this._muxedXdr.med25519().id(i.Uint64.fromString(e)),this._mAddress=$r(this._muxedXdr),this._id=e,this}},{key:"sequenceNumber",value:function(){return this.account.sequenceNumber()}},{key:"incrementSequenceNumber",value:function(){return this.account.incrementSequenceNumber()}},{key:"toXDRObject",value:function(){return this._muxedXdr}},{key:"equals",value:function(e){return this.accountId()===e.accountId()}}],[{key:"fromAddress",value:function(t,r){var n=Xr(t),o=Wr(t),i=n.med25519().id().toString();return new e(new Wn(o,r),i)}}])}();function eo(e){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(e)}function to(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ro(n.key),n)}}function ro(e){var t=function(e){if("object"!=eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eo(t)?t:t+""}var no=function(e,t,r){return t&&to(e.prototype,t),r&&to(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),function(e,t,r){(t=ro(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_data",void 0),r=t?"string"==typeof t||ArrayBuffer.isView(t)?e.fromXDR(t):e.fromXDR(t.toXDR()):new i.SorobanTransactionData({resources:new i.SorobanResources({footprint:new i.LedgerFootprint({readOnly:[],readWrite:[]}),instructions:0,diskReadBytes:0,writeBytes:0}),ext:new i.SorobanTransactionDataExt(0),resourceFee:new i.Int64(0)}),this._data=r},[{key:"setResourceFee",value:function(e){return this._data.resourceFee(new i.Int64(e)),this}},{key:"setResources",value:function(e,t,r){return this._data.resources().instructions(e),this._data.resources().diskReadBytes(t),this._data.resources().writeBytes(r),this}},{key:"appendFootprint",value:function(e,t){return this.setFootprint(this.getReadOnly().concat(e),this.getReadWrite().concat(t))}},{key:"setFootprint",value:function(e,t){return null!==e&&this.setReadOnly(e),null!==t&&this.setReadWrite(t),this}},{key:"setReadOnly",value:function(e){return this._data.resources().footprint().readOnly(null!=e?e:[]),this}},{key:"setReadWrite",value:function(e){return this._data.resources().footprint().readWrite(null!=e?e:[]),this}},{key:"build",value:function(){return i.SorobanTransactionData.fromXDR(this._data.toXDR())}},{key:"getReadOnly",value:function(){return this.getFootprint().readOnly()}},{key:"getReadWrite",value:function(){return this.getFootprint().readWrite()}},{key:"getFootprint",value:function(){return this._data.resources().footprint()}}],[{key:"fromXDR",value:function(e){return i.SorobanTransactionData.fromXDR(e,"string"==typeof e?"base64":"raw")}}]);function oo(e){return oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oo(e)}function io(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ao(n.key),n)}}function ao(e){var t=function(e){if("object"!=oo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=oo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oo(t)?t:t+""}var so=function(e,t,r){return r&&io(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"decodeAddress",value:function(e){var t={ed25519PublicKey:i.SignerKey.signerKeyTypeEd25519,preAuthTx:i.SignerKey.signerKeyTypePreAuthTx,sha256Hash:i.SignerKey.signerKeyTypeHashX,signedPayload:i.SignerKey.signerKeyTypeEd25519SignedPayload},r=Lt.getVersionByteForPrefix(e),n=t[r];if(!n)throw new Error("invalid signer key type (".concat(r,")"));var o=Ft(r,e);return n("signedPayload"===r?new i.SignerKeyEd25519SignedPayload({ed25519:o.slice(0,32),payload:o.slice(36)}):o)}},{key:"encodeSignerKey",value:function(e){var t,r;switch(e.switch()){case i.SignerKeyType.signerKeyTypeEd25519():t="ed25519PublicKey",r=e.value();break;case i.SignerKeyType.signerKeyTypePreAuthTx():t="preAuthTx",r=e.value();break;case i.SignerKeyType.signerKeyTypeHashX():t="sha256Hash",r=e.value();break;case i.SignerKeyType.signerKeyTypeEd25519SignedPayload():t="signedPayload",r=e.ed25519SignedPayload().toXDR("raw");break;default:throw new Error("invalid SignerKey (type: ".concat(e.switch(),")"))}return Mt(t,r)}}]);function uo(e){return uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uo(e)}function co(e){return function(e){if(Array.isArray(e))return lo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return lo(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lo(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function fo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function po(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fo(Object(r),!0).forEach(function(t){ho(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ho(e,t,r){return(t=mo(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mo(n.key),n)}}function mo(e){var t=function(e){if("object"!=uo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=uo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uo(t)?t:t+""}var go="100",vo=0,bo=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new Error("must specify source account for the transaction");if(void 0===r.fee)throw new Error("must specify fee for the transaction (in stroops)");this.source=t,this.operations=[],this.baseFee=r.fee,this.timebounds=r.timebounds?po({},r.timebounds):null,this.ledgerbounds=r.ledgerbounds?po({},r.ledgerbounds):null,this.minAccountSequence=r.minAccountSequence||null,this.minAccountSequenceAge=r.minAccountSequenceAge||null,this.minAccountSequenceLedgerGap=r.minAccountSequenceLedgerGap||null,this.extraSigners=r.extraSigners?co(r.extraSigners):null,this.memo=r.memo||Pn.none(),this.networkPassphrase=r.networkPassphrase||null,this.sorobanData=r.sorobanData?new no(r.sorobanData).build():null}return function(e,t,r){return t&&yo(e.prototype,t),r&&yo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"addOperation",value:function(e){return this.operations.push(e),this}},{key:"addOperationAt",value:function(e,t){return this.operations.splice(t,0,e),this}},{key:"clearOperations",value:function(){return this.operations=[],this}},{key:"clearOperationAt",value:function(e){return this.operations.splice(e,1),this}},{key:"addMemo",value:function(e){return this.memo=e,this}},{key:"setTimeout",value:function(e){if(null!==this.timebounds&&this.timebounds.maxTime>0)throw new Error("TimeBounds.max_time has been already set - setting timeout would overwrite it.");if(e<0)throw new Error("timeout cannot be negative");if(e>0){var t=Math.floor(Date.now()/1e3)+e;null===this.timebounds?this.timebounds={minTime:0,maxTime:t}:this.timebounds={minTime:this.timebounds.minTime,maxTime:t}}else this.timebounds={minTime:0,maxTime:0};return this}},{key:"setTimebounds",value:function(e,t){if("number"==typeof e&&(e=new Date(1e3*e)),"number"==typeof t&&(t=new Date(1e3*t)),null!==this.timebounds)throw new Error("TimeBounds has been already set - setting timebounds would overwrite it.");var r=Math.floor(e.valueOf()/1e3),n=Math.floor(t.valueOf()/1e3);if(r<0)throw new Error("min_time cannot be negative");if(n<0)throw new Error("max_time cannot be negative");if(n>0&&r>n)throw new Error("min_time cannot be greater than max_time");return this.timebounds={minTime:r,maxTime:n},this}},{key:"setLedgerbounds",value:function(e,t){if(null!==this.ledgerbounds)throw new Error("LedgerBounds has been already set - setting ledgerbounds would overwrite it.");if(e<0)throw new Error("min_ledger cannot be negative");if(t<0)throw new Error("max_ledger cannot be negative");if(t>0&&e>t)throw new Error("min_ledger cannot be greater than max_ledger");return this.ledgerbounds={minLedger:e,maxLedger:t},this}},{key:"setMinAccountSequence",value:function(e){if(null!==this.minAccountSequence)throw new Error("min_account_sequence has been already set - setting min_account_sequence would overwrite it.");return this.minAccountSequence=e,this}},{key:"setMinAccountSequenceAge",value:function(e){if("number"!=typeof e)throw new Error("min_account_sequence_age must be a number");if(null!==this.minAccountSequenceAge)throw new Error("min_account_sequence_age has been already set - setting min_account_sequence_age would overwrite it.");if(e<0)throw new Error("min_account_sequence_age cannot be negative");return this.minAccountSequenceAge=e,this}},{key:"setMinAccountSequenceLedgerGap",value:function(e){if(null!==this.minAccountSequenceLedgerGap)throw new Error("min_account_sequence_ledger_gap has been already set - setting min_account_sequence_ledger_gap would overwrite it.");if(e<0)throw new Error("min_account_sequence_ledger_gap cannot be negative");return this.minAccountSequenceLedgerGap=e,this}},{key:"setExtraSigners",value:function(e){if(!Array.isArray(e))throw new Error("extra_signers must be an array of strings.");if(null!==this.extraSigners)throw new Error("extra_signers has been already set - setting extra_signers would overwrite it.");if(e.length>2)throw new Error("extra_signers cannot be longer than 2 elements.");return this.extraSigners=co(e),this}},{key:"setNetworkPassphrase",value:function(e){return this.networkPassphrase=e,this}},{key:"setSorobanData",value:function(e){return this.sorobanData=new no(e).build(),this}},{key:"build",value:function(){var e=new _r(this.source.sequenceNumber()).plus(1),t={fee:new _r(this.baseFee).times(this.operations.length).toNumber(),seqNum:i.SequenceNumber.fromString(e.toString()),memo:this.memo?this.memo.toXDRObject():null};if(null===this.timebounds||void 0===this.timebounds.minTime||void 0===this.timebounds.maxTime)throw new Error("TimeBounds has to be set or you must call setTimeout(TimeoutInfinite).");wo(this.timebounds.minTime)&&(this.timebounds.minTime=this.timebounds.minTime.getTime()/1e3),wo(this.timebounds.maxTime)&&(this.timebounds.maxTime=this.timebounds.maxTime.getTime()/1e3),this.timebounds.minTime=n.UnsignedHyper.fromString(this.timebounds.minTime.toString()),this.timebounds.maxTime=n.UnsignedHyper.fromString(this.timebounds.maxTime.toString());var r=new i.TimeBounds(this.timebounds);if(this.hasV2Preconditions()){var o=null;null!==this.ledgerbounds&&(o=new i.LedgerBounds(this.ledgerbounds));var a=this.minAccountSequence||"0";a=i.SequenceNumber.fromString(a);var s=n.UnsignedHyper.fromString(null!==this.minAccountSequenceAge?this.minAccountSequenceAge.toString():"0"),u=this.minAccountSequenceLedgerGap||0,c=null!==this.extraSigners?this.extraSigners.map(so.decodeAddress):[];t.cond=i.Preconditions.precondV2(new i.PreconditionsV2({timeBounds:r,ledgerBounds:o,minSeqNum:a,minSeqAge:s,minSeqLedgerGap:u,extraSigners:c}))}else t.cond=i.Preconditions.precondTime(r);t.sourceAccount=Xr(this.source.accountId()),this.sorobanData?t.ext=new i.TransactionExt(1,this.sorobanData):t.ext=new i.TransactionExt(0,i.Void);var l=new i.Transaction(t);l.operations(this.operations);var f=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:l})),p=new Ln(f,this.networkPassphrase);return this.source.incrementSequenceNumber(),p}},{key:"hasV2Preconditions",value:function(){return null!==this.ledgerbounds||null!==this.minAccountSequence||null!==this.minAccountSequenceAge||null!==this.minAccountSequenceLedgerGap||null!==this.extraSigners&&this.extraSigners.length>0}}],[{key:"cloneFrom",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t instanceof Ln))throw new TypeError("expected a 'Transaction', got: ".concat(t));var n,o=(BigInt(t.sequence)-1n).toString();if(Lt.isValidMed25519PublicKey(t.source))n=Jn.fromAddress(t.source,o);else{if(!Lt.isValidEd25519PublicKey(t.source))throw new TypeError("unsupported tx source account: ".concat(t.source));n=new Wn(t.source,o)}var i=new e(n,po({fee:(parseInt(t.fee,10)/t.operations.length||go).toString(),memo:t.memo,networkPassphrase:t.networkPassphrase,timebounds:t.timeBounds,ledgerbounds:t.ledgerBounds,minAccountSequence:t.minAccountSequence,minAccountSequenceAge:t.minAccountSequenceAge,minAccountSequenceLedgerGap:t.minAccountSequenceLedgerGap,extraSigners:t.extraSigners},r));return t._tx.operations().forEach(function(e){return i.addOperation(e)}),i}},{key:"buildFeeBumpTransaction",value:function(e,t,r,n){var o=r.operations.length,a=new _r(r.fee).div(o),s=new _r(t);if(s.lt(a))throw new Error("Invalid baseFee, it should be at least ".concat(a," stroops."));var u=new _r(go);if(s.lt(u))throw new Error("Invalid baseFee, it should be at least ".concat(u," stroops."));var c,l=r.toEnvelope();if(l.switch()===i.EnvelopeType.envelopeTypeTxV0()){var f=l.v0().tx(),p=new i.Transaction({sourceAccount:new i.MuxedAccount.keyTypeEd25519(f.sourceAccountEd25519()),fee:f.fee(),seqNum:f.seqNum(),cond:i.Preconditions.precondTime(f.timeBounds()),memo:f.memo(),operations:f.operations(),ext:new i.TransactionExt(0)});l=new i.TransactionEnvelope.envelopeTypeTx(new i.TransactionV1Envelope({tx:p,signatures:l.v0().signatures()}))}c="string"==typeof e?Xr(e):e.xdrMuxedAccount();var d=new i.FeeBumpTransaction({feeSource:c,fee:i.Int64.fromString(s.times(o+1).toString()),innerTx:i.FeeBumpTransactionInnerTx.envelopeTypeTx(l.v1()),ext:new i.FeeBumpTransactionExt(0)}),h=new i.FeeBumpTransactionEnvelope({tx:d,signatures:[]}),y=new i.TransactionEnvelope.envelopeTypeTxFeeBump(h);return new Kn(y,n)}},{key:"fromXDR",value:function(e,t){return"string"==typeof e&&(e=i.TransactionEnvelope.fromXDR(e,"base64")),e.switch()===i.EnvelopeType.envelopeTypeTxFeeBump()?new Kn(e,t):new Ln(e,t)}}])}();function wo(e){return e instanceof Date&&!isNaN(e)}var So={PUBLIC:"Public Global Stellar Network ; September 2015",TESTNET:"Test SDF Network ; September 2015",FUTURENET:"Test SDF Future Network ; October 2022",SANDBOX:"Local Sandbox Stellar Network ; September 2022",STANDALONE:"Standalone Network ; February 2017"};function Eo(e){return Eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eo(e)}function To(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ko(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Oo(n.key),n)}}function Oo(e){var t=function(e){if("object"!=Eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Eo(t)?t:t+""}var Ao=function(e,t,r){return r&&ko(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},0,[{key:"formatTokenAmount",value:function(e,t){if(e.includes("."))throw new TypeError("No decimals are allowed");var r=e;return t>0&&(r=t>r.length?["0",r.toString().padStart(t,"0")].join("."):[r.slice(0,-t),r.slice(-t)].join(".")),r.replace(/(\.\d*?)0+$/,"$1")}},{key:"parseTokenAmount",value:function(e,t){var r,n=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return To(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?To(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(".").slice()),o=n[0],i=n[1];if(n.slice(2).length)throw new Error("Invalid decimal value: ".concat(e));return BigInt(o+(null!==(r=null==i?void 0:i.padEnd(t,"0"))&&void 0!==r?r:"0".repeat(t))).toString()}}]);function _o(e){return _o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_o(e)}function xo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Po(n.key),n)}}function Po(e){var t=function(e){if("object"!=_o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=_o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_o(t)?t:t+""}var Io=function(e,t){return t&&xo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);try{this._id=Lt.decodeContract(t)}catch(e){throw new Error("Invalid contract ID: ".concat(t))}},[{key:"contractId",value:function(){return Lt.encodeContract(this._id)}},{key:"toString",value:function(){return this.contractId()}},{key:"address",value:function(){return sn.contract(this._id)}},{key:"call",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return vn.invokeContractFunction({contract:this.address().toString(),function:e,args:r})}},{key:"getFootprint",value:function(){return i.LedgerKey.contractData(new i.LedgerKeyContractData({contract:this.address().toScAddress(),key:i.ScVal.scvLedgerKeyContractInstance(),durability:i.ContractDataDurability.persistent()}))}}]);function Ro(e){return Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(e)}function Bo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Co(n.key),n)}}function Co(e){var t=function(e){if("object"!=Ro(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ro(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ro(t)?t:t+""}function jo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jo=function(){return!!e})()}function Uo(e){return Uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Uo(e)}function No(e,t){return No=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},No(e,t)}var Lo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e,t,r){return t=Uo(t),function(e,t){if(t&&("object"==Ro(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jo()?Reflect.construct(t,r||[],Uo(e).constructor):t.apply(e,r))}(this,t,[r])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&No(e,t)}(t,e),function(e,t){return t&&Bo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"unsigned",get:function(){return!0}},{key:"size",get:function(){return 128}}])}(n.LargeInt);function Do(e){return Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Do(e)}function Fo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mo(n.key),n)}}function Mo(e){var t=function(e){if("object"!=Do(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Do(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Do(t)?t:t+""}function Vo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Vo=function(){return!!e})()}function qo(e){return qo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qo(e)}function Ho(e,t){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ho(e,t)}Lo.defineIntBoundaries();var zo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e,t,r){return t=qo(t),function(e,t){if(t&&("object"==Do(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Vo()?Reflect.construct(t,r||[],qo(e).constructor):t.apply(e,r))}(this,t,[r])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ho(e,t)}(t,e),function(e,t){return t&&Fo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"unsigned",get:function(){return!0}},{key:"size",get:function(){return 256}}])}(n.LargeInt);function Ko(e){return Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ko(e)}function Xo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$o(n.key),n)}}function $o(e){var t=function(e){if("object"!=Ko(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ko(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ko(t)?t:t+""}function Go(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Go=function(){return!!e})()}function Wo(e){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wo(e)}function Qo(e,t){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qo(e,t)}zo.defineIntBoundaries();var Zo=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e,t,r){return t=Wo(t),function(e,t){if(t&&("object"==Ko(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Go()?Reflect.construct(t,r||[],Wo(e).constructor):t.apply(e,r))}(this,t,[r])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qo(e,t)}(t,e),function(e,t){return t&&Xo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"unsigned",get:function(){return!1}},{key:"size",get:function(){return 128}}])}(n.LargeInt);function Yo(e){return Yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yo(e)}function Jo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ei(n.key),n)}}function ei(e){var t=function(e){if("object"!=Yo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Yo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Yo(t)?t:t+""}function ti(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ti=function(){return!!e})()}function ri(e){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ri(e)}function ni(e,t){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ni(e,t)}Zo.defineIntBoundaries();var oi=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(e,t,r){return t=ri(t),function(e,t){if(t&&("object"==Yo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ti()?Reflect.construct(t,r||[],ri(e).constructor):t.apply(e,r))}(this,t,[r])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ni(e,t)}(t,e),function(e,t){return t&&Jo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"unsigned",get:function(){return!1}},{key:"size",get:function(){return 256}}])}(n.LargeInt);function ii(e){return ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ii(e)}function ai(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ui(n.key),n)}}function si(e,t,r){return(t=ui(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ui(e){var t=function(e){if("object"!=ii(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ii(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ii(t)?t:t+""}oi.defineIntBoundaries();var ci=function(e,t,r){return t&&ai(e.prototype,t),r&&ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r){switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),si(this,"int",void 0),si(this,"type",void 0),r instanceof Array||(r=[r]),r=r.map(function(e){return"bigint"==typeof e?e:"function"==typeof e.toBigInt?e.toBigInt():BigInt(e)}),t){case"i64":this.int=new n.Hyper(r);break;case"i128":this.int=new Zo(r);break;case"i256":this.int=new oi(r);break;case"u64":this.int=new n.UnsignedHyper(r);break;case"u128":this.int=new Lo(r);break;case"u256":this.int=new zo(r);break;default:throw TypeError("invalid type: ".concat(t))}this.type=t},[{key:"toNumber",value:function(){var e=this.int.toBigInt();if(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)throw RangeError("value ".concat(e," not in range for Number ")+"[".concat(Number.MAX_SAFE_INTEGER,", ").concat(Number.MIN_SAFE_INTEGER,"]"));return Number(e)}},{key:"toBigInt",value:function(){return this.int.toBigInt()}},{key:"toI64",value:function(){this._sizeCheck(64);var e=this.toBigInt();if(BigInt.asIntN(64,e)!==e)throw RangeError("value too large for i64: ".concat(e));return i.ScVal.scvI64(new i.Int64(e))}},{key:"toU64",value:function(){return this._sizeCheck(64),i.ScVal.scvU64(new i.Uint64(BigInt.asUintN(64,this.toBigInt())))}},{key:"toI128",value:function(){this._sizeCheck(128);var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>64n),r=BigInt.asUintN(64,e);return i.ScVal.scvI128(new i.Int128Parts({hi:new i.Int64(t),lo:new i.Uint64(r)}))}},{key:"toU128",value:function(){this._sizeCheck(128);var e=this.int.toBigInt();return i.ScVal.scvU128(new i.UInt128Parts({hi:new i.Uint64(BigInt.asUintN(64,e>>64n)),lo:new i.Uint64(BigInt.asUintN(64,e))}))}},{key:"toI256",value:function(){var e=this.int.toBigInt(),t=BigInt.asIntN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return i.ScVal.scvI256(new i.Int256Parts({hiHi:new i.Int64(t),hiLo:new i.Uint64(r),loHi:new i.Uint64(n),loLo:new i.Uint64(o)}))}},{key:"toU256",value:function(){var e=this.int.toBigInt(),t=BigInt.asUintN(64,e>>192n),r=BigInt.asUintN(64,e>>128n),n=BigInt.asUintN(64,e>>64n),o=BigInt.asUintN(64,e);return i.ScVal.scvU256(new i.UInt256Parts({hiHi:new i.Uint64(t),hiLo:new i.Uint64(r),loHi:new i.Uint64(n),loLo:new i.Uint64(o)}))}},{key:"toScVal",value:function(){switch(this.type){case"i64":return this.toI64();case"i128":return this.toI128();case"i256":return this.toI256();case"u64":return this.toU64();case"u128":return this.toU128();case"u256":return this.toU256();default:throw TypeError("invalid type: ".concat(this.type))}}},{key:"valueOf",value:function(){return this.int.valueOf()}},{key:"toString",value:function(){return this.int.toString()}},{key:"toJSON",value:function(){return{value:this.toBigInt().toString(),type:this.type}}},{key:"_sizeCheck",value:function(e){if(this.int.size>e)throw RangeError("value too large for ".concat(e," bits (").concat(this.type,")"))}}],[{key:"isType",value:function(e){switch(e){case"i64":case"i128":case"i256":case"u64":case"u128":case"u256":return!0;default:return!1}}},{key:"getType",value:function(e){return e.slice(3).toLowerCase()}}]);function li(e){return li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},li(e)}function fi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(fi=function(){return!!e})()}function pi(e){return pi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pi(e)}function di(e,t){return di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},di(e,t)}var hi=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=e<0,i=null!==(n=null==r?void 0:r.type)&&void 0!==n?n:"";if(i.startsWith("u")&&o)throw TypeError("specified type ".concat(r.type," yet negative (").concat(e,")"));if(""===i){i=o?"i":"u";var a=function(e){var t,r=e.toString(2).length;return null!==(t=[64,128,256].find(function(e){return r<=e}))&&void 0!==t?t:r}(e);switch(a){case 64:case 128:case 256:i+=a.toString();break;default:throw RangeError("expected 64/128/256 bits for input (".concat(e,"), got ").concat(a))}}return function(e,t,r){return t=pi(t),function(e,t){if(t&&("object"==li(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fi()?Reflect.construct(t,r||[],pi(e).constructor):t.apply(e,r))}(this,t,[i,e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&di(e,t)}(t,e),function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(ci);function yi(e){var t=ci.getType(e.switch().name);switch(e.switch().name){case"scvU32":case"scvI32":return BigInt(e.value());case"scvU64":case"scvI64":return new ci(t,e.value()).toBigInt();case"scvU128":case"scvI128":return new ci(t,[e.value().lo(),e.value().hi()]).toBigInt();case"scvU256":case"scvI256":return new ci(t,[e.value().loLo(),e.value().loHi(),e.value().hiLo(),e.value().hiHi()]).toBigInt();default:throw TypeError("expected integer type, got ".concat(e.switch()))}}var mi=r(8287).Buffer;function gi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return vi(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function bi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function wi(e,t,r){return(t=function(e){var t=function(e){if("object"!=Si(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Si(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Si(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Si(e){return Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Si(e)}function Ei(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(Si(e)){case"object":var r,n,o;if(null===e)return i.ScVal.scvVoid();if(e instanceof i.ScVal)return e;if(e instanceof sn)return e.toScVal();if(e instanceof Xt)return Ei(e.publicKey(),{type:"address"});if(e instanceof Io)return e.address().toScVal();if(e instanceof Uint8Array||mi.isBuffer(e)){var a,s=Uint8Array.from(e);switch(null!==(a=null==t?void 0:t.type)&&void 0!==a?a:"bytes"){case"bytes":return i.ScVal.scvBytes(s);case"symbol":return i.ScVal.scvSymbol(s);case"string":return i.ScVal.scvString(s);default:throw new TypeError("invalid type (".concat(t.type,") specified for bytes-like value"))}}if(Array.isArray(e))return i.ScVal.scvVec(e.map(function(e,r){return Array.isArray(t.type)?Ei(e,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bi(Object(r),!0).forEach(function(t){wi(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},t.type.length>r&&{type:t.type[r]})):Ei(e,t)}));if("Object"!==(null!==(r=null===(n=e.constructor)||void 0===n?void 0:n.name)&&void 0!==r?r:""))throw new TypeError("cannot interpret ".concat(null===(o=e.constructor)||void 0===o?void 0:o.name," value as ScVal (").concat(JSON.stringify(e),")"));return i.ScVal.scvMap(Object.entries(e).sort(function(e,t){var r=gi(e,1)[0],n=gi(t,1)[0];return r.localeCompare(n)}).map(function(e){var r,n,o=gi(e,2),a=o[0],s=o[1],u=gi(null!==(r=(null!==(n=null==t?void 0:t.type)&&void 0!==n?n:{})[a])&&void 0!==r?r:[null,null],2),c=u[0],l=u[1],f=c?{type:c}:{},p=l?{type:l}:{};return new i.ScMapEntry({key:Ei(a,f),val:Ei(s,p)})}));case"number":case"bigint":switch(null==t?void 0:t.type){case"u32":return i.ScVal.scvU32(e);case"i32":return i.ScVal.scvI32(e)}return new hi(e,{type:null==t?void 0:t.type}).toScVal();case"string":var u,c=null!==(u=null==t?void 0:t.type)&&void 0!==u?u:"string";switch(c){case"string":return i.ScVal.scvString(e);case"symbol":return i.ScVal.scvSymbol(e);case"address":return new sn(e).toScVal();case"u32":return i.ScVal.scvU32(parseInt(e,10));case"i32":return i.ScVal.scvI32(parseInt(e,10));default:if(ci.isType(c))return new ci(c,e).toScVal();throw new TypeError("invalid type (".concat(t.type,") specified for string value"))}case"boolean":return i.ScVal.scvBool(e);case"undefined":return i.ScVal.scvVoid();case"function":return Ei(e());default:throw new TypeError("failed to convert typeof ".concat(Si(e)," (").concat(e,")"))}}function Ti(e){var t,r;switch(e.switch().value){case i.ScValType.scvVoid().value:return null;case i.ScValType.scvU64().value:case i.ScValType.scvI64().value:return e.value().toBigInt();case i.ScValType.scvU128().value:case i.ScValType.scvI128().value:case i.ScValType.scvU256().value:case i.ScValType.scvI256().value:return yi(e);case i.ScValType.scvVec().value:return(null!==(t=e.vec())&&void 0!==t?t:[]).map(Ti);case i.ScValType.scvAddress().value:return sn.fromScVal(e).toString();case i.ScValType.scvMap().value:return Object.fromEntries((null!==(r=e.map())&&void 0!==r?r:[]).map(function(e){return[Ti(e.key()),Ti(e.val())]}));case i.ScValType.scvBool().value:case i.ScValType.scvU32().value:case i.ScValType.scvI32().value:case i.ScValType.scvBytes().value:return e.value();case i.ScValType.scvSymbol().value:case i.ScValType.scvString().value:var n=e.value();if(mi.isBuffer(n)||ArrayBuffer.isView(n))try{return(new TextDecoder).decode(n)}catch(e){return new Uint8Array(n.buffer)}return n;case i.ScValType.scvTimepoint().value:case i.ScValType.scvDuration().value:return new i.Uint64(e.value()).toBigInt();case i.ScValType.scvError().value:if(e.error().switch().value===i.ScErrorType.sceContract().value)return{type:"contract",code:e.error().contractCode()};var o=e.error();return{type:"system",code:o.code().value,value:o.code().name};default:return e.value()}}function ki(e){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ki(e)}function Oi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ai(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Oi(Object(r),!0).forEach(function(t){_i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _i(e,t,r){return(t=function(e){var t=function(e){if("object"!=ki(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ki(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ki(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xi(e){return e.map(function(e){return e.inSuccessfulContractCall?Pi(e.event()):Pi(e)})}function Pi(e){return Ai(Ai({},"function"==typeof e.contractId&&null!=e.contractId()&&{contractId:Lt.encodeContract(e.contractId())}),{},{type:e.type().name,topics:e.body().value().topics().map(function(e){return Ti(e)}),data:Ti(e.body().value().data())})}i.scvSortedMap=function(e){var t=Array.from(e).sort(function(e,t){var r=Ti(e.key()),n=Ti(t.key());switch(Si(r)){case"number":case"bigint":return r<n?-1:1;default:return r.toString().localeCompare(n.toString())}});return i.ScVal.scvMap(t)};var Ii=r(8287).Buffer;function Ri(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,c=Object.create(u.prototype);return Bi(c,"_invoke",function(r,n,o){var i,s,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,u=e,p.n=r,a}};function d(r,n){for(s=r,u=n,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,u=h;(t=s<2?e:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(t){i=e,s=1,u=t}finally{c=1}}return{value:t,done:f}}}(r,o,i),!0),c}var a={};function s(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Bi(t={},n,function(){return this}),t),f=c.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Bi(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Bi(f,"constructor",c),Bi(c,"constructor",u),u.displayName="GeneratorFunction",Bi(c,o,"GeneratorFunction"),Bi(f),Bi(f,o,"Generator"),Bi(f,n,function(){return this}),Bi(f,"toString",function(){return"[object Generator]"}),(Ri=function(){return{w:i,m:p}})()}function Bi(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Bi=function(e,t,r,n){function i(t,r){Bi(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},Bi(e,t,r,n)}function Ci(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function ji(e,t,r){return Ui.apply(this,arguments)}function Ui(){var e;return e=Ri().m(function e(t,r,n){var o,a,s,c,l,f,p,d,h,y,m=arguments;return Ri().w(function(e){for(;;)switch(e.n){case 0:if(o=m.length>3&&void 0!==m[3]?m[3]:So.FUTURENET,t.credentials().switch().value===i.SorobanCredentialsType.sorobanCredentialsAddress().value){e.n=1;break}return e.a(2,t);case 1:if(a=i.SorobanAuthorizationEntry.fromXDR(t.toXDR()),(s=a.credentials().address()).signatureExpirationLedger(n),c=u(Ii.from(o)),l=i.HashIdPreimage.envelopeTypeSorobanAuthorization(new i.HashIdPreimageSorobanAuthorization({networkId:c,nonce:s.nonce(),invocation:a.rootInvocation(),signatureExpirationLedger:s.signatureExpirationLedger()})),f=u(l.toXDR()),"function"!=typeof r){e.n=3;break}return e.n=2,r(l);case 2:null!=(h=e.v)&&h.signature?(p=Ii.from(h.signature),d=h.publicKey):(p=Ii.from(h),d=sn.fromScAddress(s.address()).toString()),e.n=4;break;case 3:p=Ii.from(r.sign(f)),d=r.publicKey();case 4:if(Xt.fromPublicKey(d).verify(f,p)){e.n=5;break}throw new Error("signature doesn't match payload");case 5:return y=Ei({public_key:Lt.decodeEd25519PublicKey(d),signature:p},{type:{public_key:["symbol",null],signature:["symbol",null]}}),s.signature(i.ScVal.scvVec([y])),e.a(2,a)}},e)}),Ui=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Ci(i,n,o,a,s,"next",e)}function s(e){Ci(i,n,o,a,s,"throw",e)}a(void 0)})},Ui.apply(this,arguments)}function Ni(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:So.FUTURENET,a=Xt.random().rawPublicKey(),s=new i.Int64(a.subarray(0,8).reduce(function(e,t){return e<<8|t},0)),u=n||e.publicKey();if(!u)throw new Error("authorizeInvocation requires publicKey parameter");return ji(new i.SorobanAuthorizationEntry({rootInvocation:r,credentials:i.SorobanCredentials.sorobanCredentialsAddress(new i.SorobanAddressCredentials({address:new sn(u).toScAddress(),nonce:s,signatureExpirationLedger:0,signature:i.ScVal.scvVec([])}))}),e,t,o)}function Li(e){return Li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Li(e)}function Di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Fi(e,t,r){return(t=function(e){var t=function(e){if("object"!=Li(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Li(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Li(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mi(e){var t=e.function(),r={},n=t.value();switch(t.switch().value){case 0:r.type="execute",r.args={source:sn.fromScAddress(n.contractAddress()).toString(),function:n.functionName(),args:n.args().map(function(e){return Ti(e)})};break;case 1:case 2:var o=2===t.switch().value;r.type="create",r.args={};var i=[n.executable(),n.contractIdPreimage()],a=i[0],s=i[1];if(!!a.switch().value!=!!s.switch().value)throw new Error("creation function appears invalid: ".concat(JSON.stringify(n)," (should be wasm+address or token+asset)"));switch(a.switch().value){case 0:var u=s.fromAddress();r.args.type="wasm",r.args.wasm=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Di(Object(r),!0).forEach(function(t){Fi(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Di(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({salt:u.salt().toString("hex"),hash:a.wasmHash().toString("hex"),address:sn.fromScAddress(u.address()).toString()},o&&{constructorArgs:n.constructorArgs().map(function(e){return Ti(e)})});break;case 1:r.args.type="sac",r.args.asset=Zt.fromOperation(s.fromAsset()).toString();break;default:throw new Error("unknown creation type: ".concat(JSON.stringify(a)))}break;default:throw new Error("unknown invocation type (".concat(t.switch(),"): ").concat(JSON.stringify(t)))}return r.invocations=e.subInvocations().map(function(e){return Mi(e)}),r}function Vi(e,t){qi(e,1,t)}function qi(e,t,r,n){!1!==r(e,t,n)&&e.subInvocations().forEach(function(n){return qi(n,t+1,r,e)})}const Hi=(e=r.hmd(e)).exports},453:(e,t,r)=>{"use strict";var n,o=r(9612),i=r(9383),a=r(1237),s=r(9290),u=r(9538),c=r(8068),l=r(9675),f=r(5345),p=r(1514),d=r(8968),h=r(6188),y=r(8002),m=r(5880),g=r(414),v=r(3093),b=Function,w=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},S=r(5795),E=r(655),T=function(){throw new l},k=S?function(){try{return T}catch(e){try{return S(arguments,"callee").get}catch(e){return T}}}():T,O=r(4039)(),A=r(3628),_=r(1064),x=r(8648),P=r(1002),I=r(76),R={},B="undefined"!=typeof Uint8Array&&A?A(Uint8Array):n,C={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":O&&A?A([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":R,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O&&A?A(A([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O&&A?A((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&O&&A?A((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&A?A(""[Symbol.iterator]()):n,"%Symbol%":O?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":k,"%TypedArray%":B,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":I,"%Function.prototype.apply%":P,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":_,"%Math.abs%":p,"%Math.floor%":d,"%Math.max%":h,"%Math.min%":y,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":v,"%Reflect.getPrototypeOf%":x};if(A)try{null.error}catch(e){var j=A(A(e));C["%Error.prototype%"]=j}var U=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&A&&(r=A(o.prototype))}return C[t]=r,r},N={__proto__:null,"%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"]},L=r(6743),D=r(9957),F=L.call(I,Array.prototype.concat),M=L.call(P,Array.prototype.splice),V=L.call(I,String.prototype.replace),q=L.call(I,String.prototype.slice),H=L.call(I,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,X=function(e,t){var r,n=e;if(D(N,n)&&(n="%"+(r=N[n])[0]+"%"),D(C,n)){var o=C[n];if(o===R&&(o=U(n)),void 0===o&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=q(e,0,1),r=q(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return V(e,z,function(e,t,r,o){n[n.length]=r?V(o,K,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",o=X("%"+n+"%",t),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],M(r,F([0,1],u)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],h=q(d,0,1),y=q(d,-1);if(('"'===h||"'"===h||"`"===h||'"'===y||"'"===y||"`"===y)&&h!==y)throw new c("property names with quotes must have matching quotes");if("constructor"!==d&&p||(s=!0),D(C,i="%"+(n+="."+d)+"%"))a=C[i];else if(null!=a){if(!(d in a)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(S&&f+1>=r.length){var m=S(a,d);a=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[d]}else p=D(a,d),a=a[d];p&&!s&&(C[i]=a)}}return a}},487:(e,t,r)=>{"use strict";var n=r(6897),o=r(655),i=r(3126),a=r(2205);e.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},o?o(e.exports,"apply",{value:a}):e.exports.apply=a},537:(e,t,r)=>{var n=r(5606),o=r(6763),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},a=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(l(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,i=String(e).replace(a,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r<o;s=n[++r])v(s)||!T(s)?i+=" "+s:i+=" "+l(s);return i},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?o.trace(r):o.error(r),i=!0}return e.apply(this,arguments)}};var s={},u=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+c+"$","i")}function l(e,r){var n={seen:[],stylize:p};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),S(n.showHidden)&&(n.showHidden=!1),S(n.depth)&&(n.depth=2),S(n.colors)&&(n.colors=!1),S(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),d(n,e,n.depth)}function f(e,t){var r=l.styles[t];return r?"\x1b["+l.colors[r][0]+"m"+e+"\x1b["+l.colors[r][1]+"m":e}function p(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return w(o)||(o=d(e,o,n)),o}var i=function(e,t){if(S(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,r);if(i)return i;var a=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),O(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(A(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(O(r))return h(r)}var c,l="",f=!1,p=["{","}"];return m(r)&&(f=!0,p=["[","]"]),A(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(l=" "+RegExp.prototype.toString.call(r)),k(r)&&(l=" "+Date.prototype.toUTCString.call(r)),O(r)&&(l=" "+h(r)),0!==a.length||f&&0!=r.length?n<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=f?function(e,t,r,n,o){for(var i=[],a=0,s=t.length;a<s;++a)I(t,String(a))?i.push(y(e,t,r,n,String(a),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(y(e,t,r,n,o,!0))}),i}(e,r,n,s,a):a.map(function(t){return y(e,r,n,s,t,f)}),e.seen.pop(),function(e,t,r){var n=e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,l,p)):p[0]+l+p[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function y(e,t,r,n,o,i){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),I(n,o)||(a="["+o+"]"),s||(e.seen.indexOf(u.value)<0?(s=v(r)?d(e,u.value,null):d(e,u.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),S(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function m(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function S(e){return void 0===e}function E(e){return T(e)&&"[object RegExp]"===_(e)}function T(e){return"object"==typeof e&&null!==e}function k(e){return T(e)&&"[object Date]"===_(e)}function O(e){return T(e)&&("[object Error]"===_(e)||e instanceof Error)}function A(e){return"function"==typeof e}function _(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(u.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);o.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=m,t.isBoolean=g,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=S,t.isRegExp=E,t.types.isRegExp=E,t.isObject=T,t.isDate=k,t.types.isDate=k,t.isError=O,t.types.isNativeError=O,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;o.log("%s - %s",(r=[x((e=new Date).getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":"),[e.getDate(),P[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!T(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,n){e?r(e):t(n)});try{e.apply(this,o)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then(function(e){n.nextTick(a.bind(null,null,e))},function(e){n.nextTick(B.bind(null,e,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},592:(e,t,r)=>{"use strict";var n=r(655),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},1002:e=>{"use strict";e.exports=Function.prototype.apply},1064:(e,t,r)=>{"use strict";var n=r(9612);e.exports=n.getPrototypeOf||null},1093:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},1189:(e,t,r)=>{"use strict";var n=Array.prototype.slice,o=r(1093),i=Object.keys,a=i?function(e){return i(e)}:r(8875),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1237:e=>{"use strict";e.exports=EvalError},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},1514:e=>{"use strict";e.exports=Math.abs},2205:(e,t,r)=>{"use strict";var n=r(6743),o=r(1002),i=r(3144);e.exports=function(){return i(n,o,arguments)}},2299:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var a=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},u=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},c=Object.is?Object.is:r(7653),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(4133);function p(e){return e.call.bind(e)}var d=p(Object.prototype.hasOwnProperty),h=p(Object.prototype.propertyIsEnumerable),y=p(Object.prototype.toString),m=r(537).types,g=m.isAnyArrayBuffer,v=m.isArrayBufferView,b=m.isDate,w=m.isMap,S=m.isRegExp,E=m.isSet,T=m.isNativeError,k=m.isBoxedPrimitive,O=m.isNumberObject,A=m.isStringObject,_=m.isBooleanObject,x=m.isBigIntObject,P=m.isSymbolObject,I=m.isFloat32Array,R=m.isFloat64Array;function B(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function C(e){return Object.keys(e).filter(B).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function j(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function U(e,t,r,n){if(e===t)return 0!==e||!r||c(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&f(e)&&f(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var o,s,u,l,p=y(e);if(p!==y(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=C(e),h=C(t);return d.length===h.length&&L(e,t,r,n,1,d)}if("[object Object]"===p&&(!w(e)&&w(t)||!E(e)&&E(t)))return!1;if(b(e)){if(!b(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(S(e)){if(!S(t)||(u=e,l=t,!(a?u.source===l.source&&u.flags===l.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(l))))return!1}else if(T(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!I(e)&&!R(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===j(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var m=C(e),B=C(t);return m.length===B.length&&L(e,t,r,n,0,m)}if(E(e))return!(!E(t)||e.size!==t.size)&&L(e,t,r,n,2);if(w(e))return!(!w(t)||e.size!==t.size)&&L(e,t,r,n,3);if(g(e)){if(s=t,(o=e).byteLength!==s.byteLength||0!==j(new Uint8Array(o),new Uint8Array(s)))return!1}else if(k(e)&&!function(e,t){return O(e)?O(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):A(e)?A(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):_(e)?_(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):x(e)?x(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):P(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return L(e,t,r,n,0)}function N(e,t){return t.filter(function(t){return h(e,t)})}function L(e,t,r,o,a,c){if(5===arguments.length){c=Object.keys(e);var f=Object.keys(t);if(c.length!==f.length)return!1}for(var p=0;p<c.length;p++)if(!d(t,c[p]))return!1;if(r&&5===arguments.length){var y=l(e);if(0!==y.length){var m=0;for(p=0;p<y.length;p++){var g=y[p];if(h(e,g)){if(!h(t,g))return!1;c.push(g),m++}else if(h(t,g))return!1}var v=l(t);if(y.length!==v.length&&N(t,v).length!==m)return!1}else{var b=l(t);if(0!==b.length&&0!==N(t,b).length)return!1}}if(0===c.length&&(0===a||1===a&&0===e.length||0===e.size))return!0;if(void 0===o)o={val1:new Map,val2:new Map,position:0};else{var w=o.val1.get(e);if(void 0!==w){var S=o.val2.get(t);if(void 0!==S)return w===S}o.position++}o.val1.set(e,o.position),o.val2.set(t,o.position);var E=function(e,t,r,o,a,c){var l=0;if(2===c){if(!function(e,t,r,n){for(var o=null,a=s(e),u=0;u<a.length;u++){var c=a[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!M(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=s(t),f=0;f<l.length;f++){var p=l[f];if("object"===i(p)&&null!==p){if(!D(o,p,r,n))return!1}else if(!r&&!e.has(p)&&!D(o,p,r,n))return!1}return 0===o.size}return!0}(e,t,r,a))return!1}else if(3===c){if(!function(e,t,r,o){for(var a=null,s=u(e),c=0;c<s.length;c++){var l=n(s[c],2),f=l[0],p=l[1];if("object"===i(f)&&null!==f)null===a&&(a=new Set),a.add(f);else{var d=t.get(f);if(void 0===d&&!t.has(f)||!U(p,d,r,o)){if(r)return!1;if(!V(e,t,f,p,o))return!1;null===a&&(a=new Set),a.add(f)}}}if(null!==a){for(var h=u(t),y=0;y<h.length;y++){var m=n(h[y],2),g=m[0],v=m[1];if("object"===i(g)&&null!==g){if(!q(a,e,g,v,r,o))return!1}else if(!(r||e.has(g)&&U(e.get(g),v,!1,o)||q(a,e,g,v,!1,o)))return!1}return 0===a.size}return!0}(e,t,r,a))return!1}else if(1===c)for(;l<e.length;l++){if(!d(e,l)){if(d(t,l))return!1;for(var f=Object.keys(e);l<f.length;l++){var p=f[l];if(!d(t,p)||!U(e[p],t[p],r,a))return!1}return f.length===Object.keys(t).length}if(!d(t,l)||!U(e[l],t[l],r,a))return!1}for(l=0;l<o.length;l++){var h=o[l];if(!U(e[h],t[h],r,a))return!1}return!0}(e,t,r,c,o,a);return o.val1.delete(e),o.val2.delete(t),E}function D(e,t,r,n){for(var o=s(e),i=0;i<o.length;i++){var a=o[i];if(U(t,a,r,n))return e.delete(a),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(f(e))return!1}return!0}function M(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function V(e,t,r,n,o){var i=F(r);if(null!=i)return i;var a=t.get(i);return!(void 0===a&&!t.has(i)||!U(n,a,!1,o))&&!e.has(i)&&U(n,a,!1,o)}function q(e,t,r,n,o,i){for(var a=s(e),u=0;u<a.length;u++){var c=a[u];if(U(r,c,o,i)&&U(n,t.get(c),o,i))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return U(e,t,!1)},isDeepStrictEqual:function(e,t){return U(e,t,!0)}}},2464:(e,t,r)=>{"use strict";var n=r(8452),o=r(6642);e.exports=function(){var e=o();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2682:(e,t,r)=>{"use strict";var n=r(9600),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a,s;arguments.length>=3&&(a=r),s=e,"[object Array]"===o.call(s)?function(e,t,r){for(var n=0,o=e.length;n<o;n++)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a):"string"==typeof e?function(e,t,r){for(var n=0,o=e.length;n<o;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,a):function(e,t,r){for(var n in e)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a)}},2802:(e,t,r)=>{"use strict";e.exports=function(t){var r=t.toLowerCase(),n=e.exports[r];if(!n)throw new Error(r+" is not supported (we accept pull requests)");return new n},e.exports.sha=r(7816),e.exports.sha1=r(3737),e.exports.sha224=r(6710),e.exports.sha256=r(4107),e.exports.sha384=r(2827),e.exports.sha512=r(2890)},2827:(e,t,r)=>{"use strict";var n=r(6698),o=r(2890),i=r(392),a=r(2861).Buffer,s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}n(u,o),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},2861:(e,t,r)=>{var n=r(8287),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},2890:(e,t,r)=>{"use strict";var n=r(6698),o=r(392),i=r(2861).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function p(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}n(u,o),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,o=0|this._ch,i=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,b=0|this._hh,w=0|this._al,S=0|this._bl,E=0|this._cl,T=0|this._dl,k=0|this._el,O=0|this._fl,A=0|this._gl,_=0|this._hl,x=0;x<32;x+=2)t[x]=e.readInt32BE(4*x),t[x+1]=e.readInt32BE(4*x+4);for(;x<160;x+=2){var P=t[x-30],I=t[x-30+1],R=d(P,I),B=h(I,P),C=y(P=t[x-4],I=t[x-4+1]),j=m(I,P),U=t[x-14],N=t[x-14+1],L=t[x-32],D=t[x-32+1],F=B+N|0,M=R+U+g(F,B)|0;M=(M=M+C+g(F=F+j|0,j)|0)+L+g(F=F+D|0,D)|0,t[x]=M,t[x+1]=F}for(var V=0;V<160;V+=2){M=t[V],F=t[V+1];var q=l(r,n,o),H=l(w,S,E),z=f(r,w),K=f(w,r),X=p(s,k),$=p(k,s),G=a[V],W=a[V+1],Q=c(s,u,v),Z=c(k,O,A),Y=_+$|0,J=b+X+g(Y,_)|0;J=(J=(J=J+Q+g(Y=Y+Z|0,Z)|0)+G+g(Y=Y+W|0,W)|0)+M+g(Y=Y+F|0,F)|0;var ee=K+H|0,te=z+q+g(ee,K)|0;b=v,_=A,v=u,A=O,u=s,O=k,s=i+J+g(k=T+Y|0,T)|0,i=o,T=E,o=n,E=S,n=r,S=w,r=J+te+g(w=Y+ee|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+S|0,this._cl=this._cl+E|0,this._dl=this._dl+T|0,this._el=this._el+k|0,this._fl=this._fl+O|0,this._gl=this._gl+A|0,this._hl=this._hl+_|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,S)|0,this._ch=this._ch+o+g(this._cl,E)|0,this._dh=this._dh+i+g(this._dl,T)|0,this._eh=this._eh+s+g(this._el,k)|0,this._fh=this._fh+u+g(this._fl,O)|0,this._gh=this._gh+v+g(this._gl,A)|0,this._hh=this._hh+b+g(this._hl,_)|0},u.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},3003:e=>{"use strict";e.exports=function(e){return e!=e}},3093:(e,t,r)=>{"use strict";var n=r(4459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3126:(e,t,r)=>{"use strict";var n=r(6743),o=r(9675),i=r(76),a=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(n,i,e)}},3144:(e,t,r)=>{"use strict";var n=r(6743),o=r(1002),i=r(76),a=r(7119);e.exports=a||n.call(i,o)},3628:(e,t,r)=>{"use strict";var n=r(8648),o=r(1064),i=r(7176);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},3737:(e,t,r)=>{"use strict";var n=r(6698),o=r(392),i=r(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<1|e>>>31}function l(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function p(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=c(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var d=0;d<80;++d){var h=~~(d/20),y=l(r)+p(h,n,o,i)+s+t[d]+a[h]|0;s=i,i=o,o=f(n),n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},3740:function(e,t,r){var n,o=r(6763);n=()=>(()=>{var e={616:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(287);n.hp.alloc(1).subarray(0,1)instanceof n.hp||(n.hp.prototype.subarray=function(e,t){const r=Uint8Array.prototype.subarray.call(this,e,t);return Object.setPrototypeOf(r,n.hp.prototype),r});const o=n.hp},281:(e,t,r)=>{const n=r(164);e.exports=n},164:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Array:()=>M,Bool:()=>C,Double:()=>R,Enum:()=>z,Float:()=>I,Hyper:()=>A,Int:()=>E,LargeInt:()=>O,Opaque:()=>L,Option:()=>q,Quadruple:()=>B,Reference:()=>K,String:()=>U,Struct:()=>X,Union:()=>G,UnsignedHyper:()=>P,UnsignedInt:()=>x,VarArray:()=>V,VarOpaque:()=>F,Void:()=>H,XdrReader:()=>u,XdrWriter:()=>f,config:()=>ne});class n extends TypeError{constructor(e){super(`XDR Write Error: ${e}`)}}class o extends TypeError{constructor(e){super(`XDR Read Error: ${e}`)}}class i extends TypeError{constructor(e){super(`XDR Type Definition Error: ${e}`)}}class a extends i{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var s=r(616).A;class u{constructor(e){if(!s.isBuffer(e)){if(!(e instanceof Array||Array.isArray(e)||ArrayBuffer.isView(e)))throw new o(`source invalid: ${e}`);e=s.from(e)}this._buffer=e,this._length=e.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(e){const t=this._index;if(this._index+=e,this._length<this._index)throw new o("attempt to read outside the boundary of the buffer");const r=4-(e%4||4);if(r>0){for(let e=0;e<r;e++)if(0!==this._buffer[this._index+e])throw new o("invalid padding");this._index+=r}return t}rewind(){this._index=0}read(e){const t=this.advance(e);return this._buffer.subarray(t,t+e)}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 o("invalid XDR contract typecast - source buffer not entirely consumed")}}var c=r(616).A;const l=8192;class f{constructor(e){"number"==typeof e?e=c.allocUnsafe(e):e instanceof c||(e=c.allocUnsafe(l)),this._buffer=e,this._length=e.length}_buffer;_length;_index=0;alloc(e){const t=this._index;return this._index+=e,this._length<this._index&&this.resize(this._index),t}resize(e){const t=Math.ceil(e/l)*l,r=c.allocUnsafe(t);this._buffer.copy(r,0,0,this._length),this._buffer=r,this._length=t}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(e,t){if("string"==typeof e){const r=this.alloc(t);this._buffer.write(e,r,"utf8")}else{e instanceof c||(e=c.from(e));const r=this.alloc(t);e.copy(this._buffer,r,0,t)}const r=4-(t%4||4);if(r>0){const e=this.alloc(r);this._buffer.fill(0,e,this._index)}}writeInt32BE(e){const t=this.alloc(4);this._buffer.writeInt32BE(e,t)}writeUInt32BE(e){const t=this.alloc(4);this._buffer.writeUInt32BE(e,t)}writeBigInt64BE(e){const t=this.alloc(8);this._buffer.writeBigInt64BE(e,t)}writeBigUInt64BE(e){const t=this.alloc(8);this._buffer.writeBigUInt64BE(e,t)}writeFloatBE(e){const t=this.alloc(4);this._buffer.writeFloatBE(e,t)}writeDoubleBE(e){const t=this.alloc(8);this._buffer.writeDoubleBE(e,t)}static bufferChunkSize=l}var p=r(616).A;class d{toXDR(e="raw"){if(!this.write)return this.constructor.toXDR(this,e);const t=new f;return this.write(this,t),g(t.finalize(),e)}fromXDR(e,t="raw"){if(!this.read)return this.constructor.fromXDR(e,t);const r=new u(v(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}validateXDR(e,t="raw"){try{return this.fromXDR(e,t),!0}catch(e){return!1}}static toXDR(e,t="raw"){const r=new f;return this.write(e,r),g(r.finalize(),t)}static fromXDR(e,t="raw"){const r=new u(v(e,t)),n=this.read(r);return r.ensureInputConsumed(),n}static validateXDR(e,t="raw"){try{return this.fromXDR(e,t),!0}catch(e){return!1}}}class h extends d{static read(e){throw new a}static write(e,t){throw new a}static isValid(e){return!1}}class y extends d{isValid(e){return!1}}class m extends TypeError{constructor(e){super(`Invalid format ${e}, must be one of "raw", "hex", "base64"`)}}function g(e,t){switch(t){case"raw":return e;case"hex":return e.toString("hex");case"base64":return e.toString("base64");default:throw new m(t)}}function v(e,t){switch(t){case"raw":return e;case"hex":return p.from(e,"hex");case"base64":return p.from(e,"base64");default:throw new m(t)}}function b(e,t){return null!=e&&(e instanceof t||w(e,t)&&"function"==typeof e.constructor.read&&"function"==typeof e.constructor.write&&w(e,"XdrType"))}function w(e,t){do{if(e.constructor.name===t)return!0}while(e=Object.getPrototypeOf(e));return!1}const S=2147483647;class E extends h{static read(e){return e.readInt32BE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");if((0|e)!==e)throw new n("invalid i32 value");t.writeInt32BE(e)}static isValid(e){return"number"==typeof e&&(0|e)===e&&e>=-2147483648&&e<=S}}function T(e,t,r){if("bigint"!=typeof e)throw new TypeError("Expected bigint 'value', got "+typeof e);const n=t/r;if(1===n)return[e];if(r<32||r>128||2!==n&&4!==n&&8!==n)throw new TypeError(`invalid bigint (${e}) and slice size (${t} -> ${r}) combination`);const o=BigInt(r),i=new Array(n);for(let t=0;t<n;t++)i[t]=BigInt.asIntN(r,e),e>>=o;return i}function k(e,t){if(t)return[0n,(1n<<BigInt(e))-1n];const r=1n<<BigInt(e-1);return[0n-r,r-1n]}E.MAX_VALUE=S,E.MIN_VALUE=2147483648;class O extends h{constructor(e){super(),this._value=function(e,t,r){e instanceof Array?e.length&&e[0]instanceof Array&&(e=e[0]):e=[e];const n=t/e.length;switch(n){case 32:case 64:case 128:case 256:break;default:throw new RangeError(`expected slices to fit in 32/64/128/256 bits, got ${e}`)}try{for(let t=0;t<e.length;t++)"bigint"!=typeof e[t]&&(e[t]=BigInt(e[t].valueOf()))}catch(t){throw new TypeError(`expected bigint-like values, got: ${e} (${t})`)}if(r&&1===e.length&&e[0]<0n)throw new RangeError(`expected a positive value, got: ${e}`);let o=BigInt.asUintN(n,e[0]);for(let t=1;t<e.length;t++)o|=BigInt.asUintN(n,e[t])<<BigInt(t*n);r||(o=BigInt.asIntN(t,o));const[i,a]=k(t,r);if(o>=i&&o<=a)return o;throw new TypeError(`bigint values [${e}] for ${function(e,t){return`${t?"u":"i"}${e}`}(t,r)} out of range [${i}, ${a}]: ${o}`)}(e,this.size,this.unsigned)}get unsigned(){throw new a}get size(){throw new a}slice(e){return T(this._value,this.size,e)}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}toBigInt(){return BigInt(this._value)}static read(e){const{size:t}=this.prototype;return 64===t?new this(e.readBigUInt64BE()):new this(...Array.from({length:t/64},()=>e.readBigUInt64BE()).reverse())}static write(e,t){if(e instanceof this)e=e._value;else if("bigint"!=typeof e||e>this.MAX_VALUE||e<this.MIN_VALUE)throw new n(`${e} is not a ${this.name}`);const{unsigned:r,size:o}=this.prototype;if(64===o)r?t.writeBigUInt64BE(e):t.writeBigInt64BE(e);else for(const n of T(e,o,64).reverse())r?t.writeBigUInt64BE(n):t.writeBigInt64BE(n)}static isValid(e){return"bigint"==typeof e||e instanceof this}static fromString(e){return new this(e)}static MAX_VALUE=0n;static MIN_VALUE=0n;static defineIntBoundaries(){const[e,t]=k(this.prototype.size,this.prototype.unsigned);this.MIN_VALUE=e,this.MAX_VALUE=t}}class A extends O{constructor(...e){super(e)}get low(){return 0|Number(0xffffffffn&this._value)}get high(){return 0|Number(this._value>>32n)}get size(){return 64}get unsigned(){return!1}static fromBits(e,t){return new this(e,t)}}A.defineIntBoundaries();const _=4294967295;class x extends h{static read(e){return e.readUInt32BE()}static write(e,t){if("number"!=typeof e||!(e>=0&&e<=_)||e%1!=0)throw new n("invalid u32 value");t.writeUInt32BE(e)}static isValid(e){return"number"==typeof e&&e%1==0&&e>=0&&e<=_}}x.MAX_VALUE=_,x.MIN_VALUE=0;class P extends O{constructor(...e){super(e)}get low(){return 0|Number(0xffffffffn&this._value)}get high(){return 0|Number(this._value>>32n)}get size(){return 64}get unsigned(){return!0}static fromBits(e,t){return new this(e,t)}}P.defineIntBoundaries();class I extends h{static read(e){return e.readFloatBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeFloatBE(e)}static isValid(e){return"number"==typeof e}}class R extends h{static read(e){return e.readDoubleBE()}static write(e,t){if("number"!=typeof e)throw new n("not a number");t.writeDoubleBE(e)}static isValid(e){return"number"==typeof e}}class B extends h{static read(){throw new i("quadruple not supported")}static write(){throw new i("quadruple not supported")}static isValid(){return!1}}class C extends h{static read(e){const t=E.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new o(`got ${t} when trying to read a bool`)}}static write(e,t){const r=e?1:0;E.write(r,t)}static isValid(e){return"boolean"==typeof e}}var j=r(616).A;class U extends y{constructor(e=x.MAX_VALUE){super(),this._maxLength=e}read(e){const t=x.read(e);if(t>this._maxLength)throw new o(`saw ${t} length String, max allowed is ${this._maxLength}`);return e.read(t)}readString(e){return this.read(e).toString("utf8")}write(e,t){const r="string"==typeof e?j.byteLength(e,"utf8"):e.length;if(r>this._maxLength)throw new n(`got ${e.length} bytes, max allowed is ${this._maxLength}`);x.write(r,t),t.write(e,r)}isValid(e){return"string"==typeof e?j.byteLength(e,"utf8")<=this._maxLength:!!(e instanceof Array||j.isBuffer(e))&&e.length<=this._maxLength}}var N=r(616).A;class L extends y{constructor(e){super(),this._length=e}read(e){return e.read(this._length)}write(e,t){const{length:r}=e;if(r!==this._length)throw new n(`got ${e.length} bytes, expected ${this._length}`);t.write(e,r)}isValid(e){return N.isBuffer(e)&&e.length===this._length}}var D=r(616).A;class F extends y{constructor(e=x.MAX_VALUE){super(),this._maxLength=e}read(e){const t=x.read(e);if(t>this._maxLength)throw new o(`saw ${t} length VarOpaque, max allowed is ${this._maxLength}`);return e.read(t)}write(e,t){const{length:r}=e;if(e.length>this._maxLength)throw new n(`got ${e.length} bytes, max allowed is ${this._maxLength}`);x.write(r,t),t.write(e,r)}isValid(e){return D.isBuffer(e)&&e.length<=this._maxLength}}class M extends y{constructor(e,t){super(),this._childType=e,this._length=t}read(e){const t=new r.g.Array(this._length);for(let r=0;r<this._length;r++)t[r]=this._childType.read(e);return t}write(e,t){if(!r.g.Array.isArray(e))throw new n("value is not array");if(e.length!==this._length)throw new n(`got array of size ${e.length}, expected ${this._length}`);for(const r of e)this._childType.write(r,t)}isValid(e){if(!(e instanceof r.g.Array)||e.length!==this._length)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class V extends y{constructor(e,t=x.MAX_VALUE){super(),this._childType=e,this._maxLength=t}read(e){const t=x.read(e);if(t>this._maxLength)throw new o(`saw ${t} length VarArray, max allowed is ${this._maxLength}`);const r=new Array(t);for(let n=0;n<t;n++)r[n]=this._childType.read(e);return r}write(e,t){if(!(e instanceof Array))throw new n("value is not array");if(e.length>this._maxLength)throw new n(`got array of size ${e.length}, max allowed is ${this._maxLength}`);x.write(e.length,t);for(const r of e)this._childType.write(r,t)}isValid(e){if(!(e instanceof Array)||e.length>this._maxLength)return!1;for(const t of e)if(!this._childType.isValid(t))return!1;return!0}}class q extends h{constructor(e){super(),this._childType=e}read(e){if(C.read(e))return this._childType.read(e)}write(e,t){const r=null!=e;C.write(r,t),r&&this._childType.write(e,t)}isValid(e){return null==e||this._childType.isValid(e)}}class H extends h{static read(){}static write(e){if(void 0!==e)throw new n("trying to write value to a void slot")}static isValid(e){return void 0===e}}class z extends h{constructor(e,t){super(),this.name=e,this.value=t}static read(e){const t=E.read(e),r=this._byValue[t];if(void 0===r)throw new o(`unknown ${this.enumName} member for value ${t}`);return r}static write(e,t){if(!this.isValid(e))throw new n(`${e} has enum name ${e?.enumName}, not ${this.enumName}: ${JSON.stringify(e)}`);E.write(e.value,t)}static isValid(e){return e?.constructor?.enumName===this.enumName||b(e,this)}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(e){const t=this._members[e];if(!t)throw new TypeError(`${e} is not a member of ${this.enumName}`);return t}static fromValue(e){const t=this._byValue[e];if(void 0===t)throw new TypeError(`${e} is not a value of any member of ${this.enumName}`);return t}static create(e,t,r){const n=class extends z{};n.enumName=t,e.results[t]=n,n._members={},n._byValue={};for(const[e,t]of Object.entries(r)){const r=new n(e,t);n._members[e]=r,n._byValue[t]=r,n[e]=()=>r}return n}}class K extends h{resolve(){throw new i('"resolve" method should be implemented in the descendant class')}}class X extends y{constructor(e){super(),this._attributes=e||{}}static read(e){const t={};for(const[r,n]of this._fields)t[r]=n.read(e);return new this(t)}static write(e,t){if(!this.isValid(e))throw new n(`${e} has struct name ${e?.constructor?.structName}, not ${this.structName}: ${JSON.stringify(e)}`);for(const[r,n]of this._fields){const o=e._attributes[r];n.write(o,t)}}static isValid(e){return e?.constructor?.structName===this.structName||b(e,this)}static create(e,t,r){const n=class extends X{};n.structName=t,e.results[t]=n;const o=new Array(r.length);for(let t=0;t<r.length;t++){const i=r[t],a=i[0];let s=i[1];s instanceof K&&(s=s.resolve(e)),o[t]=[a,s],n.prototype[a]=$(a)}return n._fields=o,n}}function $(e){return function(t){return void 0!==t&&(this._attributes[e]=t),this._attributes[e]}}class G extends y{constructor(e,t){super(),this.set(e,t)}set(e,t){"string"==typeof e&&(e=this.constructor._switchOn.fromName(e)),this._switch=e;const r=this.constructor.armForSwitch(this._switch);this._arm=r,this._armType=r===H?H:this.constructor._arms[r],this._value=t}get(e=this._arm){if(this._arm!==H&&this._arm!==e)throw new TypeError(`${e} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(e){const t=this._switches.get(e);if(void 0!==t)return t;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${e}`)}static armTypeForArm(e){return e===H?H:this._arms[e]}static read(e){const t=this._switchOn.read(e),r=this.armForSwitch(t),n=r===H?H:this._arms[r];let o;return o=void 0!==n?n.read(e):r.read(e),new this(t,o)}static write(e,t){if(!this.isValid(e))throw new n(`${e} has union name ${e?.unionName}, not ${this.unionName}: ${JSON.stringify(e)}`);this._switchOn.write(e.switch(),t),e.armType().write(e.value(),t)}static isValid(e){return e?.constructor?.unionName===this.unionName||b(e,this)}static create(e,t,r){const n=class extends G{};n.unionName=t,e.results[t]=n,r.switchOn instanceof K?n._switchOn=r.switchOn.resolve(e):n._switchOn=r.switchOn,n._switches=new Map,n._arms={};let o=r.defaultArm;o instanceof K&&(o=o.resolve(e)),n._defaultArm=o;for(const[e,t]of r.switches){const r="string"==typeof e?n._switchOn.fromName(e):e;n._switches.set(r,t)}if(void 0!==n._switchOn.values)for(const e of n._switchOn.values())n[e.name]=function(t){return new n(e,t)},n.prototype[e.name]=function(t){return this.set(e,t)};if(r.arms)for(const[t,o]of Object.entries(r.arms))n._arms[t]=o instanceof K?o.resolve(e):o,o!==H&&(n.prototype[t]=function(){return this.get(t)});return n}}class W extends K{constructor(e){super(),this.name=e}resolve(e){return e.definitions[this.name].resolve(e)}}class Q extends K{constructor(e,t,r=!1){super(),this.childReference=e,this.length=t,this.variable=r}resolve(e){let t=this.childReference,r=this.length;return t instanceof K&&(t=t.resolve(e)),r instanceof K&&(r=r.resolve(e)),this.variable?new V(t,r):new M(t,r)}}class Z extends K{constructor(e){super(),this.childReference=e,this.name=e.name}resolve(e){let t=this.childReference;return t instanceof K&&(t=t.resolve(e)),new q(t)}}class Y extends K{constructor(e,t){super(),this.sizedType=e,this.length=t}resolve(e){let t=this.length;return t instanceof K&&(t=t.resolve(e)),new this.sizedType(t)}}class J{constructor(e,t,r){this.constructor=e,this.name=t,this.config=r}resolve(e){return this.name in e.results?e.results[this.name]:this.constructor(e,this.name,this.config)}}function ee(e,t,r){return r instanceof K&&(r=r.resolve(e)),e.results[t]=r,r}function te(e,t,r){return e.results[t]=r,r}class re{constructor(e){this._destination=e,this._definitions={}}enum(e,t){const r=new J(z.create,e,t);this.define(e,r)}struct(e,t){const r=new J(X.create,e,t);this.define(e,r)}union(e,t){const r=new J(G.create,e,t);this.define(e,r)}typedef(e,t){const r=new J(ee,e,t);this.define(e,r)}const(e,t){const r=new J(te,e,t);this.define(e,r)}void(){return H}bool(){return C}int(){return E}hyper(){return A}uint(){return x}uhyper(){return P}float(){return I}double(){return R}quadruple(){return B}string(e){return new Y(U,e)}opaque(e){return new Y(L,e)}varOpaque(e){return new Y(F,e)}array(e,t){return new Q(e,t)}varArray(e,t){return new Q(e,t,!0)}option(e){return new Z(e)}define(e,t){if(void 0!==this._destination[e])throw new i(`${e} is already defined`);this._definitions[e]=t}lookup(e){return new W(e)}resolve(){for(const e of Object.values(this._definitions))e.resolve({definitions:this._definitions,results:this._destination})}}function ne(e,t={}){if(e){const r=new re(t);e(r),r.resolve()}return t}},526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;s<c;s+=a)i.push(u(e,s,s+a>c?c:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},287:(e,t,r)=>{"use strict";const n=r(526),i=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=u(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|y(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Z(e.length)?u(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function p(e){return f(e),u(e<0?0:0|y(e))}function d(e){const t=e.length<0?0:0|y(e.length),r=u(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function y(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:$(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function S(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Z(n))return a;e[r+a]=n}return a}function E(e,t,r,n){return W($(t,e.length-r),e,r,n)}function T(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return W(G(t),e,r,n)}function O(e,t,r,n){return W(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===o||"function"!=typeof o.error||o.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},c.allocUnsafe=function(e){return p(e)},c.allocUnsafeSlow=function(e){return p(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))o+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<s;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function R(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Y[e[n]];return o}function B(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function U(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=J(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=J(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const M={};function V(e,t,r){M[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,o,i)}function z(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}V("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),V("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=q(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function $(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,p=r?-1:1,d=e[t+f];for(f+=p,i=d&(1<<-l)-1,d>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=c}return(d?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+d]=255&s,d+=h,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+d]=255&a,d+=h,a/=256,c-=8);e[r+d-h]|=128*y}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(281)})(),e.exports=n()},3918:(e,t,r)=>{"use strict";var n=r(5606);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var t=function(e){if("object"!==m(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===m(t)?t:String(t)}function c(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return p(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},f(e)}function p(e,t,r){return p=d()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&h(o,r.prototype),o},p.apply(null,arguments)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}var g=r(537).inspect,v=r(9597).codes.ERR_INVALID_ARG_TYPE;function b(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var w="",S="",E="",T="",k={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function O(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function A(e){return g(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function _(e,t,r){var o="",i="",a=0,s="",u=!1,c=A(e),l=c.split("\n"),f=A(t).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===f.length&&l[0]!==f[0]){var h=l[0].length+f[0].length;if(h<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(k[r],"\n\n")+"".concat(l[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&h<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][p]===f[0][p];)p++;p>2&&(d="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",p),"^"),p=0)}}for(var y=l[l.length-1],g=f[f.length-1];y===g&&(p++<2?s="\n ".concat(y).concat(s):o=y,l.pop(),f.pop(),0!==l.length&&0!==f.length);)y=l[l.length-1],g=f[f.length-1];var v=Math.max(l.length,f.length);if(0===v){var O=c.split("\n");if(O.length>30)for(O[26]="".concat(w,"...").concat(T);O.length>27;)O.pop();return"".concat(k.notIdentical,"\n\n").concat(O.join("\n"),"\n")}p>3&&(s="\n".concat(w,"...").concat(T).concat(s),u=!0),""!==o&&(s="\n ".concat(o).concat(s),o="");var _=0,x=k[r]+"\n".concat(S,"+ actual").concat(T," ").concat(E,"- expected").concat(T),P=" ".concat(w,"...").concat(T," Lines skipped");for(p=0;p<v;p++){var I=p-a;if(l.length<p+1)I>1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(T),u=!0):I>3&&(i+="\n ".concat(f[p-2]),_++),i+="\n ".concat(f[p-1]),_++),a=p,o+="\n".concat(E,"-").concat(T," ").concat(f[p]),_++;else if(f.length<p+1)I>1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(T),u=!0):I>3&&(i+="\n ".concat(l[p-2]),_++),i+="\n ".concat(l[p-1]),_++),a=p,i+="\n".concat(S,"+").concat(T," ").concat(l[p]),_++;else{var R=f[p],B=l[p],C=B!==R&&(!b(B,",")||B.slice(0,-1)!==R);C&&b(R,",")&&R.slice(0,-1)===B&&(C=!1,B+=","),C?(I>1&&p>2&&(I>4?(i+="\n".concat(w,"...").concat(T),u=!0):I>3&&(i+="\n ".concat(l[p-2]),_++),i+="\n ".concat(l[p-1]),_++),a=p,i+="\n".concat(S,"+").concat(T," ").concat(B),o+="\n".concat(E,"-").concat(T," ").concat(R),_+=2):(i+=o,o="",1!==I&&0!==p||(i+="\n ".concat(B),_++))}if(_>20&&p<v-2)return"".concat(x).concat(P,"\n").concat(i,"\n").concat(w,"...").concat(T).concat(o,"\n")+"".concat(w,"...").concat(T)}return"".concat(x).concat(u?P:"","\n").concat(i).concat(o).concat(s).concat(d)}var x=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(p,e);var r,o,a,u,f=(r=p,o=d(),function(){var e,t=y(r);if(o){var n=y(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return c(this,e)});function p(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),"object"!==m(e)||null===e)throw new v("options","Object",e);var r=e.message,o=e.operator,i=e.stackStartFn,a=e.actual,s=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(w="\x1b[34m",S="\x1b[32m",T="\x1b[39m",E="\x1b[31m"):(w="",S="",T="",E="")),"object"===m(a)&&null!==a&&"object"===m(s)&&null!==s&&"stack"in a&&a instanceof Error&&"stack"in s&&s instanceof Error&&(a=O(a),s=O(s)),"deepStrictEqual"===o||"strictEqual"===o)t=f.call(this,_(a,s,o));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var d=k[o],h=A(a).split("\n");if("notStrictEqual"===o&&"object"===m(a)&&null!==a&&(d=k.notStrictEqualObject),h.length>30)for(h[26]="".concat(w,"...").concat(T);h.length>27;)h.pop();t=1===h.length?f.call(this,"".concat(d," ").concat(h[0])):f.call(this,"".concat(d,"\n\n").concat(h.join("\n"),"\n"))}else{var y=A(a),g="",b=k[o];"notDeepEqual"===o||"notEqual"===o?(y="".concat(k[o],"\n\n").concat(y)).length>1024&&(y="".concat(y.slice(0,1021),"...")):(g="".concat(A(s)),y.length>512&&(y="".concat(y.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===o||"equal"===o?y="".concat(b,"\n\n").concat(y,"\n\nshould equal\n\n"):g=" ".concat(o," ").concat(g)),t=f.call(this,"".concat(y).concat(g))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(l(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=a,t.expected=s,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(l(t),i),t.stack,t.name="AssertionError",c(t)}return a=p,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return g(this,i(i({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,u),Object.defineProperty(a,"prototype",{writable:!1}),p}(f(Error),g.custom);e.exports=x},4035:(e,t,r)=>{"use strict";var n,o=r(6556),i=r(9092)(),a=r(9957),s=r(5795);if(i){var u=o("RegExp.prototype.exec"),c={},l=function(){throw c},f={toString:l,valueOf:l};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=l),n=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!t||!a(t,"value"))return!1;try{u(e,f)}catch(e){return e===c}}}else{var p=o("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===p(e)}}e.exports=n},4039:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},4107:(e,t,r)=>{"use strict";var n=r(6698),o=r(392),i=r(2861).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function p(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function h(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}n(u,o),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,u=0|this._f,y=0|this._g,m=0|this._h,g=0;g<16;++g)t[g]=e.readInt32BE(4*g);for(;g<64;++g)t[g]=h(t[g-2])+t[g-7]+d(t[g-15])+t[g-16]|0;for(var v=0;v<64;++v){var b=m+p(s)+c(s,u,y)+a[v]+t[v]|0,w=f(r)+l(r,n,o)|0;m=y,y=u,u=s,s=i+b|0,i=o,o=n,n=r,r=b+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0,this._f=u+this._f|0,this._g=y+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},4133:(e,t,r)=>{"use strict";var n=r(487),o=r(8452),i=r(3003),a=r(6642),s=r(2464),u=n(a(),Number);o(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},4148:(e,t,r)=>{"use strict";var n=r(5606),o=r(6763);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e){if("object"!==i(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}var u,c,l=r(9597).codes,f=l.ERR_AMBIGUOUS_ARGUMENT,p=l.ERR_INVALID_ARG_TYPE,d=l.ERR_INVALID_ARG_VALUE,h=l.ERR_INVALID_RETURN_VALUE,y=l.ERR_MISSING_ARGS,m=r(3918),g=r(537).inspect,v=r(537).types,b=v.isPromise,w=v.isRegExp,S=r(9133)(),E=r(9394)(),T=r(8075)("RegExp.prototype.test");function k(){var e=r(2299);u=e.isDeepEqual,c=e.isDeepStrictEqual}new Map;var O=!1,A=e.exports=I,_={};function x(e){if(e.message instanceof Error)throw e.message;throw new m(e)}function P(e,t,r,n){if(!r){var o=!1;if(0===t)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var i=new m({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw i.generatedMessage=o,i}}function I(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];P.apply(void 0,[I,t.length].concat(t))}A.fail=function e(t,r,i,a,s){var u,c=arguments.length;if(0===c?u="Failed":1===c?(i=t,t=void 0):(!1===O&&(O=!0,(n.emitWarning?n.emitWarning:o.warn.bind(o))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===c&&(a="!=")),i instanceof Error)throw i;var l={actual:t,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||e};void 0!==i&&(l.message=i);var f=new m(l);throw u&&(f.message=u,f.generatedMessage=!0),f},A.AssertionError=m,A.ok=I,A.equal=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");t!=r&&x({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},A.notEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");t==r&&x({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},A.deepEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===u&&k(),u(t,r)||x({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},A.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===u&&k(),u(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},A.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===u&&k(),c(t,r)||x({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},A.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===u&&k(),c(t,r)&&x({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},A.strictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");E(t,r)||x({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},A.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");E(t,r)&&x({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var R=function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&w(t[e])&&T(t[e],n[e])?o[e]=n[e]:o[e]=t[e])})});function B(e,t,r,n){if("function"!=typeof t){if(w(t))return T(t,e);if(2===arguments.length)throw new p("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var o=new m({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new d("error",t,"may not be an empty object");return void 0===u&&k(),a.forEach(function(o){"string"==typeof e[o]&&w(t[o])&&T(t[o],e[o])||function(e,t,r,n,o,i){if(!(r in e)||!c(e[r],t[r])){if(!n){var a=new R(e,o),s=new R(t,o,e),u=new m({actual:a,expected:s,operator:"deepStrictEqual",stackStartFn:i});throw u.actual=e,u.expected=t,u.operator=i.name,u}x({actual:e,expected:t,message:n,operator:i.name,stackStartFn:i})}}(e,t,o,r,a,n)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function C(e){if("function"!=typeof e)throw new p("fn","Function",e);try{e()}catch(e){return e}return _}function j(e){return b(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function U(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!j(t=e()))throw new h("instance of Promise","promiseFn",t)}else{if(!j(e))throw new p("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return _}).catch(function(e){return e})})}function N(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new p("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new f("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new f("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new p("error",["Object","Error","Function","RegExp"],r);if(t===_){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";x({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(o),stackStartFn:e})}if(r&&!B(t,r,n,e))throw t}function L(e,t,r,n){if(t!==_){if("string"==typeof r&&(n=r,r=void 0),!r||B(t,r)){var o=n?": ".concat(n):".",i="doesNotReject"===e.name?"rejection":"exception";x({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function D(e,t,r,n,o){if(!w(t))throw new p("regexp","RegExp",t);var a="match"===o;if("string"!=typeof e||T(t,e)!==a){if(r instanceof Error)throw r;var s=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(i(e)," (").concat(g(e),")"):(a?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(g(t),". Input:\n\n").concat(g(e),"\n"));var u=new m({actual:e,expected:t,message:r,operator:o,stackStartFn:n});throw u.generatedMessage=s,u}}function F(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];P.apply(void 0,[F,t.length].concat(t))}A.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];N.apply(void 0,[e,C(t)].concat(n))},A.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return U(t).then(function(t){return N.apply(void 0,[e,t].concat(n))})},A.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];L.apply(void 0,[e,C(t)].concat(n))},A.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return U(t).then(function(t){return L.apply(void 0,[e,t].concat(n))})},A.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=g(t);var n=new m({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var a=o.split("\n");a.shift();for(var s=n.stack.split("\n"),u=0;u<a.length;u++){var c=s.indexOf(a[u]);if(-1!==c){s=s.slice(0,c);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},A.match=function e(t,r,n){D(t,r,n,e,"match")},A.doesNotMatch=function e(t,r,n){D(t,r,n,e,"doesNotMatch")},A.strict=S(F,A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict},4372:(e,t,r)=>{"use strict";var n=r(9675),o=r(6556)("TypedArray.prototype.buffer",!0),i=r(5680);e.exports=o||function(e){if(!i(e))throw new n("Not a Typed Array");return e.buffer}},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4634:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},5345:e=>{"use strict";e.exports=URIError},5360:(e,t)=>{"use strict";var r=function(e,t){return t||(t={}),e.split("").forEach(function(e,r){e in t||(t[e]=r)}),t},n={alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",charmap:{0:14,1:8}};n.charmap=r(n.alphabet,n.charmap);var o={alphabet:"0123456789ABCDEFGHJKMNPQRSTVWXYZ",charmap:{O:0,I:1,L:1}};o.charmap=r(o.alphabet,o.charmap);var i={alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",charmap:{}};function a(e){if(this.buf=[],this.shift=8,this.carry=0,e){switch(e.type){case"rfc4648":this.charmap=t.rfc4648.charmap;break;case"crockford":this.charmap=t.crockford.charmap;break;case"base32hex":this.charmap=t.base32hex.charmap;break;default:throw new Error("invalid type")}e.charmap&&(this.charmap=e.charmap)}}function s(e){if(this.buf="",this.shift=3,this.carry=0,e){switch(e.type){case"rfc4648":this.alphabet=t.rfc4648.alphabet;break;case"crockford":this.alphabet=t.crockford.alphabet;break;case"base32hex":this.alphabet=t.base32hex.alphabet;break;default:throw new Error("invalid type")}e.alphabet?this.alphabet=e.alphabet:e.lc&&(this.alphabet=this.alphabet.toLowerCase())}}i.charmap=r(i.alphabet,i.charmap),a.prototype.charmap=n.charmap,a.prototype.write=function(e){var t=this.charmap,r=this.buf,n=this.shift,o=this.carry;return e.toUpperCase().split("").forEach(function(e){if("="!=e){var i=255&t[e];(n-=5)>0?o|=i<<n:n<0?(r.push(o|i>>-n),o=i<<(n+=8)&255):(r.push(o|i),n=8,o=0)}}),this.shift=n,this.carry=o,this},a.prototype.finalize=function(e){return e&&this.write(e),8!==this.shift&&0!==this.carry&&(this.buf.push(this.carry),this.shift=8,this.carry=0),this.buf},s.prototype.alphabet=n.alphabet,s.prototype.write=function(e){var t,r,n,o=this.shift,i=this.carry;for(n=0;n<e.length;n++)t=i|(r=e[n])>>o,this.buf+=this.alphabet[31&t],o>5&&(t=r>>(o-=5),this.buf+=this.alphabet[31&t]),i=r<<(o=5-o),o=8-o;return this.shift=o,this.carry=i,this},s.prototype.finalize=function(e){return e&&this.write(e),3!==this.shift&&(this.buf+=this.alphabet[31&this.carry],this.shift=3,this.carry=0),this.buf},t.encode=function(e,t){return new s(t).finalize(e)},t.decode=function(e,t){return new a(t).finalize(e)},t.Decoder=a,t.Encoder=s,t.charmap=r,t.crockford=o,t.rfc4648=n,t.base32hex=i},5377:(e,t,r)=>{"use strict";var n=r(2861).Buffer,o=r(4634),i=r(4372),a=ArrayBuffer.isView||function(e){try{return i(e),!0}catch(e){return!1}},s="undefined"!=typeof Uint8Array,u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,c=u&&(n.prototype instanceof Uint8Array||n.TYPED_ARRAY_SUPPORT);e.exports=function(e,t){if(e instanceof n)return e;if("string"==typeof e)return n.from(e,t);if(u&&a(e)){if(0===e.byteLength)return n.alloc(0);if(c){var r=n.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}var i=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l=n.from(i);if(l.length===e.byteLength)return l}if(s&&e instanceof Uint8Array)return n.from(e);var f=o(e);if(f)for(var p=0;p<e.length;p+=1){var d=e[p];if("number"!=typeof d||d<0||d>255||~~d!==d)throw new RangeError("Array items must be numbers in the range 0-255.")}if(f||n.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return n.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}},5606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&p())}function p(){if(!c){var e=a(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function h(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5680:(e,t,r)=>{"use strict";var n=r(5767);e.exports=function(e){return!!n(e)}},5767:(e,t,r)=>{"use strict";var n=r(2682),o=r(9209),i=r(487),a=r(6556),s=r(5795),u=r(3628),c=a("Object.prototype.toString"),l=r(9092)(),f="undefined"==typeof globalThis?r.g:globalThis,p=o(),d=a("String.prototype.slice"),h=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},y={__proto__:null};n(p,l&&s&&u?function(e){var t=new f[e];if(Symbol.toStringTag in t&&u){var r=u(t),n=s(r,Symbol.toStringTag);if(!n&&r){var o=u(r);n=s(o,Symbol.toStringTag)}y["$"+e]=i(n.get)}}:function(e){var t=new f[e],r=t.slice||t.set;r&&(y["$"+e]=i(r))}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!l){var t=d(c(e),8,-1);return h(p,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(y,function(r,n){if(!t)try{r(e),t=d(n,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return n(y,function(r,n){if(!t)try{"$"+r(e)===n&&(t=d(n,1))}catch(e){}}),t}(e):null}},5795:(e,t,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},5880:e=>{"use strict";e.exports=Math.pow},6188:e=>{"use strict";e.exports=Math.max},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,r)=>{"use strict";var n=r(453),o=r(3126),i=o([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o([r]):r}},6576:(e,t,r)=>{"use strict";var n=r(9394),o=r(8452);e.exports=function(){var e=n();return o(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6578:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},6642:(e,t,r)=>{"use strict";var n=r(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6710:(e,t,r)=>{"use strict";var n=r(6698),o=r(4107),i=r(392),a=r(2861).Buffer,s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}n(u,o),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},6743:(e,t,r)=>{"use strict";var n=r(9353);e.exports=Function.prototype.bind||n},6763:(e,t,r)=>{var n=r(537),o=r(4148);function i(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(e){u[e]=i()},"time"],[function(e){var t=u[e];if(!t)throw new Error("No such label: "+e);delete u[e];var r=i()-t;a.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),a.error(e.stack)},"trace"],[function(e){a.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=s.call(arguments,1);o.ok(!1,n.format.apply(null,t))}},"assert"]],l=0;l<c.length;l++){var f=c[l],p=f[0],d=f[1];a[d]||(a[d]=p)}e.exports=a},6897:(e,t,r)=>{"use strict";var n=r(453),o=r(41),i=r(592)(),a=r(5795),s=r(9675),u=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&a){var l=a(e,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(c=!1)}return(n||c||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(e,t,r)=>{"use strict";var n,o=r(3126),i=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!n&&i&&i(Object.prototype,"__proto__"),s=Object,u=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof u&&function(e){return u(null==e?e:s(e))}},7244:(e,t,r)=>{"use strict";var n=r(9092)(),o=r(6556)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},a=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"callee"in e&&"[object Function]"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(c(e,s,s+a>u?u:s+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(u(n));return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7653:(e,t,r)=>{"use strict";var n=r(8452),o=r(487),i=r(9211),a=r(9394),s=r(6576),u=o(a(),Object);n(u,{getPolyfill:a,implementation:i,shim:s}),e.exports=u},7816:(e,t,r)=>{"use strict";var n=r(6698),o=r(392),i=r(2861).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,o.call(this,64,56)}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,o),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,o=0|this._c,i=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var p=0;p<80;++p){var d=~~(p/20),h=c(r)+f(d,n,o,i)+s+t[p]+a[d]|0;s=i,i=o,o=l(n),n=r,r=h}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=i+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},8002:e=>{"use strict";e.exports=Math.min},8068:e=>{"use strict";e.exports=SyntaxError},8075:(e,t,r)=>{"use strict";var n=r(453),o=r(487),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},8184:(e,t,r)=>{"use strict";var n,o=r(6556),i=r(9721)(/^\s*(?:function)?\*/),a=r(9092)(),s=r(3628),u=o("Object.prototype.toString"),c=o("Function.prototype.toString");e.exports=function(e){if("function"!=typeof e)return!1;if(i(c(e)))return!0;if(!a)return"[object GeneratorFunction]"===u(e);if(!s)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&s(t)}return s(e)===n}},8287:(e,t,r)=>{"use strict";var n=r(6763);const o=r(7526),i=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=u(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const o=function(e){if(c.isBuffer(e)){const t=0|y(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Z(e.length)?u(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function p(e){return f(e),u(e<0?0:0|y(e))}function d(e){const t=e.length<0?0:0|y(e.length),r=u(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function y(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(o)return n?-1:$(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function S(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Z(n))return a;e[r+a]=n}return a}function E(e,t,r,n){return W($(t,e.length-r),e,r,n)}function T(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return W(G(t),e,r,n)}function O(e,t,r,n){return W(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,r))}function _(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},c.allocUnsafe=function(e){return p(e)},c.allocUnsafeSlow=function(e){return p(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},c.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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))o+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?_(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,o){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(n,o),l=e.slice(t,r);for(let e=0;e<s;++e)if(u[e]!==l[e]){i=u[e],a=l[e];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function P(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function R(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=Y[e[n]];return o}function B(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function U(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function N(e,t,r,n,o){H(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function L(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),c.prototype.readBigUInt64BE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=J(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=J(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=J(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=J(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=J(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=c.isBuffer(e)?e:c.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const M={};function V(e,t,r){M[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,o,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let o;throw o=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,o,i)}function z(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}V("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),V("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=q(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=q(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function $(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return o.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function J(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},8403:(e,t,r)=>{"use strict";var n=r(1189),o=r(1333)(),i=r(6556),a=r(9612),s=i("Array.prototype.push"),u=i("Object.prototype.propertyIsEnumerable"),c=o?a.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=a(e);if(1===arguments.length)return r;for(var i=1;i<arguments.length;++i){var l=a(arguments[i]),f=n(l),p=o&&(a.getOwnPropertySymbols||c);if(p)for(var d=p(l),h=0;h<d.length;++h){var y=d[h];u(l,y)&&s(f,y)}for(var m=0;m<f.length;++m){var g=f[m];if(u(l,g)){var v=l[g];r[g]=v}}}return r}},8452:(e,t,r)=>{"use strict";var n=r(1189),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(41),u=r(592)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(e,t,r,!0):s(e,t,r)},l=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)c(e,i[s],t[i[s]],r[i[s]])};l.supportsDescriptors=!!u,e.exports=l},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8875:(e,t,r)=>{"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(1093),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!p["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=a(e),s=t&&"[object String]"===i.call(e),p=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var h=c&&r;if(s&&e.length>0&&!o.call(e,0))for(var y=0;y<e.length;++y)p.push(String(y));if(n&&e.length>0)for(var m=0;m<e.length;++m)p.push(String(m));else for(var g in e)h&&"prototype"===g||!o.call(e,g)||p.push(String(g));if(u)for(var v=function(e){if("undefined"==typeof window||!d)return f(e);try{return f(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)v&&"constructor"===l[b]||!o.call(e,l[b])||p.push(l[b]);return p}}e.exports=n},8968:e=>{"use strict";e.exports=Math.floor},9032:(e,t,r)=>{"use strict";var n=r(7244),o=r(8184),i=r(5767),a=r(5680);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),f=s(Number.prototype.valueOf),p=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(u)var h=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function m(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===l(e)}function v(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function w(e){return"[object WeakSet]"===l(e)}function S(e){return"[object ArrayBuffer]"===l(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(S.working?S(e):e instanceof ArrayBuffer)}function T(e){return"[object DataView]"===l(e)}function k(e){return"undefined"!=typeof DataView&&(T.working?T(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||k(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},S.working="undefined"!=typeof ArrayBuffer&&S(new ArrayBuffer),t.isArrayBuffer=E,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=k;var O="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===l(e)}function _(e){return void 0!==O&&(void 0===A.working&&(A.working=A(new O)),A.working?A(e):e instanceof O)}function x(e){return m(e,f)}function P(e){return m(e,p)}function I(e){return m(e,d)}function R(e){return u&&m(e,h)}function B(e){return c&&m(e,y)}t.isSharedArrayBuffer=_,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=x,t.isStringObject=P,t.isBooleanObject=I,t.isBigIntObject=R,t.isSymbolObject=B,t.isBoxedPrimitive=function(e){return x(e)||P(e)||I(e)||R(e)||B(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||_(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},9092:(e,t,r)=>{"use strict";var n=r(1333);e.exports=function(){return n()&&!!Symbol.toStringTag}},9133:(e,t,r)=>{"use strict";var n=r(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var o=Object.assign({},r),i="";for(var a in o)i+=a;return e!==i}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},9209:(e,t,r)=>{"use strict";var n=r(6578),o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof o[n[t]]&&(e[e.length]=n[t]);return e}},9211:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},9290:e=>{"use strict";e.exports=RangeError},9353:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),s=r(0,o.length-a.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(u)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,n(a,arguments));return Object(t)===t?t:this}return o.apply(e,n(a,arguments))}),o.prototype){var l=function(){};l.prototype=o.prototype,i.prototype=new l,l.prototype=null}return i}},9383:e=>{"use strict";e.exports=Error},9394:(e,t,r)=>{"use strict";var n=r(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9538:e=>{"use strict";e.exports=ReferenceError},9597:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function i(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,o=a(e);if(t){var i=a(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}var s,u,c={};function l(e,t,r){r||(r=Error);var n=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(s,r);var n,a=i(s);function s(r,n,o){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i=a.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,o)),i.code=e,i}return n=s,Object.defineProperty(n,"prototype",{writable:!1}),n}(r);c[e]=n}function f(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(e,t,o){var i,a,u;if(void 0===s&&(s=r(4148)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,4)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))u="The ".concat(e," ").concat(i," ").concat(f(t,"type"));else{var c=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+1>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";u='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(f(t,"type"))}return u+". Received type ".concat(n(o))},TypeError),l("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(537));var o=u.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)},TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(4148)),s(t.length>0,"At least one arg needs to be specified");var o="The ",i=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),i){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,i-1).join(", "),o+=", and ".concat(t[i-1]," arguments")}return"".concat(o," must be specified")},TypeError),e.exports.codes=c},9600:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},9612:e=>{"use strict";e.exports=Object},9675:e=>{"use strict";e.exports=TypeError},9721:(e,t,r)=>{"use strict";var n=r(6556),o=r(4035),i=n("RegExp.prototype.exec"),a=r(9675);e.exports=function(e){if(!o(e))throw new a("`regex` must be a RegExp");return function(t){return null!==i(e,t)}}},9957:(e,t,r)=>{"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(6743);e.exports=i.call(n,o)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(448)})(),e.exports=t()},976:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function a(e,t,r){return t=l(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,r||[],l(e).constructor):t.apply(e,r))}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(u())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&c(o,r.prototype),o}(e,arguments,l(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)},s(e)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}r.d(t,{Cu:()=>z,v7:()=>_,nS:()=>U,Dr:()=>f,m_:()=>b});var f=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=(this instanceof t?this.constructor:void 0).prototype;return(n=a(this,t,[e])).__proto__=o,n.constructor=t,n.response=r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),r=t,(n=[{key:"getResponse",value:function(){return this.response}}])&&o(r.prototype,n),i&&o(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(s(Error));function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function d(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function h(e){var t=function(e,t){if("object"!=p(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==p(t)?t:t+""}function y(e,t,r){return t=g(t),function(e,t){if(t&&("object"==p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,m()?Reflect.construct(t,r||[],g(e).constructor):t.apply(e,r))}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}var b=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=(this instanceof t?this.constructor:void 0).prototype;return(n=y(this,t,[e,r])).__proto__=o,n.constructor=t,n.name="NotFoundError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(t,e),r=t,n&&d(r.prototype,n),o&&d(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(f);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function S(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,E(n.key),n)}}function E(e){var t=function(e,t){if("object"!=w(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==w(t)?t:t+""}function T(e,t,r){return t=O(t),function(e,t){if(t&&("object"==w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,k()?Reflect.construct(t,r||[],O(e).constructor):t.apply(e,r))}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}var _=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=(this instanceof t?this.constructor:void 0).prototype;return(n=T(this,t,[e,r])).__proto__=o,n.constructor=t,n.name="BadRequestError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(t,e),r=t,n&&S(r.prototype,n),o&&S(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(f);function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function P(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,I(n.key),n)}}function I(e){var t=function(e,t){if("object"!=x(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==x(t)?t:t+""}function R(e,t,r){return t=C(t),function(e,t){if(t&&("object"==x(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,B()?Reflect.construct(t,r||[],C(e).constructor):t.apply(e,r))}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}var U=function(e){function t(e,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=(this instanceof t?this.constructor:void 0).prototype;return(n=R(this,t,[e,r])).__proto__=o,n.constructor=t,n.name="BadResponseError",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}(t,e),r=t,n&&P(r.prototype,n),o&&P(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(f);function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function L(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,D(n.key),n)}}function D(e){var t=function(e,t){if("object"!=N(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==N(t)?t:t+""}function F(e,t,r){return t=H(t),function(e,t){if(t&&("object"==N(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,V()?Reflect.construct(t,r||[],H(e).constructor):t.apply(e,r))}function M(e){var t="function"==typeof Map?new Map:void 0;return M=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(V())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&q(o,r.prototype),o}(e,arguments,H(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),q(r,e)},M(e)}function V(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(V=function(){return!!e})()}function q(e,t){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},q(e,t)}function H(e){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},H(e)}var z=function(e){function t(e,r,n){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=(this instanceof t?this.constructor:void 0).prototype;return(o=F(this,t,[e])).__proto__=i,o.constructor=t,o.name="AccountRequiresMemoError",o.accountId=r,o.operationIndex=n,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&q(e,t)}(t,e),r=t,n&&L(r.prototype,n),o&&L(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(M(Error))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(924)})());