@ultrade/shared 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/constants/index.js +1 -1
- package/dist/browser/helpers/assert.helper.js +1 -1
- package/dist/browser/helpers/atomic.helper.js +1 -1
- package/dist/browser/helpers/balance.helper.js +1 -1
- package/dist/browser/helpers/codex/common.helper.js +1 -1
- package/dist/browser/helpers/codex/index.js +1 -1
- package/dist/browser/helpers/codex/mbr.helper.js +1 -1
- package/dist/browser/helpers/codex/mna.helper.js +1 -1
- package/dist/browser/helpers/codex/order.helper.js +1 -1
- package/dist/browser/helpers/codex/setGlobal.helper.js +1 -1
- package/dist/browser/helpers/codex/transfer.helper.js +2 -2
- package/dist/browser/helpers/codex/txn.helper.js +1 -1
- package/dist/browser/helpers/codex.helper.js +4 -4
- package/dist/browser/helpers/eth.helper.js +1 -1
- package/dist/browser/helpers/index.js +1 -1
- package/dist/browser/helpers/pointSystem.helper.js +1 -1
- package/dist/browser/types/index.js +1 -1
- package/dist/node/constants/index.js +1 -1
- package/dist/node/helpers/algo.helper.js +1 -1
- package/dist/node/helpers/assert.helper.js +1 -1
- package/dist/node/helpers/atomic.helper.js +1 -1
- package/dist/node/helpers/balance.helper.js +1 -1
- package/dist/node/helpers/codex/common.helper.js +1 -1
- package/dist/node/helpers/codex/index.js +2 -2
- package/dist/node/helpers/codex/mbr.helper.js +1 -1
- package/dist/node/helpers/codex/mna.helper.js +1 -1
- package/dist/node/helpers/codex/transfer.helper.js +2 -2
- package/dist/node/helpers/codex/txn.helper.js +1 -1
- package/dist/node/helpers/codex.helper.js +6 -6
- package/dist/node/helpers/eth.helper.js +1 -1
- package/dist/node/helpers/index.js +1 -1
- package/dist/node/helpers/pointSystem.helper.js +1 -1
- package/dist/node/helpers/withdraw.helper.js +2 -2
- package/dist/node/types/index.js +1 -1
- package/dist/{types → src/types}/settings.type.d.ts +39 -3
- package/package.json +6 -39
- /package/dist/{common → src/common}/auth.helper.d.ts +0 -0
- /package/dist/{common → src/common}/big-number.helper.d.ts +0 -0
- /package/dist/{common → src/common}/index.d.ts +0 -0
- /package/dist/{common → src/common}/mappers/codexAsset.mapper.d.ts +0 -0
- /package/dist/{common → src/common}/mappers/codexBalance.mapper.d.ts +0 -0
- /package/dist/{common → src/common}/mappers/index.d.ts +0 -0
- /package/dist/{common → src/common}/mappers/trade.mapper.d.ts +0 -0
- /package/dist/{common → src/common}/utils/assert.d.ts +0 -0
- /package/dist/{common → src/common}/utils/decode.d.ts +0 -0
- /package/dist/{common → src/common}/utils/index.d.ts +0 -0
- /package/dist/{common → src/common}/utils/social.d.ts +0 -0
- /package/dist/{common → src/common}/utils/stat.d.ts +0 -0
- /package/dist/{constants → src/constants}/auth.d.ts +0 -0
- /package/dist/{constants → src/constants}/cctp.d.ts +0 -0
- /package/dist/{constants → src/constants}/codex.d.ts +0 -0
- /package/dist/{constants → src/constants}/frontend.d.ts +0 -0
- /package/dist/{constants → src/constants}/index.d.ts +0 -0
- /package/dist/{constants → src/constants}/response.d.ts +0 -0
- /package/dist/{constants → src/constants}/settings.d.ts +0 -0
- /package/dist/{constants → src/constants}/withdrawalWalletsMessage.d.ts +0 -0
- /package/dist/{enums → src/enums}/chains.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/account/index.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/affiliate.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/available-pair-settings.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/common.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/component/index.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/index.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/market-maker.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/notification-center/userNotification.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/order-side.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/order-status.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/order-type.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/relayer.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/setting-type.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/social-action.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/social-prompt.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/social.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/state-type.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/trade.enums.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/tradingKeyType.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/upgrade.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/db/withdrawal-wallet.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/index.d.ts +0 -0
- /package/dist/{enums → src/enums}/maintenanceMode.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/notification.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/rabbitMq.d.ts +0 -0
- /package/dist/{enums → src/enums}/settings.enum.d.ts +0 -0
- /package/dist/{enums → src/enums}/social.enum.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/Encoding.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/algo.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/assert.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/atomic.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/balance.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/common.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/index.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/mbr.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/mna.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/order.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/setGlobal.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/transfer.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex/txn.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/codex.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/eth.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/index.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/interval.helpers.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/liquidity.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/order.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/pair.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/pointSystem.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/ticker.helpers.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/vaa.helper.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/withdraw.helper.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/accountInfo.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/api/affiliate.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/api/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/cache.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/baseModel.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/hummingbot/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/market/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/marketing/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/notification_center/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/relayer/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/social/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/softDeleteModel.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/white_label/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/db/withdrawal_wallets/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/dto/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/emailService.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/kmsService.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/last-look-trade.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/market.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/order.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/pagination.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/pair.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/query.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/accountCache.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/algod.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/balances.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/coin-market-cap.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/index.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/price-model.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/price-service.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/socialActivity.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/services/tmc.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/settings.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/streaming.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/timestream.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/trading.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/tradingKey.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/transfer.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/wallet.interface.d.ts +0 -0
- /package/dist/{interfaces → src/interfaces}/withdrawalWallets.interface.d.ts +0 -0
- /package/dist/{types → src/types}/algo-order.type.d.ts +0 -0
- /package/dist/{types → src/types}/amm/amm.d.ts +0 -0
- /package/dist/{types → src/types}/api/request.types.d.ts +0 -0
- /package/dist/{types → src/types}/codex.types.d.ts +0 -0
- /package/dist/{types → src/types}/hummingbots.types.d.ts +0 -0
- /package/dist/{types → src/types}/index.d.ts +0 -0
- /package/dist/{types → src/types}/notification.type.d.ts +0 -0
- /package/dist/{types → src/types}/state.type.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function Er(){throw new Error("setTimeout has not been defined")}function br(){throw new Error("clearTimeout has not been defined")}var C=Er,P=br;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function Ar(t){if(C===setTimeout)return setTimeout(t,0);if((C===Er||!C)&&setTimeout)return C=setTimeout,setTimeout(t,0);try{return C(t,0)}catch{try{return C.call(null,t,0)}catch{return C.call(this,t,0)}}}function ue(t){if(P===clearTimeout)return clearTimeout(t);if((P===br||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var O=[],K=!1,U,V=-1;function pe(){!K||!U||(K=!1,U.length?O=U.concat(O):V=-1,O.length&&Tr())}function Tr(){if(!K){var t=Ar(pe);K=!0;for(var r=O.length;r;){for(U=O,O=[];++V<r;)U&&U[V].run();V=-1,r=O.length}U=null,K=!1,ue(t)}}function le(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];O.push(new _r(t,r)),O.length===1&&!K&&Ar(Tr)}function _r(t,r){this.fun=t,this.array=r}_r.prototype.run=function(){this.fun.apply(null,this.array)};var me="browser",de="browser",fe=!0,ge={},he=[],xe="",Ee={},be={},Ae={};function L(){}var Te=L,_e=L,ye=L,Ie=L,Re=L,we=L,Ne=L;function Se(t){throw new Error("process.binding is not supported")}function Oe(){return"/"}function Be(t){throw new Error("process.chdir is not supported")}function De(){return 0}var G=globalThis.performance||{},Ce=G.now||G.mozNow||G.msNow||G.oNow||G.webkitNow||function(){return new Date().getTime()};function Pe(t){var r=Ce.call(G)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var ke=new Date;function Ue(){var t=new Date,r=t-ke;return r/1e3}var l={nextTick:le,title:me,browser:fe,env:ge,argv:he,version:xe,versions:Ee,on:Te,addListener:_e,once:ye,off:Ie,removeListener:Re,removeAllListeners:we,emit:Ne,binding:Se,cwd:Oe,chdir:Be,umask:De,hrtime:Pe,platform:de,release:be,config:Ae,uptime:Ue},xr={};Object.keys(xr).forEach(t=>{let r=t.split("."),e=l;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=xr[t]:e=e[o]||(e[o]={})}});var I=[],_=[],Le=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function wr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)I[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Me(t){cr||wr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Le(c*3/4-i),n=i>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[u++]=o>>16&255,a[u++]=o>>8&255,a[u++]=o&255;return i===2?(o=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[u++]=o&255):i===1&&(o=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[u++]=o>>8&255,a[u++]=o&255),a}function ve(t){return I[t>>18&63]+I[t>>12&63]+I[t>>6&63]+I[t&63]}function Fe(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ve(n));return o.join("")}function yr(t){cr||wr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,u=e-n;c<u;c+=a)i.push(Fe(t,c,c+a>u?u:c+a));return n===1?(r=t[e-1],o+=I[r>>2],o+=I[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=I[r>>10],o+=I[r>>4&63],o+=I[r<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function $(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if($()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Nr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Nr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Ke(t,r,e,n):typeof r=="string"?Ge(t,r,e):We(t,r)}s.from=function(t,r,e){return Nr(null,t,r,e)};s.kMaxLength=$();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Sr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ye(t,r,e,n){return Sr(r),r<=0?B(t,r):e!==void 0?typeof n=="string"?B(t,r).fill(e,n):B(t,r).fill(e):B(t,r)}s.alloc=function(t,r,e){return Ye(null,t,r,e)};function ur(t,r){if(Sr(r),t=B(t,r<0?0:pr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ur(null,t)};s.allocUnsafeSlow=function(t){return ur(null,t)};function Ge(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Or(r,e)|0;t=B(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ke(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=sr(t,r),t}function We(t,r){if(R(r)){var e=pr(r.length)|0;return t=B(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ct(r.length)?B(t,0):sr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=$())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$().toString(16)+" bytes");return t|0}s.isBuffer=ut;function R(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!R(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Or(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Lr(t).length;default:if(n)return X(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=Or;function He(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return rt(this,r,e);case"utf8":case"utf-8":return Cr(this,r,e);case"ascii":return Qe(this,r,e);case"latin1":case"binary":return Ze(this,r,e);case"base64":return Je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Cr(this,0,r):He.apply(this,arguments)};s.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,i){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,u=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<u;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Br(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),R(r))return r.length===0?-1:Ir(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Ir(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Ir(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function u(g,b){return i===1?g[b]:g.readUInt16BE(b*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(u(t,d)===u(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(u(t,d+h)!==u(r,h)){m=!1;break}if(m)return d}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Br(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Br(this,r,e,n,!1)};function Ve(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function $e(t,r,e,n){return J(X(r,t.length-e),t,e,n)}function Dr(t,r,e,n){return J(at(r),t,e,n)}function Xe(t,r,e,n){return Dr(t,r,e,n)}function ze(t,r,e,n){return J(Lr(r),t,e,n)}function qe(t,r,e,n){return J(st(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Ve(this,r,e,n);case"utf8":case"utf-8":return $e(this,r,e,n);case"ascii":return Dr(this,r,e,n);case"latin1":case"binary":return Xe(this,r,e,n);case"base64":return ze(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Je(t,r,e){return r===0&&e===t.length?yr(t):yr(t.slice(r,e))}function Cr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var u,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:u=t[o+1],(u&192)===128&&(m=(i&31)<<6|u&63,m>127&&(a=m));break;case 3:u=t[o+1],d=t[o+2],(u&192)===128&&(d&192)===128&&(m=(i&15)<<12|(u&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:u=t[o+1],d=t[o+2],f=t[o+3],(u&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(u&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return je(n)}var Rr=4096;function je(t){var r=t.length;if(r<=Rr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Rr));return e}function Qe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function rt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=it(t[i]);return o}function et(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var i=e-r;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function x(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};s.prototype.readUInt8=function(r,e){return e||x(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||x(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||x(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||x(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||x(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||x(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||x(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||x(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||x(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||x(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||x(r,4,this.length),j(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||x(r,4,this.length),j(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||x(r,8,this.length),j(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||x(r,8,this.length),j(this,r,!1,52,8)};function A(t,r,e,n,o,i){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function z(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};function q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):q(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):q(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=0,c=1,u=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&u===0&&this[e+a-1]!==0&&(u=1),this[e+a]=(r/c>>0)-u&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=n-1,c=1,u=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&u===0&&this[e+a+1]!==0&&(u=1),this[e+a]=(r/c>>0)-u&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):q(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):q(this,r,e,!1),e+4};function Pr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function kr(t,r,e,n,o){return o||Pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),vr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return kr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return kr(this,r,e,!1,n)};function Ur(t,r,e,n,o){return o||Pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),vr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Ur(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Ur(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=R(r)?r:X(new s(r,o).toString()),u=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%u]}return this};var tt=/[^+\/0-9A-Za-z-_]/g;function nt(t){if(t=ot(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ot(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function it(t){return t<16?"0"+t.toString(16):t.toString(16)}function X(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function at(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function st(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Lr(t){return Me(nt(t))}function J(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ct(t){return t!==t}function ut(t){return t!=null&&(!!t._isBuffer||Mr(t)||pt(t))}function Mr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Mr(t.slice(0,0))}function j(t,r,e,n,o){var i,a,c=o*8-n-1,u=(1<<c)-1,d=u>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===u)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function vr(t,r,e,n,o,i){var a,c,u,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,b=n?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+m>=1?r+=h/u:r+=h*Math.pow(2,1-m),r*u>=2&&(a++,u/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*u-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=b,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=b,a/=256,d-=8);t[e+g-b]|=k*128}import hr from"algosdk";import ln from"algosdk";import*as mn from"bs58";import Yo from"algosdk";import In,{decodeAddress as Rn,encodeAddress as wn}from"algosdk";var w=[],y=[],lt=typeof Uint8Array<"u"?Uint8Array:Array,mr=!1;function Kr(){mr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)w[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function mt(t){mr||Kr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new lt(c*3/4-i),n=i>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],a[u++]=o>>16&255,a[u++]=o>>8&255,a[u++]=o&255;return i===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[u++]=o&255):i===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[u++]=o>>8&255,a[u++]=o&255),a}function dt(t){return w[t>>18&63]+w[t>>12&63]+w[t>>6&63]+w[t&63]}function ft(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(dt(n));return o.join("")}function Fr(t){mr||Kr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,u=e-n;c<u;c+=a)i.push(ft(t,c,c+a>u?u:c+a));return n===1?(r=t[e-1],o+=w[r>>2],o+=w[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=w[r>>10],o+=w[r>>4&63],o+=w[r<<2&63],o+="="),i.push(o),i.join("")}function rr(t,r,e,n,o){var i,a,c=o*8-n-1,u=(1<<c)-1,d=u>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===u)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Wr(t,r,e,n,o,i){var a,c,u,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,b=n?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+m>=1?r+=h/u:r+=h*Math.pow(2,1-m),r*u>=2&&(a++,u/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*u-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=b,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=b,a/=256,d-=8);t[e+g-b]|=k*128}var gt={}.toString,Hr=Array.isArray||function(t){return gt.call(t)=="[object Array]"};var ht=50;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var bn=Q();function Q(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(Q()<r)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=p.prototype):(t===null&&(t=new p(r)),t.length=r),t}function p(t,r,e){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return dr(this,t)}return Vr(this,t,r,e)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function Vr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?bt(t,r,e,n):typeof r=="string"?Et(t,r,e):At(t,r)}p.from=function(t,r,e){return Vr(null,t,r,e)};p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array);function $r(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function xt(t,r,e,n){return $r(r),r<=0?D(t,r):e!==void 0?typeof n=="string"?D(t,r).fill(e,n):D(t,r).fill(e):D(t,r)}p.alloc=function(t,r,e){return xt(null,t,r,e)};function dr(t,r){if($r(r),t=D(t,r<0?0:fr(r)|0),!p.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}p.allocUnsafe=function(t){return dr(null,t)};p.allocUnsafeSlow=function(t){return dr(null,t)};function Et(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Xr(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function lr(t,r){var e=r.length<0?0:fr(r.length)|0;t=D(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function bt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),p.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=p.prototype):t=lr(t,r),t}function At(t,r){if(N(r)){var e=fr(r.length)|0;return t=D(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ft(r.length)?D(t,0):lr(t,r);if(r.type==="Buffer"&&Hr(r.data))return lr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function fr(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}p.isBuffer=Yt;function N(t){return!!(t!=null&&t._isBuffer)}p.compare=function(r,e){if(!N(r)||!N(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};p.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};p.concat=function(r,e){if(!Hr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return p.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=p.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!N(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Xr(t,r){if(N(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return re(t).length;default:if(n)return Z(t).length;r=(""+r).toLowerCase(),n=!0}}p.byteLength=Xr;function Tt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Dt(this,r,e);case"utf8":case"utf-8":return Jr(this,r,e);case"ascii":return Ot(this,r,e);case"latin1":case"binary":return Bt(this,r,e);case"base64":return Nt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ct(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}p.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)v(this,e,e+1);return this};p.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this};p.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this};p.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Jr(this,0,r):Tt.apply(this,arguments)};p.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:p.compare(this,r)===0};p.prototype.inspect=function(){var r="",e=ht;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};p.prototype.compare=function(r,e,n,o,i){if(!N(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,u=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<u;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function zr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=p.from(r,n)),N(r))return r.length===0?-1:Yr(t,r,e,n,o);if(typeof r=="number")return r=r&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Yr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Yr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function u(g,b){return i===1?g[b]:g.readUInt16BE(b*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(u(t,d)===u(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(u(t,d+h)!==u(r,h)){m=!1;break}if(m)return d}return-1}p.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};p.prototype.indexOf=function(r,e,n){return zr(this,r,e,n,!0)};p.prototype.lastIndexOf=function(r,e,n){return zr(this,r,e,n,!1)};function _t(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function yt(t,r,e,n){return nr(Z(r,t.length-e),t,e,n)}function qr(t,r,e,n){return nr(Mt(r),t,e,n)}function It(t,r,e,n){return qr(t,r,e,n)}function Rt(t,r,e,n){return nr(re(r),t,e,n)}function wt(t,r,e,n){return nr(vt(r,t.length-e),t,e,n)}p.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return _t(this,r,e,n);case"utf8":case"utf-8":return yt(this,r,e,n);case"ascii":return qr(this,r,e,n);case"latin1":case"binary":return It(this,r,e,n);case"base64":return Rt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nt(t,r,e){return r===0&&e===t.length?Fr(t):Fr(t.slice(r,e))}function Jr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var u,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:u=t[o+1],(u&192)===128&&(m=(i&31)<<6|u&63,m>127&&(a=m));break;case 3:u=t[o+1],d=t[o+2],(u&192)===128&&(d&192)===128&&(m=(i&15)<<12|(u&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:u=t[o+1],d=t[o+2],f=t[o+3],(u&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(u&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return St(n)}var Gr=4096;function St(t){var r=t.length;if(r<=Gr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Gr));return e}function Ot(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Bt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Dt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Lt(t[i]);return o}function Ct(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}p.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(p.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=p.prototype;else{var i=e-r;o=new p(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};p.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};p.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};p.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};p.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};p.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};p.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};p.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};p.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};p.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};p.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};p.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};p.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),rr(this,r,!0,23,4)};p.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),rr(this,r,!1,23,4)};p.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),rr(this,r,!0,52,8)};p.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),rr(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}p.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};p.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};p.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function er(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}p.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};p.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};function tr(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}p.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):tr(this,r,e,!0),e+4};p.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):tr(this,r,e,!1),e+4};p.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=0,c=1,u=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&u===0&&this[e+a-1]!==0&&(u=1),this[e+a]=(r/c>>0)-u&255;return e+n};p.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=n-1,c=1,u=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&u===0&&this[e+a+1]!==0&&(u=1),this[e+a]=(r/c>>0)-u&255;return e+n};p.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};p.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};p.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};p.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):tr(this,r,e,!0),e+4};p.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):tr(this,r,e,!1),e+4};function jr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Qr(t,r,e,n,o){return o||jr(t,r,e,4),Wr(t,r,e,n,23,4),e+4}p.prototype.writeFloatLE=function(r,e,n){return Qr(this,r,e,!0,n)};p.prototype.writeFloatBE=function(r,e,n){return Qr(this,r,e,!1,n)};function Zr(t,r,e,n,o){return o||jr(t,r,e,8),Wr(t,r,e,n,52,8),e+8}p.prototype.writeDoubleLE=function(r,e,n){return Zr(this,r,e,!0,n)};p.prototype.writeDoubleBE=function(r,e,n){return Zr(this,r,e,!1,n)};p.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!p.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};p.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!p.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=N(r)?r:Z(new p(r,o).toString()),u=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%u]}return this};var Pt=/[^+\/0-9A-Za-z-_]/g;function kt(t){if(t=Ut(t).replace(Pt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ut(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Lt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function Mt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function vt(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function re(t){return mt(kt(t))}function nr(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ft(t){return t!==t}function Yt(t){return t!=null&&(!!t._isBuffer||ee(t)||Gt(t))}function ee(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Gt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ee(t.slice(0,0))}import{encodeAddress as Kt,decodeAddress as Cn}from"algosdk";import Wt from"bignumber.js";Wt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var jn=`{"theme1":{"value":"${l.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var te={V1_1:"v1_1",V2:"v2"},eo={[te.V1_1]:{testnet:62368684,mainnet:552635992},[te.V2]:{testnet:148607e3,mainnet:1002541853}};import*as S from"ethereumjs-util";import wu from"algosdk";import*as un from"bs58";import ei from"algosdk";import pi from"algosdk";import ha from"algosdk";var wi={SMALLESTUNIT:l.env.SMALLEST_UNIT},Ni={SMALLEST_UNITS:l.env.SMALLEST_UNIT};var Ci=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Fi=l.env.REACT_APP_API_URL,Yi=l.env.REACT_APP_SOCKET_URL,Gi=l.env.REACT_APP_ALGO_SERVER,Ki=l.env.REACT_APP_ALGO_SERVER_PORT||"",Wi=l.env.REACT_APP_ALGOD_TOKEN||"",Hi=l.env.REACT_APP_DISPENSER_LINK,Vi=l.env.REACT_APP_FRONTEND_LINK||"",$i=l.env.REACT_APP_ALGO_EXPLORER_LINK,Xi=l.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,zi=(l.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",qi=l.env.REACT_APP_USERBACK_ACCESS_TOKEN,Ji=(l.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var ji=.001*10**6,Qi=.002*10**6;var Zi=l.env.REACT_APP_MASTER_APP_ID||"406",ra=l.env.REACT_APP_AGG_APP_ID||"408",qt=Number(l.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",qt);var Jt=l.env.REACT_APP_ALGO_NETWORK||"";var ea=Jt.toLowerCase()==="mainnet"?"mainnet":"testnet";import Pc from"algosdk";var ae=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(ae||{}),se=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(se||{}),Ns={...ae,...se};var F=(t,r)=>{let e=ln.ABIMethod.fromSignature(t),n=e.getSelector(),o={},i=r.map((a,c)=>{let u=e.args[c].type.encode(a);return o[`txnArgs${c}`]=Array.apply([],Array.from(u)).join(", "),u});return[n,...i]};var gr=(t,r,e,n,o,i)=>{let a=F("dummy(uint64)void",[1]);return hr.makeApplicationNoOpTxnFromObject({from:r,suggestedParams:{...e,fee:hr.ALGORAND_MIN_TX_FEE,flatFee:!0},appArgs:a,appIndex:t,boxes:n,foreignApps:i,note:new Uint8Array(s.from(o))})},pn=(t,r)=>{let{accounts:n,foreignAssets:o,foreignApps:i,boxes:a,appIndex:c,from:u,suggestedParams:d}=r;console.log("Total resources",[n,i,o,a]);let f=[n,i,o,a].reduce((Y,ar)=>Y+(ar?.length||0),0),m=a?.slice(0,8-f)||[],h=a?.slice(8-f)||[],g=8-(i?.length||0),b=hr.makeApplicationNoOpTxnFromObject({...r,boxes:m}),k=1,W=[],H=[];for(let Y=0;Y<h.length;Y++){let ar=h[Y];W.push(ar),(W.length===g||Y===h.length-1)&&(H.push(gr(c,u,d,W,`${t}_${k}`,i)),W=[],k++)}return H.push(gr(c,u,d,[],`${t}_${++k}`,i)),console.log("dummy count",H.length),[b,...H]};export{gr as makeDummyTxn,pn as makeGroupTxnsWithDummy};
|
|
1
|
+
function Er(){throw new Error("setTimeout has not been defined")}function br(){throw new Error("clearTimeout has not been defined")}var D=Er,P=br;typeof globalThis.setTimeout=="function"&&(D=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function Ar(t){if(D===setTimeout)return setTimeout(t,0);if((D===Er||!D)&&setTimeout)return D=setTimeout,setTimeout(t,0);try{return D(t,0)}catch{try{return D.call(null,t,0)}catch{return D.call(this,t,0)}}}function ue(t){if(P===clearTimeout)return clearTimeout(t);if((P===br||!P)&&clearTimeout)return P=clearTimeout,clearTimeout(t);try{return P(t)}catch{try{return P.call(null,t)}catch{return P.call(this,t)}}}var O=[],K=!1,U,V=-1;function pe(){!K||!U||(K=!1,U.length?O=U.concat(O):V=-1,O.length&&Tr())}function Tr(){if(!K){var t=Ar(pe);K=!0;for(var r=O.length;r;){for(U=O,O=[];++V<r;)U&&U[V].run();V=-1,r=O.length}U=null,K=!1,ue(t)}}function le(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];O.push(new _r(t,r)),O.length===1&&!K&&Ar(Tr)}function _r(t,r){this.fun=t,this.array=r}_r.prototype.run=function(){this.fun.apply(null,this.array)};var me="browser",de="browser",fe=!0,ge={},he=[],xe="",Ee={},be={},Ae={};function L(){}var Te=L,_e=L,ye=L,Ie=L,Re=L,we=L,Ne=L;function Se(t){throw new Error("process.binding is not supported")}function Oe(){return"/"}function Be(t){throw new Error("process.chdir is not supported")}function Ce(){return 0}var G=globalThis.performance||{},De=G.now||G.mozNow||G.msNow||G.oNow||G.webkitNow||function(){return new Date().getTime()};function Pe(t){var r=De.call(G)*.001,e=Math.floor(r),n=Math.floor(r%1*1e9);return t&&(e=e-t[0],n=n-t[1],n<0&&(e--,n+=1e9)),[e,n]}var ke=new Date;function Ue(){var t=new Date,r=t-ke;return r/1e3}var l={nextTick:le,title:me,browser:fe,env:ge,argv:he,version:xe,versions:Ee,on:Te,addListener:_e,once:ye,off:Ie,removeListener:Re,removeAllListeners:we,emit:Ne,binding:Se,cwd:Oe,chdir:Be,umask:Ce,hrtime:Pe,platform:de,release:be,config:Ae,uptime:Ue},xr={};Object.keys(xr).forEach(t=>{let r=t.split("."),e=l;for(let n=0;n<r.length;n++){let o=r[n];n===r.length-1?e[o]=xr[t]:e=e[o]||(e[o]={})}});var I=[],_=[],Le=typeof Uint8Array<"u"?Uint8Array:Array,cr=!1;function wr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)I[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function Me(t){cr||wr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Le(c*3/4-i),n=i>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[u++]=o>>16&255,a[u++]=o>>8&255,a[u++]=o&255;return i===2?(o=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[u++]=o&255):i===1&&(o=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[u++]=o>>8&255,a[u++]=o&255),a}function ve(t){return I[t>>18&63]+I[t>>12&63]+I[t>>6&63]+I[t&63]}function Fe(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(ve(n));return o.join("")}function yr(t){cr||wr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,u=e-n;c<u;c+=a)i.push(Fe(t,c,c+a>u?u:c+a));return n===1?(r=t[e-1],o+=I[r>>2],o+=I[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=I[r>>10],o+=I[r>>4&63],o+=I[r<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function $(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if($()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(t===null&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return ur(this,t)}return Nr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Nr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Ke(t,r,e,n):typeof r=="string"?Ge(t,r,e):We(t,r)}s.from=function(t,r,e){return Nr(null,t,r,e)};s.kMaxLength=$();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Sr(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Ye(t,r,e,n){return Sr(r),r<=0?B(t,r):e!==void 0?typeof n=="string"?B(t,r).fill(e,n):B(t,r).fill(e):B(t,r)}s.alloc=function(t,r,e){return Ye(null,t,r,e)};function ur(t,r){if(Sr(r),t=B(t,r<0?0:pr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return ur(null,t)};s.allocUnsafeSlow=function(t){return ur(null,t)};function Ge(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Or(r,e)|0;t=B(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function sr(t,r){var e=r.length<0?0:pr(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ke(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=sr(t,r),t}function We(t,r){if(R(r)){var e=pr(r.length)|0;return t=B(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ct(r.length)?B(t,0):sr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return sr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function pr(t){if(t>=$())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$().toString(16)+" bytes");return t|0}s.isBuffer=ut;function R(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return s.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=s.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!R(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Or(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Lr(t).length;default:if(n)return X(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=Or;function He(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return rt(this,r,e);case"utf8":case"utf-8":return Dr(this,r,e);case"ascii":return Qe(this,r,e);case"latin1":case"binary":return Ze(this,r,e);case"base64":return Je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}s.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)M(this,e,e+1);return this};s.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this};s.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Dr(this,0,r):He.apply(this,arguments)};s.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.compare=function(r,e,n,o,i){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,u=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<u;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Br(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),R(r))return r.length===0?-1:Ir(t,r,e,n,o);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Ir(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Ir(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function u(g,b){return i===1?g[b]:g.readUInt16BE(b*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(u(t,d)===u(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(u(t,d+h)!==u(r,h)){m=!1;break}if(m)return d}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return Br(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Br(this,r,e,n,!1)};function Ve(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function $e(t,r,e,n){return J(X(r,t.length-e),t,e,n)}function Cr(t,r,e,n){return J(at(r),t,e,n)}function Xe(t,r,e,n){return Cr(t,r,e,n)}function ze(t,r,e,n){return J(Lr(r),t,e,n)}function qe(t,r,e,n){return J(st(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Ve(this,r,e,n);case"utf8":case"utf-8":return $e(this,r,e,n);case"ascii":return Cr(this,r,e,n);case"latin1":case"binary":return Xe(this,r,e,n);case"base64":return ze(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Je(t,r,e){return r===0&&e===t.length?yr(t):yr(t.slice(r,e))}function Dr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var u,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:u=t[o+1],(u&192)===128&&(m=(i&31)<<6|u&63,m>127&&(a=m));break;case 3:u=t[o+1],d=t[o+2],(u&192)===128&&(d&192)===128&&(m=(i&15)<<12|(u&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:u=t[o+1],d=t[o+2],f=t[o+3],(u&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(u&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return je(n)}var Rr=4096;function je(t){var r=t.length;if(r<=Rr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Rr));return e}function Qe(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Ze(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function rt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=it(t[i]);return o}function et(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=s.prototype;else{var i=e-r;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function x(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};s.prototype.readUInt8=function(r,e){return e||x(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||x(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||x(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||x(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};s.prototype.readUInt32BE=function(r,e){return e||x(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};s.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||x(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||x(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||x(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(r,e){e||x(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(r,e){return e||x(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};s.prototype.readInt32BE=function(r,e){return e||x(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};s.prototype.readFloatLE=function(r,e){return e||x(r,4,this.length),j(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||x(r,4,this.length),j(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||x(r,8,this.length),j(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||x(r,8,this.length),j(this,r,!1,52,8)};function A(t,r,e,n,o,i){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;A(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function z(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};function q(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):q(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):q(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=0,c=1,u=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&u===0&&this[e+a-1]!==0&&(u=1),this[e+a]=(r/c>>0)-u&255;return e+n};s.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);A(this,r,e,n,i-1,-i)}var a=n-1,c=1,u=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&u===0&&this[e+a+1]!==0&&(u=1),this[e+a]=(r/c>>0)-u&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};s.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):z(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):z(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):q(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||A(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):q(this,r,e,!1),e+4};function Pr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function kr(t,r,e,n,o){return o||Pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),vr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return kr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return kr(this,r,e,!1,n)};function Ur(t,r,e,n,o){return o||Pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),vr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Ur(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Ur(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};s.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=R(r)?r:X(new s(r,o).toString()),u=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%u]}return this};var tt=/[^+\/0-9A-Za-z-_]/g;function nt(t){if(t=ot(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ot(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function it(t){return t<16?"0"+t.toString(16):t.toString(16)}function X(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function at(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function st(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function Lr(t){return Me(nt(t))}function J(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function ct(t){return t!==t}function ut(t){return t!=null&&(!!t._isBuffer||Mr(t)||pt(t))}function Mr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Mr(t.slice(0,0))}function j(t,r,e,n,o){var i,a,c=o*8-n-1,u=(1<<c)-1,d=u>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===u)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function vr(t,r,e,n,o,i){var a,c,u,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,b=n?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+m>=1?r+=h/u:r+=h*Math.pow(2,1-m),r*u>=2&&(a++,u/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*u-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=b,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=b,a/=256,d-=8);t[e+g-b]|=k*128}import hr from"algosdk";import ln from"algosdk";import*as mn from"bs58";import Yo from"algosdk";import In,{decodeAddress as Rn,encodeAddress as wn}from"algosdk";var w=[],y=[],lt=typeof Uint8Array<"u"?Uint8Array:Array,mr=!1;function Kr(){mr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)w[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function mt(t){mr||Kr();var r,e,n,o,i,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new lt(c*3/4-i),n=i>0?c-4:c;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)o=y[t.charCodeAt(r)]<<18|y[t.charCodeAt(r+1)]<<12|y[t.charCodeAt(r+2)]<<6|y[t.charCodeAt(r+3)],a[u++]=o>>16&255,a[u++]=o>>8&255,a[u++]=o&255;return i===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[u++]=o&255):i===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[u++]=o>>8&255,a[u++]=o&255),a}function dt(t){return w[t>>18&63]+w[t>>12&63]+w[t>>6&63]+w[t&63]}function ft(t,r,e){for(var n,o=[],i=r;i<e;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(dt(n));return o.join("")}function Fr(t){mr||Kr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,u=e-n;c<u;c+=a)i.push(ft(t,c,c+a>u?u:c+a));return n===1?(r=t[e-1],o+=w[r>>2],o+=w[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=w[r>>10],o+=w[r>>4&63],o+=w[r<<2&63],o+="="),i.push(o),i.join("")}function rr(t,r,e,n,o){var i,a,c=o*8-n-1,u=(1<<c)-1,d=u>>1,f=-7,m=e?o-1:0,h=e?-1:1,g=t[r+m];for(m+=h,i=g&(1<<-f)-1,g>>=-f,f+=c;f>0;i=i*256+t[r+m],m+=h,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=a*256+t[r+m],m+=h,f-=8);if(i===0)i=1-d;else{if(i===u)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-d}return(g?-1:1)*a*Math.pow(2,i-n)}function Wr(t,r,e,n,o,i){var a,c,u,d=i*8-o-1,f=(1<<d)-1,m=f>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,b=n?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+m>=1?r+=h/u:r+=h*Math.pow(2,1-m),r*u>=2&&(a++,u/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*u-1)*Math.pow(2,o),a=a+m):(c=r*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[e+g]=c&255,g+=b,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=b,a/=256,d-=8);t[e+g-b]|=k*128}var gt={}.toString,Hr=Array.isArray||function(t){return gt.call(t)=="[object Array]"};var ht=50;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var bn=Q();function Q(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(Q()<r)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=p.prototype):(t===null&&(t=new p(r)),t.length=r),t}function p(t,r,e){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return dr(this,t)}return Vr(this,t,r,e)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function Vr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?bt(t,r,e,n):typeof r=="string"?Et(t,r,e):At(t,r)}p.from=function(t,r,e){return Vr(null,t,r,e)};p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array);function $r(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function xt(t,r,e,n){return $r(r),r<=0?C(t,r):e!==void 0?typeof n=="string"?C(t,r).fill(e,n):C(t,r).fill(e):C(t,r)}p.alloc=function(t,r,e){return xt(null,t,r,e)};function dr(t,r){if($r(r),t=C(t,r<0?0:fr(r)|0),!p.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}p.allocUnsafe=function(t){return dr(null,t)};p.allocUnsafeSlow=function(t){return dr(null,t)};function Et(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Xr(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function lr(t,r){var e=r.length<0?0:fr(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function bt(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),p.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=p.prototype):t=lr(t,r),t}function At(t,r){if(N(r)){var e=fr(r.length)|0;return t=C(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Ft(r.length)?C(t,0):lr(t,r);if(r.type==="Buffer"&&Hr(r.data))return lr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function fr(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}p.isBuffer=Yt;function N(t){return!!(t!=null&&t._isBuffer)}p.compare=function(r,e){if(!N(r)||!N(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,o=e.length,i=0,a=Math.min(n,o);i<a;++i)if(r[i]!==e[i]){n=r[i],o=e[i];break}return n<o?-1:o<n?1:0};p.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};p.concat=function(r,e){if(!Hr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return p.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=p.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!N(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Xr(t,r){if(N(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return re(t).length;default:if(n)return Z(t).length;r=(""+r).toLowerCase(),n=!0}}p.byteLength=Xr;function Tt(t,r,e){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,r>>>=0,e<=r))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ct(this,r,e);case"utf8":case"utf-8":return Jr(this,r,e);case"ascii":return Ot(this,r,e);case"latin1":case"binary":return Bt(this,r,e);case"base64":return Nt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}p.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)v(this,e,e+1);return this};p.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this};p.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this};p.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Jr(this,0,r):Tt.apply(this,arguments)};p.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:p.compare(this,r)===0};p.prototype.inspect=function(){var r="",e=ht;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};p.prototype.compare=function(r,e,n,o,i){if(!N(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),e<0||n>r.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,o>>>=0,i>>>=0,this===r)return 0;for(var a=i-o,c=n-e,u=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<u;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function zr(t,r,e,n,o){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0)if(o)e=0;else return-1;if(typeof r=="string"&&(r=p.from(r,n)),N(r))return r.length===0?-1:Yr(t,r,e,n,o);if(typeof r=="number")return r=r&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Yr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Yr(t,r,e,n,o){var i=1,a=t.length,c=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||r.length<2)return-1;i=2,a/=2,c/=2,e/=2}function u(g,b){return i===1?g[b]:g.readUInt16BE(b*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(u(t,d)===u(r,f===-1?0:d-f)){if(f===-1&&(f=d),d-f+1===c)return f*i}else f!==-1&&(d-=d-f),f=-1}else for(e+c>a&&(e=a-c),d=e;d>=0;d--){for(var m=!0,h=0;h<c;h++)if(u(t,d+h)!==u(r,h)){m=!1;break}if(m)return d}return-1}p.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};p.prototype.indexOf=function(r,e,n){return zr(this,r,e,n,!0)};p.prototype.lastIndexOf=function(r,e,n){return zr(this,r,e,n,!1)};function _t(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n),n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var c=parseInt(r.substr(a*2,2),16);if(isNaN(c))return a;t[e+a]=c}return a}function yt(t,r,e,n){return nr(Z(r,t.length-e),t,e,n)}function qr(t,r,e,n){return nr(Mt(r),t,e,n)}function It(t,r,e,n){return qr(t,r,e,n)}function Rt(t,r,e,n){return nr(re(r),t,e,n)}function wt(t,r,e,n){return nr(vt(r,t.length-e),t,e,n)}p.prototype.write=function(r,e,n,o){if(e===void 0)o="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")o=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-e;if((n===void 0||n>i)&&(n=i),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return _t(this,r,e,n);case"utf8":case"utf-8":return yt(this,r,e,n);case"ascii":return qr(this,r,e,n);case"latin1":case"binary":return It(this,r,e,n);case"base64":return Rt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nt(t,r,e){return r===0&&e===t.length?Fr(t):Fr(t.slice(r,e))}function Jr(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;o<e;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(o+c<=e){var u,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:u=t[o+1],(u&192)===128&&(m=(i&31)<<6|u&63,m>127&&(a=m));break;case 3:u=t[o+1],d=t[o+2],(u&192)===128&&(d&192)===128&&(m=(i&15)<<12|(u&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:u=t[o+1],d=t[o+2],f=t[o+3],(u&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(u&63)<<12|(d&63)<<6|f&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=c}return St(n)}var Gr=4096;function St(t){var r=t.length;if(r<=Gr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Gr));return e}function Ot(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]&127);return n}function Bt(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;o<e;++o)n+=String.fromCharCode(t[o]);return n}function Ct(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=Lt(t[i]);return o}function Dt(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}p.prototype.slice=function(r,e){var n=this.length;r=~~r,e=e===void 0?n:~~e,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<r&&(e=r);var o;if(p.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=p.prototype;else{var i=e-r;o=new p(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+r]}return o};function E(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return o};p.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r+--e],i=1;e>0&&(i*=256);)o+=this[r+--e]*i;return o};p.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};p.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};p.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};p.prototype.readUInt32LE=function(r,e){return e||E(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};p.prototype.readUInt32BE=function(r,e){return e||E(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};p.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=this[r],i=1,a=0;++a<e&&(i*=256);)o+=this[r+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o};p.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||E(r,e,this.length);for(var o=e,i=1,a=this[r+--o];o>0&&(i*=256);)a+=this[r+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a};p.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};p.prototype.readInt16LE=function(r,e){e||E(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(r,e){e||E(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(r,e){return e||E(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};p.prototype.readInt32BE=function(r,e){return e||E(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};p.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),rr(this,r,!0,23,4)};p.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),rr(this,r,!1,23,4)};p.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),rr(this,r,!0,52,8)};p.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),rr(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<i)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}p.prototype.writeUIntLE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=1,c=0;for(this[e]=r&255;++c<n&&(a*=256);)this[e+c]=r/a&255;return e+n};p.prototype.writeUIntBE=function(r,e,n,o){if(r=+r,e=e|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,r,e,n,i,0)}var a=n-1,c=1;for(this[e+a]=r&255;--a>=0&&(c*=256);)this[e+a]=r/c&255;return e+n};p.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function er(t,r,e,n){r<0&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);o<i;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}p.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};p.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};function tr(t,r,e,n){r<0&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);o<i;++o)t[e+o]=r>>>(n?o:3-o)*8&255}p.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):tr(this,r,e,!0),e+4};p.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):tr(this,r,e,!1),e+4};p.prototype.writeIntLE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=0,c=1,u=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&u===0&&this[e+a-1]!==0&&(u=1),this[e+a]=(r/c>>0)-u&255;return e+n};p.prototype.writeIntBE=function(r,e,n,o){if(r=+r,e=e|0,!o){var i=Math.pow(2,8*n-1);T(this,r,e,n,i-1,-i)}var a=n-1,c=1,u=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&u===0&&this[e+a+1]!==0&&(u=1),this[e+a]=(r/c>>0)-u&255;return e+n};p.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),p.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};p.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):er(this,r,e,!0),e+2};p.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):er(this,r,e,!1),e+2};p.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):tr(this,r,e,!0),e+4};p.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),p.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):tr(this,r,e,!1),e+4};function jr(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Qr(t,r,e,n,o){return o||jr(t,r,e,4),Wr(t,r,e,n,23,4),e+4}p.prototype.writeFloatLE=function(r,e,n){return Qr(this,r,e,!0,n)};p.prototype.writeFloatBE=function(r,e,n){return Qr(this,r,e,!1,n)};function Zr(t,r,e,n,o){return o||jr(t,r,e,8),Wr(t,r,e,n,52,8),e+8}p.prototype.writeDoubleLE=function(r,e,n){return Zr(this,r,e,!0,n)};p.prototype.writeDoubleBE=function(r,e,n){return Zr(this,r,e,!1,n)};p.prototype.copy=function(r,e,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),e>=r.length&&(e=r.length),e||(e=0),o>0&&o<n&&(o=n),o===n||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),r.length-e<o-n&&(o=r.length-e+n);var i=o-n,a;if(this===r&&n<e&&e<o)for(a=i-1;a>=0;--a)r[a+e]=this[a+n];else if(i<1e3||!p.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+i),e);return i};p.prototype.fill=function(r,e,n,o){if(typeof r=="string"){if(typeof e=="string"?(o=e,e=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),r.length===1){var i=r.charCodeAt(0);i<256&&(r=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!p.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var a;if(typeof r=="number")for(a=e;a<n;++a)this[a]=r;else{var c=N(r)?r:Z(new p(r,o).toString()),u=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%u]}return this};var Pt=/[^+\/0-9A-Za-z-_]/g;function kt(t){if(t=Ut(t).replace(Pt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ut(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Lt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;i.push(e)}else if(e<2048){if((r-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function Mt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function vt(t,r){for(var e,n,o,i=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function re(t){return mt(kt(t))}function nr(t,r,e,n){for(var o=0;o<n&&!(o+e>=r.length||o>=t.length);++o)r[o+e]=t[o];return o}function Ft(t){return t!==t}function Yt(t){return t!=null&&(!!t._isBuffer||ee(t)||Gt(t))}function ee(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Gt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ee(t.slice(0,0))}import{encodeAddress as Kt,decodeAddress as Dn}from"algosdk";import Wt from"bignumber.js";Wt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var jn=`{"theme1":{"value":"${l.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${l.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var te={V1_1:"v1_1",V2:"v2"},eo={[te.V1_1]:{testnet:62368684,mainnet:552635992},[te.V2]:{testnet:148607e3,mainnet:1002541853}};import*as S from"ethereumjs-util";import wu from"algosdk";import*as un from"bs58";import ei from"algosdk";import pi from"algosdk";import ha from"algosdk";var wi={SMALLESTUNIT:l.env.SMALLEST_UNIT},Ni={SMALLEST_UNITS:l.env.SMALLEST_UNIT};var Di=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Fi=l.env.REACT_APP_API_URL,Yi=l.env.REACT_APP_SOCKET_URL,Gi=l.env.REACT_APP_ALGO_SERVER,Ki=l.env.REACT_APP_ALGO_SERVER_PORT||"",Wi=l.env.REACT_APP_ALGOD_TOKEN||"",Hi=l.env.REACT_APP_DISPENSER_LINK,Vi=l.env.REACT_APP_FRONTEND_LINK||"",$i=l.env.REACT_APP_ALGO_EXPLORER_LINK,Xi=l.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,zi=(l.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",qi=l.env.REACT_APP_USERBACK_ACCESS_TOKEN,Ji=(l.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var ji=.001*10**6,Qi=.002*10**6;var Zi=l.env.REACT_APP_MASTER_APP_ID||"406",ra=l.env.REACT_APP_AGG_APP_ID||"408",qt=Number(l.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",qt);var Jt=l.env.REACT_APP_ALGO_NETWORK||"";var ea=Jt.toLowerCase()==="mainnet"?"mainnet":"testnet";import Pc from"algosdk";var ae=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(ae||{}),se=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(se||{}),Ns={...ae,...se};var F=(t,r)=>{let e=ln.ABIMethod.fromSignature(t),n=e.getSelector(),o={},i=r.map((a,c)=>{let u=e.args[c].type.encode(a);return o[`txnArgs${c}`]=Array.apply([],Array.from(u)).join(", "),u});return[n,...i]};var gr=(t,r,e,n,o,i)=>{let a=F("dummy(uint64)void",[1]);return hr.makeApplicationNoOpTxnFromObject({from:r,suggestedParams:{...e,fee:hr.ALGORAND_MIN_TX_FEE,flatFee:!0},appArgs:a,appIndex:t,boxes:n,foreignApps:i,note:new Uint8Array(s.from(o))})},pn=(t,r)=>{let{accounts:n,foreignAssets:o,foreignApps:i,boxes:a,appIndex:c,from:u,suggestedParams:d}=r;console.log("Total resources",[n,i,o,a]);let f=[n,i,o,a].reduce((Y,ar)=>Y+(ar?.length||0),0),m=a?.slice(0,8-f)||[],h=a?.slice(8-f)||[],g=8-(i?.length||0),b=hr.makeApplicationNoOpTxnFromObject({...r,boxes:m}),k=1,W=[],H=[];for(let Y=0;Y<h.length;Y++){let ar=h[Y];W.push(ar),(W.length===g||Y===h.length-1)&&(H.push(gr(c,u,d,W,`${t}_${k}`,i)),W=[],k++)}return H.push(gr(c,u,d,[],`${t}_${++k}`,i)),console.log("dummy count",H.length),[b,...H]};export{gr as makeDummyTxn,pn as makeGroupTxnsWithDummy};
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|