@ultrade/shared 1.0.27 → 1.0.29
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/common/index.js +1 -7
- package/dist/browser/{common/utils/social.js → constants/env.js} +1 -1
- package/dist/browser/constants/index.js +1 -1
- package/dist/browser/enums/index.js +1 -1
- package/dist/browser/helpers/algo.helper.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 +2 -2
- package/dist/browser/helpers/codex/index.js +2 -2
- 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/{common/mappers/codexBalance.mapper.js → helpers/codex/tokens.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 +6 -6
- package/dist/browser/helpers/eth.helper.js +2 -2
- package/dist/browser/helpers/order.helper.js +1 -1
- package/dist/browser/helpers/pair.helper.js +1 -1
- package/dist/browser/helpers/pointSystem.helper.js +1 -1
- package/dist/browser/helpers/withdraw.helper.js +2 -2
- package/dist/browser/interfaces/index.js +1 -1
- package/dist/browser/services/index.js +11 -0
- package/dist/browser/types/index.js +1 -1
- package/dist/{src/common → common}/index.d.ts +0 -1
- package/dist/{src/common → common}/utils/index.d.ts +3 -0
- package/dist/constants/env.d.ts +6 -0
- package/dist/{src/constants → constants}/index.d.ts +1 -0
- package/dist/constants/social.d.ts +4 -0
- package/dist/{src/enums → enums}/db/index.d.ts +1 -0
- package/dist/enums/db/pending-actions.enum.d.ts +6 -0
- package/dist/{src/enums → enums}/index.d.ts +2 -0
- package/dist/enums/points.enum.d.ts +4 -0
- package/dist/enums/socket.enum.d.ts +18 -0
- package/dist/{src/helpers → helpers}/codex/common.helper.d.ts +2 -5
- package/dist/{src/helpers → helpers}/codex/index.d.ts +2 -0
- package/dist/helpers/codex/tokens.d.ts +5 -0
- package/dist/{src/common/utils → helpers}/decode.d.ts +1 -1
- package/dist/interfaces/algostreamer/index.d.ts +49 -0
- package/dist/{src/interfaces → interfaces}/index.d.ts +2 -0
- package/dist/{src/interfaces → interfaces}/order.interface.d.ts +1 -0
- package/dist/interfaces/socket.interface.d.ts +16 -0
- package/dist/node/common/index.js +1 -1
- package/dist/node/constants/env.js +1 -0
- package/dist/node/constants/index.js +1 -1
- package/dist/node/enums/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 +2 -2
- 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/order.helper.js +1 -1
- package/dist/node/helpers/codex/setGlobal.helper.js +1 -1
- package/dist/node/helpers/codex/tokens.js +1 -0
- 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 +2 -2
- package/dist/node/helpers/order.helper.js +1 -1
- package/dist/node/helpers/pair.helper.js +1 -1
- package/dist/node/helpers/pointSystem.helper.js +1 -1
- package/dist/node/helpers/withdraw.helper.js +2 -2
- package/dist/node/interfaces/index.js +1 -1
- package/dist/node/services/index.js +1 -0
- package/dist/node/types/index.js +1 -1
- package/dist/services/index.d.ts +2 -0
- package/dist/services/pairParam.service.d.ts +14 -0
- package/dist/services/tmc.service.d.ts +33 -0
- package/dist/{src/types → types}/api/request.types.d.ts +10 -10
- package/dist/{src/types → types}/settings.type.d.ts +3 -3
- package/package.json +39 -5
- package/dist/browser/common/big-number.helper.js +0 -11
- package/dist/browser/common/mappers/codexAsset.mapper.js +0 -11
- package/dist/browser/common/mappers/index.js +0 -11
- package/dist/browser/common/mappers/trade.mapper.js +0 -11
- package/dist/browser/common/utils/assert.js +0 -11
- package/dist/browser/common/utils/index.js +0 -11
- package/dist/browser/common/utils/stat.js +0 -11
- package/dist/browser/helpers/vaa.helper.js +0 -11
- package/dist/node/common/big-number.helper.js +0 -1
- package/dist/node/common/mappers/codexAsset.mapper.js +0 -1
- package/dist/node/common/mappers/codexBalance.mapper.js +0 -1
- package/dist/node/common/mappers/index.js +0 -1
- package/dist/node/common/mappers/trade.mapper.js +0 -1
- package/dist/node/common/utils/assert.js +0 -1
- package/dist/node/common/utils/index.js +0 -1
- package/dist/node/common/utils/social.js +0 -1
- package/dist/node/common/utils/stat.js +0 -1
- package/dist/node/helpers/vaa.helper.js +0 -0
- package/dist/src/helpers/vaa.helper.d.ts +0 -0
- /package/dist/browser/{common → helpers}/auth.helper.js +0 -0
- /package/dist/browser/{common/utils → helpers}/decode.js +0 -0
- /package/dist/{src/common → common}/big-number.helper.d.ts +0 -0
- /package/dist/{src/common → common}/mappers/codexAsset.mapper.d.ts +0 -0
- /package/dist/{src/common → common}/mappers/codexBalance.mapper.d.ts +0 -0
- /package/dist/{src/common → common}/mappers/index.d.ts +0 -0
- /package/dist/{src/common → common}/mappers/trade.mapper.d.ts +0 -0
- /package/dist/{src/common → common}/utils/assert.d.ts +0 -0
- /package/dist/{src/common → common}/utils/social.d.ts +0 -0
- /package/dist/{src/common → common}/utils/stat.d.ts +0 -0
- /package/dist/{src/constants → constants}/auth.d.ts +0 -0
- /package/dist/{src/constants → constants}/cctp.d.ts +0 -0
- /package/dist/{src/constants → constants}/codex.d.ts +0 -0
- /package/dist/{src/constants → constants}/frontend.d.ts +0 -0
- /package/dist/{src/constants → constants}/response.d.ts +0 -0
- /package/dist/{src/constants → constants}/settings.d.ts +0 -0
- /package/dist/{src/constants → constants}/withdrawalWalletsMessage.d.ts +0 -0
- /package/dist/{src/enums → enums}/chains.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/account/index.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/affiliate.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/available-pair-settings.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/common.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/component/index.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/market-maker.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/notification-center/userNotification.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/order-side.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/order-status.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/order-type.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/relayer.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/setting-type.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/social-action.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/social-prompt.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/social.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/state-type.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/trade.enums.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/tradingKeyType.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/upgrade.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/db/withdrawal-wallet.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/maintenanceMode.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/notification.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/rabbitMq.d.ts +0 -0
- /package/dist/{src/enums → enums}/settings.enum.d.ts +0 -0
- /package/dist/{src/enums → enums}/social.enum.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/Encoding.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/algo.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/assert.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/atomic.helper.d.ts +0 -0
- /package/dist/{src/common → helpers}/auth.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/balance.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/mbr.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/mna.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/order.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/setGlobal.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/transfer.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex/txn.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/codex.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/eth.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/index.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/interval.helpers.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/liquidity.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/order.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/pair.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/pointSystem.helper.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/ticker.helpers.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/withdraw.helper.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/accountInfo.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/api/affiliate.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/api/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/cache.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/baseModel.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/hummingbot/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/market/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/marketing/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/notification_center/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/relayer/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/social/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/softDeleteModel.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/white_label/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/db/withdrawal_wallets/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/dto/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/emailService.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/kmsService.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/last-look-trade.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/market.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/pagination.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/pair.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/query.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/accountCache.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/algod.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/balances.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/coin-market-cap.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/index.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/price-model.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/price-service.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/socialActivity.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/services/tmc.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/settings.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/streaming.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/timestream.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/trading.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/tradingKey.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/transfer.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/wallet.interface.d.ts +0 -0
- /package/dist/{src/interfaces → interfaces}/withdrawalWallets.interface.d.ts +0 -0
- /package/dist/node/{common → helpers}/auth.helper.js +0 -0
- /package/dist/node/{common/utils → helpers}/decode.js +0 -0
- /package/dist/{src/types → types}/algo-order.type.d.ts +0 -0
- /package/dist/{src/types → types}/amm/amm.d.ts +0 -0
- /package/dist/{src/types → types}/balance-result.types.d.ts +0 -0
- /package/dist/{src/types → types}/codex.types.d.ts +0 -0
- /package/dist/{src/types → types}/hummingbots.types.d.ts +0 -0
- /package/dist/{src/types → types}/index.d.ts +0 -0
- /package/dist/{src/types → types}/notification.type.d.ts +0 -0
- /package/dist/{src/types → types}/state.type.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function yr(){throw new Error("setTimeout has not been defined")}function Ir(){throw new Error("clearTimeout has not been defined")}var D=yr,P=Ir;typeof globalThis.setTimeout=="function"&&(D=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function Rr(t){if(D===setTimeout)return setTimeout(t,0);if((D===yr||!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 Ae(t){if(P===clearTimeout)return clearTimeout(t);if((P===Ir||!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 B=[],G=!1,k,H=-1;function Te(){!G||!k||(G=!1,k.length?B=k.concat(B):H=-1,B.length&&wr())}function wr(){if(!G){var t=Rr(Te);G=!0;for(var r=B.length;r;){for(k=B,B=[];++H<r;)k&&k[H].run();H=-1,r=B.length}k=null,G=!1,Ae(t)}}function _e(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];B.push(new Nr(t,r)),B.length===1&&!G&&Rr(wr)}function Nr(t,r){this.fun=t,this.array=r}Nr.prototype.run=function(){this.fun.apply(null,this.array)};var ye="browser",Ie="browser",Re=!0,we={},Ne=[],Se="",Be={},Oe={},Ce={};function U(){}var De=U,Pe=U,ke=U,Ue=U,Le=U,Me=U,ve=U;function Fe(t){throw new Error("process.binding is not supported")}function Ye(){return"/"}function Ge(t){throw new Error("process.chdir is not supported")}function Ke(){return 0}var Y=globalThis.performance||{},We=Y.now||Y.mozNow||Y.msNow||Y.oNow||Y.webkitNow||function(){return new Date().getTime()};function He(t){var r=We.call(Y)*.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 Ve=new Date;function $e(){var t=new Date,r=t-Ve;return r/1e3}var l={nextTick:_e,title:ye,browser:Re,env:we,argv:Ne,version:Se,versions:Be,on:De,addListener:Pe,once:ke,off:Ue,removeListener:Le,removeAllListeners:Me,emit:ve,binding:Fe,cwd:Ye,chdir:Ge,umask:Ke,hrtime:He,platform:Ie,release:Oe,config:Ce,uptime:$e},_r={};Object.keys(_r).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]=_r[t]:e=e[o]||(e[o]={})}});var R=[],y=[],Xe=typeof Uint8Array<"u"?Uint8Array:Array,pr=!1;function Cr(){pr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function ze(t){pr||Cr();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 Xe(c*3/4-i),n=i>0?c-4:c;var p=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[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function qe(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Je(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(qe(n));return o.join("")}function Sr(t){pr||Cr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(Je(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[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 V(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function O(t,r){if(V()<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 lr(this,t)}return Dr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Dr(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?Ze(t,r,e,n):typeof r=="string"?Qe(t,r,e):rt(t,r)}s.from=function(t,r,e){return Dr(null,t,r,e)};s.kMaxLength=V();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Pr(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 je(t,r,e,n){return Pr(r),r<=0?O(t,r):e!==void 0?typeof n=="string"?O(t,r).fill(e,n):O(t,r).fill(e):O(t,r)}s.alloc=function(t,r,e){return je(null,t,r,e)};function lr(t,r){if(Pr(r),t=O(t,r<0?0:mr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return lr(null,t)};s.allocUnsafeSlow=function(t){return lr(null,t)};function Qe(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=kr(r,e)|0;t=O(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function ur(t,r){var e=r.length<0?0:mr(r.length)|0;t=O(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ze(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=ur(t,r),t}function rt(t,r){if(w(r)){var e=mr(r.length)|0;return t=O(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"||bt(r.length)?O(t,0):ur(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return ur(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function mr(t){if(t>=V())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V().toString(16)+" bytes");return t|0}s.isBuffer=At;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!w(r)||!w(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(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function kr(t,r){if(w(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 $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Gr(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=kr;function et(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 lt(this,r,e);case"utf8":case"utf-8":return Mr(this,r,e);case"ascii":return ut(this,r,e);case"latin1":case"binary":return pt(this,r,e);case"base64":return st(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function L(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)L(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)L(this,e,e+3),L(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)L(this,e,e+7),L(this,e+1,e+6),L(this,e+2,e+5),L(this,e+3,e+4);return this};s.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Mr(this,0,r):et.apply(this,arguments)};s.prototype.equals=function(r){if(!w(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(!w(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,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<p;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Ur(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)),w(r))return r.length===0?-1:Br(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):Br(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Br(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 p(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(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(p(t,d+h)!==p(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 Ur(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Ur(this,r,e,n,!1)};function tt(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 nt(t,r,e,n){return q($(r,t.length-e),t,e,n)}function Lr(t,r,e,n){return q(xt(r),t,e,n)}function ot(t,r,e,n){return Lr(t,r,e,n)}function it(t,r,e,n){return q(Gr(r),t,e,n)}function at(t,r,e,n){return q(Et(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 tt(this,r,e,n);case"utf8":case"utf-8":return nt(this,r,e,n);case"ascii":return Lr(this,r,e,n);case"latin1":case"binary":return ot(this,r,e,n);case"base64":return it(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return at(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 st(t,r,e){return r===0&&e===t.length?Sr(t):Sr(t.slice(r,e))}function Mr(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 p,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(m=(i&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(m=(i&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(p&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 ct(n)}var Or=4096;function ct(t){var r=t.length;if(r<=Or)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Or));return e}function ut(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 pt(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 lt(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+=ht(t[i]);return o}function mt(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(!w(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 X(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):X(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):X(this,r,e,!1),e+2};function z(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):z(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):z(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,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&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,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&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):X(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):X(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):z(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):z(this,r,e,!1),e+4};function vr(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 Fr(t,r,e,n,o){return o||vr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Wr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Fr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Fr(this,r,e,!1,n)};function Yr(t,r,e,n,o){return o||vr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Wr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Yr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Yr(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=w(r)?r:$(new s(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var dt=/[^+\/0-9A-Za-z-_]/g;function ft(t){if(t=gt(t).replace(dt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function gt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ht(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(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 xt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Et(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 Gr(t){return ze(ft(t))}function q(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 bt(t){return t!==t}function At(t){return t!=null&&(!!t._isBuffer||Kr(t)||Tt(t))}function Kr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Tt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Kr(t.slice(0,0))}function J(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>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===p)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,p,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,_=n?1:-1,cr=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*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(a++,p/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*p-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+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=cr*128}import xn from"algosdk";import*as Tr from"bs58";import nn from"algosdk";import Un,{decodeAddress as Ln,encodeAddress as Mn}from"algosdk";var N=[],I=[],_t=typeof Uint8Array<"u"?Uint8Array:Array,fr=!1;function Xr(){fr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function yt(t){fr||Xr();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 _t(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function It(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function Rt(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(It(n));return o.join("")}function Hr(t){fr||Xr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(Rt(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=N[r>>2],o+=N[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=N[r>>10],o+=N[r>>4&63],o+=N[r<<2&63],o+="="),i.push(o),i.join("")}function Z(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>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===p)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 zr(t,r,e,n,o,i){var a,c,p,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,_=n?1:-1,cr=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*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(a++,p/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*p-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+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=cr*128}var wt={}.toString,qr=Array.isArray||function(t){return wt.call(t)=="[object Array]"};var Nt=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var On=j();function j(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(j()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(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 gr(this,t)}return Jr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Jr(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?Ot(t,r,e,n):typeof r=="string"?Bt(t,r,e):Ct(t,r)}u.from=function(t,r,e){return Jr(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function jr(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 St(t,r,e,n){return jr(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)}u.alloc=function(t,r,e){return St(null,t,r,e)};function gr(t,r){if(jr(r),t=C(t,r<0?0:hr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return gr(null,t)};u.allocUnsafeSlow=function(t){return gr(null,t)};function Bt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Qr(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function dr(t,r){var e=r.length<0?0:hr(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ot(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),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=dr(t,r),t}function Ct(t,r){if(S(r)){var e=hr(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"||Jt(r.length)?C(t,0):dr(t,r);if(r.type==="Buffer"&&qr(r.data))return dr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function hr(t){if(t>=j())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+j().toString(16)+" bytes");return t|0}u.isBuffer=jt;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(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};u.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}};u.concat=function(r,e){if(!qr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Qr(t,r){if(S(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 Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ie(t).length;default:if(n)return Q(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Qr;function Dt(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 Kt(this,r,e);case"utf8":case"utf-8":return ee(this,r,e);case"ascii":return Yt(this,r,e);case"latin1":case"binary":return Gt(this,r,e);case"base64":return vt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.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};u.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};u.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};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ee(this,0,r):Dt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=Nt;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,i){if(!S(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,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<p;++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=u.from(r,n)),S(r))return r.length===0?-1:Vr(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Vr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Vr(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 p(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(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(p(t,d+h)!==p(r,h)){m=!1;break}if(m)return d}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Zr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Zr(this,r,e,n,!1)};function Pt(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 kt(t,r,e,n){return tr(Q(r,t.length-e),t,e,n)}function re(t,r,e,n){return tr(zt(r),t,e,n)}function Ut(t,r,e,n){return re(t,r,e,n)}function Lt(t,r,e,n){return tr(ie(r),t,e,n)}function Mt(t,r,e,n){return tr(qt(r,t.length-e),t,e,n)}u.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 Pt(this,r,e,n);case"utf8":case"utf-8":return kt(this,r,e,n);case"ascii":return re(this,r,e,n);case"latin1":case"binary":return Ut(this,r,e,n);case"base64":return Lt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function vt(t,r,e){return r===0&&e===t.length?Hr(t):Hr(t.slice(r,e))}function ee(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 p,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(m=(i&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(m=(i&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(p&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 Ft(n)}var $r=4096;function Ft(t){var r=t.length;if(r<=$r)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$r));return e}function Yt(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 Gt(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 Kt(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+=Xt(t[i]);return o}function Wt(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}u.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(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var i=e-r;o=new u(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")}u.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};u.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};u.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};u.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};u.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])};u.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};u.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};u.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.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};u.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};u.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};u.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]};u.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),Z(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),Z(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),Z(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),Z(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!S(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")}u.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};u.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};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function rr(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}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):rr(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):rr(this,r,e,!1),e+2};function er(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}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):er(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):er(this,r,e,!1),e+4};u.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,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.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,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):rr(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):rr(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):er(this,r,e,!0),e+4};u.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),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):er(this,r,e,!1),e+4};function te(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 ne(t,r,e,n,o){return o||te(t,r,e,4),zr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ne(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ne(this,r,e,!1,n)};function oe(t,r,e,n,o){return o||te(t,r,e,8),zr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return oe(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return oe(this,r,e,!1,n)};u.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||!u.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};u.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"&&!u.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=S(r)?r:Q(new u(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var Ht=/[^+\/0-9A-Za-z-_]/g;function Vt(t){if(t=$t(t).replace(Ht,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function $t(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Xt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(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 zt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function qt(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 ie(t){return yt(Vt(t))}function tr(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 Jt(t){return t!==t}function jt(t){return t!=null&&(!!t._isBuffer||ae(t)||Qt(t))}function ae(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Qt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ae(t.slice(0,0))}import{encodeAddress as Zt,decodeAddress as Wn}from"algosdk";function v(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}function nr(t){return new Uint8Array(u.from(t))}function or(t){return u.from(t,"base64")}import rn from"bignumber.js";rn.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var po=`{"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 se={V1_1:"v1_1",V2:"v2"},go={[se.V1_1]:{testnet:62368684,mainnet:552635992},[se.V2]:{testnet:148607e3,mainnet:1002541853}};var ce=t=>nn.decodeAddress(t.toUpperCase()).publicKey;import*as b from"ethereumjs-util";function an(t){return b.toUnsigned(new b.BN(String(t)))}function xr(t){let r=an(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(b.setLengthLeft(r,32))}var ue=t=>new Uint8Array(b.setLengthLeft(W(t),32)),W=t=>s.from(sn(t),"hex"),sn=t=>t.startsWith("0x")?t.slice(2):t;var pe=(t,r)=>{let e=b.keccak256(t),{r:n,s:o,v:i}=b.fromRpcSig(r);return b.ecrecover(e,i,n,o)};var ir=t=>new Uint8Array(b.keccak256(s.from(t)));import ar from"algosdk";import*as gn from"bs58";import mi from"algosdk";import Ti from"algosdk";import Na from"algosdk";var br={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var Mi={SMALLESTUNIT:l.env.SMALLEST_UNIT},vi={SMALLEST_UNITS:l.env.SMALLEST_UNIT};var Wi=["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 Ji=l.env.REACT_APP_API_URL,ji=l.env.REACT_APP_SOCKET_URL,Qi=l.env.REACT_APP_ALGO_SERVER,Zi=l.env.REACT_APP_ALGO_SERVER_PORT||"",ra=l.env.REACT_APP_ALGOD_TOKEN||"",ea=l.env.REACT_APP_DISPENSER_LINK,ta=l.env.REACT_APP_FRONTEND_LINK||"",na=l.env.REACT_APP_ALGO_EXPLORER_LINK,oa=l.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,ia=(l.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",aa=l.env.REACT_APP_USERBACK_ACCESS_TOKEN,sa=(l.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var ca=.001*10**6,ua=.002*10**6;var pa=l.env.REACT_APP_MASTER_APP_ID||"406",la=l.env.REACT_APP_AGG_APP_ID||"408",pn=Number(l.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",pn);var ln=l.env.REACT_APP_ALGO_NETWORK||"";var ma=ln.toLowerCase()==="mainnet"?"mainnet":"testnet";import Hc from"algosdk";var he=(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))(he||{}),xe=(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))(xe||{}),vs={...he,...xe};import su from"algosdk";var F=(t,r,e)=>{switch(r){case"8B":return ar.encodeUint64(Number(t));case"32B":return xr(t);case"str":return nr(String(t));case"address":return sr(String(t),e);case"token":return hn(String(t),e);case"float":{var n=s.alloc(8);return n.writeDoubleBE(Number(t),0),new Uint8Array(n)}case"bool":return new Uint8Array(s.from(ar.encodeUint64(Number(t))).subarray(-1));case"2B":return new Uint8Array(s.from(ar.encodeUint64(Number(t))).subarray(-2));case"4B":return new Uint8Array(s.from(ar.encodeUint64(Number(t))).subarray(-4));default:return s.from(t.toString())}};var hn=(t,r)=>r===8?xr(+t):br[t]?new Uint8Array(W(String(t))):sr(String(t),r);var de=t=>s.from(ir(t)).toString("hex"),fe=(t,r)=>v([F(r,"str"),ir(t)]),ge=(t,r)=>v([F(r,"str"),s.from(t,"hex")]),K=(t,r)=>{let e=xn.ABIMethod.fromSignature(t),n=e.getSelector(),o={},i=r.map((a,c)=>{let p=e.args[c].type.encode(a);return o[`txnArgs${c}`]=Array.apply([],Array.from(p)).join(", "),p});return[n,...i]},Ar=(t,r,e)=>{let n=s.from(t,r),o=n.subarray(n.length-e),i=s.from(o).toString();return or(i)},be=(t,r,e,n,o="hex")=>[Er(t,o,n),En(r,n),bn(e,n,t,r,o)],En=(t,r)=>r===8?or(t):r===1?Tr.decode(t):W(t),bn=(t,r,e,n,o)=>r===8||r===1?sr(t,r):pe(Er(e,o,r),n),An=(t,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
|
|
2
|
-
${t.length}`,Er=(t,r,e)=>{let n=s.from(t,r);return s.concat([nr(An(n,e)),n])},
|
|
1
|
+
function Ir(){throw new Error("setTimeout has not been defined")}function Rr(){throw new Error("clearTimeout has not been defined")}var B=Ir,P=Rr;typeof globalThis.setTimeout=="function"&&(B=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function wr(t){if(B===setTimeout)return setTimeout(t,0);if((B===Ir||!B)&&setTimeout)return B=setTimeout,setTimeout(t,0);try{return B(t,0)}catch{try{return B.call(null,t,0)}catch{return B.call(this,t,0)}}}function _e(t){if(P===clearTimeout)return clearTimeout(t);if((P===Rr||!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=[],W=!1,U,H=-1;function ye(){!W||!U||(W=!1,U.length?O=U.concat(O):H=-1,O.length&&Nr())}function Nr(){if(!W){var t=wr(ye);W=!0;for(var r=O.length;r;){for(U=O,O=[];++H<r;)U&&U[H].run();H=-1,r=O.length}U=null,W=!1,_e(t)}}function Ie(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 Sr(t,r)),O.length===1&&!W&&wr(Nr)}function Sr(t,r){this.fun=t,this.array=r}Sr.prototype.run=function(){this.fun.apply(null,this.array)};var Re="browser",we="browser",Ne=!0,Se={},Oe=[],Ce="",De={},Be={},Pe={};function L(){}var ke=L,Ue=L,Le=L,Me=L,ve=L,Fe=L,Ye=L;function Ge(t){throw new Error("process.binding is not supported")}function We(){return"/"}function Ke(t){throw new Error("process.chdir is not supported")}function He(){return 0}var G=globalThis.performance||{},Ve=G.now||G.mozNow||G.msNow||G.oNow||G.webkitNow||function(){return new Date().getTime()};function $e(t){var r=Ve.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 Xe=new Date;function ze(){var t=new Date,r=t-Xe;return r/1e3}var l={nextTick:Ie,title:Re,browser:Ne,env:Se,argv:Oe,version:Ce,versions:De,on:ke,addListener:Ue,once:Le,off:Me,removeListener:ve,removeAllListeners:Fe,emit:Ye,binding:Ge,cwd:We,chdir:Ke,umask:He,hrtime:$e,platform:we,release:Be,config:Pe,uptime:ze},yr={};Object.keys(yr).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]=yr[t]:e=e[o]||(e[o]={})}});var R=[],y=[],qe=typeof Uint8Array<"u"?Uint8Array:Array,pr=!1;function Br(){pr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],y[t.charCodeAt(r)]=r;y[45]=62,y[95]=63}function Je(t){pr||Br();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 qe(c*3/4-i),n=i>0?c-4:c;var p=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[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=y[t.charCodeAt(r)]<<2|y[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=y[t.charCodeAt(r)]<<10|y[t.charCodeAt(r+1)]<<4|y[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function je(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Qe(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(je(n));return o.join("")}function Or(t){pr||Br();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(Qe(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=R[r>>2],o+=R[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=R[r>>10],o+=R[r>>4&63],o+=R[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 V(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function C(t,r){if(V()<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 lr(this,t)}return Pr(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Pr(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?et(t,r,e,n):typeof r=="string"?rt(t,r,e):tt(t,r)}s.from=function(t,r,e){return Pr(null,t,r,e)};s.kMaxLength=V();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function kr(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 Ze(t,r,e,n){return kr(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)}s.alloc=function(t,r,e){return Ze(null,t,r,e)};function lr(t,r){if(kr(r),t=C(t,r<0?0:mr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return lr(null,t)};s.allocUnsafeSlow=function(t){return lr(null,t)};function rt(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=Ur(r,e)|0;t=C(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function ur(t,r){var e=r.length<0?0:mr(r.length)|0;t=C(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function et(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=ur(t,r),t}function tt(t,r){if(w(r)){var e=mr(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"||Tt(r.length)?C(t,0):ur(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return ur(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function mr(t){if(t>=V())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+V().toString(16)+" bytes");return t|0}s.isBuffer=_t;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!w(r)||!w(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(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Ur(t,r){if(w(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 $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Wr(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=Ur;function nt(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 vr(this,r,e);case"ascii":return lt(this,r,e);case"latin1":case"binary":return mt(this,r,e);case"base64":return ut(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ft(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?vr(this,0,r):nt.apply(this,arguments)};s.prototype.equals=function(r){if(!w(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(!w(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,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<p;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function Lr(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)),w(r))return r.length===0?-1:Cr(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):Cr(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function Cr(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 p(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(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(p(t,d+h)!==p(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 Lr(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return Lr(this,r,e,n,!1)};function ot(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 it(t,r,e,n){return q($(r,t.length-e),t,e,n)}function Mr(t,r,e,n){return q(bt(r),t,e,n)}function at(t,r,e,n){return Mr(t,r,e,n)}function st(t,r,e,n){return q(Wr(r),t,e,n)}function ct(t,r,e,n){return q(At(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 ot(this,r,e,n);case"utf8":case"utf-8":return it(this,r,e,n);case"ascii":return Mr(this,r,e,n);case"latin1":case"binary":return at(this,r,e,n);case"base64":return st(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ct(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 ut(t,r,e){return r===0&&e===t.length?Or(t):Or(t.slice(r,e))}function vr(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 p,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(m=(i&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(m=(i&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(p&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 pt(n)}var Dr=4096;function pt(t){var r=t.length;if(r<=Dr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Dr));return e}function lt(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 mt(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+=Et(t[i]);return o}function ft(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(!w(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 X(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):X(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):X(this,r,e,!1),e+2};function z(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):z(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):z(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,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&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,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&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):X(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):X(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):z(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):z(this,r,e,!1),e+4};function Fr(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 Yr(t,r,e,n,o){return o||Fr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Hr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return Yr(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return Yr(this,r,e,!1,n)};function Gr(t,r,e,n,o){return o||Fr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Hr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return Gr(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return Gr(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=w(r)?r:$(new s(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var gt=/[^+\/0-9A-Za-z-_]/g;function ht(t){if(t=xt(t).replace(gt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function xt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Et(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(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 bt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function At(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 Wr(t){return Je(ht(t))}function q(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 Tt(t){return t!==t}function _t(t){return t!=null&&(!!t._isBuffer||Kr(t)||yt(t))}function Kr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function yt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Kr(t.slice(0,0))}function J(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>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===p)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 Hr(t,r,e,n,o,i){var a,c,p,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,_=n?1:-1,cr=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*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(a++,p/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*p-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+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=cr*128}import Te from"algosdk";import*as _r from"bs58";import an from"algosdk";import Bn,{decodeAddress as Pn,encodeAddress as kn}from"algosdk";var N=[],I=[],It=typeof Uint8Array<"u"?Uint8Array:Array,fr=!1;function zr(){fr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Rt(t){fr||zr();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 It(c*3/4-i),n=i>0?c-4:c;var p=0;for(r=0,e=0;r<n;r+=4,e+=3)o=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],a[p++]=o>>16&255,a[p++]=o>>8&255,a[p++]=o&255;return i===2?(o=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,a[p++]=o&255):i===1&&(o=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,a[p++]=o>>8&255,a[p++]=o&255),a}function wt(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function Nt(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(wt(n));return o.join("")}function Vr(t){fr||zr();for(var r,e=t.length,n=e%3,o="",i=[],a=16383,c=0,p=e-n;c<p;c+=a)i.push(Nt(t,c,c+a>p?p:c+a));return n===1?(r=t[e-1],o+=N[r>>2],o+=N[r<<4&63],o+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],o+=N[r>>10],o+=N[r>>4&63],o+=N[r<<2&63],o+="="),i.push(o),i.join("")}function Z(t,r,e,n,o){var i,a,c=o*8-n-1,p=(1<<c)-1,d=p>>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===p)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 qr(t,r,e,n,o,i){var a,c,p,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,_=n?1:-1,cr=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*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+m>=1?r+=h/p:r+=h*Math.pow(2,1-m),r*p>=2&&(a++,p/=2),a+m>=f?(c=0,a=f):a+m>=1?(c=(r*p-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+=_,c/=256,o-=8);for(a=a<<o|c,d+=o;d>0;t[e+g]=a&255,g+=_,a/=256,d-=8);t[e+g-_]|=cr*128}var St={}.toString,Jr=Array.isArray||function(t){return St.call(t)=="[object Array]"};var Ot=50;u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Nn=j();function j(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(j()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(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 gr(this,t)}return jr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function jr(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"?Dt(t,r,e):Pt(t,r)}u.from=function(t,r,e){return jr(null,t,r,e)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);function Qr(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 Ct(t,r,e,n){return Qr(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)}u.alloc=function(t,r,e){return Ct(null,t,r,e)};function gr(t,r){if(Qr(r),t=D(t,r<0?0:hr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return gr(null,t)};u.allocUnsafeSlow=function(t){return gr(null,t)};function Dt(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Zr(r,e)|0;t=D(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function dr(t,r){var e=r.length<0?0:hr(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),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=dr(t,r),t}function Pt(t,r){if(S(r)){var e=hr(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"||Qt(r.length)?D(t,0):dr(t,r);if(r.type==="Buffer"&&Jr(r.data))return dr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function hr(t){if(t>=j())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+j().toString(16)+" bytes");return t|0}u.isBuffer=Zt;function S(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!S(r)||!S(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};u.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}};u.concat=function(r,e){if(!Jr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return u.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var o=u.allocUnsafe(e),i=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Zr(t,r){if(S(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 Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ae(t).length;default:if(n)return Q(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Zr;function kt(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 Ht(this,r,e);case"utf8":case"utf-8":return te(this,r,e);case"ascii":return Wt(this,r,e);case"latin1":case"binary":return Kt(this,r,e);case"base64":return Yt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}u.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};u.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};u.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};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?te(this,0,r):kt.apply(this,arguments)};u.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.inspect=function(){var r="",e=Ot;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};u.prototype.compare=function(r,e,n,o,i){if(!S(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,p=Math.min(a,c),d=this.slice(o,i),f=r.slice(e,n),m=0;m<p;++m)if(d[m]!==f[m]){a=d[m],c=f[m];break}return a<c?-1:c<a?1:0};function re(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=u.from(r,n)),S(r))return r.length===0?-1:$r(t,r,e,n,o);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):$r(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function $r(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 p(g,_){return i===1?g[_]:g.readUInt16BE(_*i)}var d;if(o){var f=-1;for(d=e;d<a;d++)if(p(t,d)===p(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(p(t,d+h)!==p(r,h)){m=!1;break}if(m)return d}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return re(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return re(this,r,e,n,!1)};function Ut(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 Lt(t,r,e,n){return tr(Q(r,t.length-e),t,e,n)}function ee(t,r,e,n){return tr(Jt(r),t,e,n)}function Mt(t,r,e,n){return ee(t,r,e,n)}function vt(t,r,e,n){return tr(ae(r),t,e,n)}function Ft(t,r,e,n){return tr(jt(r,t.length-e),t,e,n)}u.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 Ut(this,r,e,n);case"utf8":case"utf-8":return Lt(this,r,e,n);case"ascii":return ee(this,r,e,n);case"latin1":case"binary":return Mt(this,r,e,n);case"base64":return vt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ft(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Yt(t,r,e){return r===0&&e===t.length?Vr(t):Vr(t.slice(r,e))}function te(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 p,d,f,m;switch(c){case 1:i<128&&(a=i);break;case 2:p=t[o+1],(p&192)===128&&(m=(i&31)<<6|p&63,m>127&&(a=m));break;case 3:p=t[o+1],d=t[o+2],(p&192)===128&&(d&192)===128&&(m=(i&15)<<12|(p&63)<<6|d&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:p=t[o+1],d=t[o+2],f=t[o+3],(p&192)===128&&(d&192)===128&&(f&192)===128&&(m=(i&15)<<18|(p&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 Gt(n)}var Xr=4096;function Gt(t){var r=t.length;if(r<=Xr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Xr));return e}function Wt(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 Kt(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 Ht(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+=qt(t[i]);return o}function Vt(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}u.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(u.TYPED_ARRAY_SUPPORT)o=this.subarray(r,e),o.__proto__=u.prototype;else{var i=e-r;o=new u(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")}u.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};u.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};u.prototype.readUInt8=function(r,e){return e||E(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||E(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||E(r,2,this.length),this[r]<<8|this[r+1]};u.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};u.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])};u.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};u.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};u.prototype.readInt8=function(r,e){return e||E(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.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};u.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};u.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};u.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]};u.prototype.readFloatLE=function(r,e){return e||E(r,4,this.length),Z(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||E(r,4,this.length),Z(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||E(r,8,this.length),Z(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||E(r,8,this.length),Z(this,r,!1,52,8)};function T(t,r,e,n,o,i){if(!S(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")}u.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};u.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};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function rr(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}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):rr(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):rr(this,r,e,!1),e+2};function er(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}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):er(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):er(this,r,e,!1),e+4};u.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,p=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&p===0&&this[e+a-1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.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,p=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&p===0&&this[e+a+1]!==0&&(p=1),this[e+a]=(r/c>>0)-p&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):rr(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):rr(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||T(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):er(this,r,e,!0),e+4};u.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),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):er(this,r,e,!1),e+4};function ne(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 oe(t,r,e,n,o){return o||ne(t,r,e,4),qr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return oe(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return oe(this,r,e,!1,n)};function ie(t,r,e,n,o){return o||ne(t,r,e,8),qr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return ie(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return ie(this,r,e,!1,n)};u.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||!u.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};u.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"&&!u.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=S(r)?r:Q(new u(r,o).toString()),p=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%p]}return this};var $t=/[^+\/0-9A-Za-z-_]/g;function Xt(t){if(t=zt(t).replace($t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function zt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function qt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(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 Jt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function jt(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 ae(t){return Rt(Xt(t))}function tr(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 Qt(t){return t!==t}function Zt(t){return t!=null&&(!!t._isBuffer||se(t)||rn(t))}function se(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function rn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&se(t.slice(0,0))}import{encodeAddress as en,decodeAddress as Yn}from"algosdk";function F(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}function nr(t){return new Uint8Array(u.from(t))}function or(t){return u.from(t,"base64")}import tn from"bignumber.js";tn.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var ao=`{"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 ue={V1_1:"v1_1",V2:"v2"},po={[ue.V1_1]:{testnet:62368684,mainnet:552635992},[ue.V2]:{testnet:148607e3,mainnet:1002541853}};var pe=t=>an.decodeAddress(t.toUpperCase()).publicKey;import*as b from"ethereumjs-util";function cn(t){return b.toUnsigned(new b.BN(String(t)))}function xr(t){let r=cn(t);if(r.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(b.setLengthLeft(r,32))}var le=t=>new Uint8Array(b.setLengthLeft(K(t),32)),K=t=>s.from(un(t),"hex"),un=t=>t.startsWith("0x")?t.slice(2):t;var me=(t,r)=>{let e=b.keccak256(t),{r:n,s:o,v:i}=b.fromRpcSig(r);return b.ecrecover(e,i,n,o)};var ir=t=>new Uint8Array(b.keccak256(s.from(t)));import ar from"algosdk";import*as hn from"bs58";import yi from"algosdk";import Bi from"algosdk";import mu from"algosdk";var Ar={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var zi={SMALLESTUNIT:l.env.SMALLEST_UNIT},qi={SMALLEST_UNITS:l.env.SMALLEST_UNIT};var ra=["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 sa=l.env.REACT_APP_API_URL,ca=l.env.REACT_APP_SOCKET_URL,ua=l.env.REACT_APP_ALGO_SERVER,pa=l.env.REACT_APP_ALGO_SERVER_PORT||"",la=l.env.REACT_APP_ALGOD_TOKEN||"",ma=l.env.REACT_APP_DISPENSER_LINK,da=l.env.REACT_APP_FRONTEND_LINK||"",fa=l.env.REACT_APP_ALGO_EXPLORER_LINK,ga=l.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,ha=(l.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",xa=l.env.REACT_APP_USERBACK_ACCESS_TOKEN,Ea=(l.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var ba=.001*10**6,Aa=.002*10**6;var Ta=l.env.REACT_APP_MASTER_APP_ID||"406",_a=l.env.REACT_APP_AGG_APP_ID||"408",ya=Number(l.env.REACT_APP_CODEX_APP_ID||"467960617");var mn=l.env.REACT_APP_ALGO_NETWORK||"";var Ia=mn.toLowerCase()==="mainnet"?"mainnet":"testnet";var fe=(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))(fe||{}),ge=(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))(ge||{}),Ds={...fe,...ge};var Jc={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};import Tu from"algosdk";import Pu from"algosdk";import Ju from"algosdk";var k=(t,r,e)=>{switch(r){case"8B":return ar.encodeUint64(Number(t));case"32B":return xr(t);case"str":return nr(String(t));case"address":return sr(String(t),e);case"token":return xn(String(t),e);case"float":{var n=s.alloc(8);return n.writeDoubleBE(Number(t),0),new Uint8Array(n)}case"bool":return new Uint8Array(s.from(ar.encodeUint64(Number(t))).subarray(-1));case"2B":return new Uint8Array(s.from(ar.encodeUint64(Number(t))).subarray(-2));case"4B":return new Uint8Array(s.from(ar.encodeUint64(Number(t))).subarray(-4));default:return s.from(t.toString())}};var xn=(t,r)=>r===8?xr(+t):Ar[t]?new Uint8Array(K(String(t))):sr(String(t),r);var he=t=>s.from(ir(t)).toString("hex"),xe=(t,r)=>F([k(r,"str"),ir(t)]),Ee=(t,r)=>F([k(r,"str"),s.from(t,"hex")]),Y=(t,r)=>{let e=Te.ABIMethod.fromSignature(t),n=e.getSelector(),o={},i=r.map((a,c)=>{let p=e.args[c].type.encode(a);return o[`txnArgs${c}`]=Array.apply([],Array.from(p)).join(", "),p});return[n,...i]},Tr=(t,r,e)=>{let n=s.from(t,r),o=n.subarray(n.length-e),i=s.from(o).toString();return or(i)},Ae=(t,r,e,n,o="hex")=>[Er(t,o,n),En(r,n),bn(e,n,t,r,o)],En=(t,r)=>r===8?or(t):r===1?_r.decode(t):K(t),bn=(t,r,e,n,o)=>r===8||r===1?sr(t,r):me(Er(e,o,r),n),An=(t,r)=>r===8?"MX":r===1?"":`Ethereum Signed Message:
|
|
2
|
+
${t.length}`,Er=(t,r,e)=>{let n=s.from(t,r);return s.concat([nr(An(n,e)),n])},pn=t=>{switch(t){case"ALGORAND":return 8;case"SOLANA":return 1;case"EVM":return 5;default:return 5}},sr=(t,r)=>r===8?pe(t):r===1?_r.decode(t):le(t),rl=t=>Te.isValidAddress(t)?8:t.startsWith("0x")?5:1,el=t=>{let r=t.trim();return r.startsWith("0x")&&r.length===42?5:r.length===58&&/^[A-Z2-7]+$/.test(r)?8:r.length>=32&&r.length<=44&&/^[1-9A-HJ-NP-Za-km-z]+$/.test(r)?1:0};export{En as decodeSignature,el as detectChainByAddress,sr as encodeAddress,he as generateHash,Y as getAppArgs,xe as getBoxKey,Ee as getBoxKeyFromHash,rl as getChainId,Tr as getDataBytesFromMsg,Ae as getMsgArgs,Er as getPrefixedMessage,pn as getProviderChainId,bn as getPublicKey};
|
|
3
3
|
/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|