@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,10 +1,4 @@
|
|
|
1
|
-
function lr(){throw new Error("setTimeout has not been defined")}function Er(){throw new Error("clearTimeout has not been defined")}var L=lr,P=Er;typeof globalThis.setTimeout=="function"&&(L=setTimeout);typeof globalThis.clearTimeout=="function"&&(P=clearTimeout);function xr(t){if(L===setTimeout)return setTimeout(t,0);if((L===lr||!L)&&setTimeout)return L=setTimeout,setTimeout(t,0);try{return L(t,0)}catch{try{return L.call(null,t,0)}catch{return L.call(this,t,0)}}}function he(t){if(P===clearTimeout)return clearTimeout(t);if((P===Er||!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=[],G=!1,S,H=-1;function le(){!G||!S||(G=!1,S.length?O=S.concat(O):H=-1,O.length&&mr())}function mr(){if(!G){var t=xr(le);G=!0;for(var r=O.length;r;){for(S=O,O=[];++H<r;)S&&S[H].run();H=-1,r=O.length}S=null,G=!1,he(t)}}function Ee(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 Ar(t,r)),O.length===1&&!G&&xr(mr)}function Ar(t,r){this.fun=t,this.array=r}Ar.prototype.run=function(){this.fun.apply(null,this.array)};var xe="browser",me="browser",Ae=!0,de={},we=[],ge="",Ie={},Te={},_e={};function v(){}var Re=v,ye=v,be=v,Ce=v,Ue=v,Ne=v,De=v;function Oe(t){throw new Error("process.binding is not supported")}function Fe(){return"/"}function Be(t){throw new Error("process.chdir is not supported")}function Le(){return 0}var Y=globalThis.performance||{},Pe=Y.now||Y.mozNow||Y.msNow||Y.oNow||Y.webkitNow||function(){return new Date().getTime()};function Se(t){var r=Pe.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 ke(){var t=new Date,r=t-ve;return r/1e3}var E={nextTick:Ee,title:xe,browser:Ae,env:de,argv:we,version:ge,versions:Ie,on:Re,addListener:ye,once:be,off:Ce,removeListener:Ue,removeAllListeners:Ne,emit:De,binding:Oe,cwd:Fe,chdir:Be,umask:Le,hrtime:Se,platform:me,release:Te,config:_e,uptime:ke},hr={};Object.keys(hr).forEach(t=>{let r=t.split("."),e=E;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=hr[t]:e=e[i]||(e[i]={})}});var y=[],T=[],Me=typeof Uint8Array<"u"?Uint8Array:Array,ir=!1;function Ir(){ir=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)y[r]=t[r],T[t.charCodeAt(r)]=r;T[45]=62,T[95]=63}function Ye(t){ir||Ir();var r,e,n,i,o,a,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[p-2]==="="?2:t[p-1]==="="?1:0,a=new Me(p*3/4-o),n=o>0?p-4:p;var c=0;for(r=0,e=0;r<n;r+=4,e+=3)i=T[t.charCodeAt(r)]<<18|T[t.charCodeAt(r+1)]<<12|T[t.charCodeAt(r+2)]<<6|T[t.charCodeAt(r+3)],a[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=i&255;return o===2?(i=T[t.charCodeAt(r)]<<2|T[t.charCodeAt(r+1)]>>4,a[c++]=i&255):o===1&&(i=T[t.charCodeAt(r)]<<10|T[t.charCodeAt(r+1)]<<4|T[t.charCodeAt(r+2)]>>2,a[c++]=i>>8&255,a[c++]=i&255),a}function Ge(t){return y[t>>18&63]+y[t>>12&63]+y[t>>6&63]+y[t&63]}function He(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Ge(n));return i.join("")}function dr(t){ir||Ir();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,p=0,c=e-n;p<c;p+=a)o.push(He(t,p,p+a>c?c:p+a));return n===1?(r=t[e-1],i+=y[r>>2],i+=y[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=y[r>>10],i+=y[r>>4&63],i+=y[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function W(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function F(t,r){if(W()<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 or(this,t)}return Tr(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Tr(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Ke(t,r,e,n):typeof r=="string"?Ve(t,r,e):ze(t,r)}u.from=function(t,r,e){return Tr(null,t,r,e)};u.kMaxLength=W();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function _r(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function We(t,r,e,n){return _r(r),r<=0?F(t,r):e!==void 0?typeof n=="string"?F(t,r).fill(e,n):F(t,r).fill(e):F(t,r)}u.alloc=function(t,r,e){return We(null,t,r,e)};function or(t,r){if(_r(r),t=F(t,r<0?0:ar(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return or(null,t)};u.allocUnsafeSlow=function(t){return or(null,t)};function Ve(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=Rr(r,e)|0;t=F(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function nr(t,r){var e=r.length<0?0:ar(r.length)|0;t=F(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ke(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=nr(t,r),t}function ze(t,r){if(b(r)){var e=ar(r.length)|0;return t=F(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ft(r.length)?F(t,0):nr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return nr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ar(t){if(t>=W())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W().toString(16)+" bytes");return t|0}u.isBuffer=ht;function b(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!b(r)||!b(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<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(!Array.isArray(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 i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!b(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Rr(t,r){if(b(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 V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Or(t).length;default:if(n)return V(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=Rr;function Xe(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 nt(this,r,e);case"utf8":case"utf-8":return Cr(this,r,e);case"ascii":return et(this,r,e);case"latin1":case"binary":return tt(this,r,e);case"base64":return je(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return it(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function k(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)k(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)k(this,e,e+3),k(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)k(this,e,e+7),k(this,e+1,e+6),k(this,e+2,e+5),k(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Cr(this,0,r):Xe.apply(this,arguments)};u.prototype.equals=function(r){if(!b(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!b(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,p=n-e,c=Math.min(a,p),l=this.slice(i,o),f=r.slice(e,n),h=0;h<c;++h)if(l[h]!==f[h]){a=l[h],p=f[h];break}return a<p?-1:p<a?1:0};function yr(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),b(r))return r.length===0?-1:wr(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):wr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function wr(t,r,e,n,i){var o=1,a=t.length,p=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;o=2,a/=2,p/=2,e/=2}function c(x,I){return o===1?x[I]:x.readUInt16BE(I*o)}var l;if(i){var f=-1;for(l=e;l<a;l++)if(c(t,l)===c(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===p)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+p>a&&(e=a-p),l=e;l>=0;l--){for(var h=!0,m=0;m<p;m++)if(c(t,l+m)!==c(r,m)){h=!1;break}if(h)return l}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return yr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return yr(this,r,e,n,!1)};function qe(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var p=parseInt(r.substr(a*2,2),16);if(isNaN(p))return a;t[e+a]=p}return a}function $e(t,r,e,n){return X(V(r,t.length-e),t,e,n)}function br(t,r,e,n){return X(st(r),t,e,n)}function Je(t,r,e,n){return br(t,r,e,n)}function Qe(t,r,e,n){return X(Or(r),t,e,n)}function Ze(t,r,e,n){return X(ct(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return qe(this,r,e,n);case"utf8":case"utf-8":return $e(this,r,e,n);case"ascii":return br(this,r,e,n);case"latin1":case"binary":return Je(this,r,e,n);case"base64":return Qe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function je(t,r,e){return r===0&&e===t.length?dr(t):dr(t.slice(r,e))}function Cr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,p=o>239?4:o>223?3:o>191?2:1;if(i+p<=e){var c,l,f,h;switch(p){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[i+1],l=t[i+2],(c&192)===128&&(l&192)===128&&(h=(o&15)<<12|(c&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[i+1],l=t[i+2],f=t[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(h=(o&15)<<18|(c&63)<<12|(l&63)<<6|f&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,p=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=p}return rt(n)}var gr=4096;function rt(t){var r=t.length;if(r<=gr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=gr));return e}function et(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function tt(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function nt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=pt(t[o]);return i}function it(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}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 i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function A(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||A(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||A(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||A(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||A(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||A(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||A(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||A(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||A(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||A(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||A(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||A(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||A(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||A(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||A(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||A(r,4,this.length),q(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||A(r,4,this.length),q(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||A(r,8,this.length),q(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||A(r,8,this.length),q(this,r,!1,52,8)};function w(t,r,e,n,i,o){if(!b(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;w(this,r,e,n,o,0)}var a=1,p=0;for(this[e]=r&255;++p<n&&(a*=256);)this[e+p]=r/a&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;w(this,r,e,n,o,0)}var a=n-1,p=1;for(this[e+a]=r&255;--a>=0&&(p*=256);)this[e+a]=r/p&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function K(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):K(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):K(this,r,e,!1),e+2};function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(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):z(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(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):z(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);w(this,r,e,n,o-1,-o)}var a=0,p=1,c=0;for(this[e]=r&255;++a<n&&(p*=256);)r<0&&c===0&&this[e+a-1]!==0&&(c=1),this[e+a]=(r/p>>0)-c&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);w(this,r,e,n,o-1,-o)}var a=n-1,p=1,c=0;for(this[e+a]=r&255;--a>=0&&(p*=256);)r<0&&c===0&&this[e+a+1]!==0&&(c=1),this[e+a]=(r/p>>0)-c&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||w(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||w(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):K(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):K(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(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):z(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(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):z(this,r,e,!1),e+4};function Ur(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Nr(t,r,e,n,i){return i||Ur(t,r,e,4,34028234663852886e22,-34028234663852886e22),Br(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Nr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Nr(this,r,e,!1,n)};function Dr(t,r,e,n,i){return i||Ur(t,r,e,8,17976931348623157e292,-17976931348623157e292),Br(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return Dr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return Dr(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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 p=b(r)?r:V(new u(r,i).toString()),c=p.length;for(a=0;a<n-e;++a)this[a+e]=p[a%c]}return this};var ot=/[^+\/0-9A-Za-z-_]/g;function at(t){if(t=ut(t).replace(ot,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ut(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function pt(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function st(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ct(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function Or(t){return Ye(at(t))}function X(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function ft(t){return t!==t}function ht(t){return t!=null&&(!!t._isBuffer||Fr(t)||lt(t))}function Fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function lt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Fr(t.slice(0,0))}function q(t,r,e,n,i){var o,a,p=i*8-n-1,c=(1<<p)-1,l=c>>1,f=-7,h=e?i-1:0,m=e?-1:1,x=t[r+h];for(h+=m,o=x&(1<<-f)-1,x>>=-f,f+=p;f>0;o=o*256+t[r+h],h+=m,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+t[r+h],h+=m,f-=8);if(o===0)o=1-l;else{if(o===c)return a?NaN:(x?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(x?-1:1)*a*Math.pow(2,o-n)}function Br(t,r,e,n,i,o){var a,p,c,l=o*8-i-1,f=(1<<l)-1,h=f>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,I=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(p=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?r+=m/c:r+=m*Math.pow(2,1-h),r*c>=2&&(a++,c/=2),a+h>=f?(p=0,a=f):a+h>=1?(p=(r*c-1)*Math.pow(2,i),a=a+h):(p=r*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[e+x]=p&255,x+=I,p/=256,i-=8);for(a=a<<i|p,l+=i;l>0;t[e+x]=a&255,x+=I,a/=256,l-=8);t[e+x-I]|=tr*128}function on(t,r){return{id:t.id,address:t.address,chainId:t.chainId,name:t.name,unitName:t.unitName,decimals:t.decimals,isGas:t.isGas,img:t.img,cmcLink:t.cmcLink,isArchived:r?r(t):!1}}function sn(t){return{hash:t.hash,loginAddress:t.loginAddress,loginChainId:t.loginChainId,tokenId:t.token?.id,tokenAddress:t.tokenId,tokenChainId:t.tokenChainId,amount:t.amount,lockedAmount:t.lockedAmount}}var Lr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(Lr||{}),C=Lr;var Pr=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(Pr||{}),Sr=(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))(Sr||{}),mi={...Pr,...Sr};function vr(t){switch(t){case C.Buy:return"B";case C.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}var yo=t=>{let r=new Date(t),e=r.toLocaleDateString("default",{year:"numeric",month:"numeric",day:"numeric"}),n=r.toLocaleTimeString("en-US",{hour12:!0,hour:"2-digit",minute:"2-digit"});return e+" "+n},Yr=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();function bo(t,r){return t=Math.ceil(t),r=Math.floor(r),Math.floor(Math.random()*(r-t+1))+t}function Co(t){let r=[],e=t.split(".");for(let n=0;n<e.length-1;n++)r.push(e.slice(n).join("."));return r}function Uo(t){let r=t.headers&&$({Authorization:t.headers.Authorization?.substring(0,200),"CloudFront-Viewer-Country":t.headers["CloudFront-Viewer-Country"],Host:t.headers.Host,origin:t.headers.origin,Referer:t.headers.Referer,"User-Agent":t.headers["User-Agent"],"wl-domain":t.headers["wl-domain"],"X-API-Key":kr(t.headers["X-API-Key"]),"X-Forwarded-For":t.headers["X-Forwarded-For"],"X-Forwarded-Port":t.headers["X-Forwarded-Port"],"X-Forwarded-Proto":t.headers["X-Forwarded-Proto"],"X-Trading-Key":t.headers["X-Trading-Key"],"X-Wallet-Address":t.headers["X-Wallet-Address"],"X-Wallet-Token":t.headers["X-Wallet-Token"],accessToken:kr(t.headers.accessToken),companyId:t.headers.companyId,seasonId:t.headers.seasonId}),e=t.requestContext&&$({identity:t.requestContext.identity&&$({userAgent:t.requestContext.identity.userAgent,sourceIp:t.requestContext.identity.sourceIp}),domainName:t.requestContext.domainName});return $({manage:t.manage,path:t.path,httpMethod:t.httpMethod,headers:r,requestContext:e})}function kr(t){if(!t?.length)return t;let r=Math.round(t.length/3),e=r,n=t.length-r;return t.substring(0,e)+"*".repeat(r)+t.substring(n)}function Mr(t,r){return Array.isArray(t)?t.map(e=>Mr(e,r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).filter(([e])=>e!==r).map(([e,n])=>[e,Mr(n,r)])):t}function $(t){return Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0))}import _ from"bignumber.js";_.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var xt=(f=>(f.MINUS="-",f.PLUS="+",f.MULTIPLY="*",f.DIVIDE="/",f.GREATER_THAN_OR_EQUAL=">=",f.GREATER_THAN=">",f.LESS_THAN_OR_EQUAL="<=",f.LESS_THAN="<",f.EQUAL="==",f.MOD="mod",f))(xt||{});function Bo(t){return new _(t).abs().toString()}function Lo(t){let e=new _(String(t)).integerValue(_.ROUND_CEIL).toString();return Vr(t,e)||console.log("Ceil value",{value:t,res:e}),e}function Po(t,r,e=!1){let n=new _(String(t)),i;if(e){let o=n.toFixed(),a=o.indexOf(".");if(a>=0){let p=o.slice(a+1),c=0;for(let f of p)if(f==="0")c++;else break;let l=c+1;i=n.toFixed(l,_.ROUND_UP)}else i=n.toFixed(0)}else i=n.toFixed(r);return console.log("Fixed value",{value:t,res:i}),i}function So(t){let e=new _(String(t)).integerValue(_.ROUND_FLOOR).toString();return console.log("Floor value",{value:t,res:e}),e}function vo(t){let e=new _(String(t)).integerValue(_.ROUND_HALF_UP).toString();return console.log("Round value",{value:t,res:e}),e}function Wr(t,r){return U(t,r,"+")}function ko(t,r){return U(t,r,"-")}function mt(t,r){return U(t,r,"*")}function Mo(t,r){return mt(t,r||0)}function Yo(t,r){return U(t,r,"/")}function Go(t,r){return!!U(t,r,">=")}function Ho(t,r){return!!U(t,r,">")}function Wo(t,r){return!!U(t,r,"<=")}function Vo(t,r){return!!U(t,r,"<")}function Vr(t,r){return!!U(t,r,"==")}function At(t,r){return U(t,r,"mod")}function Ko(t,r){return Vr(At(t,r),0)}function U(t,r,e){switch(t=new _(String(t)),r=new _(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}function Gr(t){if(t.toString().includes("e")){let r=t.toString().split("e");return[parseFloat(r[0]),parseFloat(r[1])]}return[t,0]}function Hr(t,r){return t+(r<0?`e${r}`:`e+${r}`)}function Kr({decimalPlaces:t=0},r){if(t>0){let[e,n]=Gr(r),[i,o]=Gr(Math.round(Number(Hr(e,n+t))));return Number(Hr(i,o-t))}return Math.round(r)}function zo(t,r){let e=Number(t);return Kr({decimalPlaces:e},Math.pow(10,-e)*Number(r))}function Xo(t,r){let e=Math.pow(10,Number(t))*Number(r);return Kr({decimalPlaces:0},e)}function ea(t,r,e){let n=t.buyOrder&&t.sellOrder?t.buyOrderId>t.sellOrderId?t.buyOrder:t.sellOrder:t.buyOrder||t.sellOrder;return{pairId:t.pairId,orderId:n?.id,orderSide:n&&vr(n.side),...zr(r,e),...Xr(t,n)}}function ta(t,r,e,n,i){return{id:t.id,pairId:t.pairId,pair:e||t.pair?.pairKey,...zr(n,i),amount:t.amount,price:t.price,total:t.total,filledAmount:t.filledAmount,filledTotal:t.filledTotal,avgPrice:t.excutedPrice,status:t.status,side:t.side,type:t.type,userId:t.userId,createdAt:t.createdAt?.getTime(),completedAt:t.completedAt?.getTime()||null,updatedAt:t.updatedAt?.getTime(),trades:r&&r.map(o=>Xr(o,t))}}function zr(t,r){return{baseTokenId:t?.id,baseTokenDecimal:t?.decimals,quoteTokenId:r?.id,quoteTokenDecimal:r?.decimals}}function Xr(t,r){return{tradeId:t.tradeId,status:t.txStatus,amount:t.amount,total:t.total,price:t.price,fee:r&&t.tradeFees.filter(e=>Yr(e.address,r.userId)).reduce((e,n)=>Wr(e,n.fee),"0"),createdAt:t.createdAt?.getTime(),updatedAt:t.updatedAt?.getTime(),isBuyer:r&&r.side===C.Buy,isMaker:r&&dt(r.side,t.tradeSide)}}function dt(t,r){return t===C.Buy&&r===C.Sell||t===C.Sell&&r===C.Buy}import fr from"algosdk";import Aa,{decodeAddress as da,encodeAddress as wa}from"algosdk";var N=[],R=[],wt=typeof Uint8Array<"u"?Uint8Array:Array,pr=!1;function Qr(){pr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)N[r]=t[r],R[t.charCodeAt(r)]=r;R[45]=62,R[95]=63}function gt(t){pr||Qr();var r,e,n,i,o,a,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[p-2]==="="?2:t[p-1]==="="?1:0,a=new wt(p*3/4-o),n=o>0?p-4:p;var c=0;for(r=0,e=0;r<n;r+=4,e+=3)i=R[t.charCodeAt(r)]<<18|R[t.charCodeAt(r+1)]<<12|R[t.charCodeAt(r+2)]<<6|R[t.charCodeAt(r+3)],a[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=i&255;return o===2?(i=R[t.charCodeAt(r)]<<2|R[t.charCodeAt(r+1)]>>4,a[c++]=i&255):o===1&&(i=R[t.charCodeAt(r)]<<10|R[t.charCodeAt(r+1)]<<4|R[t.charCodeAt(r+2)]>>2,a[c++]=i>>8&255,a[c++]=i&255),a}function It(t){return N[t>>18&63]+N[t>>12&63]+N[t>>6&63]+N[t&63]}function Tt(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(It(n));return i.join("")}function qr(t){pr||Qr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,p=0,c=e-n;p<c;p+=a)o.push(Tt(t,p,p+a>c?c:p+a));return n===1?(r=t[e-1],i+=N[r>>2],i+=N[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=N[r>>10],i+=N[r>>4&63],i+=N[r<<2&63],i+="="),o.push(i),o.join("")}function Z(t,r,e,n,i){var o,a,p=i*8-n-1,c=(1<<p)-1,l=c>>1,f=-7,h=e?i-1:0,m=e?-1:1,x=t[r+h];for(h+=m,o=x&(1<<-f)-1,x>>=-f,f+=p;f>0;o=o*256+t[r+h],h+=m,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+t[r+h],h+=m,f-=8);if(o===0)o=1-l;else{if(o===c)return a?NaN:(x?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(x?-1:1)*a*Math.pow(2,o-n)}function Zr(t,r,e,n,i,o){var a,p,c,l=o*8-i-1,f=(1<<l)-1,h=f>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=n?0:o-1,I=n?1:-1,tr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(p=isNaN(r)?1:0,a=f):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?r+=m/c:r+=m*Math.pow(2,1-h),r*c>=2&&(a++,c/=2),a+h>=f?(p=0,a=f):a+h>=1?(p=(r*c-1)*Math.pow(2,i),a=a+h):(p=r*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[e+x]=p&255,x+=I,p/=256,i-=8);for(a=a<<i|p,l+=i;l>0;t[e+x]=a&255,x+=I,a/=256,l-=8);t[e+x-I]|=tr*128}var _t={}.toString,jr=Array.isArray||function(t){return _t.call(t)=="[object Array]"};var Rt=50;s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var ha=J();function J(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if(J()<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 sr(this,t)}return re(this,t,r,e)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function re(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?Ct(t,r,e,n):typeof r=="string"?bt(t,r,e):Ut(t,r)}s.from=function(t,r,e){return re(null,t,r,e)};s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array);function ee(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 yt(t,r,e,n){return ee(r),r<=0?B(t,r):e!==void 0?typeof n=="string"?B(t,r).fill(e,n):B(t,r).fill(e):B(t,r)}s.alloc=function(t,r,e){return yt(null,t,r,e)};function sr(t,r){if(ee(r),t=B(t,r<0?0:cr(r)|0),!s.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}s.allocUnsafe=function(t){return sr(null,t)};s.allocUnsafeSlow=function(t){return sr(null,t)};function bt(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=te(r,e)|0;t=B(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function ur(t,r){var e=r.length<0?0:cr(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ct(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 Ut(t,r){if(D(r)){var e=cr(r.length)|0;return t=B(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Xt(r.length)?B(t,0):ur(t,r);if(r.type==="Buffer"&&jr(r.data))return ur(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function cr(t){if(t>=J())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J().toString(16)+" bytes");return t|0}s.isBuffer=qt;function D(t){return!!(t!=null&&t._isBuffer)}s.compare=function(r,e){if(!D(r)||!D(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<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(!jr(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 i=s.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!D(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function te(t,r){if(D(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 se(t).length;default:if(n)return Q(t).length;r=(""+r).toLowerCase(),n=!0}}s.byteLength=te;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 Mt(this,r,e);case"utf8":case"utf-8":return oe(this,r,e);case"ascii":return vt(this,r,e);case"latin1":case"binary":return kt(this,r,e);case"base64":return Pt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yt(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?oe(this,0,r):Nt.apply(this,arguments)};s.prototype.equals=function(r){if(!D(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:s.compare(this,r)===0};s.prototype.inspect=function(){var r="",e=Rt;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};s.prototype.compare=function(r,e,n,i,o){if(!D(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,p=n-e,c=Math.min(a,p),l=this.slice(i,o),f=r.slice(e,n),h=0;h<c;++h)if(l[h]!==f[h]){a=l[h],p=f[h];break}return a<p?-1:p<a?1:0};function ne(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=s.from(r,n)),D(r))return r.length===0?-1:$r(t,r,e,n,i);if(typeof r=="number")return r=r&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):$r(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function $r(t,r,e,n,i){var o=1,a=t.length,p=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;o=2,a/=2,p/=2,e/=2}function c(x,I){return o===1?x[I]:x.readUInt16BE(I*o)}var l;if(i){var f=-1;for(l=e;l<a;l++)if(c(t,l)===c(r,f===-1?0:l-f)){if(f===-1&&(f=l),l-f+1===p)return f*o}else f!==-1&&(l-=l-f),f=-1}else for(e+p>a&&(e=a-p),l=e;l>=0;l--){for(var h=!0,m=0;m<p;m++)if(c(t,l+m)!==c(r,m)){h=!1;break}if(h)return l}return-1}s.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};s.prototype.indexOf=function(r,e,n){return ne(this,r,e,n,!0)};s.prototype.lastIndexOf=function(r,e,n){return ne(this,r,e,n,!1)};function Dt(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var p=parseInt(r.substr(a*2,2),16);if(isNaN(p))return a;t[e+a]=p}return a}function Ot(t,r,e,n){return er(Q(r,t.length-e),t,e,n)}function ie(t,r,e,n){return er(Kt(r),t,e,n)}function Ft(t,r,e,n){return ie(t,r,e,n)}function Bt(t,r,e,n){return er(se(r),t,e,n)}function Lt(t,r,e,n){return er(zt(r,t.length-e),t,e,n)}s.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Dt(this,r,e,n);case"utf8":case"utf-8":return Ot(this,r,e,n);case"ascii":return ie(this,r,e,n);case"latin1":case"binary":return Ft(this,r,e,n);case"base64":return Bt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Pt(t,r,e){return r===0&&e===t.length?qr(t):qr(t.slice(r,e))}function oe(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,p=o>239?4:o>223?3:o>191?2:1;if(i+p<=e){var c,l,f,h;switch(p){case 1:o<128&&(a=o);break;case 2:c=t[i+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[i+1],l=t[i+2],(c&192)===128&&(l&192)===128&&(h=(o&15)<<12|(c&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[i+1],l=t[i+2],f=t[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(h=(o&15)<<18|(c&63)<<12|(l&63)<<6|f&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,p=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=p}return St(n)}var Jr=4096;function St(t){var r=t.length;if(r<=Jr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Jr));return e}function vt(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function kt(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function Mt(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Vt(t[o]);return i}function Yt(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}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 i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=s.prototype;else{var o=e-r;i=new s(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function d(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||d(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};s.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};s.prototype.readUInt8=function(r,e){return e||d(r,1,this.length),this[r]};s.prototype.readUInt16LE=function(r,e){return e||d(r,2,this.length),this[r]|this[r+1]<<8};s.prototype.readUInt16BE=function(r,e){return e||d(r,2,this.length),this[r]<<8|this[r+1]};s.prototype.readUInt32LE=function(r,e){return e||d(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||d(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||d(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};s.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||d(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};s.prototype.readInt8=function(r,e){return e||d(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};s.prototype.readInt16LE=function(r,e){e||d(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||d(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||d(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||d(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||d(r,4,this.length),Z(this,r,!0,23,4)};s.prototype.readFloatBE=function(r,e){return e||d(r,4,this.length),Z(this,r,!1,23,4)};s.prototype.readDoubleLE=function(r,e){return e||d(r,8,this.length),Z(this,r,!0,52,8)};s.prototype.readDoubleBE=function(r,e){return e||d(r,8,this.length),Z(this,r,!1,52,8)};function g(t,r,e,n,i,o){if(!D(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;g(this,r,e,n,o,0)}var a=1,p=0;for(this[e]=r&255;++p<n&&(a*=256);)this[e+p]=r/a&255;return e+n};s.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;g(this,r,e,n,o,0)}var a=n-1,p=1;for(this[e+a]=r&255;--a>=0&&(p*=256);)this[e+a]=r/p&255;return e+n};s.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function j(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}s.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};s.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};function rr(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}s.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||g(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):rr(this,r,e,!0),e+4};s.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||g(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):rr(this,r,e,!1),e+4};s.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);g(this,r,e,n,o-1,-o)}var a=0,p=1,c=0;for(this[e]=r&255;++a<n&&(p*=256);)r<0&&c===0&&this[e+a-1]!==0&&(c=1),this[e+a]=(r/p>>0)-c&255;return e+n};s.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);g(this,r,e,n,o-1,-o)}var a=n-1,p=1,c=0;for(this[e+a]=r&255;--a>=0&&(p*=256);)r<0&&c===0&&this[e+a+1]!==0&&(c=1),this[e+a]=(r/p>>0)-c&255;return e+n};s.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||g(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||g(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):j(this,r,e,!0),e+2};s.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||g(this,r,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):j(this,r,e,!1),e+2};s.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||g(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):rr(this,r,e,!0),e+4};s.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||g(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):rr(this,r,e,!1),e+4};function ae(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ue(t,r,e,n,i){return i||ae(t,r,e,4),Zr(t,r,e,n,23,4),e+4}s.prototype.writeFloatLE=function(r,e,n){return ue(this,r,e,!0,n)};s.prototype.writeFloatBE=function(r,e,n){return ue(this,r,e,!1,n)};function pe(t,r,e,n,i){return i||ae(t,r,e,8),Zr(t,r,e,n,52,8),e+8}s.prototype.writeDoubleLE=function(r,e,n){return pe(this,r,e,!0,n)};s.prototype.writeDoubleBE=function(r,e,n){return pe(this,r,e,!1,n)};s.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};s.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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 p=D(r)?r:Q(new s(r,i).toString()),c=p.length;for(a=0;a<n-e;++a)this[a+e]=p[a%c]}return this};var Gt=/[^+\/0-9A-Za-z-_]/g;function Ht(t){if(t=Wt(t).replace(Gt,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Wt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Vt(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,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Kt(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function zt(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function se(t){return gt(Ht(t))}function er(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Xt(t){return t!==t}function qt(t){return t!=null&&(!!t._isBuffer||ce(t)||$t(t))}function ce(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function $t(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ce(t.slice(0,0))}import{encodeAddress as ya,decodeAddress as ba}from"algosdk";function fe(t){return new Uint8Array(s.from(t))}function Na(t){return fe(t)}function Jt(t,r,e){return fr.makePaymentTxnWithSuggestedParamsFromObject({from:t,to:t,amount:0,note:r&&new Uint8Array(u.from(r,e)),suggestedParams:{fee:0,firstRound:1,lastRound:2,genesisHash:"SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=",genesisID:"testnet-v1.0"}})}function Da(t,r,e,n){return Qt(Jt(t,r,e),n)}async function Qt(t,r){let e=fr.encodeUnsignedTransaction(t),n=await r([e]),i=fr.decodeSignedTransaction(n[0]);return new Uint8Array(i.sig)}export{xt as Operations,Bo as absolute,U as bn_operation,Lo as ceil,zo as convertFromBaseUnits,Xo as convertToBaseUnits,Uo as cutEvent,Yo as divide,Na as encodeMessage,Vr as equal,Yr as equalIgnoreCase,So as floor,Jt as generateTxnForSign,Co as getDomains,bo as getRandomInt,Ho as greaterThan,Go as greaterThanOrEqual,dt as isMaker,Vo as lessThan,Wo as lessThanOrEqual,yo as listDateFormat,on as mapToCodexAssetDto,sn as mapToCodexBalanceDto,ta as mapToOrderTradeDto,ea as mapToUserTradeDto,kr as maskingString,ko as minus,At as mod,Ko as modZero,mt as multiply,Wr as plus,Mr as removeField,vo as round,Kr as roundNumber,Da as signTxn,Po as toFixed,Mo as toUsd};
|
|
2
|
-
/*!
|
|
3
|
-
* The buffer module from node.js, for the browser.
|
|
4
|
-
*
|
|
5
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
|
-
* @license MIT
|
|
7
|
-
*/
|
|
1
|
+
function J(){throw new Error("setTimeout has not been defined")}function Q(){throw new Error("clearTimeout has not been defined")}var N=J,C=Q;typeof globalThis.setTimeout=="function"&&(N=setTimeout);typeof globalThis.clearTimeout=="function"&&(C=clearTimeout);function $(t){if(N===setTimeout)return setTimeout(t,0);if((N===J||!N)&&setTimeout)return N=setTimeout,setTimeout(t,0);try{return N(t,0)}catch{try{return N.call(null,t,0)}catch{return N.call(this,t,0)}}}function Pr(t){if(C===clearTimeout)return clearTimeout(t);if((C===Q||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(t);try{return C(t)}catch{try{return C.call(null,t)}catch{return C.call(this,t)}}}var g=[],P=!1,O,v=-1;function vr(){!P||!O||(P=!1,O.length?g=O.concat(g):v=-1,g.length&&Z())}function Z(){if(!P){var t=$(vr);P=!0;for(var r=g.length;r;){for(O=g,g=[];++v<r;)O&&O[v].run();v=-1,r=g.length}O=null,P=!1,Pr(t)}}function Br(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];g.push(new j(t,r)),g.length===1&&!P&&$(Z)}function j(t,r){this.fun=t,this.array=r}j.prototype.run=function(){this.fun.apply(null,this.array)};var Sr="browser",Fr="browser",kr=!0,Mr={},Gr=[],Yr="",Hr={},Wr={},Vr={};function D(){}var Kr=D,Xr=D,qr=D,zr=D,Jr=D,Qr=D,$r=D;function Zr(t){throw new Error("process.binding is not supported")}function jr(){return"/"}function re(t){throw new Error("process.chdir is not supported")}function ee(){return 0}var U=globalThis.performance||{},te=U.now||U.mozNow||U.msNow||U.oNow||U.webkitNow||function(){return new Date().getTime()};function ne(t){var r=te.call(U)*.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 ie=new Date;function oe(){var t=new Date,r=t-ie;return r/1e3}var l={nextTick:Br,title:Sr,browser:kr,env:Mr,argv:Gr,version:Yr,versions:Hr,on:Kr,addListener:Xr,once:qr,off:zr,removeListener:Jr,removeAllListeners:Qr,emit:$r,binding:Zr,cwd:jr,chdir:re,umask:ee,hrtime:ne,platform:Fr,release:Wr,config:Vr,uptime:oe},z={};Object.keys(z).forEach(t=>{let r=t.split("."),e=l;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=z[t]:e=e[i]||(e[i]={})}});var I=[],x=[],ae=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function nr(){W=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)I[r]=t[r],x[t.charCodeAt(r)]=r;x[45]=62,x[95]=63}function pe(t){W||nr();var r,e,n,i,o,p,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[s-2]==="="?2:t[s-1]==="="?1:0,p=new ae(s*3/4-o),n=o>0?s-4:s;var u=0;for(r=0,e=0;r<n;r+=4,e+=3)i=x[t.charCodeAt(r)]<<18|x[t.charCodeAt(r+1)]<<12|x[t.charCodeAt(r+2)]<<6|x[t.charCodeAt(r+3)],p[u++]=i>>16&255,p[u++]=i>>8&255,p[u++]=i&255;return o===2?(i=x[t.charCodeAt(r)]<<2|x[t.charCodeAt(r+1)]>>4,p[u++]=i&255):o===1&&(i=x[t.charCodeAt(r)]<<10|x[t.charCodeAt(r+1)]<<4|x[t.charCodeAt(r+2)]>>2,p[u++]=i>>8&255,p[u++]=i&255),p}function se(t){return I[t>>18&63]+I[t>>12&63]+I[t>>6&63]+I[t&63]}function ue(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(se(n));return i.join("")}function rr(t){W||nr();for(var r,e=t.length,n=e%3,i="",o=[],p=16383,s=0,u=e-n;s<u;s+=p)o.push(ue(t,s,s+p>u?u:s+p));return n===1?(r=t[e-1],i+=I[r>>2],i+=I[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=I[r>>10],i+=I[r>>4&63],i+=I[r<<2&63],i+="="),o.push(i),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function B(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(B()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=a.prototype):(t===null&&(t=new a(r)),t.length=r),t}function a(t,r,e){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(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 V(this,t)}return ir(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function ir(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?he(t,r,e,n):typeof r=="string"?le(t,r,e):fe(t,r)}a.from=function(t,r,e){return ir(null,t,r,e)};a.kMaxLength=B();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function or(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 ce(t,r,e,n){return or(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}a.alloc=function(t,r,e){return ce(null,t,r,e)};function V(t,r){if(or(r),t=R(t,r<0?0:K(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return V(null,t)};a.allocUnsafeSlow=function(t){return V(null,t)};function le(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=ar(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function H(t,r){var e=r.length<0?0:K(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function he(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),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=H(t,r),t}function fe(t,r){if(_(r)){var e=K(r.length)|0;return t=R(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"||Ue(r.length)?R(t,0):H(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return H(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function K(t){if(t>=B())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+B().toString(16)+" bytes");return t|0}a.isBuffer=Pe;function _(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!_(r)||!_(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,p=Math.min(n,i);o<p;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<n?1:0};a.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}};a.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=a.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var p=r[n];if(!_(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(i,o),o+=p.length}return i};function ar(t,r){if(_(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 S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return fr(t).length;default:if(n)return S(t).length;r=(""+r).toLowerCase(),n=!0}}a.byteLength=ar;function me(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 ge(this,r,e);case"utf8":case"utf-8":return ur(this,r,e);case"ascii":return we(this,r,e);case"latin1":case"binary":return be(this,r,e);case"base64":return Ie(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Re(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function L(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}a.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};a.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};a.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};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?ur(this,0,r):me.apply(this,arguments)};a.prototype.equals=function(r){if(!_(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,n,i,o){if(!_(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var p=o-i,s=n-e,u=Math.min(p,s),f=this.slice(i,o),c=r.slice(e,n),h=0;h<u;++h)if(f[h]!==c[h]){p=f[h],s=c[h];break}return p<s?-1:s<p?1:0};function pr(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=a.from(r,n)),_(r))return r.length===0?-1:er(t,r,e,n,i);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):er(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function er(t,r,e,n,i){var o=1,p=t.length,s=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;o=2,p/=2,s/=2,e/=2}function u(d,y){return o===1?d[y]:d.readUInt16BE(y*o)}var f;if(i){var c=-1;for(f=e;f<p;f++)if(u(t,f)===u(r,c===-1?0:f-c)){if(c===-1&&(c=f),f-c+1===s)return c*o}else c!==-1&&(f-=f-c),c=-1}else for(e+s>p&&(e=p-s),f=e;f>=0;f--){for(var h=!0,T=0;T<s;T++)if(u(t,f+T)!==u(r,T)){h=!1;break}if(h)return f}return-1}a.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};a.prototype.indexOf=function(r,e,n){return pr(this,r,e,n,!0)};a.prototype.lastIndexOf=function(r,e,n){return pr(this,r,e,n,!1)};function Ee(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var p=0;p<n;++p){var s=parseInt(r.substr(p*2,2),16);if(isNaN(s))return p;t[e+p]=s}return p}function de(t,r,e,n){return M(S(r,t.length-e),t,e,n)}function sr(t,r,e,n){return M(Le(r),t,e,n)}function xe(t,r,e,n){return sr(t,r,e,n)}function Ae(t,r,e,n){return M(fr(r),t,e,n)}function Te(t,r,e,n){return M(ye(r,t.length-e),t,e,n)}a.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var p=!1;;)switch(i){case"hex":return Ee(this,r,e,n);case"utf8":case"utf-8":return de(this,r,e,n);case"ascii":return sr(this,r,e,n);case"latin1":case"binary":return xe(this,r,e,n);case"base64":return Ae(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Te(this,r,e,n);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ie(t,r,e){return r===0&&e===t.length?rr(t):rr(t.slice(r,e))}function ur(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],p=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var u,f,c,h;switch(s){case 1:o<128&&(p=o);break;case 2:u=t[i+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(p=h));break;case 3:u=t[i+1],f=t[i+2],(u&192)===128&&(f&192)===128&&(h=(o&15)<<12|(u&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(p=h));break;case 4:u=t[i+1],f=t[i+2],c=t[i+3],(u&192)===128&&(f&192)===128&&(c&192)===128&&(h=(o&15)<<18|(u&63)<<12|(f&63)<<6|c&63,h>65535&&h<1114112&&(p=h))}}p===null?(p=65533,s=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|p&1023),n.push(p),i+=s}return _e(n)}var tr=4096;function _e(t){var r=t.length;if(r<=tr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=tr));return e}function we(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function be(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function ge(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=De(t[o]);return i}function Re(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.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 i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=a.prototype;else{var o=e-r;i=new a(o,void 0);for(var p=0;p<o;++p)i[p]=this[p+r]}return i};function m(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")}a.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],o=1,p=0;++p<e&&(o*=256);)i+=this[r+p]*o;return i};a.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};a.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};a.prototype.readUInt32LE=function(r,e){return e||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};a.prototype.readUInt32BE=function(r,e){return e||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};a.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],o=1,p=0;++p<e&&(o*=256);)i+=this[r+p]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};a.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,o=1,p=this[r+--i];i>0&&(o*=256);)p+=this[r+--i]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||m(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(r,e){e||m(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(r,e){return e||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};a.prototype.readInt32BE=function(r,e){return e||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};a.prototype.readFloatLE=function(r,e){return e||m(r,4,this.length),G(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),G(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),G(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),G(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!_(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var p=1,s=0;for(this[e]=r&255;++s<n&&(p*=256);)this[e+s]=r/p&255;return e+n};a.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;E(this,r,e,n,o,0)}var p=n-1,s=1;for(this[e+p]=r&255;--p>=0&&(s*=256);)this[e+p]=r/s&255;return e+n};a.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function F(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};function k(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}a.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):k(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):k(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var p=0,s=1,u=0;for(this[e]=r&255;++p<n&&(s*=256);)r<0&&u===0&&this[e+p-1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};a.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);E(this,r,e,n,o-1,-o)}var p=n-1,s=1,u=0;for(this[e+p]=r&255;--p>=0&&(s*=256);)r<0&&u===0&&this[e+p+1]!==0&&(u=1),this[e+p]=(r/s>>0)-u&255;return e+n};a.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};a.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):F(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):F(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):k(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):k(this,r,e,!1),e+4};function cr(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function lr(t,r,e,n,i){return i||cr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Er(t,r,e,n,23,4),e+4}a.prototype.writeFloatLE=function(r,e,n){return lr(this,r,e,!0,n)};a.prototype.writeFloatBE=function(r,e,n){return lr(this,r,e,!1,n)};function hr(t,r,e,n,i){return i||cr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Er(t,r,e,n,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,n){return hr(this,r,e,!0,n)};a.prototype.writeDoubleBE=function(r,e,n){return hr(this,r,e,!1,n)};a.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,p;if(this===r&&n<e&&e<i)for(p=o-1;p>=0;--p)r[p+e]=this[p+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};a.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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 p;if(typeof r=="number")for(p=e;p<n;++p)this[p]=r;else{var s=_(r)?r:S(new a(r,i).toString()),u=s.length;for(p=0;p<n-e;++p)this[p+e]=s[p%u]}return this};var Ne=/[^+\/0-9A-Za-z-_]/g;function Ce(t){if(t=Oe(t).replace(Ne,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Oe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function De(t){return t<16?"0"+t.toString(16):t.toString(16)}function S(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],p=0;p<n;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Le(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ye(t,r){for(var e,n,i,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function fr(t){return pe(Ce(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function Ue(t){return t!==t}function Pe(t){return t!=null&&(!!t._isBuffer||mr(t)||ve(t))}function mr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ve(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&mr(t.slice(0,0))}function G(t,r,e,n,i){var o,p,s=i*8-n-1,u=(1<<s)-1,f=u>>1,c=-7,h=e?i-1:0,T=e?-1:1,d=t[r+h];for(h+=T,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=o*256+t[r+h],h+=T,c-=8);for(p=o&(1<<-c)-1,o>>=-c,c+=n;c>0;p=p*256+t[r+h],h+=T,c-=8);if(o===0)o=1-f;else{if(o===u)return p?NaN:(d?-1:1)*(1/0);p=p+Math.pow(2,n),o=o-f}return(d?-1:1)*p*Math.pow(2,o-n)}function Er(t,r,e,n,i,o){var p,s,u,f=o*8-i-1,c=(1<<f)-1,h=c>>1,T=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,y=n?1:-1,Ur=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,p=c):(p=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-p))<1&&(p--,u*=2),p+h>=1?r+=T/u:r+=T*Math.pow(2,1-h),r*u>=2&&(p++,u/=2),p+h>=c?(s=0,p=c):p+h>=1?(s=(r*u-1)*Math.pow(2,i),p=p+h):(s=r*Math.pow(2,h-1)*Math.pow(2,i),p=0));i>=8;t[e+d]=s&255,d+=y,s/=256,i-=8);for(p=p<<i|s,f+=i;f>0;t[e+d]=p&255,d+=y,p/=256,f-=8);t[e+d-y]|=Ur*128}function Ke(t,r){return{id:t.id,address:t.address,chainId:t.chainId,name:t.name,unitName:t.unitName,decimals:t.decimals,isGas:t.isGas,img:t.img,cmcLink:t.cmcLink,isArchived:r?r(t):!1}}function Je(t){return{hash:t.hash,loginAddress:t.loginAddress,loginChainId:t.loginChainId,tokenId:t.token?.id,tokenAddress:t.tokenId,tokenChainId:t.tokenChainId,amount:t.amount,lockedAmount:t.lockedAmount}}var dr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(dr||{}),w=dr;var xr=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(xr||{}),Ar=(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))(Ar||{}),tn={...xr,...Ar};function Tr(t){switch(t){case w.Buy:return"B";case w.Sell:return"S";default:throw new Error("Unknown order side type: "+t)}}var bi=(t,r)=>{if(!t)throw new Error(`Assertion error: ${r}`)};var Ci=()=>1;import A from"bignumber.js";A.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Se=(c=>(c.MINUS="-",c.PLUS="+",c.MULTIPLY="*",c.DIVIDE="/",c.GREATER_THAN_OR_EQUAL=">=",c.GREATER_THAN=">",c.LESS_THAN_OR_EQUAL="<=",c.LESS_THAN="<",c.EQUAL="==",c.MOD="mod",c))(Se||{});function Ui(t){return new A(t).abs().toString()}function Pi(t){let e=new A(String(t)).integerValue(A.ROUND_CEIL).toString();return Rr(t,e)||console.log("Ceil value",{value:t,res:e}),e}function vi(t,r,e=!1){let n=new A(String(t)),i;if(e){let o=n.toFixed(),p=o.indexOf(".");if(p>=0){let s=o.slice(p+1),u=0;for(let c of s)if(c==="0")u++;else break;let f=u+1;i=n.toFixed(f,A.ROUND_UP)}else i=n.toFixed(0)}else i=n.toFixed(r);return console.log("Fixed value",{value:t,res:i}),i}function Bi(t){let e=new A(String(t)).integerValue(A.ROUND_FLOOR).toString();return console.log("Floor value",{value:t,res:e}),e}function Si(t){let e=new A(String(t)).integerValue(A.ROUND_HALF_UP).toString();return console.log("Round value",{value:t,res:e}),e}function wr(t,r){return b(t,r,"+")}function br(t,r){return b(t,r,"-")}function X(t,r){return b(t,r,"*")}function Fi(t,r){return X(t,r||0)}function gr(t,r){return b(t,r,"/")}function ki(t,r){return!!b(t,r,">=")}function q(t,r){return!!b(t,r,">")}function Mi(t,r){return!!b(t,r,"<=")}function Gi(t,r){return!!b(t,r,"<")}function Rr(t,r){return!!b(t,r,"==")}function Fe(t,r){return b(t,r,"mod")}function Yi(t,r){return Rr(Fe(t,r),0)}function b(t,r,e){switch(t=new A(String(t)),r=new A(String(r)),e.toLowerCase()){case"-":return t.minus(r).toString();case"+":return t.plus(r).toString();case"*":case"x":return t.multipliedBy(r).toString();case"\xF7":case"/":return t.dividedBy(r).toString();case">=":return t.isGreaterThanOrEqualTo(r);case">":return t.isGreaterThan(r);case"<=":return t.isLessThanOrEqualTo(r);case"<":return t.isLessThan(r);case"==":return t.isEqualTo(r);case"mod":return t.modulo(r);default:break}}function Ir(t){if(t.toString().includes("e")){let r=t.toString().split("e");return[parseFloat(r[0]),parseFloat(r[1])]}return[t,0]}function _r(t,r){return t+(r<0?`e${r}`:`e+${r}`)}function Nr({decimalPlaces:t=0},r){if(t>0){let[e,n]=Ir(r),[i,o]=Ir(Math.round(Number(_r(e,n+t))));return Number(_r(i,o-t))}return Math.round(r)}function Hi(t,r){let e=Number(t);return Nr({decimalPlaces:e},Math.pow(10,-e)*Number(r))}function Wi(t,r){let e=Math.pow(10,Number(t))*Number(r);return Nr({decimalPlaces:0},e)}var zi=(t,r)=>q(r,0)&&q(t,0)?X(gr(br(t,r),r),100):"0";var Zi=t=>{let r=new Date(t),e=r.toLocaleDateString("default",{year:"numeric",month:"numeric",day:"numeric"}),n=r.toLocaleTimeString("en-US",{hour12:!0,hour:"2-digit",minute:"2-digit"});return e+" "+n},Dr=(t,r)=>String(t).toLowerCase()===String(r).toLowerCase();function ji(t,r){return t=Math.ceil(t),r=Math.floor(r),Math.floor(Math.random()*(r-t+1))+t}function ro(t){let r=[],e=t.split(".");for(let n=0;n<e.length-1;n++)r.push(e.slice(n).join("."));return r}function eo(t){let r=t.headers&&Y({Authorization:t.headers.Authorization?.substring(0,200),"CloudFront-Viewer-Country":t.headers["CloudFront-Viewer-Country"],Host:t.headers.Host,origin:t.headers.origin,Referer:t.headers.Referer,"User-Agent":t.headers["User-Agent"],"wl-domain":t.headers["wl-domain"],"X-API-Key":Cr(t.headers["X-API-Key"]),"X-Forwarded-For":t.headers["X-Forwarded-For"],"X-Forwarded-Port":t.headers["X-Forwarded-Port"],"X-Forwarded-Proto":t.headers["X-Forwarded-Proto"],"X-Trading-Key":t.headers["X-Trading-Key"],"X-Wallet-Address":t.headers["X-Wallet-Address"],"X-Wallet-Token":t.headers["X-Wallet-Token"],accessToken:Cr(t.headers.accessToken),companyId:t.headers.companyId,seasonId:t.headers.seasonId}),e=t.requestContext&&Y({identity:t.requestContext.identity&&Y({userAgent:t.requestContext.identity.userAgent,sourceIp:t.requestContext.identity.sourceIp}),domainName:t.requestContext.domainName});return Y({manage:t.manage,path:t.path,httpMethod:t.httpMethod,headers:r,requestContext:e})}function Cr(t){if(!t?.length)return t;let r=Math.round(t.length/3),e=r,n=t.length-r;return t.substring(0,e)+"*".repeat(r)+t.substring(n)}function Or(t,r){return Array.isArray(t)?t.map(e=>Or(e,r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).filter(([e])=>e!==r).map(([e,n])=>[e,Or(n,r)])):t}function Y(t){return Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0))}function ho(t,r,e){let n=t.buyOrder&&t.sellOrder?t.buyOrderId>t.sellOrderId?t.buyOrder:t.sellOrder:t.buyOrder||t.sellOrder;return{pairId:t.pairId,orderId:n?.id,orderSide:n&&Tr(n.side),...Lr(r,e),...yr(t,n)}}function fo(t,r,e,n,i){return{id:t.id,pairId:t.pairId,pair:e||t.pair?.pairKey,...Lr(n,i),amount:t.amount,price:t.price,total:t.total,filledAmount:t.filledAmount,filledTotal:t.filledTotal,avgPrice:t.excutedPrice,status:t.status,side:t.side,type:t.type,userId:t.userId,createdAt:t.createdAt?.getTime(),completedAt:t.completedAt?.getTime()||null,updatedAt:t.updatedAt?.getTime(),trades:r&&r.map(o=>yr(o,t))}}function Lr(t,r){return{baseTokenId:t?.id,baseTokenDecimal:t?.decimals,quoteTokenId:r?.id,quoteTokenDecimal:r?.decimals}}function yr(t,r){return{tradeId:t.tradeId,status:t.txStatus,amount:t.amount,total:t.total,price:t.price,fee:r&&t.tradeFees.filter(e=>Dr(e.address,r.userId)).reduce((e,n)=>wr(e,n.fee),"0"),createdAt:t.createdAt?.getTime(),updatedAt:t.updatedAt?.getTime(),isBuyer:r&&r.side===w.Buy,isMaker:r&&ke(r.side,t.tradeSide)}}function ke(t,r){return t===w.Buy&&r===w.Sell||t===w.Sell&&r===w.Buy}export{Se as Operations,Ui as absolute,bi as assert,b as bn_operation,Pi as ceil,zi as changes24H,Hi as convertFromBaseUnits,Wi as convertToBaseUnits,eo as cutEvent,gr as divide,Rr as equal,Dr as equalIgnoreCase,Bi as floor,ro as getDomains,Ci as getGlobalPointSystemId,ji as getRandomInt,q as greaterThan,ki as greaterThanOrEqual,ke as isMaker,Gi as lessThan,Mi as lessThanOrEqual,Zi as listDateFormat,Ke as mapToCodexAssetDto,Je as mapToCodexBalanceDto,fo as mapToOrderTradeDto,ho as mapToUserTradeDto,Cr as maskingString,br as minus,Fe as mod,Yi as modZero,X as multiply,wr as plus,Or as removeField,Si as round,Nr as roundNumber,vi as toFixed,Fi as toUsd};
|
|
8
2
|
/*! Bundled license information:
|
|
9
3
|
|
|
10
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function z(){throw new Error("setTimeout has not been defined")}function J(){throw new Error("clearTimeout has not been defined")}var R=z,_=J;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function O(i){if(R===setTimeout)return setTimeout(i,0);if((R===z||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch{try{return R.call(null,i,0)}catch{return R.call(this,i,0)}}}function lr(i){if(_===clearTimeout)return clearTimeout(i);if((_===J||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(i);try{return _(i)}catch{try{return _.call(null,i)}catch{return _.call(this,i)}}}var y=[],S=!1,I,Y=-1;function pr(){!S||!I||(S=!1,I.length?y=I.concat(y):Y=-1,y.length&&Q())}function Q(){if(!S){var i=O(pr);S=!0;for(var r=y.length;r;){for(I=y,y=[];++Y<r;)I&&I[Y].run();Y=-1,r=y.length}I=null,S=!1,lr(i)}}function sr(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];y.push(new X(i,r)),y.length===1&&!S&&O(Q)}function X(i,r){this.fun=i,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",xr="browser",Er=!0,mr={},Ar=[],gr="",yr={},Tr={},Rr={};function v(){}var _r=v,Ir=v,vr=v,Ur=v,Br=v,dr=v,Sr=v;function Yr(i){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Mr(i){throw new Error("process.chdir is not supported")}function Dr(){return 0}var d=globalThis.performance||{},Cr=d.now||d.mozNow||d.msNow||d.oNow||d.webkitNow||function(){return new Date().getTime()};function kr(i){var r=Cr.call(d)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var Nr=new Date;function Lr(){var i=new Date,r=i-Nr;return r/1e3}var L={nextTick:sr,title:wr,browser:Er,env:mr,argv:Ar,version:gr,versions:yr,on:_r,addListener:Ir,once:vr,off:Ur,removeListener:Br,removeAllListeners:dr,emit:Sr,binding:Yr,cwd:Pr,chdir:Mr,umask:Dr,hrtime:kr,platform:xr,release:Tr,config:Rr,uptime:Lr},V={};Object.keys(V).forEach(i=>{let r=i.split("."),n=L;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=V[i]:n=n[t]||(n[t]={})}});var A=[],E=[],Fr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function $(){W=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],E[i.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(i){W||$();var r,n,e,t,f,u,h=i.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=i[h-2]==="="?2:i[h-1]==="="?1:0,u=new Fr(h*3/4-f),e=f>0?h-4:h;var a=0;for(r=0,n=0;r<e;r+=4,n+=3)t=E[i.charCodeAt(r)]<<18|E[i.charCodeAt(r+1)]<<12|E[i.charCodeAt(r+2)]<<6|E[i.charCodeAt(r+3)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=t&255;return f===2?(t=E[i.charCodeAt(r)]<<2|E[i.charCodeAt(r+1)]>>4,u[a++]=t&255):f===1&&(t=E[i.charCodeAt(r)]<<10|E[i.charCodeAt(r+1)]<<4|E[i.charCodeAt(r+2)]>>2,u[a++]=t>>8&255,u[a++]=t&255),u}function Gr(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Hr(i,r,n){for(var e,t=[],f=r;f<n;f+=3)e=(i[f]<<16)+(i[f+1]<<8)+i[f+2],t.push(Gr(e));return t.join("")}function q(i){W||$();for(var r,n=i.length,e=n%3,t="",f=[],u=16383,h=0,a=n-e;h<a;h+=u)f.push(Hr(i,h,h+u>a?a:h+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(i,r){if(P()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=o.prototype):(i===null&&(i=new o(r)),i.length=r),i}function o(i,r,n){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return G(this,i)}return b(this,i,r,n)}o.poolSize=8192;o._augment=function(i){return i.__proto__=o.prototype,i};function b(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Jr(i,r,n,e):typeof r=="string"?zr(i,r,n):Or(i,r)}o.from=function(i,r,n){return b(null,i,r,n)};o.kMaxLength=P();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Vr(i,r,n,e){return j(r),r<=0?T(i,r):n!==void 0?typeof e=="string"?T(i,r).fill(n,e):T(i,r).fill(n):T(i,r)}o.alloc=function(i,r,n){return Vr(null,i,r,n)};function G(i,r){if(j(r),i=T(i,r<0?0:H(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}o.allocUnsafe=function(i){return G(null,i)};o.allocUnsafeSlow=function(i){return G(null,i)};function zr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,n)|0;i=T(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function F(i,r){var n=r.length<0?0:H(r.length)|0;i=T(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Jr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),o.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=o.prototype):i=F(i,r),i}function Or(i,r){if(g(r)){var n=H(r.length)|0;return i=T(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||ln(r.length)?T(i,0):F(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function H(i){if(i>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return i|0}o.isBuffer=pn;function g(i){return!!(i!=null&&i._isBuffer)}o.compare=function(r,n){if(!g(r)||!g(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==n[f]){e=r[f],t=n[f];break}return e<t?-1:t<e?1:0};o.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}};o.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=o.allocUnsafe(n),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(i,r){if(g(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return M(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return or(i).length;default:if(e)return M(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Qr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return en(this,r,n);case"utf8":case"utf-8":return er(this,r,n);case"ascii":return rn(this,r,n);case"latin1":case"binary":return nn(this,r,n);case"base64":return br(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function U(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}o.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 n=0;n<r;n+=2)U(this,n,n+1);return this};o.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 n=0;n<r;n+=4)U(this,n,n+3),U(this,n+1,n+2);return this};o.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 n=0;n<r;n+=8)U(this,n,n+7),U(this,n+1,n+6),U(this,n+2,n+5),U(this,n+3,n+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Qr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,n,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),n<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&n>=e)return 0;if(t>=f)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,h=e-n,a=Math.min(u,h),l=this.slice(t,f),p=r.slice(n,e),c=0;c<a;++c)if(l[c]!==p[c]){u=l[c],h=p[c];break}return u<h?-1:h<u?1:0};function nr(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:Z(i,r,n,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):Z(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function Z(i,r,n,e,t){var f=1,u=i.length,h=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;f=2,u/=2,h/=2,n/=2}function a(x,B){return f===1?x[B]:x.readUInt16BE(B*f)}var l;if(t){var p=-1;for(l=n;l<u;l++)if(a(i,l)===a(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===h)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(n+h>u&&(n=u-h),l=n;l>=0;l--){for(var c=!0,m=0;m<h;m++)if(a(i,l+m)!==a(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};o.prototype.indexOf=function(r,n,e){return nr(this,r,n,e,!0)};o.prototype.lastIndexOf=function(r,n,e){return nr(this,r,n,e,!1)};function Xr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var h=parseInt(r.substr(u*2,2),16);if(isNaN(h))return u;i[n+u]=h}return u}function qr(i,r,n,e){return k(M(r,i.length-n),i,n,e)}function ir(i,r,n,e){return k(an(r),i,n,e)}function Zr(i,r,n,e){return ir(i,r,n,e)}function Kr(i,r,n,e){return k(or(r),i,n,e)}function $r(i,r,n,e){return k(cn(r,i.length-n),i,n,e)}o.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-n;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Xr(this,r,n,e);case"utf8":case"utf-8":return qr(this,r,n,e);case"ascii":return ir(this,r,n,e);case"latin1":case"binary":return Zr(this,r,n,e);case"base64":return Kr(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function br(i,r,n){return r===0&&n===i.length?q(i):q(i.slice(r,n))}function er(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var f=i[t],u=null,h=f>239?4:f>223?3:f>191?2:1;if(t+h<=n){var a,l,p,c;switch(h){case 1:f<128&&(u=f);break;case 2:a=i[t+1],(a&192)===128&&(c=(f&31)<<6|a&63,c>127&&(u=c));break;case 3:a=i[t+1],l=i[t+2],(a&192)===128&&(l&192)===128&&(c=(f&15)<<12|(a&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:a=i[t+1],l=i[t+2],p=i[t+3],(a&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(a&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=h}return jr(e)}var K=4096;function jr(i){var r=i.length;if(r<=K)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=K));return n}function rn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function nn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function en(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",f=r;f<n;++f)t+=hn(i[f]);return t}function tn(i,r,n){for(var e=i.slice(r,n),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=o.prototype;else{var f=n-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r+--n],f=1;n>0&&(f*=256);)t+=this[r+--n]*f;return t};o.prototype.readUInt8=function(r,n){return n||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,n){return n||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,n){return n||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,n){return n||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,n){return n||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*n)),t};o.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=n,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*n)),u};o.prototype.readInt8=function(r,n){return n||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,n){n||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,n){n||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,n){return n||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,n){return n||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,n){return n||s(r,4,this.length),N(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,n){return n||s(r,4,this.length),N(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,n){return n||s(r,8,this.length),N(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,n){return n||s(r,8,this.length),N(this,r,!1,52,8)};function w(i,r,n,e,t,f){if(!g(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=1,h=0;for(this[n]=r&255;++h<e&&(u*=256);)this[n+h]=r/u&255;return n+e};o.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=e-1,h=1;for(this[n+u]=r&255;--u>=0&&(h*=256);)this[n+u]=r/h&255;return n+e};o.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function D(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(i.length-n,2);t<f;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};o.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};function C(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(i.length-n,4);t<f;++t)i[n+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):C(this,r,n,!0),n+4};o.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};o.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=0,h=1,a=0;for(this[n]=r&255;++u<e&&(h*=256);)r<0&&a===0&&this[n+u-1]!==0&&(a=1),this[n+u]=(r/h>>0)-a&255;return n+e};o.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=e-1,h=1,a=0;for(this[n+u]=r&255;--u>=0&&(h*=256);)r<0&&a===0&&this[n+u+1]!==0&&(a=1),this[n+u]=(r/h>>0)-a&255;return n+e};o.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};o.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):D(this,r,n,!0),n+2};o.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):D(this,r,n,!1),n+2};o.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):C(this,r,n,!0),n+4};o.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):C(this,r,n,!1),n+4};function tr(i,r,n,e,t,f){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function fr(i,r,n,e,t){return t||tr(i,r,n,4,34028234663852886e22,-34028234663852886e22),ar(i,r,n,e,23,4),n+4}o.prototype.writeFloatLE=function(r,n,e){return fr(this,r,n,!0,e)};o.prototype.writeFloatBE=function(r,n,e){return fr(this,r,n,!1,e)};function ur(i,r,n,e,t){return t||tr(i,r,n,8,17976931348623157e292,-17976931348623157e292),ar(i,r,n,e,52,8),n+8}o.prototype.writeDoubleLE=function(r,n,e){return ur(this,r,n,!0,e)};o.prototype.writeDoubleBE=function(r,n,e){return ur(this,r,n,!1,e)};o.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var f=t-e,u;if(this===r&&e<n&&n<t)for(u=f-1;u>=0;--u)r[u+n]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),n);return f};o.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var h=g(r)?r:M(new o(r,t).toString()),a=h.length;for(u=0;u<e-n;++u)this[u+n]=h[u%a]}return this};var fn=/[^+\/0-9A-Za-z-_]/g;function un(i){if(i=on(i).replace(fn,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function on(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function hn(i){return i<16?"0"+i.toString(16):i.toString(16)}function M(i,r){r=r||1/0;for(var n,e=i.length,t=null,f=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&f.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;f.push(n)}else if(n<2048){if((r-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function an(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function cn(i,r){for(var n,e,t,f=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,f.push(t),f.push(e);return f}function or(i){return Wr(un(i))}function k(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function ln(i){return i!==i}function pn(i){return i!=null&&(!!i._isBuffer||hr(i)||sn(i))}function hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function sn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&hr(i.slice(0,0))}function N(i,r,n,e,t){var f,u,h=t*8-e-1,a=(1<<h)-1,l=a>>1,p=-7,c=n?t-1:0,m=n?-1:1,x=i[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=h;p>0;f=f*256+i[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+i[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===a)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function ar(i,r,n,e,t,f){var u,h,a,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,B=e?1:-1,cr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+c>=1?r+=m/a:r+=m*Math.pow(2,1-c),r*a>=2&&(u++,a/=2),u+c>=p?(h=0,u=p):u+c>=1?(h=(r*a-1)*Math.pow(2,t),u=u+c):(h=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=h&255,x+=B,h/=256,t-=8);for(u=u<<t|h,l+=t;l>0;i[n+x]=u&255,x+=B,u/=256,l-=8);i[n+x-B]|=cr*128}var yn=()=>1;export{yn as getGlobalPointSystemId};
|
|
1
|
+
function X(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var R=X,_=K;typeof globalThis.setTimeout=="function"&&(R=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function V(i){if(R===setTimeout)return setTimeout(i,0);if((R===X||!R)&&setTimeout)return R=setTimeout,setTimeout(i,0);try{return R(i,0)}catch{try{return R.call(null,i,0)}catch{return R.call(this,i,0)}}}function pr(i){if(_===clearTimeout)return clearTimeout(i);if((_===K||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(i);try{return _(i)}catch{try{return _.call(null,i)}catch{return _.call(this,i)}}}var y=[],S=!1,v,D=-1;function sr(){!S||!v||(S=!1,v.length?y=v.concat(y):D=-1,y.length&&z())}function z(){if(!S){var i=V(sr);S=!0;for(var r=y.length;r;){for(v=y,y=[];++D<r;)v&&v[D].run();D=-1,r=y.length}v=null,S=!1,pr(i)}}function wr(i){var r=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)r[n-1]=arguments[n];y.push(new J(i,r)),y.length===1&&!S&&V(z)}function J(i,r){this.fun=i,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var xr="browser",Er="browser",mr=!0,Ar={},gr=[],yr="",Tr={},Rr={},_r={};function U(){}var Ir=U,vr=U,Ur=U,Br=U,dr=U,Pr=U,Sr=U;function Dr(i){throw new Error("process.binding is not supported")}function Yr(){return"/"}function Cr(i){throw new Error("process.chdir is not supported")}function Mr(){return 0}var P=globalThis.performance||{},Nr=P.now||P.mozNow||P.msNow||P.oNow||P.webkitNow||function(){return new Date().getTime()};function kr(i){var r=Nr.call(P)*.001,n=Math.floor(r),e=Math.floor(r%1*1e9);return i&&(n=n-i[0],e=e-i[1],e<0&&(n--,e+=1e9)),[n,e]}var Lr=new Date;function Fr(){var i=new Date,r=i-Lr;return r/1e3}var I={nextTick:wr,title:xr,browser:mr,env:Ar,argv:gr,version:yr,versions:Tr,on:Ir,addListener:vr,once:Ur,off:Br,removeListener:dr,removeAllListeners:Pr,emit:Sr,binding:Dr,cwd:Yr,chdir:Cr,umask:Mr,hrtime:kr,platform:Er,release:Rr,config:_r,uptime:Fr},H={};Object.keys(H).forEach(i=>{let r=i.split("."),n=I;for(let e=0;e<r.length;e++){let t=r[e];e===r.length-1?n[t]=H[i]:n=n[t]||(n[t]={})}});var A=[],E=[],Or=typeof Uint8Array<"u"?Uint8Array:Array,O=!1;function $(){O=!0;for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,n=i.length;r<n;++r)A[r]=i[r],E[i.charCodeAt(r)]=r;E[45]=62,E[95]=63}function Wr(i){O||$();var r,n,e,t,f,u,h=i.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=i[h-2]==="="?2:i[h-1]==="="?1:0,u=new Or(h*3/4-f),e=f>0?h-4:h;var a=0;for(r=0,n=0;r<e;r+=4,n+=3)t=E[i.charCodeAt(r)]<<18|E[i.charCodeAt(r+1)]<<12|E[i.charCodeAt(r+2)]<<6|E[i.charCodeAt(r+3)],u[a++]=t>>16&255,u[a++]=t>>8&255,u[a++]=t&255;return f===2?(t=E[i.charCodeAt(r)]<<2|E[i.charCodeAt(r+1)]>>4,u[a++]=t&255):f===1&&(t=E[i.charCodeAt(r)]<<10|E[i.charCodeAt(r+1)]<<4|E[i.charCodeAt(r+2)]>>2,u[a++]=t>>8&255,u[a++]=t&255),u}function Gr(i){return A[i>>18&63]+A[i>>12&63]+A[i>>6&63]+A[i&63]}function Hr(i,r,n){for(var e,t=[],f=r;f<n;f+=3)e=(i[f]<<16)+(i[f+1]<<8)+i[f+2],t.push(Gr(e));return t.join("")}function Q(i){O||$();for(var r,n=i.length,e=n%3,t="",f=[],u=16383,h=0,a=n-e;h<a;h+=u)f.push(Hr(i,h,h+u>a?a:h+u));return e===1?(r=i[n-1],t+=A[r>>2],t+=A[r<<4&63],t+="=="):e===2&&(r=(i[n-2]<<8)+i[n-1],t+=A[r>>10],t+=A[r>>4&63],t+=A[r<<2&63],t+="="),f.push(t),f.join("")}o.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Y(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function T(i,r){if(Y()<r)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(i=new Uint8Array(r),i.__proto__=o.prototype):(i===null&&(i=new o(r)),i.length=r),i}function o(i,r,n){if(!o.TYPED_ARRAY_SUPPORT&&!(this instanceof o))return new o(i,r,n);if(typeof i=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return W(this,i)}return b(this,i,r,n)}o.poolSize=8192;o._augment=function(i){return i.__proto__=o.prototype,i};function b(i,r,n,e){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Vr(i,r,n,e):typeof r=="string"?Kr(i,r,n):zr(i,r)}o.from=function(i,r,n){return b(null,i,r,n)};o.kMaxLength=Y();o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&o[Symbol.species]);function j(i){if(typeof i!="number")throw new TypeError('"size" argument must be a number');if(i<0)throw new RangeError('"size" argument must not be negative')}function Xr(i,r,n,e){return j(r),r<=0?T(i,r):n!==void 0?typeof e=="string"?T(i,r).fill(n,e):T(i,r).fill(n):T(i,r)}o.alloc=function(i,r,n){return Xr(null,i,r,n)};function W(i,r){if(j(r),i=T(i,r<0?0:G(r)|0),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<r;++n)i[n]=0;return i}o.allocUnsafe=function(i){return W(null,i)};o.allocUnsafeSlow=function(i){return W(null,i)};function Kr(i,r,n){if((typeof n!="string"||n==="")&&(n="utf8"),!o.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var e=rr(r,n)|0;i=T(i,e);var t=i.write(r,n);return t!==e&&(i=i.slice(0,t)),i}function F(i,r){var n=r.length<0?0:G(r.length)|0;i=T(i,n);for(var e=0;e<n;e+=1)i[e]=r[e]&255;return i}function Vr(i,r,n,e){if(r.byteLength,n<0||r.byteLength<n)throw new RangeError("'offset' is out of bounds");if(r.byteLength<n+(e||0))throw new RangeError("'length' is out of bounds");return n===void 0&&e===void 0?r=new Uint8Array(r):e===void 0?r=new Uint8Array(r,n):r=new Uint8Array(r,n,e),o.TYPED_ARRAY_SUPPORT?(i=r,i.__proto__=o.prototype):i=F(i,r),i}function zr(i,r){if(g(r)){var n=G(r.length)|0;return i=T(i,n),i.length===0||r.copy(i,0,0,n),i}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||pn(r.length)?T(i,0):F(i,r);if(r.type==="Buffer"&&Array.isArray(r.data))return F(i,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(i){if(i>=Y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y().toString(16)+" bytes");return i|0}o.isBuffer=sn;function g(i){return!!(i!=null&&i._isBuffer)}o.compare=function(r,n){if(!g(r)||!g(n))throw new TypeError("Arguments must be Buffers");if(r===n)return 0;for(var e=r.length,t=n.length,f=0,u=Math.min(e,t);f<u;++f)if(r[f]!==n[f]){e=r[f],t=n[f];break}return e<t?-1:t<e?1:0};o.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}};o.concat=function(r,n){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);var e;if(n===void 0)for(n=0,e=0;e<r.length;++e)n+=r[e].length;var t=o.allocUnsafe(n),f=0;for(e=0;e<r.length;++e){var u=r[e];if(!g(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(t,f),f+=u.length}return t};function rr(i,r){if(g(i))return i.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(i)||i instanceof ArrayBuffer))return i.byteLength;typeof i!="string"&&(i=""+i);var n=i.length;if(n===0)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return C(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return or(i).length;default:if(e)return C(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=rr;function Jr(i,r,n){var e=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,r>>>=0,n<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return tn(this,r,n);case"utf8":case"utf-8":return er(this,r,n);case"ascii":return nn(this,r,n);case"latin1":case"binary":return en(this,r,n);case"base64":return jr(this,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fn(this,r,n);default:if(e)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),e=!0}}o.prototype._isBuffer=!0;function B(i,r,n){var e=i[r];i[r]=i[n],i[n]=e}o.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 n=0;n<r;n+=2)B(this,n,n+1);return this};o.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 n=0;n<r;n+=4)B(this,n,n+3),B(this,n+1,n+2);return this};o.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 n=0;n<r;n+=8)B(this,n,n+7),B(this,n+1,n+6),B(this,n+2,n+5),B(this,n+3,n+4);return this};o.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?er(this,0,r):Jr.apply(this,arguments)};o.prototype.equals=function(r){if(!g(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0};o.prototype.compare=function(r,n,e,t,f){if(!g(r))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),e===void 0&&(e=r?r.length:0),t===void 0&&(t=0),f===void 0&&(f=this.length),n<0||e>r.length||t<0||f>this.length)throw new RangeError("out of range index");if(t>=f&&n>=e)return 0;if(t>=f)return-1;if(n>=e)return 1;if(n>>>=0,e>>>=0,t>>>=0,f>>>=0,this===r)return 0;for(var u=f-t,h=e-n,a=Math.min(u,h),l=this.slice(t,f),p=r.slice(n,e),c=0;c<a;++c)if(l[c]!==p[c]){u=l[c],h=p[c];break}return u<h?-1:h<u?1:0};function nr(i,r,n,e,t){if(i.length===0)return-1;if(typeof n=="string"?(e=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=t?0:i.length-1),n<0&&(n=i.length+n),n>=i.length){if(t)return-1;n=i.length-1}else if(n<0)if(t)n=0;else return-1;if(typeof r=="string"&&(r=o.from(r,e)),g(r))return r.length===0?-1:q(i,r,n,e,t);if(typeof r=="number")return r=r&255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?t?Uint8Array.prototype.indexOf.call(i,r,n):Uint8Array.prototype.lastIndexOf.call(i,r,n):q(i,[r],n,e,t);throw new TypeError("val must be string, number or Buffer")}function q(i,r,n,e,t){var f=1,u=i.length,h=r.length;if(e!==void 0&&(e=String(e).toLowerCase(),e==="ucs2"||e==="ucs-2"||e==="utf16le"||e==="utf-16le")){if(i.length<2||r.length<2)return-1;f=2,u/=2,h/=2,n/=2}function a(x,d){return f===1?x[d]:x.readUInt16BE(d*f)}var l;if(t){var p=-1;for(l=n;l<u;l++)if(a(i,l)===a(r,p===-1?0:l-p)){if(p===-1&&(p=l),l-p+1===h)return p*f}else p!==-1&&(l-=l-p),p=-1}else for(n+h>u&&(n=u-h),l=n;l>=0;l--){for(var c=!0,m=0;m<h;m++)if(a(i,l+m)!==a(r,m)){c=!1;break}if(c)return l}return-1}o.prototype.includes=function(r,n,e){return this.indexOf(r,n,e)!==-1};o.prototype.indexOf=function(r,n,e){return nr(this,r,n,e,!0)};o.prototype.lastIndexOf=function(r,n,e){return nr(this,r,n,e,!1)};function Qr(i,r,n,e){n=Number(n)||0;var t=i.length-n;e?(e=Number(e),e>t&&(e=t)):e=t;var f=r.length;if(f%2!==0)throw new TypeError("Invalid hex string");e>f/2&&(e=f/2);for(var u=0;u<e;++u){var h=parseInt(r.substr(u*2,2),16);if(isNaN(h))return u;i[n+u]=h}return u}function qr(i,r,n,e){return k(C(r,i.length-n),i,n,e)}function ir(i,r,n,e){return k(cn(r),i,n,e)}function Zr(i,r,n,e){return ir(i,r,n,e)}function $r(i,r,n,e){return k(or(r),i,n,e)}function br(i,r,n,e){return k(ln(r,i.length-n),i,n,e)}o.prototype.write=function(r,n,e,t){if(n===void 0)t="utf8",e=this.length,n=0;else if(e===void 0&&typeof n=="string")t=n,e=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(e)?(e=e|0,t===void 0&&(t="utf8")):(t=e,e=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-n;if((e===void 0||e>f)&&(e=f),r.length>0&&(e<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");t||(t="utf8");for(var u=!1;;)switch(t){case"hex":return Qr(this,r,n,e);case"utf8":case"utf-8":return qr(this,r,n,e);case"ascii":return ir(this,r,n,e);case"latin1":case"binary":return Zr(this,r,n,e);case"base64":return $r(this,r,n,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return br(this,r,n,e);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(""+t).toLowerCase(),u=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jr(i,r,n){return r===0&&n===i.length?Q(i):Q(i.slice(r,n))}function er(i,r,n){n=Math.min(i.length,n);for(var e=[],t=r;t<n;){var f=i[t],u=null,h=f>239?4:f>223?3:f>191?2:1;if(t+h<=n){var a,l,p,c;switch(h){case 1:f<128&&(u=f);break;case 2:a=i[t+1],(a&192)===128&&(c=(f&31)<<6|a&63,c>127&&(u=c));break;case 3:a=i[t+1],l=i[t+2],(a&192)===128&&(l&192)===128&&(c=(f&15)<<12|(a&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(u=c));break;case 4:a=i[t+1],l=i[t+2],p=i[t+3],(a&192)===128&&(l&192)===128&&(p&192)===128&&(c=(f&15)<<18|(a&63)<<12|(l&63)<<6|p&63,c>65535&&c<1114112&&(u=c))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,e.push(u>>>10&1023|55296),u=56320|u&1023),e.push(u),t+=h}return rn(e)}var Z=4096;function rn(i){var r=i.length;if(r<=Z)return String.fromCharCode.apply(String,i);for(var n="",e=0;e<r;)n+=String.fromCharCode.apply(String,i.slice(e,e+=Z));return n}function nn(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]&127);return e}function en(i,r,n){var e="";n=Math.min(i.length,n);for(var t=r;t<n;++t)e+=String.fromCharCode(i[t]);return e}function tn(i,r,n){var e=i.length;(!r||r<0)&&(r=0),(!n||n<0||n>e)&&(n=e);for(var t="",f=r;f<n;++f)t+=an(i[f]);return t}function fn(i,r,n){for(var e=i.slice(r,n),t="",f=0;f<e.length;f+=2)t+=String.fromCharCode(e[f]+e[f+1]*256);return t}o.prototype.slice=function(r,n){var e=this.length;r=~~r,n=n===void 0?e:~~n,r<0?(r+=e,r<0&&(r=0)):r>e&&(r=e),n<0?(n+=e,n<0&&(n=0)):n>e&&(n=e),n<r&&(n=r);var t;if(o.TYPED_ARRAY_SUPPORT)t=this.subarray(r,n),t.__proto__=o.prototype;else{var f=n-r;t=new o(f,void 0);for(var u=0;u<f;++u)t[u]=this[u+r]}return t};function s(i,r,n){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+r>n)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return t};o.prototype.readUIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r+--n],f=1;n>0&&(f*=256);)t+=this[r+--n]*f;return t};o.prototype.readUInt8=function(r,n){return n||s(r,1,this.length),this[r]};o.prototype.readUInt16LE=function(r,n){return n||s(r,2,this.length),this[r]|this[r+1]<<8};o.prototype.readUInt16BE=function(r,n){return n||s(r,2,this.length),this[r]<<8|this[r+1]};o.prototype.readUInt32LE=function(r,n){return n||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};o.prototype.readUInt32BE=function(r,n){return n||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};o.prototype.readIntLE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=this[r],f=1,u=0;++u<n&&(f*=256);)t+=this[r+u]*f;return f*=128,t>=f&&(t-=Math.pow(2,8*n)),t};o.prototype.readIntBE=function(r,n,e){r=r|0,n=n|0,e||s(r,n,this.length);for(var t=n,f=1,u=this[r+--t];t>0&&(f*=256);)u+=this[r+--t]*f;return f*=128,u>=f&&(u-=Math.pow(2,8*n)),u};o.prototype.readInt8=function(r,n){return n||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};o.prototype.readInt16LE=function(r,n){n||s(r,2,this.length);var e=this[r]|this[r+1]<<8;return e&32768?e|4294901760:e};o.prototype.readInt16BE=function(r,n){n||s(r,2,this.length);var e=this[r+1]|this[r]<<8;return e&32768?e|4294901760:e};o.prototype.readInt32LE=function(r,n){return n||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};o.prototype.readInt32BE=function(r,n){return n||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};o.prototype.readFloatLE=function(r,n){return n||s(r,4,this.length),L(this,r,!0,23,4)};o.prototype.readFloatBE=function(r,n){return n||s(r,4,this.length),L(this,r,!1,23,4)};o.prototype.readDoubleLE=function(r,n){return n||s(r,8,this.length),L(this,r,!0,52,8)};o.prototype.readDoubleBE=function(r,n){return n||s(r,8,this.length),L(this,r,!1,52,8)};function w(i,r,n,e,t,f){if(!g(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>t||r<f)throw new RangeError('"value" argument is out of bounds');if(n+e>i.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=1,h=0;for(this[n]=r&255;++h<e&&(u*=256);)this[n+h]=r/u&255;return n+e};o.prototype.writeUIntBE=function(r,n,e,t){if(r=+r,n=n|0,e=e|0,!t){var f=Math.pow(2,8*e)-1;w(this,r,n,e,f,0)}var u=e-1,h=1;for(this[n+u]=r&255;--u>=0&&(h*=256);)this[n+u]=r/h&255;return n+e};o.prototype.writeUInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,255,0),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[n]=r&255,n+1};function M(i,r,n,e){r<0&&(r=65535+r+1);for(var t=0,f=Math.min(i.length-n,2);t<f;++t)i[n+t]=(r&255<<8*(e?t:1-t))>>>(e?t:1-t)*8}o.prototype.writeUInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):M(this,r,n,!0),n+2};o.prototype.writeUInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):M(this,r,n,!1),n+2};function N(i,r,n,e){r<0&&(r=4294967295+r+1);for(var t=0,f=Math.min(i.length-n,4);t<f;++t)i[n+t]=r>>>(e?t:3-t)*8&255}o.prototype.writeUInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n+3]=r>>>24,this[n+2]=r>>>16,this[n+1]=r>>>8,this[n]=r&255):N(this,r,n,!0),n+4};o.prototype.writeUInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):N(this,r,n,!1),n+4};o.prototype.writeIntLE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=0,h=1,a=0;for(this[n]=r&255;++u<e&&(h*=256);)r<0&&a===0&&this[n+u-1]!==0&&(a=1),this[n+u]=(r/h>>0)-a&255;return n+e};o.prototype.writeIntBE=function(r,n,e,t){if(r=+r,n=n|0,!t){var f=Math.pow(2,8*e-1);w(this,r,n,e,f-1,-f)}var u=e-1,h=1,a=0;for(this[n+u]=r&255;--u>=0&&(h*=256);)r<0&&a===0&&this[n+u+1]!==0&&(a=1),this[n+u]=(r/h>>0)-a&255;return n+e};o.prototype.writeInt8=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,1,127,-128),o.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[n]=r&255,n+1};o.prototype.writeInt16LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8):M(this,r,n,!0),n+2};o.prototype.writeInt16BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>8,this[n+1]=r&255):M(this,r,n,!1),n+2};o.prototype.writeInt32LE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[n]=r&255,this[n+1]=r>>>8,this[n+2]=r>>>16,this[n+3]=r>>>24):N(this,r,n,!0),n+4};o.prototype.writeInt32BE=function(r,n,e){return r=+r,n=n|0,e||w(this,r,n,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),o.TYPED_ARRAY_SUPPORT?(this[n]=r>>>24,this[n+1]=r>>>16,this[n+2]=r>>>8,this[n+3]=r&255):N(this,r,n,!1),n+4};function tr(i,r,n,e,t,f){if(n+e>i.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function fr(i,r,n,e,t){return t||tr(i,r,n,4,34028234663852886e22,-34028234663852886e22),ar(i,r,n,e,23,4),n+4}o.prototype.writeFloatLE=function(r,n,e){return fr(this,r,n,!0,e)};o.prototype.writeFloatBE=function(r,n,e){return fr(this,r,n,!1,e)};function ur(i,r,n,e,t){return t||tr(i,r,n,8,17976931348623157e292,-17976931348623157e292),ar(i,r,n,e,52,8),n+8}o.prototype.writeDoubleLE=function(r,n,e){return ur(this,r,n,!0,e)};o.prototype.writeDoubleBE=function(r,n,e){return ur(this,r,n,!1,e)};o.prototype.copy=function(r,n,e,t){if(e||(e=0),!t&&t!==0&&(t=this.length),n>=r.length&&(n=r.length),n||(n=0),t>0&&t<e&&(t=e),t===e||r.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(t<0)throw new RangeError("sourceEnd out of bounds");t>this.length&&(t=this.length),r.length-n<t-e&&(t=r.length-n+e);var f=t-e,u;if(this===r&&e<n&&n<t)for(u=f-1;u>=0;--u)r[u+n]=this[u+e];else if(f<1e3||!o.TYPED_ARRAY_SUPPORT)for(u=0;u<f;++u)r[u+n]=this[u+e];else Uint8Array.prototype.set.call(r,this.subarray(e,e+f),n);return f};o.prototype.fill=function(r,n,e,t){if(typeof r=="string"){if(typeof n=="string"?(t=n,n=0,e=this.length):typeof e=="string"&&(t=e,e=this.length),r.length===1){var f=r.charCodeAt(0);f<256&&(r=f)}if(t!==void 0&&typeof t!="string")throw new TypeError("encoding must be a string");if(typeof t=="string"&&!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t)}else typeof r=="number"&&(r=r&255);if(n<0||this.length<n||this.length<e)throw new RangeError("Out of range index");if(e<=n)return this;n=n>>>0,e=e===void 0?this.length:e>>>0,r||(r=0);var u;if(typeof r=="number")for(u=n;u<e;++u)this[u]=r;else{var h=g(r)?r:C(new o(r,t).toString()),a=h.length;for(u=0;u<e-n;++u)this[u+n]=h[u%a]}return this};var un=/[^+\/0-9A-Za-z-_]/g;function on(i){if(i=hn(i).replace(un,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function hn(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function an(i){return i<16?"0"+i.toString(16):i.toString(16)}function C(i,r){r=r||1/0;for(var n,e=i.length,t=null,f=[],u=0;u<e;++u){if(n=i.charCodeAt(u),n>55295&&n<57344){if(!t){if(n>56319){(r-=3)>-1&&f.push(239,191,189);continue}else if(u+1===e){(r-=3)>-1&&f.push(239,191,189);continue}t=n;continue}if(n<56320){(r-=3)>-1&&f.push(239,191,189),t=n;continue}n=(t-55296<<10|n-56320)+65536}else t&&(r-=3)>-1&&f.push(239,191,189);if(t=null,n<128){if((r-=1)<0)break;f.push(n)}else if(n<2048){if((r-=2)<0)break;f.push(n>>6|192,n&63|128)}else if(n<65536){if((r-=3)<0)break;f.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((r-=4)<0)break;f.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return f}function cn(i){for(var r=[],n=0;n<i.length;++n)r.push(i.charCodeAt(n)&255);return r}function ln(i,r){for(var n,e,t,f=[],u=0;u<i.length&&!((r-=2)<0);++u)n=i.charCodeAt(u),e=n>>8,t=n%256,f.push(t),f.push(e);return f}function or(i){return Wr(on(i))}function k(i,r,n,e){for(var t=0;t<e&&!(t+n>=r.length||t>=i.length);++t)r[t+n]=i[t];return t}function pn(i){return i!==i}function sn(i){return i!=null&&(!!i._isBuffer||hr(i)||wn(i))}function hr(i){return!!i.constructor&&typeof i.constructor.isBuffer=="function"&&i.constructor.isBuffer(i)}function wn(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&hr(i.slice(0,0))}function L(i,r,n,e,t){var f,u,h=t*8-e-1,a=(1<<h)-1,l=a>>1,p=-7,c=n?t-1:0,m=n?-1:1,x=i[r+c];for(c+=m,f=x&(1<<-p)-1,x>>=-p,p+=h;p>0;f=f*256+i[r+c],c+=m,p-=8);for(u=f&(1<<-p)-1,f>>=-p,p+=e;p>0;u=u*256+i[r+c],c+=m,p-=8);if(f===0)f=1-l;else{if(f===a)return u?NaN:(x?-1:1)*(1/0);u=u+Math.pow(2,e),f=f-l}return(x?-1:1)*u*Math.pow(2,f-e)}function ar(i,r,n,e,t,f){var u,h,a,l=f*8-t-1,p=(1<<l)-1,c=p>>1,m=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=e?0:f-1,d=e?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=p):(u=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-u))<1&&(u--,a*=2),u+c>=1?r+=m/a:r+=m*Math.pow(2,1-c),r*a>=2&&(u++,a/=2),u+c>=p?(h=0,u=p):u+c>=1?(h=(r*a-1)*Math.pow(2,t),u=u+c):(h=r*Math.pow(2,c-1)*Math.pow(2,t),u=0));t>=8;i[n+x]=h&255,x+=d,h/=256,t-=8);for(u=u<<t|h,l+=t;l>0;i[n+x]=u&255,x+=d,u/=256,l-=8);i[n+x-d]|=lr*128}var cr=I.env.ALGO_NETWORK,Tn=cr&&cr.toLowerCase(),Rn=Number(I.env.WH_CORE_ID),_n=Number(I.env.SUPER_APP_ID),In=Number(I.env.CODEX_APP_ID),vn=Number(I.env.MSG_PROCESSOR_ID);export{cr as ALGO_NETWORK,In as CODEX_APP_ID,vn as MSG_PROC_ID,Tn as NETWORK,_n as SUPER_APP_ID,Rn as WH_CORE_ID};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function W(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}var x=W,I=H;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(I=clearTimeout);function V(t){if(x===setTimeout)return setTimeout(t,0);if((x===W||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function sr(t){if(I===clearTimeout)return clearTimeout(t);if((I===H||!I)&&clearTimeout)return I=clearTimeout,clearTimeout(t);try{return I(t)}catch{try{return I.call(null,t)}catch{return I.call(this,t)}}}var m=[],D=!1,w,P=-1;function fr(){!D||!w||(D=!1,w.length?m=w.concat(m):P=-1,m.length&&X())}function X(){if(!D){var t=V(fr);D=!0;for(var r=m.length;r;){for(w=m,m=[];++P<r;)w&&w[P].run();P=-1,r=m.length}w=null,D=!1,sr(t)}}function pr(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];m.push(new Q(t,r)),m.length===1&&!D&&V(X)}function Q(t,r){this.fun=t,this.array=r}Q.prototype.run=function(){this.fun.apply(null,this.array)};var _r="browser",hr="browser",Tr=!0,Ar={},dr=[],gr="",br={},mr={},Rr={};function S(){}var xr=S,Ir=S,wr=S,Sr=S,Nr=S,yr=S,Or=S;function Dr(t){throw new Error("process.binding is not supported")}function Pr(){return"/"}function Cr(t){throw new Error("process.chdir is not supported")}function Lr(){return 0}var O=globalThis.performance||{},vr=O.now||O.mozNow||O.msNow||O.oNow||O.webkitNow||function(){return new Date().getTime()};function Mr(t){var r=vr.call(O)*.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 Ur=new Date;function kr(){var t=new Date,r=t-Ur;return r/1e3}var p={nextTick:pr,title:_r,browser:Tr,env:Ar,argv:dr,version:gr,versions:br,on:xr,addListener:Ir,once:wr,off:Sr,removeListener:Nr,removeAllListeners:yr,emit:Or,binding:Dr,cwd:Pr,chdir:Cr,umask:Lr,hrtime:Mr,platform:hr,release:mr,config:Rr,uptime:kr},K={};Object.keys(K).forEach(t=>{let r=t.split("."),e=p;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=K[t]:e=e[i]||(e[i]={})}});var g=[],A=[],Br=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function Z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)g[r]=t[r],A[t.charCodeAt(r)]=r;A[45]=62,A[95]=63}function Yr(t){Y||Z();var r,e,n,i,o,a,c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[c-2]==="="?2:t[c-1]==="="?1:0,a=new Br(c*3/4-o),n=o>0?c-4:c;var E=0;for(r=0,e=0;r<n;r+=4,e+=3)i=A[t.charCodeAt(r)]<<18|A[t.charCodeAt(r+1)]<<12|A[t.charCodeAt(r+2)]<<6|A[t.charCodeAt(r+3)],a[E++]=i>>16&255,a[E++]=i>>8&255,a[E++]=i&255;return o===2?(i=A[t.charCodeAt(r)]<<2|A[t.charCodeAt(r+1)]>>4,a[E++]=i&255):o===1&&(i=A[t.charCodeAt(r)]<<10|A[t.charCodeAt(r+1)]<<4|A[t.charCodeAt(r+2)]>>2,a[E++]=i>>8&255,a[E++]=i&255),a}function Fr(t){return g[t>>18&63]+g[t>>12&63]+g[t>>6&63]+g[t&63]}function Gr(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Fr(n));return i.join("")}function q(t){Y||Z();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,c=0,E=e-n;c<E;c+=a)o.push(Gr(t,c,c+a>E?E:c+a));return n===1?(r=t[e-1],i+=g[r>>2],i+=g[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=g[r>>10],i+=g[r>>4&63],i+=g[r<<2&63],i+="="),o.push(i),o.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function R(t,r){if(C()<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 F(this,t)}return z(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function z(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?Hr(t,r,e,n):typeof r=="string"?Wr(t,r,e):Vr(t,r)}u.from=function(t,r,e){return z(null,t,r,e)};u.kMaxLength=C();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function j(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 Kr(t,r,e,n){return j(r),r<=0?R(t,r):e!==void 0?typeof n=="string"?R(t,r).fill(e,n):R(t,r).fill(e):R(t,r)}u.alloc=function(t,r,e){return Kr(null,t,r,e)};function F(t,r){if(j(r),t=R(t,r<0?0:G(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function Wr(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=rr(r,e)|0;t=R(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function B(t,r){var e=r.length<0?0:G(r.length)|0;t=R(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Hr(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=B(t,r),t}function Vr(t,r){if(b(r)){var e=G(r.length)|0;return t=R(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"||le(r.length)?R(t,0):B(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return B(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return t|0}u.isBuffer=se;function b(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!b(r)||!b(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return n<i?-1:i<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(!Array.isArray(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 i=u.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!b(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function rr(t,r){if(b(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 L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return L(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Xr(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 te(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return re(this,r,e);case"latin1":case"binary":return ee(this,r,e);case"base64":return zr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function N(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)N(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)N(this,e,e+3),N(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)N(this,e,e+7),N(this,e+1,e+6),N(this,e+2,e+5),N(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Xr.apply(this,arguments)};u.prototype.equals=function(r){if(!b(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:u.compare(this,r)===0};u.prototype.compare=function(r,e,n,i,o){if(!b(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var a=o-i,c=n-e,E=Math.min(a,c),s=this.slice(i,o),f=r.slice(e,n),l=0;l<E;++l)if(s[l]!==f[l]){a=s[l],c=f[l];break}return a<c?-1:c<a?1:0};function er(t,r,e,n,i){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=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),b(r))return r.length===0?-1:J(t,r,e,n,i);if(typeof r=="number")return r=r&255,u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):J(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function J(t,r,e,n,i){var o=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;o=2,a/=2,c/=2,e/=2}function E(T,y){return o===1?T[y]:T.readUInt16BE(y*o)}var s;if(i){var f=-1;for(s=e;s<a;s++)if(E(t,s)===E(r,f===-1?0:s-f)){if(f===-1&&(f=s),s-f+1===c)return f*o}else f!==-1&&(s-=s-f),f=-1}else for(e+c>a&&(e=a-c),s=e;s>=0;s--){for(var l=!0,d=0;d<c;d++)if(E(t,s+d)!==E(r,d)){l=!1;break}if(l)return s}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return er(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return er(this,r,e,n,!1)};function Qr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/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 qr(t,r,e,n){return U(L(r,t.length-e),t,e,n)}function tr(t,r,e,n){return U(ce(r),t,e,n)}function Jr(t,r,e,n){return tr(t,r,e,n)}function $r(t,r,e,n){return U(ur(r),t,e,n)}function Zr(t,r,e,n){return U(Ee(r,t.length-e),t,e,n)}u.prototype.write=function(r,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Qr(this,r,e,n);case"utf8":case"utf-8":return qr(this,r,e,n);case"ascii":return tr(this,r,e,n);case"latin1":case"binary":return Jr(this,r,e,n);case"base64":return $r(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zr(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function zr(t,r,e){return r===0&&e===t.length?q(t):q(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=e){var E,s,f,l;switch(c){case 1:o<128&&(a=o);break;case 2:E=t[i+1],(E&192)===128&&(l=(o&31)<<6|E&63,l>127&&(a=l));break;case 3:E=t[i+1],s=t[i+2],(E&192)===128&&(s&192)===128&&(l=(o&15)<<12|(E&63)<<6|s&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:E=t[i+1],s=t[i+2],f=t[i+3],(E&192)===128&&(s&192)===128&&(f&192)===128&&(l=(o&15)<<18|(E&63)<<12|(s&63)<<6|f&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c}return jr(n)}var $=4096;function jr(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function re(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]&127);return n}function ee(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function te(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=ue(t[o]);return i}function ne(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}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 i;if(u.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=u.prototype;else{var o=e-r;i=new u(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function _(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};u.prototype.readUInt8=function(r,e){return e||_(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||_(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||_(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return 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||_(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||_(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||_(r,e,this.length);for(var i=e,o=1,a=this[r+--i];i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};u.prototype.readInt8=function(r,e){return e||_(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,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||_(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||_(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||_(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||_(r,4,this.length),k(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||_(r,4,this.length),k(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||_(r,8,this.length),k(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||_(r,8,this.length),k(this,r,!1,52,8)};function h(t,r,e,n,i,o){if(!b(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,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,i){if(r=+r,e=e|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;h(this,r,e,n,o,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||h(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function v(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};function M(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=0,c=1,E=0;for(this[e]=r&255;++a<n&&(c*=256);)r<0&&E===0&&this[e+a-1]!==0&&(E=1),this[e+a]=(r/c>>0)-E&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var o=Math.pow(2,8*n-1);h(this,r,e,n,o-1,-o)}var a=n-1,c=1,E=0;for(this[e+a]=r&255;--a>=0&&(c*=256);)r<0&&E===0&&this[e+a+1]!==0&&(E=1),this[e+a]=(r/c>>0)-E&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||h(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||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):v(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):v(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(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):M(this,r,e,!1),e+4};function ir(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function or(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),Er(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return or(this,r,e,!1,n)};function ar(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),Er(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return ar(this,r,e,!1,n)};u.prototype.copy=function(r,e,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),e>=r.length&&(e=r.length),e||(e=0),i>0&&i<n&&(i=n),i===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(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-e<i-n&&(i=r.length-e+n);var o=i-n,a;if(this===r&&n<e&&e<i)for(a=o-1;a>=0;--a)r[a+e]=this[a+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<o;++a)r[a+e]=this[a+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+o),e);return o};u.prototype.fill=function(r,e,n,i){if(typeof r=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}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=b(r)?r:L(new u(r,i).toString()),E=c.length;for(a=0;a<n-e;++a)this[a+e]=c[a%E]}return this};var ie=/[^+\/0-9A-Za-z-_]/g;function oe(t){if(t=ae(t).replace(ie,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ae(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function ue(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],a=0;a<n;++a){if(e=t.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function ce(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ee(t,r){for(var e,n,i,o=[],a=0;a<t.length&&!((r-=2)<0);++a)e=t.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function ur(t){return Yr(oe(t))}function U(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function le(t){return t!==t}function se(t){return t!=null&&(!!t._isBuffer||cr(t)||fe(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function fe(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function k(t,r,e,n,i){var o,a,c=i*8-n-1,E=(1<<c)-1,s=E>>1,f=-7,l=e?i-1:0,d=e?-1:1,T=t[r+l];for(l+=d,o=T&(1<<-f)-1,T>>=-f,f+=c;f>0;o=o*256+t[r+l],l+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+t[r+l],l+=d,f-=8);if(o===0)o=1-s;else{if(o===E)return a?NaN:(T?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-s}return(T?-1:1)*a*Math.pow(2,o-n)}function Er(t,r,e,n,i,o){var a,c,E,s=o*8-i-1,f=(1<<s)-1,l=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=n?0:o-1,y=n?1:-1,lr=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*(E=Math.pow(2,-a))<1&&(a--,E*=2),a+l>=1?r+=d/E:r+=d*Math.pow(2,1-l),r*E>=2&&(a++,E/=2),a+l>=f?(c=0,a=f):a+l>=1?(c=(r*E-1)*Math.pow(2,i),a=a+l):(c=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+T]=c&255,T+=y,c/=256,i-=8);for(a=a<<i|c,s+=i;s>0;t[e+T]=a&255,T+=y,a/=256,s-=8);t[e+T-y]|=lr*128}var xe=864e5,Ie=30;var ye=18,Oe=1e5,De=1e3,Pe=9e4,Ce=30,Le=60,ve=328,Me=1,Ue=18,ke=36,Be=248;var Ke={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var Xe={SUCCESS:200,CREATED:201,ACCEPTED:202,NOCONTENT:204,BADREQUEST:400,FORBIDDEN:403,NOTFOUND:404,TIMEOUT:408,TOOMANYREQ:429,INTERNALSERVER:500,BADGATEWAYS:502,SERVICEUNAVILABLE:503,GATEWAYTIMEOUT:504},Qe={INSERT:"Data has been saved successfully.",ERROR:"Some error has been occured. Please try again.",SUCCESS:"Your request is executed successfully!",REQUIRED:"coin_type or price param is required",CAPTCHATEXTNOTFOUND:"Captcha text not found.",CAPTCHA_VERIFICATION_FAILED:"Captcha is not verified.",NOTEMPTY:"coin_type or price should not be empty",PAIR_LIST:"Pair list",PAIR_STATUS:"Pair status has been changed",ACTIVE_USERS:"Active Users",SETTINGS_NOT_FOUND:"No settings found in DB.",TRADE_IS_HALT:"Trading is disabled.",KYC_REQUIRED:"KYC is required for this action.",EMAIL_NOT_VERIFIED:"Your email is not verified.Please verify first.",NOT_BETA_USER:"Trade only works for beta user.",WRONG_PAIR_KEY:"Pair key not found.",PAIRDISABLED:"Temporarily order placement has been disabled for this pair. Please try again later.",BALANCE_NOT_SUFFICIENT:"You have insufficient balance.",MIN_TRADE_NOT_MATCHED:"Minimum trade limit does not matched.",ORDER_PLACED_SUCCESSFULLY:"Order has been placed successfully.",ORDER_NOT_FOUND:"Sorry this order id does not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"order successfully cancelled",ORDER_LIST:"Order list fetched successfully.",ORDER_EXIT:"Successfully exited from the position.",PAIRERR:"please provide pair param",ORDERSIDE:"side param is required",ORDERTYPE:"type param is required",ORDERIDREQ:"order_id param is required",ORDERDETAIL:"order detail",COMMODITYORICE:"commodity price",COMMODITYSPOT:"commodity spot updated",TOKEN_INSERTED:"ERC token has been added",PARAMREQ:"Parameter missing",EXIST:"Token Already Exist",BREACHEDTOKENS:"List of breached tokens",API_EXPOSE:{TOKEN_NOT_FOUND:"Token not found, Please get token and set to header.",ERROR:"Something went wrong, Please try again later"},LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",UNITS_UNAVAIL:"Amount unavailable",ORDER:{ERROR:"An error has been occured",UNITS_UNAVAIL:"Amount unavailable",LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",PLACED:"Order has been placed",NOPARAMS:"empty body params",ORDER_NOT_FOUND:"Sorry this order id not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"Order cancelled successfully"},DOMAIN_NOT_FOUND:"domain not found"},qe={SMALLESTUNIT:p.env.SMALLEST_UNIT},Je={SMALLEST_UNITS:p.env.SMALLEST_UNIT},$e={AVAILABLE_ASSETS_PER_USER:1,AVAILABLE_ASSETS_PER_IP:3};var rt=`{"theme1":{"value":"${p.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${p.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var at=["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"],ut=["obdex","kycTradeRequirementEnabled","newTab","reportButtons"],ct=["geoblock","pinnedPairs","customMenuItems","chartInt"];var ft=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;var Tt=p.env.REACT_APP_API_URL,At=p.env.REACT_APP_SOCKET_URL,dt=p.env.REACT_APP_ALGO_SERVER,gt=p.env.REACT_APP_ALGO_SERVER_PORT||"",bt=p.env.REACT_APP_ALGOD_TOKEN||"",mt=p.env.REACT_APP_DISPENSER_LINK,pe=p.env.REACT_APP_FRONTEND_LINK||"",Rt=p.env.REACT_APP_ALGO_EXPLORER_LINK,xt=p.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,It=(p.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",wt=p.env.REACT_APP_USERBACK_ACCESS_TOKEN,St=(p.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true",Nt=4,yt=100,Ot=50,Dt=50,Pt=.001*10**6,Ct=.002*10**6,Lt="Ultrade",vt=["theme1","theme2","theme3"],Mt=p.env.REACT_APP_MASTER_APP_ID||"406",Ut=p.env.REACT_APP_AGG_APP_ID||"408",_e=Number(p.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",_e);var kt=3e3,he=p.env.REACT_APP_ALGO_NETWORK||"",Bt=.3,Yt=1,Ft=pe==="https://dev.ultradedev.net",Gt="00:00",Kt=1e6,Te=he.toLowerCase()==="mainnet"?"mainnet":"testnet",Wt=/[^\p{L}\p{N} .,!?:@$%()_-]/gui,Ht=Te==="mainnet"?416001:416002;export{Ut as AGG_APP_ID,bt as ALGOD_TOKEN,xt as ALGO_EXPLORER_ASSETS_URL,Rt as ALGO_EXPLORER_LINK,he as ALGO_NETWORK,dt as ALGO_SERVER,gt as ALGO_SERVER_PORT,Tt as API_HOST,Ct as APP_CLOSEOUT_FEE,qe as BIGNUMBER,ut as BOOLEAN_SETTINGS,Je as CALCULATIONS,Ke as CCTP_UNIFIED_ASSETS,_e as CODEX_APP_ID,xe as DAY_MILLISECONDS,Bt as DEFAULT_AGG_FEE,Pe as DEFAULT_FEE_SHARE,Ce as DEFAULT_ORDER_EXPIRATION_DAYS,mt as DISPENSER_LINK,Lt as EXCHANGE_NAME,Ie as EXPIRE_DAYS,St as EXT_ORDER_TYPES,ye as FACTOR_PRICE_DECIMAL,Oe as FEE_SCALE,De as FRONTEND_FEE_SCALE,pe as FRONTEND_LINK,Kt as GASLIMIT,Nt as GLOWL_DECIMAL,Ft as IS_DEV,ct as JSON_ARRAY_SETTINGS,Dt as MARKET_TRADES_SIZE,Mt as MASTER_APP_ID,Ue as MAX_TOKEN_DECIMAL,Le as MIN_ORDER_EXPIRATION_MINS,Te as NETWORK,Ot as ORDER_BOOK_BUFFER,yt as ORDER_BOOK_SIZE,ve as ORDER_DATA_BYTES_LENGTH,Me as ORDER_MSG_VERSION,kt as PLATFORM_FEE,Ht as PeraChainId,at as PointSystemSettingsIds,It as REACT_APP_REQUIRE_ACCESS_CODE,Xe as RESPONSES,Qe as RES_MSG,$e as SERVER,ke as SHARE_DATA_LENGTH,At as SOCKET_URL,vt as THEMES,Yt as ULTRADE_ID,wt as USERBACK_ACCESS_TOKEN,Be as WITHDRAW_DATA_BYTES_LENGTH,Pt as WITHDRAW_FEE,Gt as ZERO_TIMER,ft as messageForSigning,Wt as sanitizeRegex};
|
|
1
|
+
function W(){throw new Error("setTimeout has not been defined")}function H(){throw new Error("clearTimeout has not been defined")}var x=W,N=H;typeof globalThis.setTimeout=="function"&&(x=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function V(t){if(x===setTimeout)return setTimeout(t,0);if((x===W||!x)&&setTimeout)return x=setTimeout,setTimeout(t,0);try{return x(t,0)}catch{try{return x.call(null,t,0)}catch{return x.call(this,t,0)}}}function _r(t){if(N===clearTimeout)return clearTimeout(t);if((N===H||!N)&&clearTimeout)return N=clearTimeout,clearTimeout(t);try{return N(t)}catch{try{return N.call(null,t)}catch{return N.call(this,t)}}}var I=[],w=!1,g,P=-1;function hr(){!w||!g||(w=!1,g.length?I=g.concat(I):P=-1,I.length&&X())}function X(){if(!w){var t=V(hr);w=!0;for(var r=I.length;r;){for(g=I,I=[];++P<r;)g&&g[P].run();P=-1,r=I.length}g=null,w=!1,_r(t)}}function Tr(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];I.push(new q(t,r)),I.length===1&&!w&&V(X)}function q(t,r){this.fun=t,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var fr="browser",Ar="browser",mr=!0,br={},Rr=[],Ir="",dr={},xr={},Nr={};function O(){}var gr=O,Or=O,Cr=O,Dr=O,Lr=O,wr=O,Pr=O;function yr(t){throw new Error("process.binding is not supported")}function vr(){return"/"}function Sr(t){throw new Error("process.chdir is not supported")}function Ur(){return 0}var L=globalThis.performance||{},Mr=L.now||L.mozNow||L.msNow||L.oNow||L.webkitNow||function(){return new Date().getTime()};function kr(t){var r=Mr.call(L)*.001,e=Math.floor(r),o=Math.floor(r%1*1e9);return t&&(e=e-t[0],o=o-t[1],o<0&&(e--,o+=1e9)),[e,o]}var Br=new Date;function Fr(){var t=new Date,r=t-Br;return r/1e3}var c={nextTick:Tr,title:fr,browser:mr,env:br,argv:Rr,version:Ir,versions:dr,on:gr,addListener:Or,once:Cr,off:Dr,removeListener:Lr,removeAllListeners:wr,emit:Pr,binding:yr,cwd:vr,chdir:Sr,umask:Ur,hrtime:kr,platform:Ar,release:xr,config:Nr,uptime:Fr},K={};Object.keys(K).forEach(t=>{let r=t.split("."),e=c;for(let o=0;o<r.length;o++){let n=r[o];o===r.length-1?e[n]=K[t]:e=e[n]||(e[n]={})}});var b=[],A=[],Yr=typeof Uint8Array<"u"?Uint8Array:Array,F=!1;function $(){F=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)b[r]=t[r],A[t.charCodeAt(r)]=r;A[45]=62,A[95]=63}function Gr(t){F||$();var r,e,o,n,a,p,E=t.length;if(E%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[E-2]==="="?2:t[E-1]==="="?1:0,p=new Yr(E*3/4-a),o=a>0?E-4:E;var s=0;for(r=0,e=0;r<o;r+=4,e+=3)n=A[t.charCodeAt(r)]<<18|A[t.charCodeAt(r+1)]<<12|A[t.charCodeAt(r+2)]<<6|A[t.charCodeAt(r+3)],p[s++]=n>>16&255,p[s++]=n>>8&255,p[s++]=n&255;return a===2?(n=A[t.charCodeAt(r)]<<2|A[t.charCodeAt(r+1)]>>4,p[s++]=n&255):a===1&&(n=A[t.charCodeAt(r)]<<10|A[t.charCodeAt(r+1)]<<4|A[t.charCodeAt(r+2)]>>2,p[s++]=n>>8&255,p[s++]=n&255),p}function Kr(t){return b[t>>18&63]+b[t>>12&63]+b[t>>6&63]+b[t&63]}function Wr(t,r,e){for(var o,n=[],a=r;a<e;a+=3)o=(t[a]<<16)+(t[a+1]<<8)+t[a+2],n.push(Kr(o));return n.join("")}function z(t){F||$();for(var r,e=t.length,o=e%3,n="",a=[],p=16383,E=0,s=e-o;E<s;E+=p)a.push(Wr(t,E,E+p>s?s:E+p));return o===1?(r=t[e-1],n+=b[r>>2],n+=b[r<<4&63],n+="=="):o===2&&(r=(t[e-2]<<8)+t[e-1],n+=b[r>>10],n+=b[r>>4&63],n+=b[r<<2&63],n+="="),a.push(n),a.join("")}i.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function y(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(t,r){if(y()<r)throw new RangeError("Invalid typed array length");return i.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=i.prototype):(t===null&&(t=new i(r)),t.length=r),t}function i(t,r,e){if(!i.TYPED_ARRAY_SUPPORT&&!(this instanceof i))return new i(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 Y(this,t)}return Z(this,t,r,e)}i.poolSize=8192;i._augment=function(t){return t.__proto__=i.prototype,t};function Z(t,r,e,o){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Xr(t,r,e,o):typeof r=="string"?Vr(t,r,e):qr(t,r)}i.from=function(t,r,e){return Z(null,t,r,e)};i.kMaxLength=y();i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&i[Symbol.species]);function j(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 Hr(t,r,e,o){return j(r),r<=0?d(t,r):e!==void 0?typeof o=="string"?d(t,r).fill(e,o):d(t,r).fill(e):d(t,r)}i.alloc=function(t,r,e){return Hr(null,t,r,e)};function Y(t,r){if(j(r),t=d(t,r<0?0:G(r)|0),!i.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}i.allocUnsafe=function(t){return Y(null,t)};i.allocUnsafeSlow=function(t){return Y(null,t)};function Vr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var o=rr(r,e)|0;t=d(t,o);var n=t.write(r,e);return n!==o&&(t=t.slice(0,n)),t}function B(t,r){var e=r.length<0?0:G(r.length)|0;t=d(t,e);for(var o=0;o<e;o+=1)t[o]=r[o]&255;return t}function Xr(t,r,e,o){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(o||0))throw new RangeError("'length' is out of bounds");return e===void 0&&o===void 0?r=new Uint8Array(r):o===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,o),i.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=i.prototype):t=B(t,r),t}function qr(t,r){if(R(r)){var e=G(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"||le(r.length)?d(t,0):B(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return B(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y().toString(16)+" bytes");return t|0}i.isBuffer=_e;function R(t){return!!(t!=null&&t._isBuffer)}i.compare=function(r,e){if(!R(r)||!R(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var o=r.length,n=e.length,a=0,p=Math.min(o,n);a<p;++a)if(r[a]!==e[a]){o=r[a],n=e[a];break}return o<n?-1:n<o?1:0};i.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}};i.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return i.alloc(0);var o;if(e===void 0)for(e=0,o=0;o<r.length;++o)e+=r[o].length;var n=i.allocUnsafe(e),a=0;for(o=0;o<r.length;++o){var p=r[o];if(!R(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,a),a+=p.length}return n};function rr(t,r){if(R(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return v(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return pr(t).length;default:if(o)return v(t).length;r=(""+r).toLowerCase(),o=!0}}i.byteLength=rr;function zr(t,r,e){var o=!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 ne(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return te(this,r,e);case"latin1":case"binary":return oe(this,r,e);case"base64":return re(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}i.prototype._isBuffer=!0;function C(t,r,e){var o=t[r];t[r]=t[e],t[e]=o}i.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)C(this,e,e+1);return this};i.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)C(this,e,e+3),C(this,e+1,e+2);return this};i.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)C(this,e,e+7),C(this,e+1,e+6),C(this,e+2,e+5),C(this,e+3,e+4);return this};i.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):zr.apply(this,arguments)};i.prototype.equals=function(r){if(!R(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:i.compare(this,r)===0};i.prototype.compare=function(r,e,o,n,a){if(!R(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),o===void 0&&(o=r?r.length:0),n===void 0&&(n=0),a===void 0&&(a=this.length),e<0||o>r.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=o)return 0;if(n>=a)return-1;if(e>=o)return 1;if(e>>>=0,o>>>=0,n>>>=0,a>>>=0,this===r)return 0;for(var p=a-n,E=o-e,s=Math.min(p,E),l=this.slice(n,a),_=r.slice(e,o),u=0;u<s;++u)if(l[u]!==_[u]){p=l[u],E=_[u];break}return p<E?-1:E<p?1:0};function er(t,r,e,o,n){if(t.length===0)return-1;if(typeof e=="string"?(o=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=n?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(n)return-1;e=t.length-1}else if(e<0)if(n)e=0;else return-1;if(typeof r=="string"&&(r=i.from(r,o)),R(r))return r.length===0?-1:J(t,r,e,o,n);if(typeof r=="number")return r=r&255,i.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):J(t,[r],e,o,n);throw new TypeError("val must be string, number or Buffer")}function J(t,r,e,o,n){var a=1,p=t.length,E=r.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(t.length<2||r.length<2)return-1;a=2,p/=2,E/=2,e/=2}function s(f,D){return a===1?f[D]:f.readUInt16BE(D*a)}var l;if(n){var _=-1;for(l=e;l<p;l++)if(s(t,l)===s(r,_===-1?0:l-_)){if(_===-1&&(_=l),l-_+1===E)return _*a}else _!==-1&&(l-=l-_),_=-1}else for(e+E>p&&(e=p-E),l=e;l>=0;l--){for(var u=!0,m=0;m<E;m++)if(s(t,l+m)!==s(r,m)){u=!1;break}if(u)return l}return-1}i.prototype.includes=function(r,e,o){return this.indexOf(r,e,o)!==-1};i.prototype.indexOf=function(r,e,o){return er(this,r,e,o,!0)};i.prototype.lastIndexOf=function(r,e,o){return er(this,r,e,o,!1)};function Jr(t,r,e,o){e=Number(e)||0;var n=t.length-e;o?(o=Number(o),o>n&&(o=n)):o=n;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");o>a/2&&(o=a/2);for(var p=0;p<o;++p){var E=parseInt(r.substr(p*2,2),16);if(isNaN(E))return p;t[e+p]=E}return p}function Qr(t,r,e,o){return M(v(r,t.length-e),t,e,o)}function tr(t,r,e,o){return M(se(r),t,e,o)}function $r(t,r,e,o){return tr(t,r,e,o)}function Zr(t,r,e,o){return M(pr(r),t,e,o)}function jr(t,r,e,o){return M(ue(r,t.length-e),t,e,o)}i.prototype.write=function(r,e,o,n){if(e===void 0)n="utf8",o=this.length,e=0;else if(o===void 0&&typeof e=="string")n=e,o=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(o)?(o=o|0,n===void 0&&(n="utf8")):(n=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-e;if((o===void 0||o>a)&&(o=a),r.length>0&&(o<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return Jr(this,r,e,o);case"utf8":case"utf-8":return Qr(this,r,e,o);case"ascii":return tr(this,r,e,o);case"latin1":case"binary":return $r(this,r,e,o);case"base64":return Zr(this,r,e,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jr(this,r,e,o);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function re(t,r,e){return r===0&&e===t.length?z(t):z(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var o=[],n=r;n<e;){var a=t[n],p=null,E=a>239?4:a>223?3:a>191?2:1;if(n+E<=e){var s,l,_,u;switch(E){case 1:a<128&&(p=a);break;case 2:s=t[n+1],(s&192)===128&&(u=(a&31)<<6|s&63,u>127&&(p=u));break;case 3:s=t[n+1],l=t[n+2],(s&192)===128&&(l&192)===128&&(u=(a&15)<<12|(s&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(p=u));break;case 4:s=t[n+1],l=t[n+2],_=t[n+3],(s&192)===128&&(l&192)===128&&(_&192)===128&&(u=(a&15)<<18|(s&63)<<12|(l&63)<<6|_&63,u>65535&&u<1114112&&(p=u))}}p===null?(p=65533,E=1):p>65535&&(p-=65536,o.push(p>>>10&1023|55296),p=56320|p&1023),o.push(p),n+=E}return ee(o)}var Q=4096;function ee(t){var r=t.length;if(r<=Q)return String.fromCharCode.apply(String,t);for(var e="",o=0;o<r;)e+=String.fromCharCode.apply(String,t.slice(o,o+=Q));return e}function te(t,r,e){var o="";e=Math.min(t.length,e);for(var n=r;n<e;++n)o+=String.fromCharCode(t[n]&127);return o}function oe(t,r,e){var o="";e=Math.min(t.length,e);for(var n=r;n<e;++n)o+=String.fromCharCode(t[n]);return o}function ne(t,r,e){var o=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>o)&&(e=o);for(var n="",a=r;a<e;++a)n+=Ee(t[a]);return n}function ie(t,r,e){for(var o=t.slice(r,e),n="",a=0;a<o.length;a+=2)n+=String.fromCharCode(o[a]+o[a+1]*256);return n}i.prototype.slice=function(r,e){var o=this.length;r=~~r,e=e===void 0?o:~~e,r<0?(r+=o,r<0&&(r=0)):r>o&&(r=o),e<0?(e+=o,e<0&&(e=0)):e>o&&(e=o),e<r&&(e=r);var n;if(i.TYPED_ARRAY_SUPPORT)n=this.subarray(r,e),n.__proto__=i.prototype;else{var a=e-r;n=new i(a,void 0);for(var p=0;p<a;++p)n[p]=this[p+r]}return n};function h(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")}i.prototype.readUIntLE=function(r,e,o){r=r|0,e=e|0,o||h(r,e,this.length);for(var n=this[r],a=1,p=0;++p<e&&(a*=256);)n+=this[r+p]*a;return n};i.prototype.readUIntBE=function(r,e,o){r=r|0,e=e|0,o||h(r,e,this.length);for(var n=this[r+--e],a=1;e>0&&(a*=256);)n+=this[r+--e]*a;return n};i.prototype.readUInt8=function(r,e){return e||h(r,1,this.length),this[r]};i.prototype.readUInt16LE=function(r,e){return e||h(r,2,this.length),this[r]|this[r+1]<<8};i.prototype.readUInt16BE=function(r,e){return e||h(r,2,this.length),this[r]<<8|this[r+1]};i.prototype.readUInt32LE=function(r,e){return e||h(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};i.prototype.readUInt32BE=function(r,e){return e||h(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};i.prototype.readIntLE=function(r,e,o){r=r|0,e=e|0,o||h(r,e,this.length);for(var n=this[r],a=1,p=0;++p<e&&(a*=256);)n+=this[r+p]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*e)),n};i.prototype.readIntBE=function(r,e,o){r=r|0,e=e|0,o||h(r,e,this.length);for(var n=e,a=1,p=this[r+--n];n>0&&(a*=256);)p+=this[r+--n]*a;return a*=128,p>=a&&(p-=Math.pow(2,8*e)),p};i.prototype.readInt8=function(r,e){return e||h(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};i.prototype.readInt16LE=function(r,e){e||h(r,2,this.length);var o=this[r]|this[r+1]<<8;return o&32768?o|4294901760:o};i.prototype.readInt16BE=function(r,e){e||h(r,2,this.length);var o=this[r+1]|this[r]<<8;return o&32768?o|4294901760:o};i.prototype.readInt32LE=function(r,e){return e||h(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};i.prototype.readInt32BE=function(r,e){return e||h(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};i.prototype.readFloatLE=function(r,e){return e||h(r,4,this.length),k(this,r,!0,23,4)};i.prototype.readFloatBE=function(r,e){return e||h(r,4,this.length),k(this,r,!1,23,4)};i.prototype.readDoubleLE=function(r,e){return e||h(r,8,this.length),k(this,r,!0,52,8)};i.prototype.readDoubleBE=function(r,e){return e||h(r,8,this.length),k(this,r,!1,52,8)};function T(t,r,e,o,n,a){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<a)throw new RangeError('"value" argument is out of bounds');if(e+o>t.length)throw new RangeError("Index out of range")}i.prototype.writeUIntLE=function(r,e,o,n){if(r=+r,e=e|0,o=o|0,!n){var a=Math.pow(2,8*o)-1;T(this,r,e,o,a,0)}var p=1,E=0;for(this[e]=r&255;++E<o&&(p*=256);)this[e+E]=r/p&255;return e+o};i.prototype.writeUIntBE=function(r,e,o,n){if(r=+r,e=e|0,o=o|0,!n){var a=Math.pow(2,8*o)-1;T(this,r,e,o,a,0)}var p=o-1,E=1;for(this[e+p]=r&255;--p>=0&&(E*=256);)this[e+p]=r/E&255;return e+o};i.prototype.writeUInt8=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function S(t,r,e,o){r<0&&(r=65535+r+1);for(var n=0,a=Math.min(t.length-e,2);n<a;++n)t[e+n]=(r&255<<8*(o?n:1-n))>>>(o?n:1-n)*8}i.prototype.writeUInt16LE=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):S(this,r,e,!0),e+2};i.prototype.writeUInt16BE=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):S(this,r,e,!1),e+2};function U(t,r,e,o){r<0&&(r=4294967295+r+1);for(var n=0,a=Math.min(t.length-e,4);n<a;++n)t[e+n]=r>>>(o?n:3-n)*8&255}i.prototype.writeUInt32LE=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):U(this,r,e,!0),e+4};i.prototype.writeUInt32BE=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};i.prototype.writeIntLE=function(r,e,o,n){if(r=+r,e=e|0,!n){var a=Math.pow(2,8*o-1);T(this,r,e,o,a-1,-a)}var p=0,E=1,s=0;for(this[e]=r&255;++p<o&&(E*=256);)r<0&&s===0&&this[e+p-1]!==0&&(s=1),this[e+p]=(r/E>>0)-s&255;return e+o};i.prototype.writeIntBE=function(r,e,o,n){if(r=+r,e=e|0,!n){var a=Math.pow(2,8*o-1);T(this,r,e,o,a-1,-a)}var p=o-1,E=1,s=0;for(this[e+p]=r&255;--p>=0&&(E*=256);)r<0&&s===0&&this[e+p+1]!==0&&(s=1),this[e+p]=(r/E>>0)-s&255;return e+o};i.prototype.writeInt8=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};i.prototype.writeInt16LE=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):S(this,r,e,!0),e+2};i.prototype.writeInt16BE=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):S(this,r,e,!1),e+2};i.prototype.writeInt32LE=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):U(this,r,e,!0),e+4};i.prototype.writeInt32BE=function(r,e,o){return r=+r,e=e|0,o||T(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),i.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):U(this,r,e,!1),e+4};function nr(t,r,e,o,n,a){if(e+o>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ir(t,r,e,o,n){return n||nr(t,r,e,4,34028234663852886e22,-34028234663852886e22),Er(t,r,e,o,23,4),e+4}i.prototype.writeFloatLE=function(r,e,o){return ir(this,r,e,!0,o)};i.prototype.writeFloatBE=function(r,e,o){return ir(this,r,e,!1,o)};function ar(t,r,e,o,n){return n||nr(t,r,e,8,17976931348623157e292,-17976931348623157e292),Er(t,r,e,o,52,8),e+8}i.prototype.writeDoubleLE=function(r,e,o){return ar(this,r,e,!0,o)};i.prototype.writeDoubleBE=function(r,e,o){return ar(this,r,e,!1,o)};i.prototype.copy=function(r,e,o,n){if(o||(o=0),!n&&n!==0&&(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<o&&(n=o),n===o||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-e<n-o&&(n=r.length-e+o);var a=n-o,p;if(this===r&&o<e&&e<n)for(p=a-1;p>=0;--p)r[p+e]=this[p+o];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(p=0;p<a;++p)r[p+e]=this[p+o];else Uint8Array.prototype.set.call(r,this.subarray(o,o+a),e);return a};i.prototype.fill=function(r,e,o,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,o=this.length):typeof o=="string"&&(n=o,o=this.length),r.length===1){var a=r.charCodeAt(0);a<256&&(r=a)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<o)throw new RangeError("Out of range index");if(o<=e)return this;e=e>>>0,o=o===void 0?this.length:o>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<o;++p)this[p]=r;else{var E=R(r)?r:v(new i(r,n).toString()),s=E.length;for(p=0;p<o-e;++p)this[p+e]=E[p%s]}return this};var ae=/[^+\/0-9A-Za-z-_]/g;function pe(t){if(t=ce(t).replace(ae,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ce(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ee(t){return t<16?"0"+t.toString(16):t.toString(16)}function v(t,r){r=r||1/0;for(var e,o=t.length,n=null,a=[],p=0;p<o;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!n){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(p+1===o){(r-=3)>-1&&a.push(239,191,189);continue}n=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(r-=3)>-1&&a.push(239,191,189);if(n=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function se(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ue(t,r){for(var e,o,n,a=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),o=e>>8,n=e%256,a.push(n),a.push(o);return a}function pr(t){return Gr(pe(t))}function M(t,r,e,o){for(var n=0;n<o&&!(n+e>=r.length||n>=t.length);++n)r[n+e]=t[n];return n}function le(t){return t!==t}function _e(t){return t!=null&&(!!t._isBuffer||cr(t)||he(t))}function cr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function he(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&cr(t.slice(0,0))}function k(t,r,e,o,n){var a,p,E=n*8-o-1,s=(1<<E)-1,l=s>>1,_=-7,u=e?n-1:0,m=e?-1:1,f=t[r+u];for(u+=m,a=f&(1<<-_)-1,f>>=-_,_+=E;_>0;a=a*256+t[r+u],u+=m,_-=8);for(p=a&(1<<-_)-1,a>>=-_,_+=o;_>0;p=p*256+t[r+u],u+=m,_-=8);if(a===0)a=1-l;else{if(a===s)return p?NaN:(f?-1:1)*(1/0);p=p+Math.pow(2,o),a=a-l}return(f?-1:1)*p*Math.pow(2,a-o)}function Er(t,r,e,o,n,a){var p,E,s,l=a*8-n-1,_=(1<<l)-1,u=_>>1,m=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=o?0:a-1,D=o?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(E=isNaN(r)?1:0,p=_):(p=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-p))<1&&(p--,s*=2),p+u>=1?r+=m/s:r+=m*Math.pow(2,1-u),r*s>=2&&(p++,s/=2),p+u>=_?(E=0,p=_):p+u>=1?(E=(r*s-1)*Math.pow(2,n),p=p+u):(E=r*Math.pow(2,u-1)*Math.pow(2,n),p=0));n>=8;t[e+f]=E&255,f+=D,E/=256,n-=8);for(p=p<<n|E,l+=n;l>0;t[e+f]=p&255,f+=D,p/=256,l-=8);t[e+f-D]|=lr*128}var Ne=864e5,ge=30;var Le=18,we=1e5,Pe=1e3,ye=9e4,ve=30,Se=60,Ue=328,Me=1,ke=18,Be=36,Fe=248;var We={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};var qe={SUCCESS:200,CREATED:201,ACCEPTED:202,NOCONTENT:204,BADREQUEST:400,FORBIDDEN:403,NOTFOUND:404,TIMEOUT:408,TOOMANYREQ:429,INTERNALSERVER:500,BADGATEWAYS:502,SERVICEUNAVILABLE:503,GATEWAYTIMEOUT:504},ze={INSERT:"Data has been saved successfully.",ERROR:"Some error has been occured. Please try again.",SUCCESS:"Your request is executed successfully!",REQUIRED:"coin_type or price param is required",CAPTCHATEXTNOTFOUND:"Captcha text not found.",CAPTCHA_VERIFICATION_FAILED:"Captcha is not verified.",NOTEMPTY:"coin_type or price should not be empty",PAIR_LIST:"Pair list",PAIR_STATUS:"Pair status has been changed",ACTIVE_USERS:"Active Users",SETTINGS_NOT_FOUND:"No settings found in DB.",TRADE_IS_HALT:"Trading is disabled.",KYC_REQUIRED:"KYC is required for this action.",EMAIL_NOT_VERIFIED:"Your email is not verified.Please verify first.",NOT_BETA_USER:"Trade only works for beta user.",WRONG_PAIR_KEY:"Pair key not found.",PAIRDISABLED:"Temporarily order placement has been disabled for this pair. Please try again later.",BALANCE_NOT_SUFFICIENT:"You have insufficient balance.",MIN_TRADE_NOT_MATCHED:"Minimum trade limit does not matched.",ORDER_PLACED_SUCCESSFULLY:"Order has been placed successfully.",ORDER_NOT_FOUND:"Sorry this order id does not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"order successfully cancelled",ORDER_LIST:"Order list fetched successfully.",ORDER_EXIT:"Successfully exited from the position.",PAIRERR:"please provide pair param",ORDERSIDE:"side param is required",ORDERTYPE:"type param is required",ORDERIDREQ:"order_id param is required",ORDERDETAIL:"order detail",COMMODITYORICE:"commodity price",COMMODITYSPOT:"commodity spot updated",TOKEN_INSERTED:"ERC token has been added",PARAMREQ:"Parameter missing",EXIST:"Token Already Exist",BREACHEDTOKENS:"List of breached tokens",API_EXPOSE:{TOKEN_NOT_FOUND:"Token not found, Please get token and set to header.",ERROR:"Something went wrong, Please try again later"},LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",UNITS_UNAVAIL:"Amount unavailable",ORDER:{ERROR:"An error has been occured",UNITS_UNAVAIL:"Amount unavailable",LIMITED_UNITS:"ONLY {{units}} units are available. You can place your order with this amount",PLACED:"Order has been placed",NOPARAMS:"empty body params",ORDER_NOT_FOUND:"Sorry this order id not found.",ORDER_ALREADY_MATCHED:"Order already matched.",ORDER_ALREADY_CANCELED:"Order already cancelled.",ORDER_CANCELED_SUCCESSFULLY:"Order cancelled successfully"},DOMAIN_NOT_FOUND:"domain not found"},Je={SMALLESTUNIT:c.env.SMALLEST_UNIT},Qe={SMALLEST_UNITS:c.env.SMALLEST_UNIT},$e={AVAILABLE_ASSETS_PER_USER:1,AVAILABLE_ASSETS_PER_IP:3};var et=`{"theme1":{"value":"${c.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var pt=["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"],ct=["obdex","kycTradeRequirementEnabled","newTab","reportButtons"],Et=["geoblock","pinnedPairs","customMenuItems","chartInt"];var _t=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;var At=c.env.REACT_APP_API_URL,mt=c.env.REACT_APP_SOCKET_URL,bt=c.env.REACT_APP_ALGO_SERVER,Rt=c.env.REACT_APP_ALGO_SERVER_PORT||"",It=c.env.REACT_APP_ALGOD_TOKEN||"",dt=c.env.REACT_APP_DISPENSER_LINK,Te=c.env.REACT_APP_FRONTEND_LINK||"",xt=c.env.REACT_APP_ALGO_EXPLORER_LINK,Nt=c.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,gt=(c.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Ot=c.env.REACT_APP_USERBACK_ACCESS_TOKEN,Ct=(c.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true",Dt=4,Lt=100,wt=50,Pt=50,yt=.001*10**6,vt=.002*10**6,St="Ultrade",Ut=["theme1","theme2","theme3"],Mt=c.env.REACT_APP_MASTER_APP_ID||"406",kt=c.env.REACT_APP_AGG_APP_ID||"408",Bt=Number(c.env.REACT_APP_CODEX_APP_ID||"467960617"),Ft=3e3,fe=c.env.REACT_APP_ALGO_NETWORK||"",Yt=.3,Gt=1,Kt=Te==="https://dev.ultradedev.net",Wt="00:00",Ht=1e6,Ae=fe.toLowerCase()==="mainnet"?"mainnet":"testnet",Vt=/[^\p{L}\p{N} .,!?:@$%()_-]/gui,Xt=Ae==="mainnet"?416001:416002;var sr=(n=>(n.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",n.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",n.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",n.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",n))(sr||{}),ur=(o=>(o.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",o.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",o.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",o))(ur||{}),rn={...sr,...ur};var di={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"},xi=99999999;export{kt as AGG_APP_ID,It as ALGOD_TOKEN,Nt as ALGO_EXPLORER_ASSETS_URL,xt as ALGO_EXPLORER_LINK,fe as ALGO_NETWORK,bt as ALGO_SERVER,Rt as ALGO_SERVER_PORT,At as API_HOST,vt as APP_CLOSEOUT_FEE,Je as BIGNUMBER,ct as BOOLEAN_SETTINGS,Qe as CALCULATIONS,We as CCTP_UNIFIED_ASSETS,Bt as CODEX_APP_ID,Ne as DAY_MILLISECONDS,Yt as DEFAULT_AGG_FEE,ye as DEFAULT_FEE_SHARE,ve as DEFAULT_ORDER_EXPIRATION_DAYS,dt as DISPENSER_LINK,St as EXCHANGE_NAME,ge as EXPIRE_DAYS,Ct as EXT_ORDER_TYPES,Le as FACTOR_PRICE_DECIMAL,we as FEE_SCALE,Pe as FRONTEND_FEE_SCALE,Te as FRONTEND_LINK,Ht as GASLIMIT,Dt as GLOWL_DECIMAL,Kt as IS_DEV,Et as JSON_ARRAY_SETTINGS,Pt as MARKET_TRADES_SIZE,Mt as MASTER_APP_ID,ke as MAX_TOKEN_DECIMAL,Se as MIN_ORDER_EXPIRATION_MINS,Ae as NETWORK,wt as ORDER_BOOK_BUFFER,Lt as ORDER_BOOK_SIZE,Ue as ORDER_DATA_BYTES_LENGTH,Me as ORDER_MSG_VERSION,Ft as PLATFORM_FEE,xi as POINTS_MAX_VALUE,Xt as PeraChainId,pt as PointSystemSettingsIds,gt as REACT_APP_REQUIRE_ACCESS_CODE,qe as RESPONSES,ze as RES_MSG,$e as SERVER,Be as SHARE_DATA_LENGTH,mt as SOCKET_URL,Ut as THEMES,Gt as ULTRADE_ID,Ot as USERBACK_ACCESS_TOKEN,Fe as WITHDRAW_DATA_BYTES_LENGTH,yt as WITHDRAW_FEE,Wt as ZERO_TIMER,_t as messageForSigning,Vt as sanitizeRegex,di as twitterActionToPermissionMap};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@esbuild-plugins/node-globals-polyfill/Buffer.js:
|