@ultrade/shared 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/browser/common/index.js +1 -7
  2. package/dist/browser/{common/utils/social.js → constants/env.js} +1 -1
  3. package/dist/browser/constants/index.js +1 -1
  4. package/dist/browser/enums/index.js +1 -1
  5. package/dist/browser/helpers/algo.helper.js +1 -1
  6. package/dist/browser/helpers/assert.helper.js +1 -1
  7. package/dist/browser/helpers/atomic.helper.js +1 -1
  8. package/dist/browser/helpers/balance.helper.js +1 -1
  9. package/dist/browser/helpers/codex/common.helper.js +2 -2
  10. package/dist/browser/helpers/codex/index.js +2 -2
  11. package/dist/browser/helpers/codex/mbr.helper.js +1 -1
  12. package/dist/browser/helpers/codex/mna.helper.js +1 -1
  13. package/dist/browser/helpers/codex/order.helper.js +1 -1
  14. package/dist/browser/helpers/codex/setGlobal.helper.js +1 -1
  15. package/dist/browser/{common/mappers/codexBalance.mapper.js → helpers/codex/tokens.js} +1 -1
  16. package/dist/browser/helpers/codex/transfer.helper.js +2 -2
  17. package/dist/browser/helpers/codex/txn.helper.js +1 -1
  18. package/dist/browser/helpers/codex.helper.js +6 -6
  19. package/dist/browser/helpers/eth.helper.js +2 -2
  20. package/dist/browser/helpers/order.helper.js +1 -1
  21. package/dist/browser/helpers/pair.helper.js +1 -1
  22. package/dist/browser/helpers/pointSystem.helper.js +1 -1
  23. package/dist/browser/helpers/withdraw.helper.js +2 -2
  24. package/dist/browser/interfaces/index.js +1 -1
  25. package/dist/browser/services/index.js +11 -0
  26. package/dist/browser/types/index.js +1 -1
  27. package/dist/{src/common → common}/index.d.ts +0 -1
  28. package/dist/{src/common → common}/utils/index.d.ts +3 -0
  29. package/dist/constants/env.d.ts +6 -0
  30. package/dist/{src/constants → constants}/index.d.ts +1 -0
  31. package/dist/constants/social.d.ts +4 -0
  32. package/dist/{src/enums → enums}/db/index.d.ts +1 -0
  33. package/dist/enums/db/pending-actions.enum.d.ts +6 -0
  34. package/dist/{src/enums → enums}/db/relayer.enum.d.ts +1 -0
  35. package/dist/{src/enums → enums}/index.d.ts +2 -0
  36. package/dist/enums/points.enum.d.ts +4 -0
  37. package/dist/enums/socket.enum.d.ts +18 -0
  38. package/dist/{src/helpers → helpers}/codex/common.helper.d.ts +2 -5
  39. package/dist/{src/helpers → helpers}/codex/index.d.ts +2 -0
  40. package/dist/helpers/codex/tokens.d.ts +5 -0
  41. package/dist/{src/helpers → helpers}/codex.helper.d.ts +1 -0
  42. package/dist/{src/common/utils → helpers}/decode.d.ts +1 -1
  43. package/dist/interfaces/algostreamer/index.d.ts +50 -0
  44. package/dist/{src/interfaces → interfaces}/index.d.ts +2 -0
  45. package/dist/{src/interfaces → interfaces}/order.interface.d.ts +1 -0
  46. package/dist/interfaces/socket.interface.d.ts +16 -0
  47. package/dist/node/common/index.js +1 -1
  48. package/dist/node/constants/env.js +1 -0
  49. package/dist/node/constants/index.js +1 -1
  50. package/dist/node/enums/index.js +1 -1
  51. package/dist/node/helpers/algo.helper.js +1 -1
  52. package/dist/node/helpers/assert.helper.js +1 -1
  53. package/dist/node/helpers/atomic.helper.js +1 -1
  54. package/dist/node/helpers/balance.helper.js +1 -1
  55. package/dist/node/helpers/codex/common.helper.js +2 -2
  56. package/dist/node/helpers/codex/index.js +2 -2
  57. package/dist/node/helpers/codex/mbr.helper.js +1 -1
  58. package/dist/node/helpers/codex/mna.helper.js +1 -1
  59. package/dist/node/helpers/codex/order.helper.js +1 -1
  60. package/dist/node/helpers/codex/setGlobal.helper.js +1 -1
  61. package/dist/node/helpers/codex/tokens.js +1 -0
  62. package/dist/node/helpers/codex/transfer.helper.js +2 -2
  63. package/dist/node/helpers/codex/txn.helper.js +1 -1
  64. package/dist/node/helpers/codex.helper.js +6 -6
  65. package/dist/node/helpers/eth.helper.js +2 -2
  66. package/dist/node/helpers/order.helper.js +1 -1
  67. package/dist/node/helpers/pair.helper.js +1 -1
  68. package/dist/node/helpers/pointSystem.helper.js +1 -1
  69. package/dist/node/helpers/withdraw.helper.js +2 -2
  70. package/dist/node/interfaces/index.js +1 -1
  71. package/dist/node/services/index.js +1 -0
  72. package/dist/node/types/index.js +1 -1
  73. package/dist/services/index.d.ts +2 -0
  74. package/dist/services/pairParam.service.d.ts +14 -0
  75. package/dist/services/tmc.service.d.ts +33 -0
  76. package/dist/{src/types → types}/api/request.types.d.ts +10 -10
  77. package/dist/{src/types → types}/settings.type.d.ts +3 -3
  78. package/package.json +39 -5
  79. package/dist/browser/common/big-number.helper.js +0 -11
  80. package/dist/browser/common/mappers/codexAsset.mapper.js +0 -11
  81. package/dist/browser/common/mappers/index.js +0 -11
  82. package/dist/browser/common/mappers/trade.mapper.js +0 -11
  83. package/dist/browser/common/utils/assert.js +0 -11
  84. package/dist/browser/common/utils/index.js +0 -11
  85. package/dist/browser/common/utils/stat.js +0 -11
  86. package/dist/browser/helpers/vaa.helper.js +0 -11
  87. package/dist/node/common/big-number.helper.js +0 -1
  88. package/dist/node/common/mappers/codexAsset.mapper.js +0 -1
  89. package/dist/node/common/mappers/codexBalance.mapper.js +0 -1
  90. package/dist/node/common/mappers/index.js +0 -1
  91. package/dist/node/common/mappers/trade.mapper.js +0 -1
  92. package/dist/node/common/utils/assert.js +0 -1
  93. package/dist/node/common/utils/index.js +0 -1
  94. package/dist/node/common/utils/social.js +0 -1
  95. package/dist/node/common/utils/stat.js +0 -1
  96. package/dist/node/helpers/vaa.helper.js +0 -0
  97. package/dist/src/helpers/vaa.helper.d.ts +0 -0
  98. /package/dist/browser/{common → helpers}/auth.helper.js +0 -0
  99. /package/dist/browser/{common/utils → helpers}/decode.js +0 -0
  100. /package/dist/{src/common → common}/big-number.helper.d.ts +0 -0
  101. /package/dist/{src/common → common}/mappers/codexAsset.mapper.d.ts +0 -0
  102. /package/dist/{src/common → common}/mappers/codexBalance.mapper.d.ts +0 -0
  103. /package/dist/{src/common → common}/mappers/index.d.ts +0 -0
  104. /package/dist/{src/common → common}/mappers/trade.mapper.d.ts +0 -0
  105. /package/dist/{src/common → common}/utils/assert.d.ts +0 -0
  106. /package/dist/{src/common → common}/utils/social.d.ts +0 -0
  107. /package/dist/{src/common → common}/utils/stat.d.ts +0 -0
  108. /package/dist/{src/constants → constants}/auth.d.ts +0 -0
  109. /package/dist/{src/constants → constants}/cctp.d.ts +0 -0
  110. /package/dist/{src/constants → constants}/codex.d.ts +0 -0
  111. /package/dist/{src/constants → constants}/frontend.d.ts +0 -0
  112. /package/dist/{src/constants → constants}/response.d.ts +0 -0
  113. /package/dist/{src/constants → constants}/settings.d.ts +0 -0
  114. /package/dist/{src/constants → constants}/withdrawalWalletsMessage.d.ts +0 -0
  115. /package/dist/{src/enums → enums}/chains.enum.d.ts +0 -0
  116. /package/dist/{src/enums → enums}/db/account/index.d.ts +0 -0
  117. /package/dist/{src/enums → enums}/db/affiliate.enum.d.ts +0 -0
  118. /package/dist/{src/enums → enums}/db/available-pair-settings.enum.d.ts +0 -0
  119. /package/dist/{src/enums → enums}/db/common.enum.d.ts +0 -0
  120. /package/dist/{src/enums → enums}/db/component/index.d.ts +0 -0
  121. /package/dist/{src/enums → enums}/db/market-maker.enum.d.ts +0 -0
  122. /package/dist/{src/enums → enums}/db/notification-center/userNotification.enum.d.ts +0 -0
  123. /package/dist/{src/enums → enums}/db/order-side.enum.d.ts +0 -0
  124. /package/dist/{src/enums → enums}/db/order-status.enum.d.ts +0 -0
  125. /package/dist/{src/enums → enums}/db/order-type.enum.d.ts +0 -0
  126. /package/dist/{src/enums → enums}/db/setting-type.enum.d.ts +0 -0
  127. /package/dist/{src/enums → enums}/db/social-action.enum.d.ts +0 -0
  128. /package/dist/{src/enums → enums}/db/social-prompt.enum.d.ts +0 -0
  129. /package/dist/{src/enums → enums}/db/social.enum.d.ts +0 -0
  130. /package/dist/{src/enums → enums}/db/state-type.enum.d.ts +0 -0
  131. /package/dist/{src/enums → enums}/db/trade.enums.d.ts +0 -0
  132. /package/dist/{src/enums → enums}/db/tradingKeyType.enum.d.ts +0 -0
  133. /package/dist/{src/enums → enums}/db/upgrade.enum.d.ts +0 -0
  134. /package/dist/{src/enums → enums}/db/withdrawal-wallet.enum.d.ts +0 -0
  135. /package/dist/{src/enums → enums}/maintenanceMode.enum.d.ts +0 -0
  136. /package/dist/{src/enums → enums}/notification.enum.d.ts +0 -0
  137. /package/dist/{src/enums → enums}/rabbitMq.d.ts +0 -0
  138. /package/dist/{src/enums → enums}/settings.enum.d.ts +0 -0
  139. /package/dist/{src/enums → enums}/social.enum.d.ts +0 -0
  140. /package/dist/{src/helpers → helpers}/Encoding.d.ts +0 -0
  141. /package/dist/{src/helpers → helpers}/algo.helper.d.ts +0 -0
  142. /package/dist/{src/helpers → helpers}/assert.helper.d.ts +0 -0
  143. /package/dist/{src/helpers → helpers}/atomic.helper.d.ts +0 -0
  144. /package/dist/{src/common → helpers}/auth.helper.d.ts +0 -0
  145. /package/dist/{src/helpers → helpers}/balance.helper.d.ts +0 -0
  146. /package/dist/{src/helpers → helpers}/codex/mbr.helper.d.ts +0 -0
  147. /package/dist/{src/helpers → helpers}/codex/mna.helper.d.ts +0 -0
  148. /package/dist/{src/helpers → helpers}/codex/order.helper.d.ts +0 -0
  149. /package/dist/{src/helpers → helpers}/codex/setGlobal.helper.d.ts +0 -0
  150. /package/dist/{src/helpers → helpers}/codex/transfer.helper.d.ts +0 -0
  151. /package/dist/{src/helpers → helpers}/codex/txn.helper.d.ts +0 -0
  152. /package/dist/{src/helpers → helpers}/eth.helper.d.ts +0 -0
  153. /package/dist/{src/helpers → helpers}/index.d.ts +0 -0
  154. /package/dist/{src/helpers → helpers}/interval.helpers.d.ts +0 -0
  155. /package/dist/{src/helpers → helpers}/liquidity.helper.d.ts +0 -0
  156. /package/dist/{src/helpers → helpers}/order.helper.d.ts +0 -0
  157. /package/dist/{src/helpers → helpers}/pair.helper.d.ts +0 -0
  158. /package/dist/{src/helpers → helpers}/pointSystem.helper.d.ts +0 -0
  159. /package/dist/{src/helpers → helpers}/ticker.helpers.d.ts +0 -0
  160. /package/dist/{src/helpers → helpers}/withdraw.helper.d.ts +0 -0
  161. /package/dist/{src/interfaces → interfaces}/accountInfo.interface.d.ts +0 -0
  162. /package/dist/{src/interfaces → interfaces}/api/affiliate.interface.d.ts +0 -0
  163. /package/dist/{src/interfaces → interfaces}/api/index.d.ts +0 -0
  164. /package/dist/{src/interfaces → interfaces}/cache.interface.d.ts +0 -0
  165. /package/dist/{src/interfaces → interfaces}/db/baseModel.interface.d.ts +0 -0
  166. /package/dist/{src/interfaces → interfaces}/db/hummingbot/index.d.ts +0 -0
  167. /package/dist/{src/interfaces → interfaces}/db/index.d.ts +0 -0
  168. /package/dist/{src/interfaces → interfaces}/db/market/index.d.ts +0 -0
  169. /package/dist/{src/interfaces → interfaces}/db/marketing/index.d.ts +0 -0
  170. /package/dist/{src/interfaces → interfaces}/db/notification_center/index.d.ts +0 -0
  171. /package/dist/{src/interfaces → interfaces}/db/relayer/index.d.ts +0 -0
  172. /package/dist/{src/interfaces → interfaces}/db/social/index.d.ts +0 -0
  173. /package/dist/{src/interfaces → interfaces}/db/softDeleteModel.interface.d.ts +0 -0
  174. /package/dist/{src/interfaces → interfaces}/db/white_label/index.d.ts +0 -0
  175. /package/dist/{src/interfaces → interfaces}/db/withdrawal_wallets/index.d.ts +0 -0
  176. /package/dist/{src/interfaces → interfaces}/dto/index.d.ts +0 -0
  177. /package/dist/{src/interfaces → interfaces}/emailService.interface.d.ts +0 -0
  178. /package/dist/{src/interfaces → interfaces}/kmsService.interface.d.ts +0 -0
  179. /package/dist/{src/interfaces → interfaces}/last-look-trade.interface.d.ts +0 -0
  180. /package/dist/{src/interfaces → interfaces}/market.interface.d.ts +0 -0
  181. /package/dist/{src/interfaces → interfaces}/pagination.interface.d.ts +0 -0
  182. /package/dist/{src/interfaces → interfaces}/pair.interface.d.ts +0 -0
  183. /package/dist/{src/interfaces → interfaces}/query.interface.d.ts +0 -0
  184. /package/dist/{src/interfaces → interfaces}/services/accountCache.interface.d.ts +0 -0
  185. /package/dist/{src/interfaces → interfaces}/services/algod.interface.d.ts +0 -0
  186. /package/dist/{src/interfaces → interfaces}/services/balances.interface.d.ts +0 -0
  187. /package/dist/{src/interfaces → interfaces}/services/coin-market-cap.interface.d.ts +0 -0
  188. /package/dist/{src/interfaces → interfaces}/services/index.d.ts +0 -0
  189. /package/dist/{src/interfaces → interfaces}/services/price-model.interface.d.ts +0 -0
  190. /package/dist/{src/interfaces → interfaces}/services/price-service.interface.d.ts +0 -0
  191. /package/dist/{src/interfaces → interfaces}/services/socialActivity.interface.d.ts +0 -0
  192. /package/dist/{src/interfaces → interfaces}/services/tmc.interface.d.ts +0 -0
  193. /package/dist/{src/interfaces → interfaces}/settings.interface.d.ts +0 -0
  194. /package/dist/{src/interfaces → interfaces}/streaming.interface.d.ts +0 -0
  195. /package/dist/{src/interfaces → interfaces}/timestream.interface.d.ts +0 -0
  196. /package/dist/{src/interfaces → interfaces}/trading.interface.d.ts +0 -0
  197. /package/dist/{src/interfaces → interfaces}/tradingKey.interface.d.ts +0 -0
  198. /package/dist/{src/interfaces → interfaces}/transfer.interface.d.ts +0 -0
  199. /package/dist/{src/interfaces → interfaces}/wallet.interface.d.ts +0 -0
  200. /package/dist/{src/interfaces → interfaces}/withdrawalWallets.interface.d.ts +0 -0
  201. /package/dist/node/{common → helpers}/auth.helper.js +0 -0
  202. /package/dist/node/{common/utils → helpers}/decode.js +0 -0
  203. /package/dist/{src/types → types}/algo-order.type.d.ts +0 -0
  204. /package/dist/{src/types → types}/amm/amm.d.ts +0 -0
  205. /package/dist/{src/types → types}/balance-result.types.d.ts +0 -0
  206. /package/dist/{src/types → types}/codex.types.d.ts +0 -0
  207. /package/dist/{src/types → types}/hummingbots.types.d.ts +0 -0
  208. /package/dist/{src/types → types}/index.d.ts +0 -0
  209. /package/dist/{src/types → types}/notification.type.d.ts +0 -0
  210. /package/dist/{src/types → types}/state.type.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- function V(){throw new Error("setTimeout has not been defined")}function K(){throw new Error("clearTimeout has not been defined")}var C=V,D=K;typeof globalThis.setTimeout=="function"&&(C=setTimeout);typeof globalThis.clearTimeout=="function"&&(D=clearTimeout);function z(t){if(C===setTimeout)return setTimeout(t,0);if((C===V||!C)&&setTimeout)return C=setTimeout,setTimeout(t,0);try{return C(t,0)}catch{try{return C.call(null,t,0)}catch{return C.call(this,t,0)}}}function Tr(t){if(D===clearTimeout)return clearTimeout(t);if((D===K||!D)&&clearTimeout)return D=clearTimeout,clearTimeout(t);try{return D(t)}catch{try{return D.call(null,t)}catch{return D.call(this,t)}}}var N=[],y=!1,d,g=-1;function Ir(){!y||!d||(y=!1,d.length?N=d.concat(N):g=-1,N.length&&J())}function J(){if(!y){var t=z(Ir);y=!0;for(var r=N.length;r;){for(d=N,N=[];++g<r;)d&&d[g].run();g=-1,r=N.length}d=null,y=!1,Tr(t)}}function Rr(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];N.push(new X(t,r)),N.length===1&&!y&&z(J)}function X(t,r){this.fun=t,this.array=r}X.prototype.run=function(){this.fun.apply(null,this.array)};var wr="browser",Nr="browser",br=!0,Cr={},Dr=[],dr="",Or={},Lr={},vr={};function O(){}var yr=O,gr=O,Ur=O,Pr=O,Br=O,Mr=O,Fr=O;function kr(t){throw new Error("process.binding is not supported")}function Gr(){return"/"}function Yr(t){throw new Error("process.chdir is not supported")}function Sr(){return 0}var v=globalThis.performance||{},Wr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Hr(t){var r=Wr.call(v)*.001,e=Math.floor(r),i=Math.floor(r%1*1e9);return t&&(e=e-t[0],i=i-t[1],i<0&&(e--,i+=1e9)),[e,i]}var Vr=new Date;function Kr(){var t=new Date,r=t-Vr;return r/1e3}var m={nextTick:Rr,title:wr,browser:br,env:Cr,argv:Dr,version:dr,versions:Or,on:yr,addListener:gr,once:Ur,off:Pr,removeListener:Br,removeAllListeners:Mr,emit:Fr,binding:kr,cwd:Gr,chdir:Yr,umask:Sr,hrtime:Hr,platform:Nr,release:Lr,config:vr,uptime:Kr},H={};Object.keys(H).forEach(t=>{let r=t.split("."),e=m;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?e[n]=H[t]:e=e[n]||(e[n]={})}});var R=[],T=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function $(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],T[t.charCodeAt(r)]=r;T[45]=62,T[95]=63}function Jr(t){Y||$();var r,e,i,n,o,p,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,p=new zr(c*3/4-o),i=o>0?c-4:c;var f=0;for(r=0,e=0;r<i;r+=4,e+=3)n=T[t.charCodeAt(r)]<<18|T[t.charCodeAt(r+1)]<<12|T[t.charCodeAt(r+2)]<<6|T[t.charCodeAt(r+3)],p[f++]=n>>16&255,p[f++]=n>>8&255,p[f++]=n&255;return o===2?(n=T[t.charCodeAt(r)]<<2|T[t.charCodeAt(r+1)]>>4,p[f++]=n&255):o===1&&(n=T[t.charCodeAt(r)]<<10|T[t.charCodeAt(r+1)]<<4|T[t.charCodeAt(r+2)]>>2,p[f++]=n>>8&255,p[f++]=n&255),p}function Xr(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function qr(t,r,e){for(var i,n=[],o=r;o<e;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],n.push(Xr(i));return n.join("")}function q(t){Y||$();for(var r,e=t.length,i=e%3,n="",o=[],p=16383,c=0,f=e-i;c<f;c+=p)o.push(qr(t,c,c+p>f?f:c+p));return i===1?(r=t[e-1],n+=R[r>>2],n+=R[r<<4&63],n+="=="):i===2&&(r=(t[e-2]<<8)+t[e-1],n+=R[r>>10],n+=R[r>>4&63],n+=R[r<<2&63],n+="="),o.push(n),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function U(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function b(t,r){if(U()<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 S(this,t)}return j(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function j(t,r,e,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?$r(t,r,e,i):typeof r=="string"?Zr(t,r,e):jr(t,r)}a.from=function(t,r,e){return j(null,t,r,e)};a.kMaxLength=U();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function rr(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 Qr(t,r,e,i){return rr(r),r<=0?b(t,r):e!==void 0?typeof i=="string"?b(t,r).fill(e,i):b(t,r).fill(e):b(t,r)}a.alloc=function(t,r,e){return Qr(null,t,r,e)};function S(t,r){if(rr(r),t=b(t,r<0?0:W(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return S(null,t)};a.allocUnsafeSlow=function(t){return S(null,t)};function Zr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=er(r,e)|0;t=b(t,i);var n=t.write(r,e);return n!==i&&(t=t.slice(0,n)),t}function G(t,r){var e=r.length<0?0:W(r.length)|0;t=b(t,e);for(var i=0;i<e;i+=1)t[i]=r[i]&255;return t}function $r(t,r,e,i){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,i),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=G(t,r),t}function jr(t,r){if(w(r)){var e=W(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"||xe(r.length)?b(t,0):G(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return G(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(t){if(t>=U())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+U().toString(16)+" bytes");return t|0}a.isBuffer=Te;function w(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!w(r)||!w(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var i=r.length,n=e.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==e[o]){i=r[o],n=e[o];break}return i<n?-1:n<i?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 i;if(e===void 0)for(e=0,i=0;i<r.length;++i)e+=r[i].length;var n=a.allocUnsafe(e),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!w(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function er(t,r){if(w(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return cr(t).length;default:if(i)return P(t).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=er;function re(t,r,e){var i=!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 fe(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return ce(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return pe(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,r,e);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function L(t,r,e){var i=t[r];t[r]=t[e],t[e]=i}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?nr(this,0,r):re.apply(this,arguments)};a.prototype.equals=function(r){if(!w(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,i,n,o){if(!w(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-e,f=Math.min(p,c),u=this.slice(n,o),E=r.slice(e,i),h=0;h<f;++h)if(u[h]!==E[h]){p=u[h],c=E[h];break}return p<c?-1:c<p?1:0};function tr(t,r,e,i,n){if(t.length===0)return-1;if(typeof e=="string"?(i=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=a.from(r,i)),w(r))return r.length===0?-1:Q(t,r,e,i,n);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Q(t,[r],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Q(t,r,e,i,n){var o=1,p=t.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,p/=2,c/=2,e/=2}function f(x,s){return o===1?x[s]:x.readUInt16BE(s*o)}var u;if(n){var E=-1;for(u=e;u<p;u++)if(f(t,u)===f(r,E===-1?0:u-E)){if(E===-1&&(E=u),u-E+1===c)return E*o}else E!==-1&&(u-=u-E),E=-1}else for(e+c>p&&(e=p-c),u=e;u>=0;u--){for(var h=!0,I=0;I<c;I++)if(f(t,u+I)!==f(r,I)){h=!1;break}if(h)return u}return-1}a.prototype.includes=function(r,e,i){return this.indexOf(r,e,i)!==-1};a.prototype.indexOf=function(r,e,i){return tr(this,r,e,i,!0)};a.prototype.lastIndexOf=function(r,e,i){return tr(this,r,e,i,!1)};function ee(t,r,e,i){e=Number(e)||0;var n=t.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function te(t,r,e,i){return F(P(r,t.length-e),t,e,i)}function ir(t,r,e,i){return F(Ae(r),t,e,i)}function ie(t,r,e,i){return ir(t,r,e,i)}function ne(t,r,e,i){return F(cr(r),t,e,i)}function oe(t,r,e,i){return F(_e(r,t.length-e),t,e,i)}a.prototype.write=function(r,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<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 ee(this,r,e,i);case"utf8":case"utf-8":return te(this,r,e,i);case"ascii":return ir(this,r,e,i);case"latin1":case"binary":return ie(this,r,e,i);case"base64":return ne(this,r,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,r,e,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function pe(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 i=[],n=r;n<e;){var o=t[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=e){var f,u,E,h;switch(c){case 1:o<128&&(p=o);break;case 2:f=t[n+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(p=h));break;case 3:f=t[n+1],u=t[n+2],(f&192)===128&&(u&192)===128&&(h=(o&15)<<12|(f&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(p=h));break;case 4:f=t[n+1],u=t[n+2],E=t[n+3],(f&192)===128&&(u&192)===128&&(E&192)===128&&(h=(o&15)<<18|(f&63)<<12|(u&63)<<6|E&63,h>65535&&h<1114112&&(p=h))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return ae(i)}var Z=4096;function ae(t){var r=t.length;if(r<=Z)return String.fromCharCode.apply(String,t);for(var e="",i=0;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=Z));return e}function ce(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]&127);return i}function he(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]);return i}function fe(t,r,e){var i=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>i)&&(e=i);for(var n="",o=r;o<e;++o)n+=me(t[o]);return n}function ue(t,r,e){for(var i=t.slice(r,e),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,e){var i=this.length;r=~~r,e=e===void 0?i:~~e,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<r&&(e=r);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(r,e),n.__proto__=a.prototype;else{var o=e-r;n=new a(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};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")}a.prototype.readUIntLE=function(r,e,i){r=r|0,e=e|0,i||A(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return n};a.prototype.readUIntBE=function(r,e,i){r=r|0,e=e|0,i||A(r,e,this.length);for(var n=this[r+--e],o=1;e>0&&(o*=256);)n+=this[r+--e]*o;return n};a.prototype.readUInt8=function(r,e){return e||A(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||A(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||A(r,2,this.length),this[r]<<8|this[r+1]};a.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};a.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])};a.prototype.readIntLE=function(r,e,i){r=r|0,e=e|0,i||A(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(r,e,i){r=r|0,e=e|0,i||A(r,e,this.length);for(var n=e,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||A(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||A(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,e){e||A(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.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};a.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]};a.prototype.readFloatLE=function(r,e){return e||A(r,4,this.length),k(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||A(r,4,this.length),k(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||A(r,8,this.length),k(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||A(r,8,this.length),k(this,r,!1,52,8)};function _(t,r,e,i,n,o){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(e+i>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;_(this,r,e,i,o,0)}var p=1,c=0;for(this[e]=r&255;++c<i&&(p*=256);)this[e+c]=r/p&255;return e+i};a.prototype.writeUIntBE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;_(this,r,e,i,o,0)}var p=i-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+i};a.prototype.writeUInt8=function(r,e,i){return r=+r,e=e|0,i||_(this,r,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function B(t,r,e,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(t.length-e,2);n<o;++n)t[e+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}a.prototype.writeUInt16LE=function(r,e,i){return r=+r,e=e|0,i||_(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};a.prototype.writeUInt16BE=function(r,e,i){return r=+r,e=e|0,i||_(this,r,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};function M(t,r,e,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(t.length-e,4);n<o;++n)t[e+n]=r>>>(i?n:3-n)*8&255}a.prototype.writeUInt32LE=function(r,e,i){return r=+r,e=e|0,i||_(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):M(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,i){return r=+r,e=e|0,i||_(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):M(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);_(this,r,e,i,o-1,-o)}var p=0,c=1,f=0;for(this[e]=r&255;++p<i&&(c*=256);)r<0&&f===0&&this[e+p-1]!==0&&(f=1),this[e+p]=(r/c>>0)-f&255;return e+i};a.prototype.writeIntBE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);_(this,r,e,i,o-1,-o)}var p=i-1,c=1,f=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&f===0&&this[e+p+1]!==0&&(f=1),this[e+p]=(r/c>>0)-f&255;return e+i};a.prototype.writeInt8=function(r,e,i){return r=+r,e=e|0,i||_(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,i){return r=+r,e=e|0,i||_(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};a.prototype.writeInt16BE=function(r,e,i){return r=+r,e=e|0,i||_(this,r,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};a.prototype.writeInt32LE=function(r,e,i){return r=+r,e=e|0,i||_(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):M(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,i){return r=+r,e=e|0,i||_(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):M(this,r,e,!1),e+4};function or(t,r,e,i,n,o){if(e+i>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function pr(t,r,e,i,n){return n||or(t,r,e,4,34028234663852886e22,-34028234663852886e22),fr(t,r,e,i,23,4),e+4}a.prototype.writeFloatLE=function(r,e,i){return pr(this,r,e,!0,i)};a.prototype.writeFloatBE=function(r,e,i){return pr(this,r,e,!1,i)};function ar(t,r,e,i,n){return n||or(t,r,e,8,17976931348623157e292,-17976931348623157e292),fr(t,r,e,i,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,i){return ar(this,r,e,!0,i)};a.prototype.writeDoubleBE=function(r,e,i){return ar(this,r,e,!1,i)};a.prototype.copy=function(r,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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-i&&(n=r.length-e+i);var o=n-i,p;if(this===r&&i<e&&e<n)for(p=o-1;p>=0;--p)r[p+e]=this[p+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),e);return o};a.prototype.fill=function(r,e,i,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<i;++p)this[p]=r;else{var c=w(r)?r:P(new a(r,n).toString()),f=c.length;for(p=0;p<i-e;++p)this[p+e]=c[p%f]}return this};var se=/[^+\/0-9A-Za-z-_]/g;function le(t){if(t=Ee(t).replace(se,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ee(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function me(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,r){r=r||1/0;for(var e,i=t.length,n=null,o=[],p=0;p<i;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!n){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=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 Ae(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function _e(t,r){for(var e,i,n,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),i=e>>8,n=e%256,o.push(n),o.push(i);return o}function cr(t){return Jr(le(t))}function F(t,r,e,i){for(var n=0;n<i&&!(n+e>=r.length||n>=t.length);++n)r[n+e]=t[n];return n}function xe(t){return t!==t}function Te(t){return t!=null&&(!!t._isBuffer||hr(t)||Ie(t))}function hr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ie(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&hr(t.slice(0,0))}function k(t,r,e,i,n){var o,p,c=n*8-i-1,f=(1<<c)-1,u=f>>1,E=-7,h=e?n-1:0,I=e?-1:1,x=t[r+h];for(h+=I,o=x&(1<<-E)-1,x>>=-E,E+=c;E>0;o=o*256+t[r+h],h+=I,E-=8);for(p=o&(1<<-E)-1,o>>=-E,E+=i;E>0;p=p*256+t[r+h],h+=I,E-=8);if(o===0)o=1-u;else{if(o===f)return p?NaN:(x?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-u}return(x?-1:1)*p*Math.pow(2,o-i)}function fr(t,r,e,i,n,o){var p,c,f,u=o*8-n-1,E=(1<<u)-1,h=E>>1,I=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,s=i?1:-1,xr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=E):(p=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-p))<1&&(p--,f*=2),p+h>=1?r+=I/f:r+=I*Math.pow(2,1-h),r*f>=2&&(p++,f/=2),p+h>=E?(c=0,p=E):p+h>=1?(c=(r*f-1)*Math.pow(2,n),p=p+h):(c=r*Math.pow(2,h-1)*Math.pow(2,n),p=0));n>=8;t[e+x]=c&255,x+=s,c/=256,n-=8);for(p=p<<n|c,u+=n;u>0;t[e+x]=p&255,x+=s,p/=256,u-=8);t[e+x-s]|=xr*128}var Re=(s=>(s[s.Solana=1]="Solana",s[s.Algorand=8]="Algorand",s[s.Polygon=5]="Polygon",s[s.Bsc=4]="Bsc",s[s.Avalanche=6]="Avalanche",s[s.Arbitrum=23]="Arbitrum",s[s.Optimism=24]="Optimism",s[s.Base=30]="Base",s[s.Ethereum=2]="Ethereum",s[s.Sepolia=10002]="Sepolia",s[s.ArbitrumSepolia=10003]="ArbitrumSepolia",s[s.BaseSepolia=10004]="BaseSepolia",s[s.OptimismSepolia=10005]="OptimismSepolia",s[s.PolygonAmoy=10007]="PolygonAmoy",s))(Re||{}),ut={1:"Solana",2:"Ethereum",5:"Polygon",4:"BNB Chain",6:"Avalanche",8:"Algorand",23:"Arbitrum",24:"Optimism",30:"Base",10002:"Ethereum Sepolia",10003:"Arbitrum Sepolia",10004:"Base Sepolia",10005:"Optimism Sepolia",10007:"Polygon Amoy"},st={4:["","https://bsc-testnet.public.blastapi.io","https://bsc-testnet.blockpi.network/v1/rpc/private","https://bsc-testnet-rpc.publicnode.com","https://api.zan.top/bsc-testnet","https://data-seed-prebsc-2-s1.bnbchain.org:8545","https://data-seed-prebsc-2-s2.bnbchain.org:8545","https://data-seed-prebsc-2-s3.bnbchain.org:8545","https://data-seed-prebsc-1-s1.bnbchain.org:8545","https://data-seed-prebsc-1-s2.bnbchain.org:8545","https://data-seed-prebsc-1-s3.bnbchain.org:8545","https://endpoints.omniatech.io/v1/bsc/testnet/public"],6:["","https://rpc.ankr.com/avalanche_fuji","https://rpc.ankr.com/avalanche_fuji-c","https://api.avax-test.network/ext/bc/C/rpc","https://ava-testnet.public.blastapi.io/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/fuji/public","https://avalanche-fuji.blockpi.network/v1/rpc/private","https://avalanche-fuji-c-chain-rpc.publicnode.com","https://avalanche-fuji.blockpi.network/v1/rpc/private"],10002:["https://ethereum-sepolia-rpc.publicnode.com","https://sepolia.gateway.tenderly.co","https://eth-sepolia.public.blastapi.io","https://ethereum-sepolia.blockpi.network/v1/rpc/private","https://sepolia.drpc.org","https://endpoints.omniatech.io/v1/eth/sepolia/public","https://1rpc.io/sepolia","https://gateway.tenderly.co/public/sepolia","https://sepolia.gateway.tenderly.co","https://api.zan.top/eth-sepolia","https://ethereum-sepolia.rpc.subquery.network/public"],10003:["","https://arbitrum-sepolia.blockpi.network/v1/rpc/private ","https://arbitrum-sepolia.gateway.tenderly.co","https://endpoints.omniatech.io/v1/arbitrum/sepolia/public","https://api.zan.top/arb-sepolia","https://sepolia-rollup.arbitrum.io/rpc"],10004:["","https://sepolia.base.org","https://base-sepolia-rpc.publicnode.com","https://base-sepolia.gateway.tenderly.co","https://base-sepolia.blockpi.network/v1/rpc/private","https://node.histori.xyz/base-sepolia/8ry9f6t9dct1se2hlagxnd9n2a"],10005:["","https://optimism-sepolia.blockpi.network/v1/rpc/private","https://sepolia.optimism.io","https://api.zan.top/opt-sepolia","https://optimism-sepolia.gateway.tenderly.co","https://optimism-sepolia.drpc.org","https://endpoints.omniatech.io/v1/op/sepolia/public"],10007:["https://rpc-amoy.polygon.technology","https://polygon-amoy-bor-rpc.publicnode.com","https://rpc.ankr.com/polygon_amoy","https://polygon-amoy.drpc.org","https://api.zan.top/polygon-amoy","https://polygon-amoy.gateway.tenderly.co"]},lt={2:["","https://eth.llamarpc.com","https://ethereum.blockpi.network/v1/rpc/public","https://eth-mainnet.nodereal.io/v1/1659dfb40aa24bbb8153a677b98064d7","https://uk.rpc.blxrbdn.com","https://singapore.rpc.blxrbdn.com","https://virginia.rpc.blxrbdn.com","https://eth-mainnet.public.blastapi.io","https://api.securerpc.com/v1","https://mainnet.gateway.tenderly.co","https://eth-pokt.nodies.app","https://eth.blockrazor.xyz","https://eth.merkle.io","https://gateway.tenderly.co/public/mainnet","https://eth.rpc.blxrbdn.com"],4:["","https://bsc.blockrazor.xyz","https://bscrpc.com","https://bsc-mainnet.public.blastapi.io","https://binance.llamarpc.com","https://go.getblock.io/cc778cdbdf5c4b028ec9456e0e6c0cf3","https://bsc-pokt.nodies.app","https://56.rpc.thirdweb.com","https://bsc.blockpi.network/v1/rpc/private","https://bsc.rpc.blxrbdn.com","https://bsc-dataseed.bnbchain.org","https://endpoints.omniatech.io/v1/bsc/mainnet/public","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed2.ninicoin.io","https://0.48.club","https://bsc-dataseed3.defibit.io"],5:["","https://polygon.llamarpc.com","https://polygon-rpc.com","https://rpc-mainnet.matic.quiknode.pro","https://endpoints.omniatech.io/v1/matic/mainnet/public","https://polygon-pokt.nodies.app","https://polygon-bor-rpc.publicnode.com","https://polygon.rpc.subquery.network/public","https://polygon-bor-rpc.publicnode.com","https://polygon.blockpi.network/v1/rpc/private","https://polygon.api.onfinality.io/public","https://polygon.lava.build","https://api.zan.top/polygon-mainnet","https://polygon.meowrpc.com"],6:["","https://avalanche-c-chain-rpc.publicnode.com","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://avalanche-c-chain-rpc.publicnode.com","https://avalanche.blockpi.network/v1/rpc/private","https://avalanche.public-rpc.com","https://avalanche.drpc.org","https://avax.meowrpc.com","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://api.avax.network/ext/bc/C/rpc","https://1rpc.io/avax/c","https://avax-pokt.nodies.app/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://api.zan.top/avax-mainnet/ext/bc/C/rpc"],23:["","https://arbitrum.llamarpc.com","https://arbitrum.rpc.subquery.network/public","https://endpoints.omniatech.io/v1/arbitrum/one/public","https://arbitrum.meowrpc.com","https://arbitrum.gateway.tenderly.co","https://arbitrum-one.public.blastapi.io","https://arb1.lava.build","https://arbitrum-one.publicnode.com","https://arbitrum.blockpi.network/v1/rpc/public","https://arb-pokt.nodies.app","https://api.zan.top/arb-one","https://arb1.arbitrum.io/rpc","https://arbitrum.drpc.org","https://1rpc.io/arb"],24:["","https://optimism.llamarpc.com","https://op-pokt.nodies.app","https://optimism-mainnet.public.blastapi.io","https://optimism.blockpi.network/v1/rpc/public","https://endpoints.omniatech.io/v1/op/mainnet/public","https://optimism-rpc.publicnode.com","https://optimism.drpc.org","https://1rpc.io/op","https://optimism.gateway.tenderly.co","https://optimism.lava.build","https://optimism.rpc.subquery.network/public","https://mainnet.optimism.io","https://optimism-rpc.publicnode.com","https://gateway.tenderly.co/public/optimism"],30:["","https://base.llamarpc.com","https://base-mainnet.public.blastapi.io","https://base-rpc.publicnode.com","https://base.blockpi.network/v1/rpc/public","https://base.drpc.org","https://mainnet.base.org","https://base.api.onfinality.io/public","https://base-pokt.nodies.app","https://1rpc.io/base","https://developer-access-mainnet.base.org","https://endpoints.omniatech.io/v1/base/mainnet/public","https://base.rpc.subquery.network/public","https://base.api.onfinality.io/public","https://base.meowrpc.com","https://base.gateway.tenderly.co"]};var we=(n=>(n[n.Off=0]="Off",n[n.Full=1]="Full",n[n.Partial=2]="Partial",n[n.Scheduled=3]="Scheduled",n))(we||{});var Ne=(o=>(o[o.SELF_TRADE=1]="SELF_TRADE",o[o.FULL_FILLED=2]="FULL_FILLED",o[o.FULL_CANCELLED=3]="FULL_CANCELLED",o[o.PARTIALLY_CANCELLED=4]="PARTIALLY_CANCELLED",o[o.CREATED=5]="CREATED",o))(Ne||{});var be=(f=>(f.USERS_READ="users.read",f.FOLLOWS_READ="follows.read",f.FOLLOWS_WRITE="follows.write",f.TWEET_READ="tweet.read",f.TWEET_WRITE="tweet.write",f.OFFLINE_ACCESS="offline.access",f.LIKE_READ="like.read",f.LIKE_WRITE="like.write",f))(be||{});var ur=(u=>(u.MFT_AUDIO_LINK="mft.audioLink",u.MFT_TITLE="mft.title",u.MODE_PRE_SALE="mode.preSale",u.MAKER_FEE="makerFee",u.TAKER_FEE="takerFee",u.VIEW_BASE_COIN_ICON_LINK="view.baseCoinIconLink",u.VIEW_BASE_COIN_MARKET_LINK="view.baseCoinMarketLink",u.VIEW_PRICE_COIN_ICON_LINK="view.priceCoinIconLink",u.VIEW_PRICE_COIN_MARKET_LINK="view.priceCoinMarketLink",u))(ur||{}),Ce=ur;var sr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(sr||{}),De=sr;var lr=(o=>(o[o.Open=1]="Open",o[o.Canceled=2]="Canceled",o[o.Matched=3]="Matched",o[o.SelfMatched=4]="SelfMatched",o[o.Expired=5]="Expired",o))(lr||{}),de=lr;var Er=(n=>(n[n.Limit=0]="Limit",n[n.IOC=1]="IOC",n[n.POST=2]="POST",n[n.Market=3]="Market",n))(Er||{}),Oe=Er;var mr=(e=>(e.User="User",e.Api="API",e))(mr||{});var Le=(n=>(n.COMPANY="COMPANY",n.TWITTER="TWITTER",n.DISCORD="DISCORD",n.TELEGRAM="TELEGRAM",n))(Le||{}),ve=(h=>(h[h.TWITTER_FOLLOW=1]="TWITTER_FOLLOW",h[h.TWITTER_REPLY=2]="TWITTER_REPLY",h[h.TWITTER_RETWEET=3]="TWITTER_RETWEET",h[h.TWITTER_LIKE=4]="TWITTER_LIKE",h[h.COMPANY_FIRST_LOGIN=5]="COMPANY_FIRST_LOGIN",h[h.COMPANY_CONFIRM_EMAIL=6]="COMPANY_CONFIRM_EMAIL",h[h.COMPANY_DEPOSIT=7]="COMPANY_DEPOSIT",h[h.COMPANY_TRADE=8]="COMPANY_TRADE",h[h.TELEGRAM_JOIN_GROUP=9]="TELEGRAM_JOIN_GROUP",h[h.DISCORD_JOIN_SERVER=10]="DISCORD_JOIN_SERVER",h[h.AFFILIATE_POINTS_REWARD=11]="AFFILIATE_POINTS_REWARD",h))(ve||{}),St=[1,9,10,6,5];var ye=(n=>(n.CREATED="created",n.STARTED="started",n.PAUSED="paused",n.CLOSED="closed",n))(ye||{}),ge=(e=>(e.Post="POST",e.Comment="COMMENT",e))(ge||{});var Ue=(p=>(p.INSTRUCTIONS="INSTRUCTIONS",p.TEXT_STYLE="TEXT_STYLE",p.TEXT_TONE="TEXT_TONE",p.REACTION_TYPE="REACTION_TYPE",p.COMMENT_LENGTH="COMMENT_LENGTH",p.CONTEXT="CONTEXT",p))(Ue||{});var Pe=(p=>(p[p.FEE_TIER_1=1]="FEE_TIER_1",p[p.FEE_TIER_2=2]="FEE_TIER_2",p[p.FEE_TIER_3=3]="FEE_TIER_3",p[p.FEE_TIER_4=4]="FEE_TIER_4",p[p.FEE_TIER_5=5]="FEE_TIER_5",p[p.FEE_TIER_6=6]="FEE_TIER_6",p))(Pe||{}),Be=(e=>(e[e.Approve=1]="Approve",e[e.Reject=0]="Reject",e))(Be||{}),Me=(o=>(o.INITIATED="INITIATED",o.CREATED="CREATED",o.PROCESSING="PROCESSING",o.APPROVED="APPROVED",o.REJECTED="REJECTED",o))(Me||{});var Fe=(o=>(o.INVITED_ACCOUNTS_COUNT="invitedAccountsCount",o.CREATED_AT="createdAt",o.FEE_SHARE="feeShare",o.ADDRESS="address",o.REFERRAL_TRADING_VOLUME="referralTradingVolume",o))(Fe||{});var ke=(p=>(p.ACTIVE="ACTIVE",p.FAILED="FAILED",p.STARTING="STARTING",p.DRAINING="DRAINING",p.TERMINATING="TERMINATING",p.TERMINATED="TERMINATED",p))(ke||{}),Ge=(o=>(o.MATCHING_ENGINE="me",o.ORDER_SERVICE="ors",o.API="api",o.SOCKET_SERVICE="ws",o.TRANSACTION_SERVICE="tns",o))(Ge||{}),Ye=(o=>(o.ACTIVE="ACTIVE",o.FAILED="FAILED",o.UNASSIGNED="UNASSIGNED",o.ASSIGNED="ASSIGNED",o.STARTING="STARTING",o))(Ye||{});var Se=(n=>(n.Pending="pending",n.Completed="completed",n.Failed="failed",n.Received="received",n))(Se||{}),We=(i=>(i.Deposit="deposit",i.Withdraw="withdraw",i.Rebalance="rebalance",i))(We||{}),He=(i=>(i.PENDING="pending",i.COMPLETED="completed",i.FAILED="failed",i))(He||{}),Ve=(o=>(o.USER_TO_TMC="user_to_tmc",o.TMC_TO_USER="tmc_to_user",o.RELAYER_TO_TMC="relayer_to_tmc",o.RELAYER_TO_CODEX="relayer_to_codex",o.RELAYER_TO_CIRCLE="relayer_to_circle",o))(Ve||{});var Ke=(i=>(i.Unconfirmed="UNCONFIRMED",i.Confirmed="CONFIRMED",i.Rejected="REJECTED",i))(Ke||{}),ze=(i=>(i.RESUBMITTED="RESUBMITTED",i.PROCESSED="PROCESSED",i.REMATCHED="REMATCHED",i))(ze||{});var Je=(n=>(n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.THIRD=3]="THIRD",n[n.FOURTH=4]="FOURTH",n))(Je||{}),Xe=(c=>(c.REBATE_TIER="rebateTier",c.CREATED_AT="createdAt",c.NAME="name",c.TAKER_FEE="takerFee",c.ENABLED="enabled",c.ADDRESS="address",c.CHAIN="chainId",c))(Xe||{});var qe=(e=>(e.ASCENDING="ASC",e.DESCENDING="DESC",e))(qe||{});var Ar=(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))(Ar||{}),_r=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(_r||{}),xi={...Ar,..._r},Qe=(i=>(i.CRITICAL="CRITICAL",i.IMPORTANT="IMPORTANT",i.INFO="INFO",i))(Qe||{}),Ze=(e=>(e.UNREAD="UNREAD",e.READ="READ",e))(Ze||{}),$e=(i=>(i.PENDING="PENDING",i.PROCESSED="PROCESSED",i.FAILED="FAILED",i))($e||{});var je=(p=>(p.STRING="string",p.BOOLEAN="boolean",p.INT="int",p.FLOAT="float",p.SINGLE_CHOICE="single-choice",p.MULTI_CHOICE="multi-choice",p))(je||{});var rt=(c=>(c.VERSION="version",c.LAST_ALGO_BLOCK="last_algo_block",c.PRICES_PROVIDER_API_KEY="prices_provider_api_key",c.DEFAULT_API_DOMAIN="default_api_domain",c.NONCE_ACCOUNTS_SOLANA="nonce_accounts_solana",c.ARCHIVE_DATA_BATCH_SIZE="archive_data_batch_size",c.ARCHIVE_TASK_LOCK="archive_task_lock",c))(rt||{});var et=(i=>(i.SUCCESS="success",i.FAILED="failed",i.PENDING="pending",i))(et||{});var tt=(i=>(i.SOLANA="SOLANA",i.ALGORAND="ALGORAND",i.EVM="EVM",i))(tt||{});var it=(o=>(o.CONNECTED="CONNECTED",o.CONNECTING="CONNECTING",o.DISCONNECTED="DISCONNECTED",o.DISCONNECTING="DISCONNECTING",o.PENDING="PENDING",o))(it||{});var nt=(l=>(l.ENABLED="company.enabled",l.APP_TITLE="company.appTitle",l.DOMAIN="company.domain",l.DIRECT_SETTLE="company.directSettlement",l.KYC="markets.kycTradeRequirementEnabled",l.GEOBLOCK="company.geoblock",l.LOGO="appearance.logo",l.THEMES="appearance.themes",l.NEW_TAB="appearance.newTab",l.TARGET="appearance.target",l.REPORT_BUTTONS="appearance.reportButtons",l.CUSTOM_MENU_ITEMS="appearance.customMenuItems",l.APPEARANCE_CHART_TYPE="appearance.chartType",l.APPEARANCE_CHART_INT="appearance.chartInt",l.AMM="product.amm",l.OBDEX="product.obdex",l.POINTS="product.pointSystem",l.AFFILIATE_DASHBOARD_THRESHOLD="product.affiliateDashboardThreshold",l.AFFILIATE_DEFAULT_FEE_SHARE="product.affiliateDefaultFeeShare",l.AFFILIATE_DASHBOARD_VISIBILITY="product.affiliateDashboardVisibility",l.AMM_FEE="company.ammFee",l.FEE_SHARE="company.feeShare",l.MIN_FEE="company.minFee",l.MAKER_FEE="company.makerFee",l.TAKER_FEE="company.takerFee",l.PINNED_PAIRS="markets.pinnedPairs",l.TWITTER_ENABLED="point-system.twitterEnabled",l.TWITTER_JOB_ENABLED="point-system.twitterJobEnabled",l.TWITTER_HASHTAGS="point-system.twitterHashtags",l.TWITTER_ACCOUNT_NAME="point-system.twitterAccountName",l.DISCORD_ENABLED="point-system.discordEnabled",l.TELEGRAM_ENABLED="point-system.telegramEnabled",l.TELEGRAM_GROUP_NAME="point-system.telegramGroupName",l.TELEGRAM_BOT_NAME="point-system.telegramBotName",l.GUIDE_LINK="point-system.guideLink",l))(nt||{});export{_r as AccountNotificationEnum,ve as ActionEnum,Le as ActionSource,We as ActionTypeEnum,Fe as AffiliateSortByEnum,Ce as AvailablePairSettings,He as CCTPStatus,ut as ChainNames,Re as Chains,xi as CombinedNotificationEnum,ke as ComponentStatusType,Ge as ComponentType,Pe as FeeTier,Ar as GlobalNotificationEnum,lt as HTTPSRPC_MAINNET,st as HTTPSRPC_TESTNET,Me as KYCAuthenticationStatus,Be as LastLookAction,we as MaintenanceMode,Je as MarketMakerRebateTier,Xe as MarketMakerSortByEnum,St as NON_REPEATABLE_ACTIONS,Ne as Notification,Qe as NotificationPriorityEnum,Ze as NotificationStatusEnum,Se as OperationStatusEnum,De as OrderSide,de as OrderStatus,Oe as OrderType,Ye as PairComponentStatusType,Ue as PromptTypeEnum,it as RabbitConnectionStatus,$e as ScheduledNotificationStatusEnum,ye as SeasonStatusEnum,nt as SettingIds,je as SettingTypeColumn,qe as SortDirectionEnum,rt as StateType,Ke as TradeStatus,ze as TradeSubStatus,mr as TradingKeyType,Ve as TransactionType,ge as TweetType,be as TwitterAccessScopeEnum,et as UpgradeStatus,tt as WithdrawalWalletType};
1
+ function K(){throw new Error("setTimeout has not been defined")}function z(){throw new Error("clearTimeout has not been defined")}var b=K,O=z;typeof globalThis.setTimeout=="function"&&(b=setTimeout);typeof globalThis.clearTimeout=="function"&&(O=clearTimeout);function J(t){if(b===setTimeout)return setTimeout(t,0);if((b===K||!b)&&setTimeout)return b=setTimeout,setTimeout(t,0);try{return b(t,0)}catch{try{return b.call(null,t,0)}catch{return b.call(this,t,0)}}}function Tr(t){if(O===clearTimeout)return clearTimeout(t);if((O===z||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(t);try{return O(t)}catch{try{return O.call(null,t)}catch{return O.call(this,t)}}}var C=[],g=!1,L,U=-1;function Ir(){!g||!L||(g=!1,L.length?C=L.concat(C):U=-1,C.length&&X())}function X(){if(!g){var t=J(Ir);g=!0;for(var r=C.length;r;){for(L=C,C=[];++U<r;)L&&L[U].run();U=-1,r=C.length}L=null,g=!1,Tr(t)}}function wr(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];C.push(new q(t,r)),C.length===1&&!g&&J(X)}function q(t,r){this.fun=t,this.array=r}q.prototype.run=function(){this.fun.apply(null,this.array)};var Rr="browser",Nr="browser",Cr=!0,Dr={},br=[],Or="",Lr={},dr={},vr={};function d(){}var yr=d,gr=d,Ur=d,Pr=d,Br=d,Fr=d,Yr=d;function kr(t){throw new Error("process.binding is not supported")}function Gr(){return"/"}function Mr(t){throw new Error("process.chdir is not supported")}function Wr(){return 0}var y=globalThis.performance||{},Hr=y.now||y.mozNow||y.msNow||y.oNow||y.webkitNow||function(){return new Date().getTime()};function Sr(t){var r=Hr.call(y)*.001,e=Math.floor(r),i=Math.floor(r%1*1e9);return t&&(e=e-t[0],i=i-t[1],i<0&&(e--,i+=1e9)),[e,i]}var Vr=new Date;function Kr(){var t=new Date,r=t-Vr;return r/1e3}var E={nextTick:wr,title:Rr,browser:Cr,env:Dr,argv:br,version:Or,versions:Lr,on:yr,addListener:gr,once:Ur,off:Pr,removeListener:Br,removeAllListeners:Fr,emit:Yr,binding:kr,cwd:Gr,chdir:Mr,umask:Wr,hrtime:Sr,platform:Nr,release:dr,config:vr,uptime:Kr},V={};Object.keys(V).forEach(t=>{let r=t.split("."),e=E;for(let i=0;i<r.length;i++){let n=r[i];i===r.length-1?e[n]=V[t]:e=e[n]||(e[n]={})}});var R=[],I=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function j(){W=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],I[t.charCodeAt(r)]=r;I[45]=62,I[95]=63}function Jr(t){W||j();var r,e,i,n,o,p,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,p=new zr(c*3/4-o),i=o>0?c-4:c;var f=0;for(r=0,e=0;r<i;r+=4,e+=3)n=I[t.charCodeAt(r)]<<18|I[t.charCodeAt(r+1)]<<12|I[t.charCodeAt(r+2)]<<6|I[t.charCodeAt(r+3)],p[f++]=n>>16&255,p[f++]=n>>8&255,p[f++]=n&255;return o===2?(n=I[t.charCodeAt(r)]<<2|I[t.charCodeAt(r+1)]>>4,p[f++]=n&255):o===1&&(n=I[t.charCodeAt(r)]<<10|I[t.charCodeAt(r+1)]<<4|I[t.charCodeAt(r+2)]>>2,p[f++]=n>>8&255,p[f++]=n&255),p}function Xr(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function qr(t,r,e){for(var i,n=[],o=r;o<e;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],n.push(Xr(i));return n.join("")}function Q(t){W||j();for(var r,e=t.length,i=e%3,n="",o=[],p=16383,c=0,f=e-i;c<f;c+=p)o.push(qr(t,c,c+p>f?f:c+p));return i===1?(r=t[e-1],n+=R[r>>2],n+=R[r<<4&63],n+="=="):i===2&&(r=(t[e-2]<<8)+t[e-1],n+=R[r>>10],n+=R[r>>4&63],n+=R[r<<2&63],n+="="),o.push(n),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function P(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function D(t,r){if(P()<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 H(this,t)}return rr(this,t,r,e)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function rr(t,r,e,i){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?$r(t,r,e,i):typeof r=="string"?Zr(t,r,e):jr(t,r)}a.from=function(t,r,e){return rr(null,t,r,e)};a.kMaxLength=P();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function er(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 Qr(t,r,e,i){return er(r),r<=0?D(t,r):e!==void 0?typeof i=="string"?D(t,r).fill(e,i):D(t,r).fill(e):D(t,r)}a.alloc=function(t,r,e){return Qr(null,t,r,e)};function H(t,r){if(er(r),t=D(t,r<0?0:S(r)|0),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}a.allocUnsafe=function(t){return H(null,t)};a.allocUnsafeSlow=function(t){return H(null,t)};function Zr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var i=tr(r,e)|0;t=D(t,i);var n=t.write(r,e);return n!==i&&(t=t.slice(0,n)),t}function M(t,r){var e=r.length<0?0:S(r.length)|0;t=D(t,e);for(var i=0;i<e;i+=1)t[i]=r[i]&255;return t}function $r(t,r,e,i){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(i||0))throw new RangeError("'length' is out of bounds");return e===void 0&&i===void 0?r=new Uint8Array(r):i===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,i),a.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=a.prototype):t=M(t,r),t}function jr(t,r){if(N(r)){var e=S(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"||xe(r.length)?D(t,0):M(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return M(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function S(t){if(t>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return t|0}a.isBuffer=Te;function N(t){return!!(t!=null&&t._isBuffer)}a.compare=function(r,e){if(!N(r)||!N(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var i=r.length,n=e.length,o=0,p=Math.min(i,n);o<p;++o)if(r[o]!==e[o]){i=r[o],n=e[o];break}return i<n?-1:n<i?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 i;if(e===void 0)for(e=0,i=0;i<r.length;++i)e+=r[i].length;var n=a.allocUnsafe(e),o=0;for(i=0;i<r.length;++i){var p=r[i];if(!N(p))throw new TypeError('"list" argument must be an Array of Buffers');p.copy(n,o),o+=p.length}return n};function tr(t,r){if(N(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return hr(t).length;default:if(i)return B(t).length;r=(""+r).toLowerCase(),i=!0}}a.byteLength=tr;function re(t,r,e){var i=!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 fe(this,r,e);case"utf8":case"utf-8":return or(this,r,e);case"ascii":return ce(this,r,e);case"latin1":case"binary":return he(this,r,e);case"base64":return pe(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return se(this,r,e);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a.prototype._isBuffer=!0;function v(t,r,e){var i=t[r];t[r]=t[e],t[e]=i}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)v(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)v(this,e,e+3),v(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)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this};a.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?or(this,0,r):re.apply(this,arguments)};a.prototype.equals=function(r){if(!N(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0};a.prototype.compare=function(r,e,i,n,o){if(!N(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),e<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=i)return 0;if(n>=o)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;for(var p=o-n,c=i-e,f=Math.min(p,c),s=this.slice(n,o),m=r.slice(e,i),h=0;h<f;++h)if(s[h]!==m[h]){p=s[h],c=m[h];break}return p<c?-1:c<p?1:0};function ir(t,r,e,i,n){if(t.length===0)return-1;if(typeof e=="string"?(i=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=a.from(r,i)),N(r))return r.length===0?-1:Z(t,r,e,i,n);if(typeof r=="number")return r=r&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Z(t,[r],e,i,n);throw new TypeError("val must be string, number or Buffer")}function Z(t,r,e,i,n){var o=1,p=t.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||r.length<2)return-1;o=2,p/=2,c/=2,e/=2}function f(T,u){return o===1?T[u]:T.readUInt16BE(u*o)}var s;if(n){var m=-1;for(s=e;s<p;s++)if(f(t,s)===f(r,m===-1?0:s-m)){if(m===-1&&(m=s),s-m+1===c)return m*o}else m!==-1&&(s-=s-m),m=-1}else for(e+c>p&&(e=p-c),s=e;s>=0;s--){for(var h=!0,w=0;w<c;w++)if(f(t,s+w)!==f(r,w)){h=!1;break}if(h)return s}return-1}a.prototype.includes=function(r,e,i){return this.indexOf(r,e,i)!==-1};a.prototype.indexOf=function(r,e,i){return ir(this,r,e,i,!0)};a.prototype.lastIndexOf=function(r,e,i){return ir(this,r,e,i,!1)};function ee(t,r,e,i){e=Number(e)||0;var n=t.length-e;i?(i=Number(i),i>n&&(i=n)):i=n;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var p=0;p<i;++p){var c=parseInt(r.substr(p*2,2),16);if(isNaN(c))return p;t[e+p]=c}return p}function te(t,r,e,i){return k(B(r,t.length-e),t,e,i)}function nr(t,r,e,i){return k(_e(r),t,e,i)}function ie(t,r,e,i){return nr(t,r,e,i)}function ne(t,r,e,i){return k(hr(r),t,e,i)}function oe(t,r,e,i){return k(Ae(r,t.length-e),t,e,i)}a.prototype.write=function(r,e,i,n){if(e===void 0)n="utf8",i=this.length,e=0;else if(i===void 0&&typeof e=="string")n=e,i=this.length,e=0;else if(isFinite(e))e=e|0,isFinite(i)?(i=i|0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-e;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<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 ee(this,r,e,i);case"utf8":case"utf-8":return te(this,r,e,i);case"ascii":return nr(this,r,e,i);case"latin1":case"binary":return ie(this,r,e,i);case"base64":return ne(this,r,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,r,e,i);default:if(p)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function pe(t,r,e){return r===0&&e===t.length?Q(t):Q(t.slice(r,e))}function or(t,r,e){e=Math.min(t.length,e);for(var i=[],n=r;n<e;){var o=t[n],p=null,c=o>239?4:o>223?3:o>191?2:1;if(n+c<=e){var f,s,m,h;switch(c){case 1:o<128&&(p=o);break;case 2:f=t[n+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(p=h));break;case 3:f=t[n+1],s=t[n+2],(f&192)===128&&(s&192)===128&&(h=(o&15)<<12|(f&63)<<6|s&63,h>2047&&(h<55296||h>57343)&&(p=h));break;case 4:f=t[n+1],s=t[n+2],m=t[n+3],(f&192)===128&&(s&192)===128&&(m&192)===128&&(h=(o&15)<<18|(f&63)<<12|(s&63)<<6|m&63,h>65535&&h<1114112&&(p=h))}}p===null?(p=65533,c=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|p&1023),i.push(p),n+=c}return ae(i)}var $=4096;function ae(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",i=0;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=$));return e}function ce(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]&127);return i}function he(t,r,e){var i="";e=Math.min(t.length,e);for(var n=r;n<e;++n)i+=String.fromCharCode(t[n]);return i}function fe(t,r,e){var i=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>i)&&(e=i);for(var n="",o=r;o<e;++o)n+=me(t[o]);return n}function se(t,r,e){for(var i=t.slice(r,e),n="",o=0;o<i.length;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a.prototype.slice=function(r,e){var i=this.length;r=~~r,e=e===void 0?i:~~e,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),e<r&&(e=r);var n;if(a.TYPED_ARRAY_SUPPORT)n=this.subarray(r,e),n.__proto__=a.prototype;else{var o=e-r;n=new a(o,void 0);for(var p=0;p<o;++p)n[p]=this[p+r]}return n};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")}a.prototype.readUIntLE=function(r,e,i){r=r|0,e=e|0,i||A(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return n};a.prototype.readUIntBE=function(r,e,i){r=r|0,e=e|0,i||A(r,e,this.length);for(var n=this[r+--e],o=1;e>0&&(o*=256);)n+=this[r+--e]*o;return n};a.prototype.readUInt8=function(r,e){return e||A(r,1,this.length),this[r]};a.prototype.readUInt16LE=function(r,e){return e||A(r,2,this.length),this[r]|this[r+1]<<8};a.prototype.readUInt16BE=function(r,e){return e||A(r,2,this.length),this[r]<<8|this[r+1]};a.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};a.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])};a.prototype.readIntLE=function(r,e,i){r=r|0,e=e|0,i||A(r,e,this.length);for(var n=this[r],o=1,p=0;++p<e&&(o*=256);)n+=this[r+p]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n};a.prototype.readIntBE=function(r,e,i){r=r|0,e=e|0,i||A(r,e,this.length);for(var n=e,o=1,p=this[r+--n];n>0&&(o*=256);)p+=this[r+--n]*o;return o*=128,p>=o&&(p-=Math.pow(2,8*e)),p};a.prototype.readInt8=function(r,e){return e||A(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};a.prototype.readInt16LE=function(r,e){e||A(r,2,this.length);var i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};a.prototype.readInt16BE=function(r,e){e||A(r,2,this.length);var i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};a.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};a.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]};a.prototype.readFloatLE=function(r,e){return e||A(r,4,this.length),G(this,r,!0,23,4)};a.prototype.readFloatBE=function(r,e){return e||A(r,4,this.length),G(this,r,!1,23,4)};a.prototype.readDoubleLE=function(r,e){return e||A(r,8,this.length),G(this,r,!0,52,8)};a.prototype.readDoubleBE=function(r,e){return e||A(r,8,this.length),G(this,r,!1,52,8)};function x(t,r,e,i,n,o){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(e+i>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;x(this,r,e,i,o,0)}var p=1,c=0;for(this[e]=r&255;++c<i&&(p*=256);)this[e+c]=r/p&255;return e+i};a.prototype.writeUIntBE=function(r,e,i,n){if(r=+r,e=e|0,i=i|0,!n){var o=Math.pow(2,8*i)-1;x(this,r,e,i,o,0)}var p=i-1,c=1;for(this[e+p]=r&255;--p>=0&&(c*=256);)this[e+p]=r/c&255;return e+i};a.prototype.writeUInt8=function(r,e,i){return r=+r,e=e|0,i||x(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,i){r<0&&(r=65535+r+1);for(var n=0,o=Math.min(t.length-e,2);n<o;++n)t[e+n]=(r&255<<8*(i?n:1-n))>>>(i?n:1-n)*8}a.prototype.writeUInt16LE=function(r,e,i){return r=+r,e=e|0,i||x(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,i){return r=+r,e=e|0,i||x(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 Y(t,r,e,i){r<0&&(r=4294967295+r+1);for(var n=0,o=Math.min(t.length-e,4);n<o;++n)t[e+n]=r>>>(i?n:3-n)*8&255}a.prototype.writeUInt32LE=function(r,e,i){return r=+r,e=e|0,i||x(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):Y(this,r,e,!0),e+4};a.prototype.writeUInt32BE=function(r,e,i){return r=+r,e=e|0,i||x(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):Y(this,r,e,!1),e+4};a.prototype.writeIntLE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);x(this,r,e,i,o-1,-o)}var p=0,c=1,f=0;for(this[e]=r&255;++p<i&&(c*=256);)r<0&&f===0&&this[e+p-1]!==0&&(f=1),this[e+p]=(r/c>>0)-f&255;return e+i};a.prototype.writeIntBE=function(r,e,i,n){if(r=+r,e=e|0,!n){var o=Math.pow(2,8*i-1);x(this,r,e,i,o-1,-o)}var p=i-1,c=1,f=0;for(this[e+p]=r&255;--p>=0&&(c*=256);)r<0&&f===0&&this[e+p+1]!==0&&(f=1),this[e+p]=(r/c>>0)-f&255;return e+i};a.prototype.writeInt8=function(r,e,i){return r=+r,e=e|0,i||x(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,i){return r=+r,e=e|0,i||x(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,i){return r=+r,e=e|0,i||x(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,i){return r=+r,e=e|0,i||x(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):Y(this,r,e,!0),e+4};a.prototype.writeInt32BE=function(r,e,i){return r=+r,e=e|0,i||x(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):Y(this,r,e,!1),e+4};function pr(t,r,e,i,n,o){if(e+i>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,i,n){return n||pr(t,r,e,4,34028234663852886e22,-34028234663852886e22),sr(t,r,e,i,23,4),e+4}a.prototype.writeFloatLE=function(r,e,i){return ar(this,r,e,!0,i)};a.prototype.writeFloatBE=function(r,e,i){return ar(this,r,e,!1,i)};function cr(t,r,e,i,n){return n||pr(t,r,e,8,17976931348623157e292,-17976931348623157e292),sr(t,r,e,i,52,8),e+8}a.prototype.writeDoubleLE=function(r,e,i){return cr(this,r,e,!0,i)};a.prototype.writeDoubleBE=function(r,e,i){return cr(this,r,e,!1,i)};a.prototype.copy=function(r,e,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=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-i&&(n=r.length-e+i);var o=n-i,p;if(this===r&&i<e&&e<n)for(p=o-1;p>=0;--p)r[p+e]=this[p+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(p=0;p<o;++p)r[p+e]=this[p+i];else Uint8Array.prototype.set.call(r,this.subarray(i,i+o),e);return o};a.prototype.fill=function(r,e,i,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),r.length===1){var o=r.charCodeAt(0);o<256&&(r=o)}if(n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else typeof r=="number"&&(r=r&255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;e=e>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);var p;if(typeof r=="number")for(p=e;p<i;++p)this[p]=r;else{var c=N(r)?r:B(new a(r,n).toString()),f=c.length;for(p=0;p<i-e;++p)this[p+e]=c[p%f]}return this};var ue=/[^+\/0-9A-Za-z-_]/g;function le(t){if(t=Ee(t).replace(ue,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ee(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function me(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,r){r=r||1/0;for(var e,i=t.length,n=null,o=[],p=0;p<i;++p){if(e=t.charCodeAt(p),e>55295&&e<57344){if(!n){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(p+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),n=e;continue}e=(n-55296<<10|e-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=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 _e(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Ae(t,r){for(var e,i,n,o=[],p=0;p<t.length&&!((r-=2)<0);++p)e=t.charCodeAt(p),i=e>>8,n=e%256,o.push(n),o.push(i);return o}function hr(t){return Jr(le(t))}function k(t,r,e,i){for(var n=0;n<i&&!(n+e>=r.length||n>=t.length);++n)r[n+e]=t[n];return n}function xe(t){return t!==t}function Te(t){return t!=null&&(!!t._isBuffer||fr(t)||Ie(t))}function fr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Ie(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&fr(t.slice(0,0))}function G(t,r,e,i,n){var o,p,c=n*8-i-1,f=(1<<c)-1,s=f>>1,m=-7,h=e?n-1:0,w=e?-1:1,T=t[r+h];for(h+=w,o=T&(1<<-m)-1,T>>=-m,m+=c;m>0;o=o*256+t[r+h],h+=w,m-=8);for(p=o&(1<<-m)-1,o>>=-m,m+=i;m>0;p=p*256+t[r+h],h+=w,m-=8);if(o===0)o=1-s;else{if(o===f)return p?NaN:(T?-1:1)*(1/0);p=p+Math.pow(2,i),o=o-s}return(T?-1:1)*p*Math.pow(2,o-i)}function sr(t,r,e,i,n,o){var p,c,f,s=o*8-n-1,m=(1<<s)-1,h=m>>1,w=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=i?0:o-1,u=i?1:-1,_=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,p=m):(p=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-p))<1&&(p--,f*=2),p+h>=1?r+=w/f:r+=w*Math.pow(2,1-h),r*f>=2&&(p++,f/=2),p+h>=m?(c=0,p=m):p+h>=1?(c=(r*f-1)*Math.pow(2,n),p=p+h):(c=r*Math.pow(2,h-1)*Math.pow(2,n),p=0));n>=8;t[e+T]=c&255,T+=u,c/=256,n-=8);for(p=p<<n|c,s+=n;s>0;t[e+T]=p&255,T+=u,p/=256,s-=8);t[e+T-u]|=_*128}var we=(u=>(u[u.Solana=1]="Solana",u[u.Algorand=8]="Algorand",u[u.Polygon=5]="Polygon",u[u.Bsc=4]="Bsc",u[u.Avalanche=6]="Avalanche",u[u.Arbitrum=23]="Arbitrum",u[u.Optimism=24]="Optimism",u[u.Base=30]="Base",u[u.Ethereum=2]="Ethereum",u[u.Sepolia=10002]="Sepolia",u[u.ArbitrumSepolia=10003]="ArbitrumSepolia",u[u.BaseSepolia=10004]="BaseSepolia",u[u.OptimismSepolia=10005]="OptimismSepolia",u[u.PolygonAmoy=10007]="PolygonAmoy",u))(we||{}),Et={1:"Solana",2:"Ethereum",5:"Polygon",4:"BNB Chain",6:"Avalanche",8:"Algorand",23:"Arbitrum",24:"Optimism",30:"Base",10002:"Ethereum Sepolia",10003:"Arbitrum Sepolia",10004:"Base Sepolia",10005:"Optimism Sepolia",10007:"Polygon Amoy"},mt={4:["","https://bsc-testnet.public.blastapi.io","https://bsc-testnet.blockpi.network/v1/rpc/private","https://bsc-testnet-rpc.publicnode.com","https://api.zan.top/bsc-testnet","https://data-seed-prebsc-2-s1.bnbchain.org:8545","https://data-seed-prebsc-2-s2.bnbchain.org:8545","https://data-seed-prebsc-2-s3.bnbchain.org:8545","https://data-seed-prebsc-1-s1.bnbchain.org:8545","https://data-seed-prebsc-1-s2.bnbchain.org:8545","https://data-seed-prebsc-1-s3.bnbchain.org:8545","https://endpoints.omniatech.io/v1/bsc/testnet/public"],6:["","https://rpc.ankr.com/avalanche_fuji","https://rpc.ankr.com/avalanche_fuji-c","https://api.avax-test.network/ext/bc/C/rpc","https://ava-testnet.public.blastapi.io/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/fuji/public","https://avalanche-fuji.blockpi.network/v1/rpc/private","https://avalanche-fuji-c-chain-rpc.publicnode.com","https://avalanche-fuji.blockpi.network/v1/rpc/private"],10002:["https://ethereum-sepolia-rpc.publicnode.com","https://sepolia.gateway.tenderly.co","https://eth-sepolia.public.blastapi.io","https://ethereum-sepolia.blockpi.network/v1/rpc/private","https://sepolia.drpc.org","https://endpoints.omniatech.io/v1/eth/sepolia/public","https://1rpc.io/sepolia","https://gateway.tenderly.co/public/sepolia","https://sepolia.gateway.tenderly.co","https://api.zan.top/eth-sepolia","https://ethereum-sepolia.rpc.subquery.network/public"],10003:["","https://arbitrum-sepolia.blockpi.network/v1/rpc/private ","https://arbitrum-sepolia.gateway.tenderly.co","https://endpoints.omniatech.io/v1/arbitrum/sepolia/public","https://api.zan.top/arb-sepolia","https://sepolia-rollup.arbitrum.io/rpc"],10004:["","https://sepolia.base.org","https://base-sepolia-rpc.publicnode.com","https://base-sepolia.gateway.tenderly.co","https://base-sepolia.blockpi.network/v1/rpc/private","https://node.histori.xyz/base-sepolia/8ry9f6t9dct1se2hlagxnd9n2a"],10005:["","https://optimism-sepolia.blockpi.network/v1/rpc/private","https://sepolia.optimism.io","https://api.zan.top/opt-sepolia","https://optimism-sepolia.gateway.tenderly.co","https://optimism-sepolia.drpc.org","https://endpoints.omniatech.io/v1/op/sepolia/public"],10007:["https://rpc-amoy.polygon.technology","https://polygon-amoy-bor-rpc.publicnode.com","https://rpc.ankr.com/polygon_amoy","https://polygon-amoy.drpc.org","https://api.zan.top/polygon-amoy","https://polygon-amoy.gateway.tenderly.co"]},_t={2:["","https://eth.llamarpc.com","https://ethereum.blockpi.network/v1/rpc/public","https://eth-mainnet.nodereal.io/v1/1659dfb40aa24bbb8153a677b98064d7","https://uk.rpc.blxrbdn.com","https://singapore.rpc.blxrbdn.com","https://virginia.rpc.blxrbdn.com","https://eth-mainnet.public.blastapi.io","https://api.securerpc.com/v1","https://mainnet.gateway.tenderly.co","https://eth-pokt.nodies.app","https://eth.blockrazor.xyz","https://eth.merkle.io","https://gateway.tenderly.co/public/mainnet","https://eth.rpc.blxrbdn.com"],4:["","https://bsc.blockrazor.xyz","https://bscrpc.com","https://bsc-mainnet.public.blastapi.io","https://binance.llamarpc.com","https://go.getblock.io/cc778cdbdf5c4b028ec9456e0e6c0cf3","https://bsc-pokt.nodies.app","https://56.rpc.thirdweb.com","https://bsc.blockpi.network/v1/rpc/private","https://bsc.rpc.blxrbdn.com","https://bsc-dataseed.bnbchain.org","https://endpoints.omniatech.io/v1/bsc/mainnet/public","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed2.ninicoin.io","https://0.48.club","https://bsc-dataseed3.defibit.io"],5:["","https://polygon.llamarpc.com","https://polygon-rpc.com","https://rpc-mainnet.matic.quiknode.pro","https://endpoints.omniatech.io/v1/matic/mainnet/public","https://polygon-pokt.nodies.app","https://polygon-bor-rpc.publicnode.com","https://polygon.rpc.subquery.network/public","https://polygon-bor-rpc.publicnode.com","https://polygon.blockpi.network/v1/rpc/private","https://polygon.api.onfinality.io/public","https://polygon.lava.build","https://api.zan.top/polygon-mainnet","https://polygon.meowrpc.com"],6:["","https://avalanche-c-chain-rpc.publicnode.com","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://avalanche-c-chain-rpc.publicnode.com","https://avalanche.blockpi.network/v1/rpc/private","https://avalanche.public-rpc.com","https://avalanche.drpc.org","https://avax.meowrpc.com","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://api.avax.network/ext/bc/C/rpc","https://1rpc.io/avax/c","https://avax-pokt.nodies.app/ext/bc/C/rpc","https://endpoints.omniatech.io/v1/avax/mainnet/public","https://api.zan.top/avax-mainnet/ext/bc/C/rpc"],23:["","https://arbitrum.llamarpc.com","https://arbitrum.rpc.subquery.network/public","https://endpoints.omniatech.io/v1/arbitrum/one/public","https://arbitrum.meowrpc.com","https://arbitrum.gateway.tenderly.co","https://arbitrum-one.public.blastapi.io","https://arb1.lava.build","https://arbitrum-one.publicnode.com","https://arbitrum.blockpi.network/v1/rpc/public","https://arb-pokt.nodies.app","https://api.zan.top/arb-one","https://arb1.arbitrum.io/rpc","https://arbitrum.drpc.org","https://1rpc.io/arb"],24:["","https://optimism.llamarpc.com","https://op-pokt.nodies.app","https://optimism-mainnet.public.blastapi.io","https://optimism.blockpi.network/v1/rpc/public","https://endpoints.omniatech.io/v1/op/mainnet/public","https://optimism-rpc.publicnode.com","https://optimism.drpc.org","https://1rpc.io/op","https://optimism.gateway.tenderly.co","https://optimism.lava.build","https://optimism.rpc.subquery.network/public","https://mainnet.optimism.io","https://optimism-rpc.publicnode.com","https://gateway.tenderly.co/public/optimism"],30:["","https://base.llamarpc.com","https://base-mainnet.public.blastapi.io","https://base-rpc.publicnode.com","https://base.blockpi.network/v1/rpc/public","https://base.drpc.org","https://mainnet.base.org","https://base.api.onfinality.io/public","https://base-pokt.nodies.app","https://1rpc.io/base","https://developer-access-mainnet.base.org","https://endpoints.omniatech.io/v1/base/mainnet/public","https://base.rpc.subquery.network/public","https://base.api.onfinality.io/public","https://base.meowrpc.com","https://base.gateway.tenderly.co"]};var Re=(n=>(n[n.Off=0]="Off",n[n.Full=1]="Full",n[n.Partial=2]="Partial",n[n.Scheduled=3]="Scheduled",n))(Re||{});var Ne=(o=>(o[o.SELF_TRADE=1]="SELF_TRADE",o[o.FULL_FILLED=2]="FULL_FILLED",o[o.FULL_CANCELLED=3]="FULL_CANCELLED",o[o.PARTIALLY_CANCELLED=4]="PARTIALLY_CANCELLED",o[o.CREATED=5]="CREATED",o))(Ne||{});var Ce=(f=>(f.USERS_READ="users.read",f.FOLLOWS_READ="follows.read",f.FOLLOWS_WRITE="follows.write",f.TWEET_READ="tweet.read",f.TWEET_WRITE="tweet.write",f.OFFLINE_ACCESS="offline.access",f.LIKE_READ="like.read",f.LIKE_WRITE="like.write",f))(Ce||{});var ur=(s=>(s.MFT_AUDIO_LINK="mft.audioLink",s.MFT_TITLE="mft.title",s.MODE_PRE_SALE="mode.preSale",s.MAKER_FEE="makerFee",s.TAKER_FEE="takerFee",s.VIEW_BASE_COIN_ICON_LINK="view.baseCoinIconLink",s.VIEW_BASE_COIN_MARKET_LINK="view.baseCoinMarketLink",s.VIEW_PRICE_COIN_ICON_LINK="view.priceCoinIconLink",s.VIEW_PRICE_COIN_MARKET_LINK="view.priceCoinMarketLink",s))(ur||{}),De=ur;var lr=(e=>(e[e.Buy=0]="Buy",e[e.Sell=1]="Sell",e))(lr||{}),be=lr;var Er=(o=>(o[o.Open=1]="Open",o[o.Canceled=2]="Canceled",o[o.Matched=3]="Matched",o[o.SelfMatched=4]="SelfMatched",o[o.Expired=5]="Expired",o))(Er||{}),Oe=Er;var mr=(n=>(n[n.Limit=0]="Limit",n[n.IOC=1]="IOC",n[n.POST=2]="POST",n[n.Market=3]="Market",n))(mr||{}),Le=mr;var _r=(e=>(e.User="User",e.Api="API",e))(_r||{});var de=(n=>(n.COMPANY="COMPANY",n.TWITTER="TWITTER",n.DISCORD="DISCORD",n.TELEGRAM="TELEGRAM",n))(de||{}),ve=(h=>(h[h.TWITTER_FOLLOW=1]="TWITTER_FOLLOW",h[h.TWITTER_REPLY=2]="TWITTER_REPLY",h[h.TWITTER_RETWEET=3]="TWITTER_RETWEET",h[h.TWITTER_LIKE=4]="TWITTER_LIKE",h[h.COMPANY_FIRST_LOGIN=5]="COMPANY_FIRST_LOGIN",h[h.COMPANY_CONFIRM_EMAIL=6]="COMPANY_CONFIRM_EMAIL",h[h.COMPANY_DEPOSIT=7]="COMPANY_DEPOSIT",h[h.COMPANY_TRADE=8]="COMPANY_TRADE",h[h.TELEGRAM_JOIN_GROUP=9]="TELEGRAM_JOIN_GROUP",h[h.DISCORD_JOIN_SERVER=10]="DISCORD_JOIN_SERVER",h[h.AFFILIATE_POINTS_REWARD=11]="AFFILIATE_POINTS_REWARD",h))(ve||{}),Vt=[1,9,10,6,5];var ye=(n=>(n.CREATED="created",n.STARTED="started",n.PAUSED="paused",n.CLOSED="closed",n))(ye||{}),ge=(e=>(e.Post="POST",e.Comment="COMMENT",e))(ge||{});var Ue=(p=>(p.INSTRUCTIONS="INSTRUCTIONS",p.TEXT_STYLE="TEXT_STYLE",p.TEXT_TONE="TEXT_TONE",p.REACTION_TYPE="REACTION_TYPE",p.COMMENT_LENGTH="COMMENT_LENGTH",p.CONTEXT="CONTEXT",p))(Ue||{});var Pe=(p=>(p[p.FEE_TIER_1=1]="FEE_TIER_1",p[p.FEE_TIER_2=2]="FEE_TIER_2",p[p.FEE_TIER_3=3]="FEE_TIER_3",p[p.FEE_TIER_4=4]="FEE_TIER_4",p[p.FEE_TIER_5=5]="FEE_TIER_5",p[p.FEE_TIER_6=6]="FEE_TIER_6",p))(Pe||{}),Be=(e=>(e[e.Approve=1]="Approve",e[e.Reject=0]="Reject",e))(Be||{}),Fe=(o=>(o.INITIATED="INITIATED",o.CREATED="CREATED",o.PROCESSING="PROCESSING",o.APPROVED="APPROVED",o.REJECTED="REJECTED",o))(Fe||{});var Ye=(o=>(o.INVITED_ACCOUNTS_COUNT="invitedAccountsCount",o.CREATED_AT="createdAt",o.FEE_SHARE="feeShare",o.ADDRESS="address",o.REFERRAL_TRADING_VOLUME="referralTradingVolume",o))(Ye||{});var ke=(p=>(p.ACTIVE="ACTIVE",p.FAILED="FAILED",p.STARTING="STARTING",p.DRAINING="DRAINING",p.TERMINATING="TERMINATING",p.TERMINATED="TERMINATED",p))(ke||{}),Ge=(o=>(o.MATCHING_ENGINE="me",o.ORDER_SERVICE="ors",o.API="api",o.SOCKET_SERVICE="ws",o.TRANSACTION_SERVICE="tns",o))(Ge||{}),Me=(o=>(o.ACTIVE="ACTIVE",o.FAILED="FAILED",o.UNASSIGNED="UNASSIGNED",o.ASSIGNED="ASSIGNED",o.STARTING="STARTING",o))(Me||{});var We=(n=>(n.Pending="pending",n.Completed="completed",n.Failed="failed",n.Received="received",n))(We||{}),He=(n=>(n.Deposit="deposit",n.FastDeposit="fast_deposit",n.Withdraw="withdraw",n.Rebalance="rebalance",n))(He||{}),Se=(i=>(i.PENDING="pending",i.COMPLETED="completed",i.FAILED="failed",i))(Se||{}),Ve=(o=>(o.USER_TO_TMC="user_to_tmc",o.TMC_TO_USER="tmc_to_user",o.RELAYER_TO_TMC="relayer_to_tmc",o.RELAYER_TO_CODEX="relayer_to_codex",o.RELAYER_TO_CIRCLE="relayer_to_circle",o))(Ve||{});var Ke=(i=>(i.Unconfirmed="UNCONFIRMED",i.Confirmed="CONFIRMED",i.Rejected="REJECTED",i))(Ke||{}),ze=(i=>(i.RESUBMITTED="RESUBMITTED",i.PROCESSED="PROCESSED",i.REMATCHED="REMATCHED",i))(ze||{});var Je=(n=>(n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.THIRD=3]="THIRD",n[n.FOURTH=4]="FOURTH",n))(Je||{}),Xe=(c=>(c.REBATE_TIER="rebateTier",c.CREATED_AT="createdAt",c.NAME="name",c.TAKER_FEE="takerFee",c.ENABLED="enabled",c.ADDRESS="address",c.CHAIN="chainId",c))(Xe||{});var qe=(e=>(e.ASCENDING="ASC",e.DESCENDING="DESC",e))(qe||{});var Ar=(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))(Ar||{}),xr=(i=>(i.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",i.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",i.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",i))(xr||{}),wi={...Ar,...xr},Qe=(i=>(i.CRITICAL="CRITICAL",i.IMPORTANT="IMPORTANT",i.INFO="INFO",i))(Qe||{}),Ze=(e=>(e.UNREAD="UNREAD",e.READ="READ",e))(Ze||{}),$e=(i=>(i.PENDING="PENDING",i.PROCESSED="PROCESSED",i.FAILED="FAILED",i))($e||{});var je=(p=>(p.STRING="string",p.BOOLEAN="boolean",p.INT="int",p.FLOAT="float",p.SINGLE_CHOICE="single-choice",p.MULTI_CHOICE="multi-choice",p))(je||{});var rt=(c=>(c.VERSION="version",c.LAST_ALGO_BLOCK="last_algo_block",c.PRICES_PROVIDER_API_KEY="prices_provider_api_key",c.DEFAULT_API_DOMAIN="default_api_domain",c.NONCE_ACCOUNTS_SOLANA="nonce_accounts_solana",c.ARCHIVE_DATA_BATCH_SIZE="archive_data_batch_size",c.ARCHIVE_TASK_LOCK="archive_task_lock",c))(rt||{});var et=(i=>(i.SUCCESS="success",i.FAILED="failed",i.PENDING="pending",i))(et||{});var tt=(i=>(i.SOLANA="SOLANA",i.ALGORAND="ALGORAND",i.EVM="EVM",i))(tt||{});var it=(n=>(n.TIMESTAMP="timestamp",n.TYPE="action_type",n.CHAIN="login_chain_id",n.STATUS="status",n))(it||{});var nt=(o=>(o.CONNECTED="CONNECTED",o.CONNECTING="CONNECTING",o.DISCONNECTED="DISCONNECTED",o.DISCONNECTING="DISCONNECTING",o.PENDING="PENDING",o))(nt||{});var ot=(e=>(e.NAME="name",e.POINTS="points",e))(ot||{});var pt=(l=>(l.ENABLED="company.enabled",l.APP_TITLE="company.appTitle",l.DOMAIN="company.domain",l.DIRECT_SETTLE="company.directSettlement",l.KYC="markets.kycTradeRequirementEnabled",l.GEOBLOCK="company.geoblock",l.LOGO="appearance.logo",l.THEMES="appearance.themes",l.NEW_TAB="appearance.newTab",l.TARGET="appearance.target",l.REPORT_BUTTONS="appearance.reportButtons",l.CUSTOM_MENU_ITEMS="appearance.customMenuItems",l.APPEARANCE_CHART_TYPE="appearance.chartType",l.APPEARANCE_CHART_INT="appearance.chartInt",l.AMM="product.amm",l.OBDEX="product.obdex",l.POINTS="product.pointSystem",l.AFFILIATE_DASHBOARD_THRESHOLD="product.affiliateDashboardThreshold",l.AFFILIATE_DEFAULT_FEE_SHARE="product.affiliateDefaultFeeShare",l.AFFILIATE_DASHBOARD_VISIBILITY="product.affiliateDashboardVisibility",l.AMM_FEE="company.ammFee",l.FEE_SHARE="company.feeShare",l.MIN_FEE="company.minFee",l.MAKER_FEE="company.makerFee",l.TAKER_FEE="company.takerFee",l.PINNED_PAIRS="markets.pinnedPairs",l.TWITTER_ENABLED="point-system.twitterEnabled",l.TWITTER_JOB_ENABLED="point-system.twitterJobEnabled",l.TWITTER_HASHTAGS="point-system.twitterHashtags",l.TWITTER_ACCOUNT_NAME="point-system.twitterAccountName",l.DISCORD_ENABLED="point-system.discordEnabled",l.TELEGRAM_ENABLED="point-system.telegramEnabled",l.TELEGRAM_GROUP_NAME="point-system.telegramGroupName",l.TELEGRAM_BOT_NAME="point-system.telegramBotName",l.GUIDE_LINK="point-system.guideLink",l))(pt||{});var at=(_=>(_[_.QUOTE=1]="QUOTE",_[_.LAST_PRICE=2]="LAST_PRICE",_[_.DEPTH=3]="DEPTH",_[_.LAST_CANDLESTICK=4]="LAST_CANDLESTICK",_[_.ORDERS=5]="ORDERS",_[_.TRADES=6]="TRADES",_[_.SYSTEM=7]="SYSTEM",_[_.WALLET_TRANSACTIONS=8]="WALLET_TRANSACTIONS",_[_.ALL_STAT=9]="ALL_STAT",_[_.CODEX_ASSETS=12]="CODEX_ASSETS",_[_.CODEX_BALANCES=10]="CODEX_BALANCES",_[_.LAST_LOOK=11]="LAST_LOOK",_[_.SETTINGS_UPDATE=13]="SETTINGS_UPDATE",_[_.NEW_NOTIFICATION=14]="NEW_NOTIFICATION",_[_.POINT_SYSTEM_SETTINGS_UPDATE=15]="POINT_SYSTEM_SETTINGS_UPDATE",_))(at||{}),In=[5,8,10,11];export{xr as AccountNotificationEnum,ve as ActionEnum,de as ActionSource,He as ActionTypeEnum,Ye as AffiliateSortByEnum,De as AvailablePairSettings,Se as CCTPStatus,Et as ChainNames,we as Chains,wi as CombinedNotificationEnum,ke as ComponentStatusType,Ge as ComponentType,Pe as FeeTier,Ar as GlobalNotificationEnum,_t as HTTPSRPC_MAINNET,mt as HTTPSRPC_TESTNET,Fe as KYCAuthenticationStatus,Be as LastLookAction,Re as MaintenanceMode,Je as MarketMakerRebateTier,Xe as MarketMakerSortByEnum,Vt as NON_REPEATABLE_ACTIONS,Ne as Notification,Qe as NotificationPriorityEnum,Ze as NotificationStatusEnum,We as OperationStatusEnum,be as OrderSide,Oe as OrderStatus,Le as OrderType,In as PRIVATE_STREAMS,Me as PairComponentStatusType,it as PendingActionsSortByEnum,ot as PointsSortByEnum,Ue as PromptTypeEnum,nt as RabbitConnectionStatus,at as STREAMS,$e as ScheduledNotificationStatusEnum,ye as SeasonStatusEnum,pt as SettingIds,je as SettingTypeColumn,qe as SortDirectionEnum,rt as StateType,Ke as TradeStatus,ze as TradeSubStatus,_r as TradingKeyType,Ve as TransactionType,ge as TweetType,Ce as TwitterAccessScopeEnum,et as UpgradeStatus,tt as WithdrawalWalletType};
2
2
  /*! Bundled license information:
3
3
 
4
4
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -1,4 +1,4 @@
1
- function fr(){throw new Error("setTimeout has not been defined")}function lr(){throw new Error("clearTimeout has not been defined")}var v=fr,N=lr;typeof globalThis.setTimeout=="function"&&(v=setTimeout);typeof globalThis.clearTimeout=="function"&&(N=clearTimeout);function pr(t){if(v===setTimeout)return setTimeout(t,0);if((v===fr||!v)&&setTimeout)return v=setTimeout,setTimeout(t,0);try{return v(t,0)}catch{try{return v.call(null,t,0)}catch{return v.call(this,t,0)}}}function jr(t){if(N===clearTimeout)return clearTimeout(t);if((N===lr||!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 k=[],O=!1,P,L=-1;function re(){!O||!P||(O=!1,P.length?k=P.concat(k):L=-1,k.length&&hr())}function hr(){if(!O){var t=pr(re);O=!0;for(var r=k.length;r;){for(P=k,k=[];++L<r;)P&&P[L].run();L=-1,r=k.length}P=null,O=!1,jr(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];k.push(new gr(t,r)),k.length===1&&!O&&pr(hr)}function gr(t,r){this.fun=t,this.array=r}gr.prototype.run=function(){this.fun.apply(null,this.array)};var te="browser",ne="browser",ie=!0,oe={},ae=[],ue="",se={},ce={},fe={};function D(){}var le=D,pe=D,he=D,ge=D,me=D,xe=D,de=D;function be(t){throw new Error("process.binding is not supported")}function Ee(){return"/"}function we(t){throw new Error("process.chdir is not supported")}function ye(){return 0}var F=globalThis.performance||{},Te=F.now||F.mozNow||F.msNow||F.oNow||F.webkitNow||function(){return new Date().getTime()};function _e(t){var r=Te.call(F)*.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 Ae=new Date;function Ie(){var t=new Date,r=t-Ae;return r/1e3}var x={nextTick:ee,title:te,browser:ie,env:oe,argv:ae,version:ue,versions:se,on:le,addListener:pe,once:he,off:ge,removeListener:me,removeAllListeners:xe,emit:de,binding:be,cwd:Ee,chdir:we,umask:ye,hrtime:_e,platform:ne,release:ce,config:fe,uptime:Ie},cr={};Object.keys(cr).forEach(t=>{let r=t.split("."),e=x;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=cr[t]:e=e[i]||(e[i]={})}});var A=[],T=[],Re=typeof Uint8Array<"u"?Uint8Array:Array,er=!1;function br(){er=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],T[t.charCodeAt(r)]=r;T[45]=62,T[95]=63}function Se(t){er||br();var r,e,n,i,o,a,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,a=new Re(s*3/4-o),n=o>0?s-4:s;var f=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[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=T[t.charCodeAt(r)]<<2|T[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=T[t.charCodeAt(r)]<<10|T[t.charCodeAt(r+1)]<<4|T[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function ke(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Be(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(ke(n));return i.join("")}function mr(t){er||br();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(Be(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=A[r>>2],i+=A[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=A[r>>10],i+=A[r>>4&63],i+=A[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 Y(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if(Y()<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 tr(this,t)}return Er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Er(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?Ne(t,r,e,n):typeof r=="string"?ve(t,r,e):Pe(t,r)}u.from=function(t,r,e){return Er(null,t,r,e)};u.kMaxLength=Y();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function wr(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 Ue(t,r,e,n){return wr(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)}u.alloc=function(t,r,e){return Ue(null,t,r,e)};function tr(t,r){if(wr(r),t=B(t,r<0?0:nr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return tr(null,t)};u.allocUnsafeSlow=function(t){return tr(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=yr(r,e)|0;t=B(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function rr(t,r){var e=r.length<0?0:nr(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Ne(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=rr(t,r),t}function Pe(t,r){if(I(r)){var e=nr(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"||Ze(r.length)?B(t,0):rr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return rr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function nr(t){if(t>=Y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y().toString(16)+" bytes");return t|0}u.isBuffer=je;function I(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!I(r)||!I(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(!I(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function yr(t,r){if(I(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 W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return kr(t).length;default:if(n)return W(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=yr;function De(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 Ve(this,r,e);case"utf8":case"utf-8":return Ar(this,r,e);case"ascii":return Ge(this,r,e);case"latin1":case"binary":return He(this,r,e);case"base64":return Ye(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function C(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)C(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)C(this,e,e+3),C(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)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};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Ar(this,0,r):De.apply(this,arguments)};u.prototype.equals=function(r){if(!I(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(!I(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,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<a?1:0};function Tr(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)),I(r))return r.length===0?-1:xr(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):xr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function xr(t,r,e,n,i){var o=1,a=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,a/=2,s/=2,e/=2}function f(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,m=0;m<s;m++)if(f(t,p+m)!==f(r,m)){l=!1;break}if(l)return p}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Tr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Tr(this,r,e,n,!1)};function Ce(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 s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function Me(t,r,e,n){return V(W(r,t.length-e),t,e,n)}function _r(t,r,e,n){return V(Xe(r),t,e,n)}function Fe(t,r,e,n){return _r(t,r,e,n)}function Oe(t,r,e,n){return V(kr(r),t,e,n)}function Le(t,r,e,n){return V(Qe(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 Ce(this,r,e,n);case"utf8":case"utf-8":return Me(this,r,e,n);case"ascii":return _r(this,r,e,n);case"latin1":case"binary":return Fe(this,r,e,n);case"base64":return Oe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(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 Ye(t,r,e){return r===0&&e===t.length?mr(t):mr(t.slice(r,e))}function Ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return We(n)}var dr=4096;function We(t){var r=t.length;if(r<=dr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=dr));return e}function Ge(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 He(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 Ve(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+=Je(t[o]);return i}function Ke(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 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")}u.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};u.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};u.prototype.readUInt8=function(r,e){return e||d(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||d(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||d(r,2,this.length),this[r]<<8|this[r+1]};u.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};u.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])};u.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};u.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};u.prototype.readInt8=function(r,e){return e||d(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.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};u.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};u.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};u.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]};u.prototype.readFloatLE=function(r,e){return e||d(r,4,this.length),K(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||d(r,4,this.length),K(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||d(r,8,this.length),K(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||d(r,8,this.length),K(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!I(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;E(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=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;E(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function G(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||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};function H(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||E(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):H(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(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):H(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);E(this,r,e,n,o-1,-o)}var a=0,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&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);E(this,r,e,n,o-1,-o)}var a=n-1,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(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||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(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):H(this,r,e,!0),e+4};u.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),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):H(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 Rr(t,r,e,n,i){return i||Ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),Ur(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Rr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Rr(this,r,e,!1,n)};function Sr(t,r,e,n,i){return i||Ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),Ur(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return Sr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return Sr(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 s=I(r)?r:W(new u(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var $e=/[^+\/0-9A-Za-z-_]/g;function ze(t){if(t=qe(t).replace($e,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function qe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Je(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(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 Xe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Qe(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 kr(t){return Se(ze(t))}function V(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 Ze(t){return t!==t}function je(t){return t!=null&&(!!t._isBuffer||Br(t)||rt(t))}function Br(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function rt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Br(t.slice(0,0))}function K(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)}function Ur(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=m/f:r+=m*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+g]=a&255,g+=y,a/=256,p-=8);t[e+g-y]|=j*128}import sr from"algosdk";import zt,{decodeAddress as qt,encodeAddress as Jt}from"algosdk";var R=[],_=[],et=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function Dr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function tt(t){or||Dr();var r,e,n,i,o,a,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,a=new et(s*3/4-o),n=o>0?s-4:s;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function nt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function it(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(nt(n));return i.join("")}function vr(t){or||Dr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(it(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=R[r>>2],i+=R[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=R[r>>10],i+=R[r>>4&63],i+=R[r<<2&63],i+="="),o.push(i),o.join("")}function q(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)}function Cr(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=m/f:r+=m*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+g]=a&255,g+=y,a/=256,p-=8);t[e+g-y]|=j*128}var ot={}.toString,Mr=Array.isArray||function(t){return ot.call(t)=="[object Array]"};var at=50;c.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Gt=$();function $(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(t,r){if($()<r)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=c.prototype):(t===null&&(t=new c(r)),t.length=r),t}function c(t,r,e){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c))return new c(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 ar(this,t)}return Fr(this,t,r,e)}c.poolSize=8192;c._augment=function(t){return t.__proto__=c.prototype,t};function Fr(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"?st(t,r,e):ft(t,r)}c.from=function(t,r,e){return Fr(null,t,r,e)};c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array);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 ut(t,r,e,n){return Or(r),r<=0?U(t,r):e!==void 0?typeof n=="string"?U(t,r).fill(e,n):U(t,r).fill(e):U(t,r)}c.alloc=function(t,r,e){return ut(null,t,r,e)};function ar(t,r){if(Or(r),t=U(t,r<0?0:ur(r)|0),!c.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}c.allocUnsafe=function(t){return ar(null,t)};c.allocUnsafeSlow=function(t){return ar(null,t)};function st(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!c.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Lr(r,e)|0;t=U(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function ir(t,r){var e=r.length<0?0:ur(r.length)|0;t=U(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),c.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=c.prototype):t=ir(t,r),t}function ft(t,r){if(S(r)){var e=ur(r.length)|0;return t=U(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Bt(r.length)?U(t,0):ir(t,r);if(r.type==="Buffer"&&Mr(r.data))return ir(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ur(t){if(t>=$())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$().toString(16)+" bytes");return t|0}c.isBuffer=Ut;function S(t){return!!(t!=null&&t._isBuffer)}c.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,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};c.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}};c.concat=function(r,e){if(!Mr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return c.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=c.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Lr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return $r(t).length;default:if(n)return z(t).length;r=(""+r).toLowerCase(),n=!0}}c.byteLength=Lr;function lt(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 yt(this,r,e);case"utf8":case"utf-8":return Gr(this,r,e);case"ascii":return Et(this,r,e);case"latin1":case"binary":return wt(this,r,e);case"base64":return dt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}c.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};c.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};c.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};c.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Gr(this,0,r):lt.apply(this,arguments)};c.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:c.compare(this,r)===0};c.prototype.inspect=function(){var r="",e=at;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};c.prototype.compare=function(r,e,n,i,o){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),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,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<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=c.from(r,n)),S(r))return r.length===0?-1:Nr(t,r,e,n,i);if(typeof r=="number")return r=r&255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):Nr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function Nr(t,r,e,n,i){var o=1,a=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,a/=2,s/=2,e/=2}function f(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,m=0;m<s;m++)if(f(t,p+m)!==f(r,m)){l=!1;break}if(l)return p}return-1}c.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};c.prototype.indexOf=function(r,e,n){return Yr(this,r,e,n,!0)};c.prototype.lastIndexOf=function(r,e,n){return Yr(this,r,e,n,!1)};function pt(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 s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function ht(t,r,e,n){return Q(z(r,t.length-e),t,e,n)}function Wr(t,r,e,n){return Q(St(r),t,e,n)}function gt(t,r,e,n){return Wr(t,r,e,n)}function mt(t,r,e,n){return Q($r(r),t,e,n)}function xt(t,r,e,n){return Q(kt(r,t.length-e),t,e,n)}c.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 pt(this,r,e,n);case"utf8":case"utf-8":return ht(this,r,e,n);case"ascii":return Wr(this,r,e,n);case"latin1":case"binary":return gt(this,r,e,n);case"base64":return mt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dt(t,r,e){return r===0&&e===t.length?vr(t):vr(t.slice(r,e))}function Gr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return bt(n)}var Pr=4096;function bt(t){var r=t.length;if(r<=Pr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Pr));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 wt(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 yt(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+=Rt(t[o]);return i}function Tt(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}c.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(c.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=c.prototype;else{var o=e-r;i=new c(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function b(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")}c.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};c.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};c.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};c.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};c.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};c.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};c.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};c.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(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};c.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(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};c.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};c.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};c.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};c.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),q(this,r,!0,23,4)};c.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),q(this,r,!1,23,4)};c.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),q(this,r,!0,52,8)};c.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),q(this,r,!1,52,8)};function w(t,r,e,n,i,o){if(!S(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")}c.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,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=r/a&255;return e+n};c.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,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};c.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,255,0),c.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}c.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};function X(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}c.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):X(this,r,e,!0),e+4};c.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};c.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,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.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,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};c.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};c.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):X(this,r,e,!0),e+4};c.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),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};function Hr(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 Vr(t,r,e,n,i){return i||Hr(t,r,e,4),Cr(t,r,e,n,23,4),e+4}c.prototype.writeFloatLE=function(r,e,n){return Vr(this,r,e,!0,n)};c.prototype.writeFloatBE=function(r,e,n){return Vr(this,r,e,!1,n)};function Kr(t,r,e,n,i){return i||Hr(t,r,e,8),Cr(t,r,e,n,52,8),e+8}c.prototype.writeDoubleLE=function(r,e,n){return Kr(this,r,e,!0,n)};c.prototype.writeDoubleBE=function(r,e,n){return Kr(this,r,e,!1,n)};c.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||!c.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};c.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"&&!c.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 s=S(r)?r:z(new c(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function At(t){if(t=It(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function It(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Rt(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,r){r=r||1/0;for(var e,n=t.length,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 kt(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 $r(t){return tt(At(t))}function Q(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 Bt(t){return t!==t}function Ut(t){return t!=null&&(!!t._isBuffer||zr(t)||vt(t))}function zr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function vt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&zr(t.slice(0,0))}import{encodeAddress as Xr,decodeAddress as en}from"algosdk";function qr(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}function Jr(t){return t.map(r=>r instanceof Uint8Array?new Uint8Array(r):typeof r=="string"?Nt(r):(typeof r=="boolean"&&(r=BigInt(r?1:0)),typeof r=="number"&&(r=BigInt(r)),Pt(r)))}function Nt(t){return new Uint8Array(c.from(t))}function Pt(t){let r=c.alloc(8);for(let e=0;e<8;e++)r[7-e]=Number(BigInt(t)>>BigInt(e*8)&BigInt(255));return new Uint8Array(r)}function Z(t){return c.from(t,"base64")}import Dt from"bignumber.js";Dt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var An=`{"theme1":{"value":"${x.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},kn={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};function Zr(t){return Object.keys(t).sort().reduce((r,e)=>({...r,[e]:t[e]}),{})}var gi=(t,r)=>r.map(n=>({appIndex:t,name:qr(Jr(["WLP_",n]))}));function Ct(t){let r={};return t.forEach(e=>{let n=Z(e.key).toString(),i=e.value,o=i.type;o==2&&(i=i.uint),o==1&&(i=Z(i.bytes)),n=="gov"?r.gov=Xr(i):r[n]=i}),Zr(r)}var mi=t=>{let r={0:t.amount},e=t.assets;for(let n=0;n<e.length;n++){let i=e[n]["asset-id"],o=e[n].amount;r[i]=o}return console.log(`Account ${t.address} balances`,JSON.stringify(r)),r},xi=async(t,r)=>{let e=await t.getApplicationByID(r).do();return Ct(e.params["global-state"])},di=async(t,r)=>{let{boxes:e}=await t.getApplicationBoxes(r).do();console.log("boxes",r,e.map(n=>n.name).filter(n=>n.length===32).map(n=>u.from(n).toString("base64")))},bi=async(t,r,e)=>{try{let{value:n}=await t.getApplicationBoxByName(r,e).do();return n}catch(n){if(n.message.includes("box not found"))return console.log(`Box not found '${u.from(e).toString("hex")}'`),null;throw n}},Ei=async(t,r=1)=>{let e=await t.getTransactionParams().do();return r>1&&(e.fee=sr.ALGORAND_MIN_TX_FEE*r,e.flatFee=!0),{...e}},wi=(t,r)=>Object.keys(t).includes(r.toString()),yi=t=>sr.decodeAddress(t.toUpperCase()).publicKey,Ti=(t,r,e,n)=>sr.verifyBytes(new Uint8Array(u.from(e,n)),Z(t),r);export{gi as createBoxes,yi as decodeAndNormalizeAddress,Ct as decodeStateArray,mi as getAccountAssetBalances,di as getAppBoxes,xi as getAppGlobalState,bi as getBoxByName,Ei as getTxnParams,wi as isAssetOptedIn,Ti as verifySignature};
1
+ function fr(){throw new Error("setTimeout has not been defined")}function lr(){throw new Error("clearTimeout has not been defined")}var N=fr,v=lr;typeof globalThis.setTimeout=="function"&&(N=setTimeout);typeof globalThis.clearTimeout=="function"&&(v=clearTimeout);function pr(t){if(N===setTimeout)return setTimeout(t,0);if((N===fr||!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 jr(t){if(v===clearTimeout)return clearTimeout(t);if((v===lr||!v)&&clearTimeout)return v=clearTimeout,clearTimeout(t);try{return v(t)}catch{try{return v.call(null,t)}catch{return v.call(this,t)}}}var k=[],O=!1,P,L=-1;function re(){!O||!P||(O=!1,P.length?k=P.concat(k):L=-1,k.length&&hr())}function hr(){if(!O){var t=pr(re);O=!0;for(var r=k.length;r;){for(P=k,k=[];++L<r;)P&&P[L].run();L=-1,r=k.length}P=null,O=!1,jr(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];k.push(new gr(t,r)),k.length===1&&!O&&pr(hr)}function gr(t,r){this.fun=t,this.array=r}gr.prototype.run=function(){this.fun.apply(null,this.array)};var te="browser",ne="browser",ie=!0,oe={},ae=[],ue="",se={},ce={},fe={};function D(){}var le=D,pe=D,he=D,ge=D,me=D,xe=D,de=D;function be(t){throw new Error("process.binding is not supported")}function Ee(){return"/"}function we(t){throw new Error("process.chdir is not supported")}function ye(){return 0}var F=globalThis.performance||{},Te=F.now||F.mozNow||F.msNow||F.oNow||F.webkitNow||function(){return new Date().getTime()};function _e(t){var r=Te.call(F)*.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 Ae=new Date;function Ie(){var t=new Date,r=t-Ae;return r/1e3}var x={nextTick:ee,title:te,browser:ie,env:oe,argv:ae,version:ue,versions:se,on:le,addListener:pe,once:he,off:ge,removeListener:me,removeAllListeners:xe,emit:de,binding:be,cwd:Ee,chdir:we,umask:ye,hrtime:_e,platform:ne,release:ce,config:fe,uptime:Ie},cr={};Object.keys(cr).forEach(t=>{let r=t.split("."),e=x;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=cr[t]:e=e[i]||(e[i]={})}});var A=[],T=[],Re=typeof Uint8Array<"u"?Uint8Array:Array,er=!1;function br(){er=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)A[r]=t[r],T[t.charCodeAt(r)]=r;T[45]=62,T[95]=63}function Se(t){er||br();var r,e,n,i,o,a,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,a=new Re(s*3/4-o),n=o>0?s-4:s;var f=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[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=T[t.charCodeAt(r)]<<2|T[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=T[t.charCodeAt(r)]<<10|T[t.charCodeAt(r+1)]<<4|T[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function ke(t){return A[t>>18&63]+A[t>>12&63]+A[t>>6&63]+A[t&63]}function Be(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(ke(n));return i.join("")}function mr(t){er||br();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(Be(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=A[r>>2],i+=A[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=A[r>>10],i+=A[r>>4&63],i+=A[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 Y(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,r){if(Y()<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 tr(this,t)}return Er(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Er(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?ve(t,r,e,n):typeof r=="string"?Ne(t,r,e):Pe(t,r)}u.from=function(t,r,e){return Er(null,t,r,e)};u.kMaxLength=Y();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function wr(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 Ue(t,r,e,n){return wr(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)}u.alloc=function(t,r,e){return Ue(null,t,r,e)};function tr(t,r){if(wr(r),t=B(t,r<0?0:nr(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return tr(null,t)};u.allocUnsafeSlow=function(t){return tr(null,t)};function Ne(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=yr(r,e)|0;t=B(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function rr(t,r){var e=r.length<0?0:nr(r.length)|0;t=B(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function ve(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=rr(t,r),t}function Pe(t,r){if(I(r)){var e=nr(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"||Ze(r.length)?B(t,0):rr(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return rr(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function nr(t){if(t>=Y())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y().toString(16)+" bytes");return t|0}u.isBuffer=je;function I(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!I(r)||!I(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(!I(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function yr(t,r){if(I(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 W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return kr(t).length;default:if(n)return W(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=yr;function De(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 Ve(this,r,e);case"utf8":case"utf-8":return Ar(this,r,e);case"ascii":return Ge(this,r,e);case"latin1":case"binary":return He(this,r,e);case"base64":return Ye(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ke(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function C(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)C(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)C(this,e,e+3),C(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)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};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Ar(this,0,r):De.apply(this,arguments)};u.prototype.equals=function(r){if(!I(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(!I(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,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<a?1:0};function Tr(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)),I(r))return r.length===0?-1:xr(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):xr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function xr(t,r,e,n,i){var o=1,a=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,a/=2,s/=2,e/=2}function f(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,m=0;m<s;m++)if(f(t,p+m)!==f(r,m)){l=!1;break}if(l)return p}return-1}u.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};u.prototype.indexOf=function(r,e,n){return Tr(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return Tr(this,r,e,n,!1)};function Ce(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 s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function Me(t,r,e,n){return V(W(r,t.length-e),t,e,n)}function _r(t,r,e,n){return V(Xe(r),t,e,n)}function Fe(t,r,e,n){return _r(t,r,e,n)}function Oe(t,r,e,n){return V(kr(r),t,e,n)}function Le(t,r,e,n){return V(Qe(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 Ce(this,r,e,n);case"utf8":case"utf-8":return Me(this,r,e,n);case"ascii":return _r(this,r,e,n);case"latin1":case"binary":return Fe(this,r,e,n);case"base64":return Oe(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le(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 Ye(t,r,e){return r===0&&e===t.length?mr(t):mr(t.slice(r,e))}function Ar(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return We(n)}var dr=4096;function We(t){var r=t.length;if(r<=dr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=dr));return e}function Ge(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 He(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 Ve(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+=Je(t[o]);return i}function Ke(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 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")}u.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};u.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};u.prototype.readUInt8=function(r,e){return e||d(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||d(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||d(r,2,this.length),this[r]<<8|this[r+1]};u.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};u.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])};u.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};u.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};u.prototype.readInt8=function(r,e){return e||d(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.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};u.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};u.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};u.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]};u.prototype.readFloatLE=function(r,e){return e||d(r,4,this.length),K(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||d(r,4,this.length),K(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||d(r,8,this.length),K(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||d(r,8,this.length),K(this,r,!1,52,8)};function E(t,r,e,n,i,o){if(!I(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;E(this,r,e,n,o,0)}var a=1,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=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;E(this,r,e,n,o,0)}var a=n-1,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function G(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||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};function H(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||E(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):H(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||E(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):H(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);E(this,r,e,n,o-1,-o)}var a=0,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&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);E(this,r,e,n,o-1,-o)}var a=n-1,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||E(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||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):G(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||E(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):G(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||E(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):H(this,r,e,!0),e+4};u.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),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):H(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 Rr(t,r,e,n,i){return i||Ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),Ur(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return Rr(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return Rr(this,r,e,!1,n)};function Sr(t,r,e,n,i){return i||Ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),Ur(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return Sr(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return Sr(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 s=I(r)?r:W(new u(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var $e=/[^+\/0-9A-Za-z-_]/g;function ze(t){if(t=qe(t).replace($e,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function qe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Je(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(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 Xe(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function Qe(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 kr(t){return Se(ze(t))}function V(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 Ze(t){return t!==t}function je(t){return t!=null&&(!!t._isBuffer||Br(t)||rt(t))}function Br(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function rt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Br(t.slice(0,0))}function K(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)}function Ur(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=m/f:r+=m*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+g]=a&255,g+=y,a/=256,p-=8);t[e+g-y]|=j*128}import sr from"algosdk";import zt,{decodeAddress as qt,encodeAddress as Jt}from"algosdk";var R=[],_=[],et=typeof Uint8Array<"u"?Uint8Array:Array,or=!1;function Dr(){or=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)R[r]=t[r],_[t.charCodeAt(r)]=r;_[45]=62,_[95]=63}function tt(t){or||Dr();var r,e,n,i,o,a,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,a=new et(s*3/4-o),n=o>0?s-4:s;var f=0;for(r=0,e=0;r<n;r+=4,e+=3)i=_[t.charCodeAt(r)]<<18|_[t.charCodeAt(r+1)]<<12|_[t.charCodeAt(r+2)]<<6|_[t.charCodeAt(r+3)],a[f++]=i>>16&255,a[f++]=i>>8&255,a[f++]=i&255;return o===2?(i=_[t.charCodeAt(r)]<<2|_[t.charCodeAt(r+1)]>>4,a[f++]=i&255):o===1&&(i=_[t.charCodeAt(r)]<<10|_[t.charCodeAt(r+1)]<<4|_[t.charCodeAt(r+2)]>>2,a[f++]=i>>8&255,a[f++]=i&255),a}function nt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function it(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(nt(n));return i.join("")}function Nr(t){or||Dr();for(var r,e=t.length,n=e%3,i="",o=[],a=16383,s=0,f=e-n;s<f;s+=a)o.push(it(t,s,s+a>f?f:s+a));return n===1?(r=t[e-1],i+=R[r>>2],i+=R[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=R[r>>10],i+=R[r>>4&63],i+=R[r<<2&63],i+="="),o.push(i),o.join("")}function q(t,r,e,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,p=f>>1,h=-7,l=e?i-1:0,m=e?-1:1,g=t[r+l];for(l+=m,o=g&(1<<-h)-1,g>>=-h,h+=s;h>0;o=o*256+t[r+l],l+=m,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=a*256+t[r+l],l+=m,h-=8);if(o===0)o=1-p;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-p}return(g?-1:1)*a*Math.pow(2,o-n)}function Cr(t,r,e,n,i,o){var a,s,f,p=o*8-i-1,h=(1<<p)-1,l=h>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,j=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?r+=m/f:r+=m*Math.pow(2,1-l),r*f>=2&&(a++,f/=2),a+l>=h?(s=0,a=h):a+l>=1?(s=(r*f-1)*Math.pow(2,i),a=a+l):(s=r*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,p+=i;p>0;t[e+g]=a&255,g+=y,a/=256,p-=8);t[e+g-y]|=j*128}var ot={}.toString,Mr=Array.isArray||function(t){return ot.call(t)=="[object Array]"};var at=50;c.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Gt=$();function $(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function U(t,r){if($()<r)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=c.prototype):(t===null&&(t=new c(r)),t.length=r),t}function c(t,r,e){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c))return new c(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 ar(this,t)}return Fr(this,t,r,e)}c.poolSize=8192;c._augment=function(t){return t.__proto__=c.prototype,t};function Fr(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"?st(t,r,e):ft(t,r)}c.from=function(t,r,e){return Fr(null,t,r,e)};c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array);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 ut(t,r,e,n){return Or(r),r<=0?U(t,r):e!==void 0?typeof n=="string"?U(t,r).fill(e,n):U(t,r).fill(e):U(t,r)}c.alloc=function(t,r,e){return ut(null,t,r,e)};function ar(t,r){if(Or(r),t=U(t,r<0?0:ur(r)|0),!c.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}c.allocUnsafe=function(t){return ar(null,t)};c.allocUnsafeSlow=function(t){return ar(null,t)};function st(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!c.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=Lr(r,e)|0;t=U(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function ir(t,r){var e=r.length<0?0:ur(r.length)|0;t=U(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),c.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=c.prototype):t=ir(t,r),t}function ft(t,r){if(S(r)){var e=ur(r.length)|0;return t=U(t,e),t.length===0||r.copy(t,0,0,e),t}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Bt(r.length)?U(t,0):ir(t,r);if(r.type==="Buffer"&&Mr(r.data))return ir(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function ur(t){if(t>=$())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$().toString(16)+" bytes");return t|0}c.isBuffer=Ut;function S(t){return!!(t!=null&&t._isBuffer)}c.compare=function(r,e){if(!S(r)||!S(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,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};c.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}};c.concat=function(r,e){if(!Mr(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return c.alloc(0);var n;if(e===void 0)for(e=0,n=0;n<r.length;++n)e+=r[n].length;var i=c.allocUnsafe(e),o=0;for(n=0;n<r.length;++n){var a=r[n];if(!S(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o),o+=a.length}return i};function Lr(t,r){if(S(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;if(e===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return $r(t).length;default:if(n)return z(t).length;r=(""+r).toLowerCase(),n=!0}}c.byteLength=Lr;function lt(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 yt(this,r,e);case"utf8":case"utf-8":return Gr(this,r,e);case"ascii":return Et(this,r,e);case"latin1":case"binary":return wt(this,r,e);case"base64":return dt(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function M(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}c.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};c.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};c.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};c.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?Gr(this,0,r):lt.apply(this,arguments)};c.prototype.equals=function(r){if(!S(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:c.compare(this,r)===0};c.prototype.inspect=function(){var r="",e=at;return this.length>0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),"<Buffer "+r+">"};c.prototype.compare=function(r,e,n,i,o){if(!S(r))throw new TypeError("Argument must be a Buffer");if(e===void 0&&(e=0),n===void 0&&(n=r?r.length:0),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,s=n-e,f=Math.min(a,s),p=this.slice(i,o),h=r.slice(e,n),l=0;l<f;++l)if(p[l]!==h[l]){a=p[l],s=h[l];break}return a<s?-1:s<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=c.from(r,n)),S(r))return r.length===0?-1:vr(t,r,e,n,i);if(typeof r=="number")return r=r&255,c.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):vr(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function vr(t,r,e,n,i){var o=1,a=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,a/=2,s/=2,e/=2}function f(g,y){return o===1?g[y]:g.readUInt16BE(y*o)}var p;if(i){var h=-1;for(p=e;p<a;p++)if(f(t,p)===f(r,h===-1?0:p-h)){if(h===-1&&(h=p),p-h+1===s)return h*o}else h!==-1&&(p-=p-h),h=-1}else for(e+s>a&&(e=a-s),p=e;p>=0;p--){for(var l=!0,m=0;m<s;m++)if(f(t,p+m)!==f(r,m)){l=!1;break}if(l)return p}return-1}c.prototype.includes=function(r,e,n){return this.indexOf(r,e,n)!==-1};c.prototype.indexOf=function(r,e,n){return Yr(this,r,e,n,!0)};c.prototype.lastIndexOf=function(r,e,n){return Yr(this,r,e,n,!1)};function pt(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 s=parseInt(r.substr(a*2,2),16);if(isNaN(s))return a;t[e+a]=s}return a}function ht(t,r,e,n){return Q(z(r,t.length-e),t,e,n)}function Wr(t,r,e,n){return Q(St(r),t,e,n)}function gt(t,r,e,n){return Wr(t,r,e,n)}function mt(t,r,e,n){return Q($r(r),t,e,n)}function xt(t,r,e,n){return Q(kt(r,t.length-e),t,e,n)}c.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 pt(this,r,e,n);case"utf8":case"utf-8":return ht(this,r,e,n);case"ascii":return Wr(this,r,e,n);case"latin1":case"binary":return gt(this,r,e,n);case"base64":return mt(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,r,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dt(t,r,e){return r===0&&e===t.length?Nr(t):Nr(t.slice(r,e))}function Gr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){var f,p,h,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],p=t[i+2],(f&192)===128&&(p&192)===128&&(l=(o&15)<<12|(f&63)<<6|p&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],p=t[i+2],h=t[i+3],(f&192)===128&&(p&192)===128&&(h&192)===128&&(l=(o&15)<<18|(f&63)<<12|(p&63)<<6|h&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return bt(n)}var Pr=4096;function bt(t){var r=t.length;if(r<=Pr)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=Pr));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 wt(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 yt(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+=Rt(t[o]);return i}function Tt(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}c.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(c.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=c.prototype;else{var o=e-r;i=new c(o,void 0);for(var a=0;a<o;++a)i[a]=this[a+r]}return i};function b(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")}c.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r],o=1,a=0;++a<e&&(o*=256);)i+=this[r+a]*o;return i};c.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||b(r,e,this.length);for(var i=this[r+--e],o=1;e>0&&(o*=256);)i+=this[r+--e]*o;return i};c.prototype.readUInt8=function(r,e){return e||b(r,1,this.length),this[r]};c.prototype.readUInt16LE=function(r,e){return e||b(r,2,this.length),this[r]|this[r+1]<<8};c.prototype.readUInt16BE=function(r,e){return e||b(r,2,this.length),this[r]<<8|this[r+1]};c.prototype.readUInt32LE=function(r,e){return e||b(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};c.prototype.readUInt32BE=function(r,e){return e||b(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};c.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||b(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};c.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||b(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};c.prototype.readInt8=function(r,e){return e||b(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};c.prototype.readInt16LE=function(r,e){e||b(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function(r,e){e||b(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function(r,e){return e||b(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};c.prototype.readInt32BE=function(r,e){return e||b(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};c.prototype.readFloatLE=function(r,e){return e||b(r,4,this.length),q(this,r,!0,23,4)};c.prototype.readFloatBE=function(r,e){return e||b(r,4,this.length),q(this,r,!1,23,4)};c.prototype.readDoubleLE=function(r,e){return e||b(r,8,this.length),q(this,r,!0,52,8)};c.prototype.readDoubleBE=function(r,e){return e||b(r,8,this.length),q(this,r,!1,52,8)};function w(t,r,e,n,i,o){if(!S(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")}c.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,s=0;for(this[e]=r&255;++s<n&&(a*=256);)this[e+s]=r/a&255;return e+n};c.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,s=1;for(this[e+a]=r&255;--a>=0&&(s*=256);)this[e+a]=r/s&255;return e+n};c.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,255,0),c.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}c.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};function X(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}c.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):X(this,r,e,!0),e+4};c.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};c.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,s=1,f=0;for(this[e]=r&255;++a<n&&(s*=256);)r<0&&f===0&&this[e+a-1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.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,s=1,f=0;for(this[e+a]=r&255;--a>=0&&(s*=256);)r<0&&f===0&&this[e+a+1]!==0&&(f=1),this[e+a]=(r/s>>0)-f&255;return e+n};c.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};c.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):J(this,r,e,!0),e+2};c.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):J(this,r,e,!1),e+2};c.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||w(this,r,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):X(this,r,e,!0),e+4};c.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),c.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):X(this,r,e,!1),e+4};function Hr(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 Vr(t,r,e,n,i){return i||Hr(t,r,e,4),Cr(t,r,e,n,23,4),e+4}c.prototype.writeFloatLE=function(r,e,n){return Vr(this,r,e,!0,n)};c.prototype.writeFloatBE=function(r,e,n){return Vr(this,r,e,!1,n)};function Kr(t,r,e,n,i){return i||Hr(t,r,e,8),Cr(t,r,e,n,52,8),e+8}c.prototype.writeDoubleLE=function(r,e,n){return Kr(this,r,e,!0,n)};c.prototype.writeDoubleBE=function(r,e,n){return Kr(this,r,e,!1,n)};c.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||!c.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};c.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"&&!c.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 s=S(r)?r:z(new c(r,i).toString()),f=s.length;for(a=0;a<n-e;++a)this[a+e]=s[a%f]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function At(t){if(t=It(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function It(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Rt(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,r){r=r||1/0;for(var e,n=t.length,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 kt(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 $r(t){return tt(At(t))}function Q(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 Bt(t){return t!==t}function Ut(t){return t!=null&&(!!t._isBuffer||zr(t)||Nt(t))}function zr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Nt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&zr(t.slice(0,0))}import{encodeAddress as Xr,decodeAddress as en}from"algosdk";function qr(t){return t.reduce((r,e)=>Uint8Array.from([...r,...e]))}function Jr(t){return t.map(r=>r instanceof Uint8Array?new Uint8Array(r):typeof r=="string"?vt(r):(typeof r=="boolean"&&(r=BigInt(r?1:0)),typeof r=="number"&&(r=BigInt(r)),Pt(r)))}function vt(t){return new Uint8Array(c.from(t))}function Pt(t){let r=c.alloc(8);for(let e=0;e<8;e++)r[7-e]=Number(BigInt(t)>>BigInt(e*8)&BigInt(255));return new Uint8Array(r)}function Z(t){return c.from(t,"base64")}import Dt from"bignumber.js";Dt.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var An=`{"theme1":{"value":"${x.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${x.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var Qr={V1_1:"v1_1",V2:"v2"},kn={[Qr.V1_1]:{testnet:62368684,mainnet:552635992},[Qr.V2]:{testnet:148607e3,mainnet:1002541853}};function Zr(t){return Object.keys(t).sort().reduce((r,e)=>({...r,[e]:t[e]}),{})}var gi=(t,r)=>r.map(n=>({appIndex:t,name:qr(Jr(["WLP_",n]))}));function Ct(t){let r={};return t.forEach(e=>{let n=Z(e.key).toString(),i=e.value,o=i.type;o==2&&(i=i.uint),o==1&&(i=Z(i.bytes)),n=="gov"?r.gov=Xr(i):r[n]=i}),Zr(r)}var mi=t=>{let r={0:t.amount},e=t.assets;for(let n=0;n<e.length;n++){let i=e[n]["asset-id"],o=e[n].amount;r[i]=o}return console.log(`Account ${t.address} balances`,JSON.stringify(r)),r},xi=async(t,r)=>{let e=await t.getApplicationByID(r).do();return Ct(e.params["global-state"])},di=async(t,r)=>{let{boxes:e}=await t.getApplicationBoxes(r).do();console.log("boxes",r,e.map(n=>n.name).filter(n=>n.length===32).map(n=>u.from(n).toString("base64")))},bi=async(t,r,e)=>{try{let{value:n}=await t.getApplicationBoxByName(r,e).do();return n}catch(n){if(n.message.includes("box not found"))return console.log(`Box not found '${u.from(e).toString("hex")}'`),null;throw n}},Ei=async(t,r=1)=>{let e=await t.getTransactionParams().do();return r>1&&(e.fee=sr.ALGORAND_MIN_TX_FEE*r,e.flatFee=!0),{...e}},wi=(t,r)=>Object.keys(t).includes(r.toString()),yi=t=>sr.decodeAddress(t.toUpperCase()).publicKey,Ti=(t,r,e,n)=>sr.verifyBytes(new Uint8Array(u.from(e,n)),Z(t),r);export{gi as createBoxes,yi as decodeAndNormalizeAddress,Ct as decodeStateArray,mi as getAccountAssetBalances,di as getAppBoxes,xi as getAppGlobalState,bi as getBoxByName,Ei as getTxnParams,wi as isAssetOptedIn,Ti as verifySignature};
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *