@ultrade/shared 1.0.26 → 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 (208) 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/assert.helper.js +1 -1
  52. package/dist/node/helpers/atomic.helper.js +1 -1
  53. package/dist/node/helpers/balance.helper.js +1 -1
  54. package/dist/node/helpers/codex/common.helper.js +2 -2
  55. package/dist/node/helpers/codex/index.js +2 -2
  56. package/dist/node/helpers/codex/mbr.helper.js +1 -1
  57. package/dist/node/helpers/codex/mna.helper.js +1 -1
  58. package/dist/node/helpers/codex/order.helper.js +1 -1
  59. package/dist/node/helpers/codex/setGlobal.helper.js +1 -1
  60. package/dist/node/helpers/codex/tokens.js +1 -0
  61. package/dist/node/helpers/codex/transfer.helper.js +2 -2
  62. package/dist/node/helpers/codex/txn.helper.js +1 -1
  63. package/dist/node/helpers/codex.helper.js +6 -6
  64. package/dist/node/helpers/eth.helper.js +2 -2
  65. package/dist/node/helpers/order.helper.js +1 -1
  66. package/dist/node/helpers/pair.helper.js +1 -1
  67. package/dist/node/helpers/withdraw.helper.js +2 -2
  68. package/dist/node/interfaces/index.js +1 -1
  69. package/dist/node/services/index.js +1 -0
  70. package/dist/node/types/index.js +1 -1
  71. package/dist/services/index.d.ts +2 -0
  72. package/dist/services/pairParam.service.d.ts +14 -0
  73. package/dist/services/tmc.service.d.ts +33 -0
  74. package/dist/{src/types → types}/api/request.types.d.ts +10 -10
  75. package/dist/{src/types → types}/settings.type.d.ts +4 -3
  76. package/package.json +39 -5
  77. package/dist/browser/common/big-number.helper.js +0 -11
  78. package/dist/browser/common/mappers/codexAsset.mapper.js +0 -11
  79. package/dist/browser/common/mappers/index.js +0 -11
  80. package/dist/browser/common/mappers/trade.mapper.js +0 -11
  81. package/dist/browser/common/utils/assert.js +0 -11
  82. package/dist/browser/common/utils/index.js +0 -11
  83. package/dist/browser/common/utils/stat.js +0 -11
  84. package/dist/browser/helpers/vaa.helper.js +0 -11
  85. package/dist/node/common/big-number.helper.js +0 -1
  86. package/dist/node/common/mappers/codexAsset.mapper.js +0 -1
  87. package/dist/node/common/mappers/codexBalance.mapper.js +0 -1
  88. package/dist/node/common/mappers/index.js +0 -1
  89. package/dist/node/common/mappers/trade.mapper.js +0 -1
  90. package/dist/node/common/utils/assert.js +0 -1
  91. package/dist/node/common/utils/index.js +0 -1
  92. package/dist/node/common/utils/social.js +0 -1
  93. package/dist/node/common/utils/stat.js +0 -1
  94. package/dist/node/helpers/vaa.helper.js +0 -0
  95. package/dist/src/helpers/vaa.helper.d.ts +0 -0
  96. /package/dist/browser/{common → helpers}/auth.helper.js +0 -0
  97. /package/dist/browser/{common/utils → helpers}/decode.js +0 -0
  98. /package/dist/{src/common → common}/big-number.helper.d.ts +0 -0
  99. /package/dist/{src/common → common}/mappers/codexAsset.mapper.d.ts +0 -0
  100. /package/dist/{src/common → common}/mappers/codexBalance.mapper.d.ts +0 -0
  101. /package/dist/{src/common → common}/mappers/index.d.ts +0 -0
  102. /package/dist/{src/common → common}/mappers/trade.mapper.d.ts +0 -0
  103. /package/dist/{src/common → common}/utils/assert.d.ts +0 -0
  104. /package/dist/{src/common → common}/utils/social.d.ts +0 -0
  105. /package/dist/{src/common → common}/utils/stat.d.ts +0 -0
  106. /package/dist/{src/constants → constants}/auth.d.ts +0 -0
  107. /package/dist/{src/constants → constants}/cctp.d.ts +0 -0
  108. /package/dist/{src/constants → constants}/codex.d.ts +0 -0
  109. /package/dist/{src/constants → constants}/frontend.d.ts +0 -0
  110. /package/dist/{src/constants → constants}/response.d.ts +0 -0
  111. /package/dist/{src/constants → constants}/settings.d.ts +0 -0
  112. /package/dist/{src/constants → constants}/withdrawalWalletsMessage.d.ts +0 -0
  113. /package/dist/{src/enums → enums}/chains.enum.d.ts +0 -0
  114. /package/dist/{src/enums → enums}/db/account/index.d.ts +0 -0
  115. /package/dist/{src/enums → enums}/db/affiliate.enum.d.ts +0 -0
  116. /package/dist/{src/enums → enums}/db/available-pair-settings.enum.d.ts +0 -0
  117. /package/dist/{src/enums → enums}/db/common.enum.d.ts +0 -0
  118. /package/dist/{src/enums → enums}/db/component/index.d.ts +0 -0
  119. /package/dist/{src/enums → enums}/db/market-maker.enum.d.ts +0 -0
  120. /package/dist/{src/enums → enums}/db/notification-center/userNotification.enum.d.ts +0 -0
  121. /package/dist/{src/enums → enums}/db/order-side.enum.d.ts +0 -0
  122. /package/dist/{src/enums → enums}/db/order-status.enum.d.ts +0 -0
  123. /package/dist/{src/enums → enums}/db/order-type.enum.d.ts +0 -0
  124. /package/dist/{src/enums → enums}/db/setting-type.enum.d.ts +0 -0
  125. /package/dist/{src/enums → enums}/db/social-action.enum.d.ts +0 -0
  126. /package/dist/{src/enums → enums}/db/social-prompt.enum.d.ts +0 -0
  127. /package/dist/{src/enums → enums}/db/social.enum.d.ts +0 -0
  128. /package/dist/{src/enums → enums}/db/state-type.enum.d.ts +0 -0
  129. /package/dist/{src/enums → enums}/db/trade.enums.d.ts +0 -0
  130. /package/dist/{src/enums → enums}/db/tradingKeyType.enum.d.ts +0 -0
  131. /package/dist/{src/enums → enums}/db/upgrade.enum.d.ts +0 -0
  132. /package/dist/{src/enums → enums}/db/withdrawal-wallet.enum.d.ts +0 -0
  133. /package/dist/{src/enums → enums}/maintenanceMode.enum.d.ts +0 -0
  134. /package/dist/{src/enums → enums}/notification.enum.d.ts +0 -0
  135. /package/dist/{src/enums → enums}/rabbitMq.d.ts +0 -0
  136. /package/dist/{src/enums → enums}/settings.enum.d.ts +0 -0
  137. /package/dist/{src/enums → enums}/social.enum.d.ts +0 -0
  138. /package/dist/{src/helpers → helpers}/Encoding.d.ts +0 -0
  139. /package/dist/{src/helpers → helpers}/algo.helper.d.ts +0 -0
  140. /package/dist/{src/helpers → helpers}/assert.helper.d.ts +0 -0
  141. /package/dist/{src/helpers → helpers}/atomic.helper.d.ts +0 -0
  142. /package/dist/{src/common → helpers}/auth.helper.d.ts +0 -0
  143. /package/dist/{src/helpers → helpers}/balance.helper.d.ts +0 -0
  144. /package/dist/{src/helpers → helpers}/codex/mbr.helper.d.ts +0 -0
  145. /package/dist/{src/helpers → helpers}/codex/mna.helper.d.ts +0 -0
  146. /package/dist/{src/helpers → helpers}/codex/order.helper.d.ts +0 -0
  147. /package/dist/{src/helpers → helpers}/codex/setGlobal.helper.d.ts +0 -0
  148. /package/dist/{src/helpers → helpers}/codex/transfer.helper.d.ts +0 -0
  149. /package/dist/{src/helpers → helpers}/codex/txn.helper.d.ts +0 -0
  150. /package/dist/{src/helpers → helpers}/eth.helper.d.ts +0 -0
  151. /package/dist/{src/helpers → helpers}/index.d.ts +0 -0
  152. /package/dist/{src/helpers → helpers}/interval.helpers.d.ts +0 -0
  153. /package/dist/{src/helpers → helpers}/liquidity.helper.d.ts +0 -0
  154. /package/dist/{src/helpers → helpers}/order.helper.d.ts +0 -0
  155. /package/dist/{src/helpers → helpers}/pair.helper.d.ts +0 -0
  156. /package/dist/{src/helpers → helpers}/pointSystem.helper.d.ts +0 -0
  157. /package/dist/{src/helpers → helpers}/ticker.helpers.d.ts +0 -0
  158. /package/dist/{src/helpers → helpers}/withdraw.helper.d.ts +0 -0
  159. /package/dist/{src/interfaces → interfaces}/accountInfo.interface.d.ts +0 -0
  160. /package/dist/{src/interfaces → interfaces}/api/affiliate.interface.d.ts +0 -0
  161. /package/dist/{src/interfaces → interfaces}/api/index.d.ts +0 -0
  162. /package/dist/{src/interfaces → interfaces}/cache.interface.d.ts +0 -0
  163. /package/dist/{src/interfaces → interfaces}/db/baseModel.interface.d.ts +0 -0
  164. /package/dist/{src/interfaces → interfaces}/db/hummingbot/index.d.ts +0 -0
  165. /package/dist/{src/interfaces → interfaces}/db/index.d.ts +0 -0
  166. /package/dist/{src/interfaces → interfaces}/db/market/index.d.ts +0 -0
  167. /package/dist/{src/interfaces → interfaces}/db/marketing/index.d.ts +0 -0
  168. /package/dist/{src/interfaces → interfaces}/db/notification_center/index.d.ts +0 -0
  169. /package/dist/{src/interfaces → interfaces}/db/relayer/index.d.ts +0 -0
  170. /package/dist/{src/interfaces → interfaces}/db/social/index.d.ts +0 -0
  171. /package/dist/{src/interfaces → interfaces}/db/softDeleteModel.interface.d.ts +0 -0
  172. /package/dist/{src/interfaces → interfaces}/db/white_label/index.d.ts +0 -0
  173. /package/dist/{src/interfaces → interfaces}/db/withdrawal_wallets/index.d.ts +0 -0
  174. /package/dist/{src/interfaces → interfaces}/dto/index.d.ts +0 -0
  175. /package/dist/{src/interfaces → interfaces}/emailService.interface.d.ts +0 -0
  176. /package/dist/{src/interfaces → interfaces}/kmsService.interface.d.ts +0 -0
  177. /package/dist/{src/interfaces → interfaces}/last-look-trade.interface.d.ts +0 -0
  178. /package/dist/{src/interfaces → interfaces}/market.interface.d.ts +0 -0
  179. /package/dist/{src/interfaces → interfaces}/pagination.interface.d.ts +0 -0
  180. /package/dist/{src/interfaces → interfaces}/pair.interface.d.ts +0 -0
  181. /package/dist/{src/interfaces → interfaces}/query.interface.d.ts +0 -0
  182. /package/dist/{src/interfaces → interfaces}/services/accountCache.interface.d.ts +0 -0
  183. /package/dist/{src/interfaces → interfaces}/services/algod.interface.d.ts +0 -0
  184. /package/dist/{src/interfaces → interfaces}/services/balances.interface.d.ts +0 -0
  185. /package/dist/{src/interfaces → interfaces}/services/coin-market-cap.interface.d.ts +0 -0
  186. /package/dist/{src/interfaces → interfaces}/services/index.d.ts +0 -0
  187. /package/dist/{src/interfaces → interfaces}/services/price-model.interface.d.ts +0 -0
  188. /package/dist/{src/interfaces → interfaces}/services/price-service.interface.d.ts +0 -0
  189. /package/dist/{src/interfaces → interfaces}/services/socialActivity.interface.d.ts +0 -0
  190. /package/dist/{src/interfaces → interfaces}/services/tmc.interface.d.ts +0 -0
  191. /package/dist/{src/interfaces → interfaces}/settings.interface.d.ts +0 -0
  192. /package/dist/{src/interfaces → interfaces}/streaming.interface.d.ts +0 -0
  193. /package/dist/{src/interfaces → interfaces}/timestream.interface.d.ts +0 -0
  194. /package/dist/{src/interfaces → interfaces}/trading.interface.d.ts +0 -0
  195. /package/dist/{src/interfaces → interfaces}/tradingKey.interface.d.ts +0 -0
  196. /package/dist/{src/interfaces → interfaces}/transfer.interface.d.ts +0 -0
  197. /package/dist/{src/interfaces → interfaces}/wallet.interface.d.ts +0 -0
  198. /package/dist/{src/interfaces → interfaces}/withdrawalWallets.interface.d.ts +0 -0
  199. /package/dist/node/{common → helpers}/auth.helper.js +0 -0
  200. /package/dist/node/{common/utils → helpers}/decode.js +0 -0
  201. /package/dist/{src/types → types}/algo-order.type.d.ts +0 -0
  202. /package/dist/{src/types → types}/amm/amm.d.ts +0 -0
  203. /package/dist/{src/types → types}/balance-result.types.d.ts +0 -0
  204. /package/dist/{src/types → types}/codex.types.d.ts +0 -0
  205. /package/dist/{src/types → types}/hummingbots.types.d.ts +0 -0
  206. /package/dist/{src/types → types}/index.d.ts +0 -0
  207. /package/dist/{src/types → types}/notification.type.d.ts +0 -0
  208. /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 w=V,A=K;typeof globalThis.setTimeout=="function"&&(w=setTimeout);typeof globalThis.clearTimeout=="function"&&(A=clearTimeout);function H(t){if(w===setTimeout)return setTimeout(t,0);if((w===V||!w)&&setTimeout)return w=setTimeout,setTimeout(t,0);try{return w(t,0)}catch{try{return w.call(null,t,0)}catch{return w.call(this,t,0)}}}function fr(t){if(A===clearTimeout)return clearTimeout(t);if((A===K||!A)&&clearTimeout)return A=clearTimeout,clearTimeout(t);try{return A(t)}catch{try{return A.call(null,t)}catch{return A.call(this,t)}}}var x=[],k=!1,I,P=-1;function mr(){!k||!I||(k=!1,I.length?x=I.concat(x):P=-1,x.length&&z())}function z(){if(!k){var t=H(mr);k=!0;for(var r=x.length;r;){for(I=x,x=[];++P<r;)I&&I[P].run();P=-1,r=x.length}I=null,k=!1,fr(t)}}function gr(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];x.push(new J(t,r)),x.length===1&&!k&&H(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var hr="browser",br="browser",dr=!0,Er={},_r=[],Tr="",xr={},yr={},wr={};function R(){}var Ar=R,Ir=R,Rr=R,Sr=R,Nr=R,vr=R,kr=R;function Pr(t){throw new Error("process.binding is not supported")}function Cr(){return"/"}function Or(t){throw new Error("process.chdir is not supported")}function Br(){return 0}var v=globalThis.performance||{},Dr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Mr(t){var r=Dr.call(v)*.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 Lr=new Date;function Ur(){var t=new Date,r=t-Lr;return r/1e3}var g={nextTick:gr,title:hr,browser:dr,env:Er,argv:_r,version:Tr,versions:xr,on:Ar,addListener:Ir,once:Rr,off:Sr,removeListener:Nr,removeAllListeners:vr,emit:kr,binding:Pr,cwd:Cr,chdir:Or,umask:Br,hrtime:Mr,platform:br,release:yr,config:wr,uptime:Ur},G={};Object.keys(G).forEach(t=>{let r=t.split("."),e=g;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=G[t]:e=e[i]||(e[i]={})}});var _=[],d=[],Yr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function Z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)_[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function Fr(t){Y||Z();var r,e,n,i,a,o,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,o=new Yr(s*3/4-a),n=a>0?s-4:s;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)i=d[t.charCodeAt(r)]<<18|d[t.charCodeAt(r+1)]<<12|d[t.charCodeAt(r+2)]<<6|d[t.charCodeAt(r+3)],o[l++]=i>>16&255,o[l++]=i>>8&255,o[l++]=i&255;return a===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,o[l++]=i&255):a===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,o[l++]=i>>8&255,o[l++]=i&255),o}function Wr(t){return _[t>>18&63]+_[t>>12&63]+_[t>>6&63]+_[t&63]}function Gr(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(Wr(n));return i.join("")}function X(t){Y||Z();for(var r,e=t.length,n=e%3,i="",a=[],o=16383,s=0,l=e-n;s<l;s+=o)a.push(Gr(t,s,s+o>l?l:s+o));return n===1?(r=t[e-1],i+=_[r>>2],i+=_[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=_[r>>10],i+=_[r>>4&63],i+=_[r<<2&63],i+="="),a.push(i),a.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,r){if(C()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return F(this,t)}return Q(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Q(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Hr(t,r,e,n):typeof r=="string"?Kr(t,r,e):zr(t,r)}u.from=function(t,r,e){return Q(null,t,r,e)};u.kMaxLength=C();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function j(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Vr(t,r,e,n){return j(r),r<=0?y(t,r):e!==void 0?typeof n=="string"?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}u.alloc=function(t,r,e){return Vr(null,t,r,e)};function F(t,r){if(j(r),t=y(t,r<0?0:W(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function Kr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=rr(r,e)|0;t=y(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function U(t,r){var e=r.length<0?0:W(r.length)|0;t=y(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Hr(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=U(t,r),t}function zr(t,r){if(T(r)){var e=W(r.length)|0;return t=y(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"||pe(r.length)?y(t,0):U(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return U(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(t){if(t>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return t|0}u.isBuffer=fe;function T(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!T(r)||!T(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];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),a=0;for(n=0;n<r.length;++n){var o=r[n];if(!T(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function rr(t,r){if(T(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 O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return O(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Jr(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 ne(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return ee(this,r,e);case"latin1":case"binary":return te(this,r,e);case"base64":return jr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function S(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)S(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)S(this,e,e+3),S(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)S(this,e,e+7),S(this,e+1,e+6),S(this,e+2,e+5),S(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Jr.apply(this,arguments)};u.prototype.equals=function(r){if(!T(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,a){if(!T(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),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,s=n-e,l=Math.min(o,s),p=this.slice(i,a),f=r.slice(e,n),c=0;c<l;++c)if(p[c]!==f[c]){o=p[c],s=f[c];break}return o<s?-1:s<o?1:0};function er(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),T(r))return r.length===0?-1:q(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):q(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function q(t,r,e,n,i){var a=1,o=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;a=2,o/=2,s/=2,e/=2}function l(b,N){return a===1?b[N]:b.readUInt16BE(N*a)}var p;if(i){var f=-1;for(p=e;p<o;p++)if(l(t,p)===l(r,f===-1?0:p-f)){if(f===-1&&(f=p),p-f+1===s)return f*a}else f!==-1&&(p-=p-f),f=-1}else for(e+s>o&&(e=o-s),p=e;p>=0;p--){for(var c=!0,E=0;E<s;E++)if(l(t,p+E)!==l(r,E)){c=!1;break}if(c)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 er(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return er(this,r,e,n,!1)};function Xr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(r.substr(o*2,2),16);if(isNaN(s))return o;t[e+o]=s}return o}function qr(t,r,e,n){return M(O(r,t.length-e),t,e,n)}function tr(t,r,e,n){return M(le(r),t,e,n)}function $r(t,r,e,n){return tr(t,r,e,n)}function Zr(t,r,e,n){return M(ur(r),t,e,n)}function Qr(t,r,e,n){return M(ce(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 a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Xr(this,r,e,n);case"utf8":case"utf-8":return qr(this,r,e,n);case"ascii":return tr(this,r,e,n);case"latin1":case"binary":return $r(this,r,e,n);case"base64":return Zr(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qr(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jr(t,r,e){return r===0&&e===t.length?X(t):X(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=e){var l,p,f,c;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],(l&192)===128&&(c=(a&31)<<6|l&63,c>127&&(o=c));break;case 3:l=t[i+1],p=t[i+2],(l&192)===128&&(p&192)===128&&(c=(a&15)<<12|(l&63)<<6|p&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:l=t[i+1],p=t[i+2],f=t[i+3],(l&192)===128&&(p&192)===128&&(f&192)===128&&(c=(a&15)<<18|(l&63)<<12|(p&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return re(n)}var $=4096;function re(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function ee(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 te(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 ne(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=se(t[a]);return i}function ie(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+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 a=e-r;i=new u(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+r]}return i};function m(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};u.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||m(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||m(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||m(r,4,this.length),L(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),L(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),L(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),L(this,r,!1,52,8)};function h(t,r,e,n,i,a){if(!T(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)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 a=Math.pow(2,8*n)-1;h(this,r,e,n,a,0)}var o=1,s=0;for(this[e]=r&255;++s<n&&(o*=256);)this[e+s]=r/o&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;h(this,r,e,n,a,0)}var o=n-1,s=1;for(this[e+o]=r&255;--o>=0&&(s*=256);)this[e+o]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function B(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(t.length-e,2);i<a;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};function D(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(t.length-e,4);i<a;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):D(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):D(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);h(this,r,e,n,a-1,-a)}var o=0,s=1,l=0;for(this[e]=r&255;++o<n&&(s*=256);)r<0&&l===0&&this[e+o-1]!==0&&(l=1),this[e+o]=(r/s>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);h(this,r,e,n,a-1,-a)}var o=n-1,s=1,l=0;for(this[e+o]=r&255;--o>=0&&(s*=256);)r<0&&l===0&&this[e+o+1]!==0&&(l=1),this[e+o]=(r/s>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):D(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):D(this,r,e,!1),e+4};function ir(t,r,e,n,i,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),lr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function or(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),lr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return or(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 a=i-n,o;if(this===r&&n<e&&e<i)for(o=a-1;o>=0;--o)r[o+e]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)r[o+e]=this[o+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};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 a=r.charCodeAt(0);a<256&&(r=a)}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 o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var s=T(r)?r:O(new u(r,i).toString()),l=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%l]}return this};var ae=/[^+\/0-9A-Za-z-_]/g;function oe(t){if(t=ue(t).replace(ae,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ue(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function se(t){return t<16?"0"+t.toString(16):t.toString(16)}function O(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function le(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ce(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function ur(t){return Fr(oe(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function pe(t){return t!==t}function fe(t){return t!=null&&(!!t._isBuffer||sr(t)||me(t))}function sr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function me(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&sr(t.slice(0,0))}function L(t,r,e,n,i){var a,o,s=i*8-n-1,l=(1<<s)-1,p=l>>1,f=-7,c=e?i-1:0,E=e?-1:1,b=t[r+c];for(c+=E,a=b&(1<<-f)-1,b>>=-f,f+=s;f>0;a=a*256+t[r+c],c+=E,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=o*256+t[r+c],c+=E,f-=8);if(a===0)a=1-p;else{if(a===l)return o?NaN:(b?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-p}return(b?-1:1)*o*Math.pow(2,a-n)}function lr(t,r,e,n,i,a){var o,s,l,p=a*8-i-1,f=(1<<p)-1,c=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:a-1,N=n?1:-1,pr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?r+=E/l:r+=E*Math.pow(2,1-c),r*l>=2&&(o++,l/=2),o+c>=f?(s=0,o=f):o+c>=1?(s=(r*l-1)*Math.pow(2,i),o=o+c):(s=r*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[e+b]=s&255,b+=N,s/=256,i-=8);for(o=o<<i|s,p+=i;p>0;t[e+b]=o&255,b+=N,o/=256,p-=8);t[e+b-N]|=pr*128}var Re=`{"theme1":{"value":"${g.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${g.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${g.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var cr={V1_1:"v1_1",V2:"v2"},ke={[cr.V1_1]:{testnet:62368684,mainnet:552635992},[cr.V2]:{testnet:148607e3,mainnet:1002541853}};var it=t=>{let r={};return t.forEach(({settingId:e,value:n,setting:i})=>{i.type==="boolean"?r[e]=n==="true":r[e]=n}),{discordEnabled:r["point-system.discordEnabled"],telegramBotName:r["point-system.telegramBotName"],telegramBotId:r["point-system.telegramBotId"],telegramEnabled:r["point-system.telegramEnabled"],telegramGroupId:r["point-system.telegramGroupId"],telegramGroupName:r["point-system.telegramGroupName"],twitterAccountId:r["point-system.twitterAccountId"],twitterAccountName:r["point-system.twitterAccountName"],twitterEnabled:r["point-system.twitterEnabled"],twitterJobEnabled:r["point-system.twitterJobEnabled"],guideLink:r["point-system.guideLink"]}};export{it as transformPointSystemSettings};
1
+ function K(){throw new Error("setTimeout has not been defined")}function V(){throw new Error("clearTimeout has not been defined")}var w=K,A=V;typeof globalThis.setTimeout=="function"&&(w=setTimeout);typeof globalThis.clearTimeout=="function"&&(A=clearTimeout);function H(t){if(w===setTimeout)return setTimeout(t,0);if((w===K||!w)&&setTimeout)return w=setTimeout,setTimeout(t,0);try{return w(t,0)}catch{try{return w.call(null,t,0)}catch{return w.call(this,t,0)}}}function fr(t){if(A===clearTimeout)return clearTimeout(t);if((A===V||!A)&&clearTimeout)return A=clearTimeout,clearTimeout(t);try{return A(t)}catch{try{return A.call(null,t)}catch{return A.call(this,t)}}}var x=[],k=!1,I,P=-1;function mr(){!k||!I||(k=!1,I.length?x=I.concat(x):P=-1,x.length&&z())}function z(){if(!k){var t=H(mr);k=!0;for(var r=x.length;r;){for(I=x,x=[];++P<r;)I&&I[P].run();P=-1,r=x.length}I=null,k=!1,fr(t)}}function gr(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];x.push(new J(t,r)),x.length===1&&!k&&H(z)}function J(t,r){this.fun=t,this.array=r}J.prototype.run=function(){this.fun.apply(null,this.array)};var hr="browser",br="browser",dr=!0,Er={},_r=[],Tr="",xr={},yr={},wr={};function R(){}var Ar=R,Ir=R,Rr=R,Sr=R,Nr=R,vr=R,kr=R;function Pr(t){throw new Error("process.binding is not supported")}function Cr(){return"/"}function Or(t){throw new Error("process.chdir is not supported")}function Br(){return 0}var v=globalThis.performance||{},Dr=v.now||v.mozNow||v.msNow||v.oNow||v.webkitNow||function(){return new Date().getTime()};function Mr(t){var r=Dr.call(v)*.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 Lr=new Date;function Ur(){var t=new Date,r=t-Lr;return r/1e3}var g={nextTick:gr,title:hr,browser:dr,env:Er,argv:_r,version:Tr,versions:xr,on:Ar,addListener:Ir,once:Rr,off:Sr,removeListener:Nr,removeAllListeners:vr,emit:kr,binding:Pr,cwd:Cr,chdir:Or,umask:Br,hrtime:Mr,platform:br,release:yr,config:wr,uptime:Ur},G={};Object.keys(G).forEach(t=>{let r=t.split("."),e=g;for(let n=0;n<r.length;n++){let i=r[n];n===r.length-1?e[i]=G[t]:e=e[i]||(e[i]={})}});var _=[],d=[],Yr=typeof Uint8Array<"u"?Uint8Array:Array,Y=!1;function Z(){Y=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,e=t.length;r<e;++r)_[r]=t[r],d[t.charCodeAt(r)]=r;d[45]=62,d[95]=63}function Fr(t){Y||Z();var r,e,n,i,a,o,s=t.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=t[s-2]==="="?2:t[s-1]==="="?1:0,o=new Yr(s*3/4-a),n=a>0?s-4:s;var l=0;for(r=0,e=0;r<n;r+=4,e+=3)i=d[t.charCodeAt(r)]<<18|d[t.charCodeAt(r+1)]<<12|d[t.charCodeAt(r+2)]<<6|d[t.charCodeAt(r+3)],o[l++]=i>>16&255,o[l++]=i>>8&255,o[l++]=i&255;return a===2?(i=d[t.charCodeAt(r)]<<2|d[t.charCodeAt(r+1)]>>4,o[l++]=i&255):a===1&&(i=d[t.charCodeAt(r)]<<10|d[t.charCodeAt(r+1)]<<4|d[t.charCodeAt(r+2)]>>2,o[l++]=i>>8&255,o[l++]=i&255),o}function Wr(t){return _[t>>18&63]+_[t>>12&63]+_[t>>6&63]+_[t&63]}function Gr(t,r,e){for(var n,i=[],a=r;a<e;a+=3)n=(t[a]<<16)+(t[a+1]<<8)+t[a+2],i.push(Wr(n));return i.join("")}function X(t){Y||Z();for(var r,e=t.length,n=e%3,i="",a=[],o=16383,s=0,l=e-n;s<l;s+=o)a.push(Gr(t,s,s+o>l?l:s+o));return n===1?(r=t[e-1],i+=_[r>>2],i+=_[r<<4&63],i+="=="):n===2&&(r=(t[e-2]<<8)+t[e-1],i+=_[r>>10],i+=_[r>>4&63],i+=_[r<<2&63],i+="="),a.push(i),a.join("")}u.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function C(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,r){if(C()<r)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=u.prototype):(t===null&&(t=new u(r)),t.length=r),t}function u(t,r,e){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,r,e);if(typeof t=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return F(this,t)}return Q(this,t,r,e)}u.poolSize=8192;u._augment=function(t){return t.__proto__=u.prototype,t};function Q(t,r,e,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Hr(t,r,e,n):typeof r=="string"?Vr(t,r,e):zr(t,r)}u.from=function(t,r,e){return Q(null,t,r,e)};u.kMaxLength=C();u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&u[Symbol.species]);function j(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Kr(t,r,e,n){return j(r),r<=0?y(t,r):e!==void 0?typeof n=="string"?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}u.alloc=function(t,r,e){return Kr(null,t,r,e)};function F(t,r){if(j(r),t=y(t,r<0?0:W(r)|0),!u.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}u.allocUnsafe=function(t){return F(null,t)};u.allocUnsafeSlow=function(t){return F(null,t)};function Vr(t,r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=rr(r,e)|0;t=y(t,n);var i=t.write(r,e);return i!==n&&(t=t.slice(0,i)),t}function U(t,r){var e=r.length<0?0:W(r.length)|0;t=y(t,e);for(var n=0;n<e;n+=1)t[n]=r[n]&255;return t}function Hr(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return e===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,e):r=new Uint8Array(r,e,n),u.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=u.prototype):t=U(t,r),t}function zr(t,r){if(T(r)){var e=W(r.length)|0;return t=y(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"||pe(r.length)?y(t,0):U(t,r);if(r.type==="Buffer"&&Array.isArray(r.data))return U(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function W(t){if(t>=C())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C().toString(16)+" bytes");return t|0}u.isBuffer=fe;function T(t){return!!(t!=null&&t._isBuffer)}u.compare=function(r,e){if(!T(r)||!T(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,a=0,o=Math.min(n,i);a<o;++a)if(r[a]!==e[a]){n=r[a],i=e[a];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),a=0;for(n=0;n<r.length;++n){var o=r[n];if(!T(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function rr(t,r){if(T(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 O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return ur(t).length;default:if(n)return O(t).length;r=(""+r).toLowerCase(),n=!0}}u.byteLength=rr;function Jr(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 ne(this,r,e);case"utf8":case"utf-8":return nr(this,r,e);case"ascii":return ee(this,r,e);case"latin1":case"binary":return te(this,r,e);case"base64":return jr(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}u.prototype._isBuffer=!0;function S(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)S(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)S(this,e,e+3),S(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)S(this,e,e+7),S(this,e+1,e+6),S(this,e+2,e+5),S(this,e+3,e+4);return this};u.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?nr(this,0,r):Jr.apply(this,arguments)};u.prototype.equals=function(r){if(!T(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,a){if(!T(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),a===void 0&&(a=this.length),e<0||n>r.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&e>=n)return 0;if(i>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,a>>>=0,this===r)return 0;for(var o=a-i,s=n-e,l=Math.min(o,s),p=this.slice(i,a),f=r.slice(e,n),c=0;c<l;++c)if(p[c]!==f[c]){o=p[c],s=f[c];break}return o<s?-1:s<o?1:0};function er(t,r,e,n,i){if(t.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof r=="string"&&(r=u.from(r,n)),T(r))return r.length===0?-1:q(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):q(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function q(t,r,e,n,i){var a=1,o=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;a=2,o/=2,s/=2,e/=2}function l(b,N){return a===1?b[N]:b.readUInt16BE(N*a)}var p;if(i){var f=-1;for(p=e;p<o;p++)if(l(t,p)===l(r,f===-1?0:p-f)){if(f===-1&&(f=p),p-f+1===s)return f*a}else f!==-1&&(p-=p-f),f=-1}else for(e+s>o&&(e=o-s),p=e;p>=0;p--){for(var c=!0,E=0;E<s;E++)if(l(t,p+E)!==l(r,E)){c=!1;break}if(c)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 er(this,r,e,n,!0)};u.prototype.lastIndexOf=function(r,e,n){return er(this,r,e,n,!1)};function Xr(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;var a=r.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(r.substr(o*2,2),16);if(isNaN(s))return o;t[e+o]=s}return o}function qr(t,r,e,n){return M(O(r,t.length-e),t,e,n)}function tr(t,r,e,n){return M(le(r),t,e,n)}function $r(t,r,e,n){return tr(t,r,e,n)}function Zr(t,r,e,n){return M(ur(r),t,e,n)}function Qr(t,r,e,n){return M(ce(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 a=this.length-e;if((n===void 0||n>a)&&(n=a),r.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Xr(this,r,e,n);case"utf8":case"utf-8":return qr(this,r,e,n);case"ascii":return tr(this,r,e,n);case"latin1":case"binary":return $r(this,r,e,n);case"base64":return Zr(this,r,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qr(this,r,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function jr(t,r,e){return r===0&&e===t.length?X(t):X(t.slice(r,e))}function nr(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=e){var l,p,f,c;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],(l&192)===128&&(c=(a&31)<<6|l&63,c>127&&(o=c));break;case 3:l=t[i+1],p=t[i+2],(l&192)===128&&(p&192)===128&&(c=(a&15)<<12|(l&63)<<6|p&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:l=t[i+1],p=t[i+2],f=t[i+3],(l&192)===128&&(p&192)===128&&(f&192)===128&&(c=(a&15)<<18|(l&63)<<12|(p&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return re(n)}var $=4096;function re(t){var r=t.length;if(r<=$)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=$));return e}function ee(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 te(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 ne(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",a=r;a<e;++a)i+=se(t[a]);return i}function ie(t,r,e){for(var n=t.slice(r,e),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+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 a=e-r;i=new u(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+r]}return i};function m(t,r,e){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return i};u.prototype.readUIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r+--e],a=1;e>0&&(a*=256);)i+=this[r+--e]*a;return i};u.prototype.readUInt8=function(r,e){return e||m(r,1,this.length),this[r]};u.prototype.readUInt16LE=function(r,e){return e||m(r,2,this.length),this[r]|this[r+1]<<8};u.prototype.readUInt16BE=function(r,e){return e||m(r,2,this.length),this[r]<<8|this[r+1]};u.prototype.readUInt32LE=function(r,e){return e||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};u.prototype.readUInt32BE=function(r,e){return e||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};u.prototype.readIntLE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=this[r],a=1,o=0;++o<e&&(a*=256);)i+=this[r+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*e)),i};u.prototype.readIntBE=function(r,e,n){r=r|0,e=e|0,n||m(r,e,this.length);for(var i=e,a=1,o=this[r+--i];i>0&&(a*=256);)o+=this[r+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*e)),o};u.prototype.readInt8=function(r,e){return e||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};u.prototype.readInt16LE=function(r,e){e||m(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function(r,e){e||m(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function(r,e){return e||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};u.prototype.readInt32BE=function(r,e){return e||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};u.prototype.readFloatLE=function(r,e){return e||m(r,4,this.length),L(this,r,!0,23,4)};u.prototype.readFloatBE=function(r,e){return e||m(r,4,this.length),L(this,r,!1,23,4)};u.prototype.readDoubleLE=function(r,e){return e||m(r,8,this.length),L(this,r,!0,52,8)};u.prototype.readDoubleBE=function(r,e){return e||m(r,8,this.length),L(this,r,!1,52,8)};function h(t,r,e,n,i,a){if(!T(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<a)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 a=Math.pow(2,8*n)-1;h(this,r,e,n,a,0)}var o=1,s=0;for(this[e]=r&255;++s<n&&(o*=256);)this[e+s]=r/o&255;return e+n};u.prototype.writeUIntBE=function(r,e,n,i){if(r=+r,e=e|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;h(this,r,e,n,a,0)}var o=n-1,s=1;for(this[e+o]=r&255;--o>=0&&(s*=256);)this[e+o]=r/s&255;return e+n};u.prototype.writeUInt8=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=r&255,e+1};function B(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,a=Math.min(t.length-e,2);i<a;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}u.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};u.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};function D(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,a=Math.min(t.length-e,4);i<a;++i)t[e+i]=r>>>(n?i:3-i)*8&255}u.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=r&255):D(this,r,e,!0),e+4};u.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):D(this,r,e,!1),e+4};u.prototype.writeIntLE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);h(this,r,e,n,a-1,-a)}var o=0,s=1,l=0;for(this[e]=r&255;++o<n&&(s*=256);)r<0&&l===0&&this[e+o-1]!==0&&(l=1),this[e+o]=(r/s>>0)-l&255;return e+n};u.prototype.writeIntBE=function(r,e,n,i){if(r=+r,e=e|0,!i){var a=Math.pow(2,8*n-1);h(this,r,e,n,a-1,-a)}var o=n-1,s=1,l=0;for(this[e+o]=r&255;--o>=0&&(s*=256);)r<0&&l===0&&this[e+o+1]!==0&&(l=1),this[e+o]=(r/s>>0)-l&255;return e+n};u.prototype.writeInt8=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=r&255,e+1};u.prototype.writeInt16LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8):B(this,r,e,!0),e+2};u.prototype.writeInt16BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=r&255):B(this,r,e,!1),e+2};u.prototype.writeInt32LE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=r&255,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):D(this,r,e,!0),e+4};u.prototype.writeInt32BE=function(r,e,n){return r=+r,e=e|0,n||h(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),u.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=r&255):D(this,r,e,!1),e+4};function ir(t,r,e,n,i,a){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ar(t,r,e,n,i){return i||ir(t,r,e,4,34028234663852886e22,-34028234663852886e22),lr(t,r,e,n,23,4),e+4}u.prototype.writeFloatLE=function(r,e,n){return ar(this,r,e,!0,n)};u.prototype.writeFloatBE=function(r,e,n){return ar(this,r,e,!1,n)};function or(t,r,e,n,i){return i||ir(t,r,e,8,17976931348623157e292,-17976931348623157e292),lr(t,r,e,n,52,8),e+8}u.prototype.writeDoubleLE=function(r,e,n){return or(this,r,e,!0,n)};u.prototype.writeDoubleBE=function(r,e,n){return or(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 a=i-n,o;if(this===r&&n<e&&e<i)for(o=a-1;o>=0;--o)r[o+e]=this[o+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)r[o+e]=this[o+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+a),e);return a};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 a=r.charCodeAt(0);a<256&&(r=a)}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 o;if(typeof r=="number")for(o=e;o<n;++o)this[o]=r;else{var s=T(r)?r:O(new u(r,i).toString()),l=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%l]}return this};var ae=/[^+\/0-9A-Za-z-_]/g;function oe(t){if(t=ue(t).replace(ae,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function ue(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function se(t){return t<16?"0"+t.toString(16):t.toString(16)}function O(t,r){r=r||1/0;for(var e,n=t.length,i=null,a=[],o=0;o<n;++o){if(e=t.charCodeAt(o),e>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(r-=3)>-1&&a.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&a.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&a.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;a.push(e)}else if(e<2048){if((r-=2)<0)break;a.push(e>>6|192,e&63|128)}else if(e<65536){if((r-=3)<0)break;a.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((r-=4)<0)break;a.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return a}function le(t){for(var r=[],e=0;e<t.length;++e)r.push(t.charCodeAt(e)&255);return r}function ce(t,r){for(var e,n,i,a=[],o=0;o<t.length&&!((r-=2)<0);++o)e=t.charCodeAt(o),n=e>>8,i=e%256,a.push(i),a.push(n);return a}function ur(t){return Fr(oe(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function pe(t){return t!==t}function fe(t){return t!=null&&(!!t._isBuffer||sr(t)||me(t))}function sr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function me(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&sr(t.slice(0,0))}function L(t,r,e,n,i){var a,o,s=i*8-n-1,l=(1<<s)-1,p=l>>1,f=-7,c=e?i-1:0,E=e?-1:1,b=t[r+c];for(c+=E,a=b&(1<<-f)-1,b>>=-f,f+=s;f>0;a=a*256+t[r+c],c+=E,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=o*256+t[r+c],c+=E,f-=8);if(a===0)a=1-p;else{if(a===l)return o?NaN:(b?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-p}return(b?-1:1)*o*Math.pow(2,a-n)}function lr(t,r,e,n,i,a){var o,s,l,p=a*8-i-1,f=(1<<p)-1,c=f>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:a-1,N=n?1:-1,pr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?r+=E/l:r+=E*Math.pow(2,1-c),r*l>=2&&(o++,l/=2),o+c>=f?(s=0,o=f):o+c>=1?(s=(r*l-1)*Math.pow(2,i),o=o+c):(s=r*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[e+b]=s&255,b+=N,s/=256,i-=8);for(o=o<<i|s,p+=i;p>0;t[e+b]=o&255,b+=N,o/=256,p-=8);t[e+b-N]|=pr*128}var Re=`{"theme1":{"value":"${g.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${g.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${g.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var cr={V1_1:"v1_1",V2:"v2"},ke={[cr.V1_1]:{testnet:62368684,mainnet:552635992},[cr.V2]:{testnet:148607e3,mainnet:1002541853}};var it=t=>{let r={};return t.forEach(({settingId:e,value:n,setting:i})=>{i.type==="boolean"?r[e]=n==="true":r[e]=n}),{discordEnabled:r["point-system.discordEnabled"],telegramBotName:r["point-system.telegramBotName"],telegramBotId:r["point-system.telegramBotId"],telegramEnabled:r["point-system.telegramEnabled"],telegramGroupId:r["point-system.telegramGroupId"],telegramGroupName:r["point-system.telegramGroupName"],twitterAccountId:r["point-system.twitterAccountId"],twitterAccountName:r["point-system.twitterAccountName"],twitterEnabled:r["point-system.twitterEnabled"],twitterJobEnabled:r["point-system.twitterJobEnabled"],guideLink:r["point-system.guideLink"]}};export{it as transformPointSystemSettings};
2
2
  /*! Bundled license information:
3
3
 
4
4
  @esbuild-plugins/node-globals-polyfill/Buffer.js:
@@ -1,5 +1,5 @@
1
- function Oe(){throw new Error("setTimeout has not been defined")}function Ne(){throw new Error("clearTimeout has not been defined")}var U=Oe,M=Ne;typeof globalThis.setTimeout=="function"&&(U=setTimeout);typeof globalThis.clearTimeout=="function"&&(M=clearTimeout);function ke(t){if(U===setTimeout)return setTimeout(t,0);if((U===Oe||!U)&&setTimeout)return U=setTimeout,setTimeout(t,0);try{return U(t,0)}catch{try{return U.call(null,t,0)}catch{return U.call(this,t,0)}}}function Nr(t){if(M===clearTimeout)return clearTimeout(t);if((M===Ne||!M)&&clearTimeout)return M=clearTimeout,clearTimeout(t);try{return M(t)}catch{try{return M.call(null,t)}catch{return M.call(this,t)}}}var N=[],H=!1,v,j=-1;function kr(){!H||!v||(H=!1,v.length?N=v.concat(N):j=-1,N.length&&Pe())}function Pe(){if(!H){var t=ke(kr);H=!0;for(var e=N.length;e;){for(v=N,N=[];++j<e;)v&&v[j].run();j=-1,e=N.length}v=null,H=!1,Nr(t)}}function Pr(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];N.push(new Be(t,e)),N.length===1&&!H&&ke(Pe)}function Be(t,e){this.fun=t,this.array=e}Be.prototype.run=function(){this.fun.apply(null,this.array)};var Br="browser",Ur="browser",Mr=!0,Lr={},vr=[],Fr="",Wr={},Yr={},Gr={};function F(){}var Kr=F,Hr=F,Vr=F,$r=F,zr=F,Xr=F,qr=F;function Jr(t){throw new Error("process.binding is not supported")}function jr(){return"/"}function Qr(t){throw new Error("process.chdir is not supported")}function Zr(){return 0}var K=globalThis.performance||{},et=K.now||K.mozNow||K.msNow||K.oNow||K.webkitNow||function(){return new Date().getTime()};function rt(t){var e=et.call(K)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var tt=new Date;function nt(){var t=new Date,e=t-tt;return e/1e3}var c={nextTick:Pr,title:Br,browser:Mr,env:Lr,argv:vr,version:Fr,versions:Wr,on:Kr,addListener:Hr,once:Vr,off:$r,removeListener:zr,removeAllListeners:Xr,emit:qr,binding:Jr,cwd:jr,chdir:Qr,umask:Zr,hrtime:rt,platform:Ur,release:Yr,config:Gr,uptime:nt},Re={};Object.keys(Re).forEach(t=>{let e=t.split("."),r=c;for(let n=0;n<e.length;n++){let o=e[n];n===e.length-1?r[o]=Re[t]:r=r[o]||(r[o]={})}});var D=[],_=[],ot=typeof Uint8Array<"u"?Uint8Array:Array,le=!1;function ve(){le=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)D[e]=t[e],_[t.charCodeAt(e)]=e;_[45]=62,_[95]=63}function it(t){le||ve();var e,r,n,o,i,a,u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[u-2]==="="?2:t[u-1]==="="?1:0,a=new ot(u*3/4-i),n=i>0?u-4:u;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)o=_[t.charCodeAt(e)]<<18|_[t.charCodeAt(e+1)]<<12|_[t.charCodeAt(e+2)]<<6|_[t.charCodeAt(e+3)],a[d++]=o>>16&255,a[d++]=o>>8&255,a[d++]=o&255;return i===2?(o=_[t.charCodeAt(e)]<<2|_[t.charCodeAt(e+1)]>>4,a[d++]=o&255):i===1&&(o=_[t.charCodeAt(e)]<<10|_[t.charCodeAt(e+1)]<<4|_[t.charCodeAt(e+2)]>>2,a[d++]=o>>8&255,a[d++]=o&255),a}function at(t){return D[t>>18&63]+D[t>>12&63]+D[t>>6&63]+D[t&63]}function st(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(at(n));return o.join("")}function Ue(t){le||ve();for(var e,r=t.length,n=r%3,o="",i=[],a=16383,u=0,d=r-n;u<d;u+=a)i.push(st(t,u,u+a>d?d:u+a));return n===1?(e=t[r-1],o+=D[e>>2],o+=D[e<<4&63],o+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],o+=D[e>>10],o+=D[e>>4&63],o+=D[e<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Q(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(t,e){if(Q()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=s.prototype):(t===null&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return ge(this,t)}return Fe(this,t,e,r)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function Fe(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?pt(t,e,r,n):typeof e=="string"?ut(t,e,r):dt(t,e)}s.from=function(t,e,r){return Fe(null,t,e,r)};s.kMaxLength=Q();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function We(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ct(t,e,r,n){return We(e),e<=0?k(t,e):r!==void 0?typeof n=="string"?k(t,e).fill(r,n):k(t,e).fill(r):k(t,e)}s.alloc=function(t,e,r){return ct(null,t,e,r)};function ge(t,e){if(We(e),t=k(t,e<0?0:fe(e)|0),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}s.allocUnsafe=function(t){return ge(null,t)};s.allocUnsafeSlow=function(t){return ge(null,t)};function ut(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=Ye(e,r)|0;t=k(t,n);var o=t.write(e,r);return o!==n&&(t=t.slice(0,o)),t}function me(t,e){var r=e.length<0?0:fe(e.length)|0;t=k(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function pt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=s.prototype):t=me(t,e),t}function dt(t,e){if(w(e)){var r=fe(e.length)|0;return t=k(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Ot(e.length)?k(t,0):me(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return me(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function fe(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}s.isBuffer=Nt;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(e,r){if(!w(e)||!w(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,a=Math.min(n,o);i<a;++i)if(e[i]!==r[i]){n=e[i],o=r[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var o=s.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Ye(t,e){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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Xe(t).length;default:if(n)return Z(t).length;e=(""+e).toLowerCase(),n=!0}}s.byteLength=Ye;function mt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Tt(this,e,r);case"utf8":case"utf-8":return He(this,e,r);case"ascii":return It(this,e,r);case"latin1":case"binary":return yt(this,e,r);case"base64":return ht(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Et(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function W(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)W(this,r,r+1);return this};s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)W(this,r,r+3),W(this,r+1,r+2);return this};s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)W(this,r,r+7),W(this,r+1,r+6),W(this,r+2,r+5),W(this,r+3,r+4);return this};s.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?He(this,0,e):mt.apply(this,arguments)};s.prototype.equals=function(e){if(!w(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.compare=function(e,r,n,o,i){if(!w(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,u=n-r,d=Math.min(a,u),l=this.slice(o,i),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],u=g[m];break}return a<u?-1:u<a?1:0};function Ge(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),w(e))return e.length===0?-1:Me(t,e,r,n,o);if(typeof e=="number")return e=e&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Me(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Me(t,e,r,n,o){var i=1,a=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,u/=2,r/=2}function d(f,I){return i===1?f[I]:f.readUInt16BE(I*i)}var l;if(o){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===u)return g*i}else g!==-1&&(l-=l-g),g=-1}else for(r+u>a&&(r=a-u),l=r;l>=0;l--){for(var m=!0,b=0;b<u;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return Ge(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return Ge(this,e,r,n,!1)};function lt(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(a*2,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function gt(t,e,r,n){return te(Z(e,t.length-r),t,r,n)}function Ke(t,e,r,n){return te(wt(e),t,r,n)}function ft(t,e,r,n){return Ke(t,e,r,n)}function bt(t,e,r,n){return te(Xe(e),t,r,n)}function xt(t,e,r,n){return te(Rt(e,t.length-r),t,r,n)}s.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return lt(this,e,r,n);case"utf8":case"utf-8":return gt(this,e,r,n);case"ascii":return Ke(this,e,r,n);case"latin1":case"binary":return ft(this,e,r,n);case"base64":return bt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ht(t,e,r){return e===0&&r===t.length?Ue(t):Ue(t.slice(e,r))}function He(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u<=r){var d,l,g,m;switch(u){case 1:i<128&&(a=i);break;case 2:d=t[o+1],(d&192)===128&&(m=(i&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[o+1],l=t[o+2],(d&192)===128&&(l&192)===128&&(m=(i&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[o+1],l=t[o+2],g=t[o+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(i&15)<<18|(d&63)<<12|(l&63)<<6|g&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=u}return At(n)}var Le=4096;function At(t){var e=t.length;if(e<=Le)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Le));return r}function It(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function yt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function Tt(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=Dt(t[i]);return o}function Et(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(e,r),o.__proto__=s.prototype;else{var i=r-e;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+e]}return o};function x(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return o};s.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e+--r],i=1;r>0&&(i*=256);)o+=this[e+--r]*i;return o};s.prototype.readUInt8=function(e,r){return r||x(e,1,this.length),this[e]};s.prototype.readUInt16LE=function(e,r){return r||x(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUInt16BE=function(e,r){return r||x(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUInt32LE=function(e,r){return r||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUInt32BE=function(e,r){return r||x(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};s.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=r,i=1,a=this[e+--o];o>0&&(i*=256);)a+=this[e+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};s.prototype.readInt8=function(e,r){return r||x(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){r||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){r||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return r||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return r||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,r){return r||x(e,4,this.length),ne(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return r||x(e,4,this.length),ne(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return r||x(e,8,this.length),ne(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return r||x(e,8,this.length),ne(this,e,!1,52,8)};function y(t,e,r,n,o,i){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;y(this,e,r,n,i,0)}var a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};s.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;y(this,e,r,n,i,0)}var a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function ee(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};function re(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):re(this,e,r,!0),r+4};s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};s.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);y(this,e,r,n,i-1,-i)}var a=0,u=1,d=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};s.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);y(this,e,r,n,i-1,-i)}var a=n-1,u=1,d=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):re(this,e,r,!0),r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};function Ve(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $e(t,e,r,n,o){return o||Ve(t,e,r,4,34028234663852886e22,-34028234663852886e22),Je(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return $e(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return $e(this,e,r,!1,n)};function ze(t,e,r,n,o){return o||Ve(t,e,r,8,17976931348623157e292,-17976931348623157e292),Je(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return ze(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return ze(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);var i=o-n,a;if(this===e&&n<r&&r<o)for(a=i-1;a>=0;--a)e[a+r]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),r);return i};s.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var u=w(e)?e:Z(new s(e,o).toString()),d=u.length;for(a=0;a<n-r;++a)this[a+r]=u[a%d]}return this};var _t=/[^+\/0-9A-Za-z-_]/g;function St(t){if(t=Ct(t).replace(_t,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ct(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Dt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function wt(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Rt(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function Xe(t){return it(St(t))}function te(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function Ot(t){return t!==t}function Nt(t){return t!=null&&(!!t._isBuffer||qe(t)||kt(t))}function qe(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function kt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&qe(t.slice(0,0))}function ne(t,e,r,n,o){var i,a,u=o*8-n-1,d=(1<<u)-1,l=d>>1,g=-7,m=r?o-1:0,b=r?-1:1,f=t[e+m];for(m+=b,i=f&(1<<-g)-1,f>>=-g,g+=u;g>0;i=i*256+t[e+m],m+=b,g-=8);for(a=i&(1<<-g)-1,i>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(i===0)i=1-l;else{if(i===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-l}return(f?-1:1)*a*Math.pow(2,i-n)}function Je(t,e,r,n,o,i){var a,u,d,l=i*8-o-1,g=(1<<l)-1,m=g>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,I=n?1:-1,q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(u=0,a=g):a+m>=1?(u=(e*d-1)*Math.pow(2,o),a=a+m):(u=e*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[r+f]=u&255,f+=I,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+f]=a&255,f+=I,a/=256,l-=8);t[r+f-I]|=q*128}import{PublicKey as X}from"@solana/web3.js";var V={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};import gp from"algosdk";import*as wr from"bs58";import fn from"algosdk";import oo,{decodeAddress as io,encodeAddress as ao}from"algosdk";var R=[],S=[],Pt=typeof Uint8Array<"u"?Uint8Array:Array,xe=!1;function er(){xe=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)R[e]=t[e],S[t.charCodeAt(e)]=e;S[45]=62,S[95]=63}function Bt(t){xe||er();var e,r,n,o,i,a,u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[u-2]==="="?2:t[u-1]==="="?1:0,a=new Pt(u*3/4-i),n=i>0?u-4:u;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)o=S[t.charCodeAt(e)]<<18|S[t.charCodeAt(e+1)]<<12|S[t.charCodeAt(e+2)]<<6|S[t.charCodeAt(e+3)],a[d++]=o>>16&255,a[d++]=o>>8&255,a[d++]=o&255;return i===2?(o=S[t.charCodeAt(e)]<<2|S[t.charCodeAt(e+1)]>>4,a[d++]=o&255):i===1&&(o=S[t.charCodeAt(e)]<<10|S[t.charCodeAt(e+1)]<<4|S[t.charCodeAt(e+2)]>>2,a[d++]=o>>8&255,a[d++]=o&255),a}function Ut(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Mt(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(Ut(n));return o.join("")}function je(t){xe||er();for(var e,r=t.length,n=r%3,o="",i=[],a=16383,u=0,d=r-n;u<d;u+=a)i.push(Mt(t,u,u+a>d?d:u+a));return n===1?(e=t[r-1],o+=R[e>>2],o+=R[e<<4&63],o+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],o+=R[e>>10],o+=R[e>>4&63],o+=R[e<<2&63],o+="="),i.push(o),i.join("")}function ae(t,e,r,n,o){var i,a,u=o*8-n-1,d=(1<<u)-1,l=d>>1,g=-7,m=r?o-1:0,b=r?-1:1,f=t[e+m];for(m+=b,i=f&(1<<-g)-1,f>>=-g,g+=u;g>0;i=i*256+t[e+m],m+=b,g-=8);for(a=i&(1<<-g)-1,i>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(i===0)i=1-l;else{if(i===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-l}return(f?-1:1)*a*Math.pow(2,i-n)}function rr(t,e,r,n,o,i){var a,u,d,l=i*8-o-1,g=(1<<l)-1,m=g>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,I=n?1:-1,q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(u=0,a=g):a+m>=1?(u=(e*d-1)*Math.pow(2,o),a=a+m):(u=e*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[r+f]=u&255,f+=I,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+f]=a&255,f+=I,a/=256,l-=8);t[r+f-I]|=q*128}var Lt={}.toString,tr=Array.isArray||function(t){return Lt.call(t)=="[object Array]"};var vt=50;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Zn=oe();function oe(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function P(t,e){if(oe()<e)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=p.prototype):(t===null&&(t=new p(e)),t.length=e),t}function p(t,e,r){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return he(this,t)}return nr(this,t,e,r)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function nr(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Yt(t,e,r,n):typeof e=="string"?Wt(t,e,r):Gt(t,e)}p.from=function(t,e,r){return nr(null,t,e,r)};p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__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 Ft(t,e,r,n){return or(e),e<=0?P(t,e):r!==void 0?typeof n=="string"?P(t,e).fill(r,n):P(t,e).fill(r):P(t,e)}p.alloc=function(t,e,r){return Ft(null,t,e,r)};function he(t,e){if(or(e),t=P(t,e<0?0:Ae(e)|0),!p.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}p.allocUnsafe=function(t){return he(null,t)};p.allocUnsafeSlow=function(t){return he(null,t)};function Wt(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!p.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=ir(e,r)|0;t=P(t,n);var o=t.write(e,r);return o!==n&&(t=t.slice(0,o)),t}function be(t,e){var r=e.length<0?0:Ae(e.length)|0;t=P(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Yt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),p.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=p.prototype):t=be(t,e),t}function Gt(t,e){if(O(e)){var r=Ae(e.length)|0;return t=P(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||cn(e.length)?P(t,0):be(t,e);if(e.type==="Buffer"&&tr(e.data))return be(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ae(t){if(t>=oe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe().toString(16)+" bytes");return t|0}p.isBuffer=un;function O(t){return!!(t!=null&&t._isBuffer)}p.compare=function(e,r){if(!O(e)||!O(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,a=Math.min(n,o);i<a;++i)if(e[i]!==r[i]){n=e[i],o=r[i];break}return n<o?-1:o<n?1:0};p.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};p.concat=function(e,r){if(!tr(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var o=p.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!O(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function ir(t,e){if(O(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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ie(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mr(t).length;default:if(n)return ie(t).length;e=(""+e).toLowerCase(),n=!0}}p.byteLength=ir;function Kt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zt(this,e,r);case"utf8":case"utf-8":return cr(this,e,r);case"ascii":return jt(this,e,r);case"latin1":case"binary":return Qt(this,e,r);case"base64":return qt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return en(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function Y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}p.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Y(this,r,r+1);return this};p.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Y(this,r,r+3),Y(this,r+1,r+2);return this};p.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Y(this,r,r+7),Y(this,r+1,r+6),Y(this,r+2,r+5),Y(this,r+3,r+4);return this};p.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?cr(this,0,e):Kt.apply(this,arguments)};p.prototype.equals=function(e){if(!O(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){var e="",r=vt;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"};p.prototype.compare=function(e,r,n,o,i){if(!O(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,u=n-r,d=Math.min(a,u),l=this.slice(o,i),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],u=g[m];break}return a<u?-1:u<a?1:0};function ar(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,n)),O(e))return e.length===0?-1:Qe(t,e,r,n,o);if(typeof e=="number")return e=e&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Qe(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Qe(t,e,r,n,o){var i=1,a=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,u/=2,r/=2}function d(f,I){return i===1?f[I]:f.readUInt16BE(I*i)}var l;if(o){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===u)return g*i}else g!==-1&&(l-=l-g),g=-1}else for(r+u>a&&(r=a-u),l=r;l>=0;l--){for(var m=!0,b=0;b<u;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}p.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};p.prototype.indexOf=function(e,r,n){return ar(this,e,r,n,!0)};p.prototype.lastIndexOf=function(e,r,n){return ar(this,e,r,n,!1)};function Ht(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(a*2,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function Vt(t,e,r,n){return ue(ie(e,t.length-r),t,r,n)}function sr(t,e,r,n){return ue(an(e),t,r,n)}function $t(t,e,r,n){return sr(t,e,r,n)}function zt(t,e,r,n){return ue(mr(e),t,r,n)}function Xt(t,e,r,n){return ue(sn(e,t.length-r),t,r,n)}p.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Ht(this,e,r,n);case"utf8":case"utf-8":return Vt(this,e,r,n);case"ascii":return sr(this,e,r,n);case"latin1":case"binary":return $t(this,e,r,n);case"base64":return zt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xt(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qt(t,e,r){return e===0&&r===t.length?je(t):je(t.slice(e,r))}function cr(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u<=r){var d,l,g,m;switch(u){case 1:i<128&&(a=i);break;case 2:d=t[o+1],(d&192)===128&&(m=(i&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[o+1],l=t[o+2],(d&192)===128&&(l&192)===128&&(m=(i&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[o+1],l=t[o+2],g=t[o+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(i&15)<<18|(d&63)<<12|(l&63)<<6|g&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=u}return Jt(n)}var Ze=4096;function Jt(t){var e=t.length;if(e<=Ze)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Ze));return r}function jt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function Qt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function Zt(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=on(t[i]);return o}function en(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}p.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var o;if(p.TYPED_ARRAY_SUPPORT)o=this.subarray(e,r),o.__proto__=p.prototype;else{var i=r-e;o=new p(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+e]}return o};function h(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return o};p.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e+--r],i=1;r>0&&(i*=256);)o+=this[e+--r]*i;return o};p.prototype.readUInt8=function(e,r){return r||h(e,1,this.length),this[e]};p.prototype.readUInt16LE=function(e,r){return r||h(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUInt16BE=function(e,r){return r||h(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUInt32LE=function(e,r){return r||h(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUInt32BE=function(e,r){return r||h(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};p.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=r,i=1,a=this[e+--o];o>0&&(i*=256);)a+=this[e+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};p.prototype.readInt8=function(e,r){return r||h(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){r||h(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(e,r){r||h(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(e,r){return r||h(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return r||h(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readFloatLE=function(e,r){return r||h(e,4,this.length),ae(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return r||h(e,4,this.length),ae(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return r||h(e,8,this.length),ae(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return r||h(e,8,this.length),ae(this,e,!1,52,8)};function T(t,e,r,n,o,i){if(!O(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}p.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,e,r,n,i,0)}var a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};p.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,e,r,n,i,0)}var a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};p.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function se(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}p.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};function ce(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>(n?o:3-o)*8&255}p.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):ce(this,e,r,!0),r+4};p.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};p.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);T(this,e,r,n,i-1,-i)}var a=0,u=1,d=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};p.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);T(this,e,r,n,i-1,-i)}var a=n-1,u=1,d=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};p.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};p.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):ce(this,e,r,!0),r+4};p.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};function ur(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function pr(t,e,r,n,o){return o||ur(t,e,r,4),rr(t,e,r,n,23,4),r+4}p.prototype.writeFloatLE=function(e,r,n){return pr(this,e,r,!0,n)};p.prototype.writeFloatBE=function(e,r,n){return pr(this,e,r,!1,n)};function dr(t,e,r,n,o){return o||ur(t,e,r,8),rr(t,e,r,n,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,n){return dr(this,e,r,!0,n)};p.prototype.writeDoubleBE=function(e,r,n){return dr(this,e,r,!1,n)};p.prototype.copy=function(e,r,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);var i=o-n,a;if(this===e&&n<r&&r<o)for(a=i-1;a>=0;--a)e[a+r]=this[a+n];else if(i<1e3||!p.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),r);return i};p.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!p.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var u=O(e)?e:ie(new p(e,o).toString()),d=u.length;for(a=0;a<n-r;++a)this[a+r]=u[a%d]}return this};var rn=/[^+\/0-9A-Za-z-_]/g;function tn(t){if(t=nn(t).replace(rn,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function nn(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function on(t){return t<16?"0"+t.toString(16):t.toString(16)}function ie(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function an(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function sn(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function mr(t){return Bt(tn(t))}function ue(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function cn(t){return t!==t}function un(t){return t!=null&&(!!t._isBuffer||lr(t)||pn(t))}function lr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function pn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&lr(t.slice(0,0))}import{encodeAddress as dn,decodeAddress as lo}from"algosdk";function B(t){return t.reduce((e,r)=>Uint8Array.from([...e,...r]))}function Ie(t){return new Uint8Array(p.from(t))}function gr(t){return p.from(t).toString("utf-8")}function fr(t){return p.from(t).toString("base64")}function ye(t){return p.from(t,"base64")}import mn from"bignumber.js";mn.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Bo=`{"theme1":{"value":"${c.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var br={V1_1:"v1_1",V2:"v2"},vo={[br.V1_1]:{testnet:62368684,mainnet:552635992},[br.V2]:{testnet:148607e3,mainnet:1002541853}};var xr=t=>fn.decodeAddress(t.toUpperCase()).publicKey;import*as A from"ethereumjs-util";function Te(t){let e=A.fromSigned(s.from(t));return BigInt(e.toString())}function xn(t){return A.toUnsigned(new A.BN(String(t)))}function $(t){let e=xn(t);if(e.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(A.setLengthLeft(e,32))}var hr=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let e=s.from(t).toString("hex");if(e.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",e),new Error("Invalid normalized address");let r="0x"+e.slice(-40);if(!An(r))throw new Error("Invalid hex address");return r},Ar=t=>new Uint8Array(A.setLengthLeft(pe(t),32)),pe=t=>s.from(hn(t),"hex"),hn=t=>t.startsWith("0x")?t.slice(2):t,An=t=>A.isValidAddress(t);var Ee=t=>new Uint8Array(A.keccak256(s.from(t)));import L from"algosdk";import*as Ce from"bs58";import Li from"algosdk";import $i from"algosdk";import $a from"algosdk";var ta={SMALLESTUNIT:c.env.SMALLEST_UNIT},na={SMALLEST_UNITS:c.env.SMALLEST_UNIT};var ca=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Tr=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;var fa=c.env.REACT_APP_API_URL,ba=c.env.REACT_APP_SOCKET_URL,xa=c.env.REACT_APP_ALGO_SERVER,ha=c.env.REACT_APP_ALGO_SERVER_PORT||"",Aa=c.env.REACT_APP_ALGOD_TOKEN||"",Ia=c.env.REACT_APP_DISPENSER_LINK,ya=c.env.REACT_APP_FRONTEND_LINK||"",Ta=c.env.REACT_APP_ALGO_EXPLORER_LINK,Ea=c.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,_a=(c.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Sa=c.env.REACT_APP_USERBACK_ACCESS_TOKEN,Ca=(c.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Da=.001*10**6,wa=.002*10**6;var Ra=c.env.REACT_APP_MASTER_APP_ID||"406",Oa=c.env.REACT_APP_AGG_APP_ID||"408",yn=Number(c.env.REACT_APP_CODEX_APP_ID||"467960617");console.log("CODEX_APP_ID",yn);var Tn=c.env.REACT_APP_ALGO_NETWORK||"";var Na=Tn.toLowerCase()==="mainnet"?"mainnet":"testnet";import iu from"algosdk";var Er=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(Er||{}),_r=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(_r||{}),ec={...Er,..._r};import Au from"algosdk";var E=(t,e,r)=>{switch(e){case"8B":return L.encodeUint64(Number(t));case"32B":return $(t);case"str":return Ie(String(t));case"address":return G(String(t),r);case"token":return Dr(String(t),r);case"float":{var n=s.alloc(8);return n.writeDoubleBE(Number(t),0),new Uint8Array(n)}case"bool":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-1));case"2B":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-2));case"4B":return new Uint8Array(s.from(L.encodeUint64(Number(t))).subarray(-4));default:return s.from(t.toString())}},C=(t,e,r)=>{switch(e){case"8B":return L.decodeUint64(t,"safe");case"32B":return Te(t);case"str":return gr(t);case"address":return Cr(t,r);case"token":return On(t,r);case"float":return s.from(t).readDoubleBE(0);case"bool":case"2B":return C(t,"8B");default:return s.from(t).toString()}};var Cr=(t,e)=>e===8?L.encodeAddress(t):e===1?Ce.encode(t):hr(t),On=(t,e)=>{let r=s.from(t).toString("hex");return r.startsWith("0x")||(r="0x"+r),V[r]?r:e===8?String(Te(t)):e===1?Ce.encode(t):Cr(t,e)};var Dr=(t,e)=>e===8?$(+t):V[t]?new Uint8Array(pe(String(t))):G(String(t),e);var Se=(t,e,r,n)=>{let o=G(t,e),i=L.encodeUint64(e),a=L.encodeUint64(n),u=Dr(r,n);return B([o,i,u,a])};var De=(t,e)=>B([Nn(t),Sr(e)]),Nn=t=>new Uint8Array(s.from(t+`
2
- `,"utf-8")),Sr=t=>new Uint8Array(s.from(fr(t)));var de=t=>s.from(Ee(t)).toString("hex");var z=(t,e,r)=>{let n=s.from(t,e),o=n.subarray(n.length-r),i=s.from(o).toString();return ye(i)};var G=(t,e)=>e===8?xr(t):e===1?wr.decode(t):Ar(t);var Pn=new X("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),Bn=new X("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");function Un(t,e,r=!1,n=Pn,o=Bn){if(!r&&!X.isOnCurve(e.toBuffer()))throw new Error("TokenOwnerOffCurveError");let[i]=X.findProgramAddressSync([e.toBuffer(),n.toBuffer(),t.toBuffer()],o);return i}var ol=(t,e,r)=>{let n=t==="MainNet"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU";if(Or(e,r))return n},il=c.env.ALGO_NETWORK==="MainNet"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",Or=(t,e)=>V[t]&&e===1,Mn=(t,e="hex")=>z(t,e,248),al=t=>de(Mn(t,"hex")),sl=(t,e="hex")=>{let r=z(t,e,248),n=Number(C(r.subarray(32,40),"8B")),o=Number(C(r.subarray(104,112),"8B"));return{loginAddress:String(C(r.subarray(0,32),"address",n)),loginChainId:n,tokenIndex:String(C(r.subarray(40,72),"token",o)),tokenChainId:o,recipient:String(C(r.subarray(72,104),"address",o)),recipientChainId:o,tokenAmount:String(C(r.subarray(112,144),"32B")),isNative:!!C(r.subarray(144,145),"bool"),fee:Number(C(r.subarray(145,177),"32B")),random:Number(C(r.subarray(177,185),"8B"))}},cl=(t,e)=>{let{loginAddress:r,loginChainId:n,recipient:o,recipientChainId:i,tokenAmount:a,tokenIndex:u,isNative:d,fee:l,random:g,solanaUsdc:m}=t,b=G(o,i);if(Or(String(u),i)){let q=new X(m),we=Un(q,new X(o));console.log("associatedTokenAddress",we.toBase58()),b=G(we.toBase58(),i)}let f=Se(r,n,u,i),I=B([f.slice(0,72),b,E(i,"8B"),$(a),E(+d,"bool"),$(l),E(g,"8B")]);return De(e||JSON.stringify(t),I)},Ln={EVM:5,ALGORAND:8,SOLANA:1},ul=t=>{let e=[E(t.address,"address",Ln[t.type]),E(t.name,"str"),E(t.type,"str"),E(t.description||"","str")],r=s.concat(e),n=Tr(t.address);return De(n,r)};export{Bn as ASSOCIATED_TOKEN_PROGRAM_ID,il as SOLANA_USDC,Pn as TOKEN_PROGRAM_ID,al as calcWithdrawHash,ul as createWithdrawalWalletMsg,sl as decodeWithdrawMsg,Un as getAssociatedTokenAddressSync,ol as getSolanaUsdc,Mn as getWithdrawBytesFromMsg,Or as isSolanaCctp,cl as makeWithdrawMsg};
1
+ function Oe(){throw new Error("setTimeout has not been defined")}function ke(){throw new Error("clearTimeout has not been defined")}var U=Oe,L=ke;typeof globalThis.setTimeout=="function"&&(U=setTimeout);typeof globalThis.clearTimeout=="function"&&(L=clearTimeout);function Pe(t){if(U===setTimeout)return setTimeout(t,0);if((U===Oe||!U)&&setTimeout)return U=setTimeout,setTimeout(t,0);try{return U(t,0)}catch{try{return U.call(null,t,0)}catch{return U.call(this,t,0)}}}function kr(t){if(L===clearTimeout)return clearTimeout(t);if((L===ke||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(t);try{return L(t)}catch{try{return L.call(null,t)}catch{return L.call(this,t)}}}var k=[],H=!1,v,j=-1;function Pr(){!H||!v||(H=!1,v.length?k=v.concat(k):j=-1,k.length&&Be())}function Be(){if(!H){var t=Pe(Pr);H=!0;for(var e=k.length;e;){for(v=k,k=[];++j<e;)v&&v[j].run();j=-1,e=k.length}v=null,H=!1,kr(t)}}function Br(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];k.push(new Ue(t,e)),k.length===1&&!H&&Pe(Be)}function Ue(t,e){this.fun=t,this.array=e}Ue.prototype.run=function(){this.fun.apply(null,this.array)};var Ur="browser",Lr="browser",Mr=!0,vr={},Fr=[],Wr="",Yr={},Kr={},Gr={};function F(){}var Hr=F,Vr=F,$r=F,Xr=F,zr=F,qr=F,Jr=F;function jr(t){throw new Error("process.binding is not supported")}function Qr(){return"/"}function Zr(t){throw new Error("process.chdir is not supported")}function et(){return 0}var G=globalThis.performance||{},rt=G.now||G.mozNow||G.msNow||G.oNow||G.webkitNow||function(){return new Date().getTime()};function tt(t){var e=rt.call(G)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var nt=new Date;function ot(){var t=new Date,e=t-nt;return e/1e3}var c={nextTick:Br,title:Ur,browser:Mr,env:vr,argv:Fr,version:Wr,versions:Yr,on:Hr,addListener:Vr,once:$r,off:Xr,removeListener:zr,removeAllListeners:qr,emit:Jr,binding:jr,cwd:Qr,chdir:Zr,umask:et,hrtime:tt,platform:Lr,release:Kr,config:Gr,uptime:ot},Ne={};Object.keys(Ne).forEach(t=>{let e=t.split("."),r=c;for(let n=0;n<e.length;n++){let o=e[n];n===e.length-1?r[o]=Ne[t]:r=r[o]||(r[o]={})}});var D=[],_=[],it=typeof Uint8Array<"u"?Uint8Array:Array,le=!1;function Fe(){le=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)D[e]=t[e],_[t.charCodeAt(e)]=e;_[45]=62,_[95]=63}function at(t){le||Fe();var e,r,n,o,i,a,u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[u-2]==="="?2:t[u-1]==="="?1:0,a=new it(u*3/4-i),n=i>0?u-4:u;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)o=_[t.charCodeAt(e)]<<18|_[t.charCodeAt(e+1)]<<12|_[t.charCodeAt(e+2)]<<6|_[t.charCodeAt(e+3)],a[d++]=o>>16&255,a[d++]=o>>8&255,a[d++]=o&255;return i===2?(o=_[t.charCodeAt(e)]<<2|_[t.charCodeAt(e+1)]>>4,a[d++]=o&255):i===1&&(o=_[t.charCodeAt(e)]<<10|_[t.charCodeAt(e+1)]<<4|_[t.charCodeAt(e+2)]>>2,a[d++]=o>>8&255,a[d++]=o&255),a}function st(t){return D[t>>18&63]+D[t>>12&63]+D[t>>6&63]+D[t&63]}function ct(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(st(n));return o.join("")}function Le(t){le||Fe();for(var e,r=t.length,n=r%3,o="",i=[],a=16383,u=0,d=r-n;u<d;u+=a)i.push(ct(t,u,u+a>d?d:u+a));return n===1?(e=t[r-1],o+=D[e>>2],o+=D[e<<4&63],o+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],o+=D[e>>10],o+=D[e>>4&63],o+=D[e<<2&63],o+="="),i.push(o),i.join("")}s.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function Q(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function P(t,e){if(Q()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=s.prototype):(t===null&&(t=new s(e)),t.length=e),t}function s(t,e,r){if(!s.TYPED_ARRAY_SUPPORT&&!(this instanceof s))return new s(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return ge(this,t)}return We(this,t,e,r)}s.poolSize=8192;s._augment=function(t){return t.__proto__=s.prototype,t};function We(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?dt(t,e,r,n):typeof e=="string"?pt(t,e,r):mt(t,e)}s.from=function(t,e,r){return We(null,t,e,r)};s.kMaxLength=Q();s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&s[Symbol.species]);function Ye(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,e,r,n){return Ye(e),e<=0?P(t,e):r!==void 0?typeof n=="string"?P(t,e).fill(r,n):P(t,e).fill(r):P(t,e)}s.alloc=function(t,e,r){return ut(null,t,e,r)};function ge(t,e){if(Ye(e),t=P(t,e<0?0:fe(e)|0),!s.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}s.allocUnsafe=function(t){return ge(null,t)};s.allocUnsafeSlow=function(t){return ge(null,t)};function pt(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!s.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=Ke(e,r)|0;t=P(t,n);var o=t.write(e,r);return o!==n&&(t=t.slice(0,o)),t}function me(t,e){var r=e.length<0?0:fe(e.length)|0;t=P(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function dt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),s.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=s.prototype):t=me(t,e),t}function mt(t,e){if(w(e)){var r=fe(e.length)|0;return t=P(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Ot(e.length)?P(t,0):me(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return me(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function fe(t){if(t>=Q())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q().toString(16)+" bytes");return t|0}s.isBuffer=kt;function w(t){return!!(t!=null&&t._isBuffer)}s.compare=function(e,r){if(!w(e)||!w(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,a=Math.min(n,o);i<a;++i)if(e[i]!==r[i]){n=e[i],o=r[i];break}return n<o?-1:o<n?1:0};s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};s.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return s.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var o=s.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!w(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function Ke(t,e){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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return qe(t).length;default:if(n)return Z(t).length;e=(""+e).toLowerCase(),n=!0}}s.byteLength=Ke;function lt(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Et(this,e,r);case"utf8":case"utf-8":return Ve(this,e,r);case"ascii":return Tt(this,e,r);case"latin1":case"binary":return yt(this,e,r);case"base64":return At(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _t(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s.prototype._isBuffer=!0;function W(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)W(this,r,r+1);return this};s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)W(this,r,r+3),W(this,r+1,r+2);return this};s.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)W(this,r,r+7),W(this,r+1,r+6),W(this,r+2,r+5),W(this,r+3,r+4);return this};s.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Ve(this,0,e):lt.apply(this,arguments)};s.prototype.equals=function(e){if(!w(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:s.compare(this,e)===0};s.prototype.compare=function(e,r,n,o,i){if(!w(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,u=n-r,d=Math.min(a,u),l=this.slice(o,i),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],u=g[m];break}return a<u?-1:u<a?1:0};function Ge(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=s.from(e,n)),w(e))return e.length===0?-1:Me(t,e,r,n,o);if(typeof e=="number")return e=e&255,s.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Me(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Me(t,e,r,n,o){var i=1,a=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,u/=2,r/=2}function d(f,I){return i===1?f[I]:f.readUInt16BE(I*i)}var l;if(o){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===u)return g*i}else g!==-1&&(l-=l-g),g=-1}else for(r+u>a&&(r=a-u),l=r;l>=0;l--){for(var m=!0,b=0;b<u;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}s.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};s.prototype.indexOf=function(e,r,n){return Ge(this,e,r,n,!0)};s.prototype.lastIndexOf=function(e,r,n){return Ge(this,e,r,n,!1)};function gt(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(a*2,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function ft(t,e,r,n){return te(Z(e,t.length-r),t,r,n)}function He(t,e,r,n){return te(Rt(e),t,r,n)}function bt(t,e,r,n){return He(t,e,r,n)}function xt(t,e,r,n){return te(qe(e),t,r,n)}function ht(t,e,r,n){return te(Nt(e,t.length-r),t,r,n)}s.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return gt(this,e,r,n);case"utf8":case"utf-8":return ft(this,e,r,n);case"ascii":return He(this,e,r,n);case"latin1":case"binary":return bt(this,e,r,n);case"base64":return xt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ht(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function At(t,e,r){return e===0&&r===t.length?Le(t):Le(t.slice(e,r))}function Ve(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u<=r){var d,l,g,m;switch(u){case 1:i<128&&(a=i);break;case 2:d=t[o+1],(d&192)===128&&(m=(i&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[o+1],l=t[o+2],(d&192)===128&&(l&192)===128&&(m=(i&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[o+1],l=t[o+2],g=t[o+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(i&15)<<18|(d&63)<<12|(l&63)<<6|g&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=u}return It(n)}var ve=4096;function It(t){var e=t.length;if(e<=ve)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=ve));return r}function Tt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function yt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function Et(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=wt(t[i]);return o}function _t(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}s.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var o;if(s.TYPED_ARRAY_SUPPORT)o=this.subarray(e,r),o.__proto__=s.prototype;else{var i=r-e;o=new s(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+e]}return o};function x(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return o};s.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e+--r],i=1;r>0&&(i*=256);)o+=this[e+--r]*i;return o};s.prototype.readUInt8=function(e,r){return r||x(e,1,this.length),this[e]};s.prototype.readUInt16LE=function(e,r){return r||x(e,2,this.length),this[e]|this[e+1]<<8};s.prototype.readUInt16BE=function(e,r){return r||x(e,2,this.length),this[e]<<8|this[e+1]};s.prototype.readUInt32LE=function(e,r){return r||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};s.prototype.readUInt32BE=function(e,r){return r||x(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};s.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};s.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||x(e,r,this.length);for(var o=r,i=1,a=this[e+--o];o>0&&(i*=256);)a+=this[e+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};s.prototype.readInt8=function(e,r){return r||x(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};s.prototype.readInt16LE=function(e,r){r||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};s.prototype.readInt16BE=function(e,r){r||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};s.prototype.readInt32LE=function(e,r){return r||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};s.prototype.readInt32BE=function(e,r){return r||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};s.prototype.readFloatLE=function(e,r){return r||x(e,4,this.length),ne(this,e,!0,23,4)};s.prototype.readFloatBE=function(e,r){return r||x(e,4,this.length),ne(this,e,!1,23,4)};s.prototype.readDoubleLE=function(e,r){return r||x(e,8,this.length),ne(this,e,!0,52,8)};s.prototype.readDoubleBE=function(e,r){return r||x(e,8,this.length),ne(this,e,!1,52,8)};function T(t,e,r,n,o,i){if(!w(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}s.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,e,r,n,i,0)}var a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};s.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;T(this,e,r,n,i,0)}var a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};s.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function ee(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}s.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};function re(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>(n?o:3-o)*8&255}s.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):re(this,e,r,!0),r+4};s.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};s.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);T(this,e,r,n,i-1,-i)}var a=0,u=1,d=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};s.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);T(this,e,r,n,i-1,-i)}var a=n-1,u=1,d=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};s.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};s.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ee(this,e,r,!0),r+2};s.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ee(this,e,r,!1),r+2};s.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):re(this,e,r,!0),r+4};s.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||T(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):re(this,e,r,!1),r+4};function $e(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Xe(t,e,r,n,o){return o||$e(t,e,r,4,34028234663852886e22,-34028234663852886e22),je(t,e,r,n,23,4),r+4}s.prototype.writeFloatLE=function(e,r,n){return Xe(this,e,r,!0,n)};s.prototype.writeFloatBE=function(e,r,n){return Xe(this,e,r,!1,n)};function ze(t,e,r,n,o){return o||$e(t,e,r,8,17976931348623157e292,-17976931348623157e292),je(t,e,r,n,52,8),r+8}s.prototype.writeDoubleLE=function(e,r,n){return ze(this,e,r,!0,n)};s.prototype.writeDoubleBE=function(e,r,n){return ze(this,e,r,!1,n)};s.prototype.copy=function(e,r,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);var i=o-n,a;if(this===e&&n<r&&r<o)for(a=i-1;a>=0;--a)e[a+r]=this[a+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),r);return i};s.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var u=w(e)?e:Z(new s(e,o).toString()),d=u.length;for(a=0;a<n-r;++a)this[a+r]=u[a%d]}return this};var St=/[^+\/0-9A-Za-z-_]/g;function Ct(t){if(t=Dt(t).replace(St,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Dt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function wt(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function Rt(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Nt(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function qe(t){return at(Ct(t))}function te(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function Ot(t){return t!==t}function kt(t){return t!=null&&(!!t._isBuffer||Je(t)||Pt(t))}function Je(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Pt(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Je(t.slice(0,0))}function ne(t,e,r,n,o){var i,a,u=o*8-n-1,d=(1<<u)-1,l=d>>1,g=-7,m=r?o-1:0,b=r?-1:1,f=t[e+m];for(m+=b,i=f&(1<<-g)-1,f>>=-g,g+=u;g>0;i=i*256+t[e+m],m+=b,g-=8);for(a=i&(1<<-g)-1,i>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(i===0)i=1-l;else{if(i===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-l}return(f?-1:1)*a*Math.pow(2,i-n)}function je(t,e,r,n,o,i){var a,u,d,l=i*8-o-1,g=(1<<l)-1,m=g>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,I=n?1:-1,J=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(u=0,a=g):a+m>=1?(u=(e*d-1)*Math.pow(2,o),a=a+m):(u=e*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[r+f]=u&255,f+=I,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+f]=a&255,f+=I,a/=256,l-=8);t[r+f-I]|=J*128}import{PublicKey as q}from"@solana/web3.js";var V={"0x4343545055534443000000000000000000000000000000000000000000000000":65537};import cd from"algosdk";import*as Rr from"bs58";import bn from"algosdk";import oo,{decodeAddress as io,encodeAddress as ao}from"algosdk";var R=[],S=[],Bt=typeof Uint8Array<"u"?Uint8Array:Array,xe=!1;function rr(){xe=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)R[e]=t[e],S[t.charCodeAt(e)]=e;S[45]=62,S[95]=63}function Ut(t){xe||rr();var e,r,n,o,i,a,u=t.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i=t[u-2]==="="?2:t[u-1]==="="?1:0,a=new Bt(u*3/4-i),n=i>0?u-4:u;var d=0;for(e=0,r=0;e<n;e+=4,r+=3)o=S[t.charCodeAt(e)]<<18|S[t.charCodeAt(e+1)]<<12|S[t.charCodeAt(e+2)]<<6|S[t.charCodeAt(e+3)],a[d++]=o>>16&255,a[d++]=o>>8&255,a[d++]=o&255;return i===2?(o=S[t.charCodeAt(e)]<<2|S[t.charCodeAt(e+1)]>>4,a[d++]=o&255):i===1&&(o=S[t.charCodeAt(e)]<<10|S[t.charCodeAt(e+1)]<<4|S[t.charCodeAt(e+2)]>>2,a[d++]=o>>8&255,a[d++]=o&255),a}function Lt(t){return R[t>>18&63]+R[t>>12&63]+R[t>>6&63]+R[t&63]}function Mt(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16)+(t[i+1]<<8)+t[i+2],o.push(Lt(n));return o.join("")}function Qe(t){xe||rr();for(var e,r=t.length,n=r%3,o="",i=[],a=16383,u=0,d=r-n;u<d;u+=a)i.push(Mt(t,u,u+a>d?d:u+a));return n===1?(e=t[r-1],o+=R[e>>2],o+=R[e<<4&63],o+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],o+=R[e>>10],o+=R[e>>4&63],o+=R[e<<2&63],o+="="),i.push(o),i.join("")}function ae(t,e,r,n,o){var i,a,u=o*8-n-1,d=(1<<u)-1,l=d>>1,g=-7,m=r?o-1:0,b=r?-1:1,f=t[e+m];for(m+=b,i=f&(1<<-g)-1,f>>=-g,g+=u;g>0;i=i*256+t[e+m],m+=b,g-=8);for(a=i&(1<<-g)-1,i>>=-g,g+=n;g>0;a=a*256+t[e+m],m+=b,g-=8);if(i===0)i=1-l;else{if(i===d)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-l}return(f?-1:1)*a*Math.pow(2,i-n)}function tr(t,e,r,n,o,i){var a,u,d,l=i*8-o-1,g=(1<<l)-1,m=g>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,I=n?1:-1,J=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+m>=1?e+=b/d:e+=b*Math.pow(2,1-m),e*d>=2&&(a++,d/=2),a+m>=g?(u=0,a=g):a+m>=1?(u=(e*d-1)*Math.pow(2,o),a=a+m):(u=e*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;t[r+f]=u&255,f+=I,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+f]=a&255,f+=I,a/=256,l-=8);t[r+f-I]|=J*128}var vt={}.toString,nr=Array.isArray||function(t){return vt.call(t)=="[object Array]"};var Ft=50;p.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;var Zn=oe();function oe(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function B(t,e){if(oe()<e)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=p.prototype):(t===null&&(t=new p(e)),t.length=e),t}function p(t,e,r){if(!p.TYPED_ARRAY_SUPPORT&&!(this instanceof p))return new p(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return he(this,t)}return or(this,t,e,r)}p.poolSize=8192;p._augment=function(t){return t.__proto__=p.prototype,t};function or(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Kt(t,e,r,n):typeof e=="string"?Yt(t,e,r):Gt(t,e)}p.from=function(t,e,r){return or(null,t,e,r)};p.TYPED_ARRAY_SUPPORT&&(p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array);function ir(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 Wt(t,e,r,n){return ir(e),e<=0?B(t,e):r!==void 0?typeof n=="string"?B(t,e).fill(r,n):B(t,e).fill(r):B(t,e)}p.alloc=function(t,e,r){return Wt(null,t,e,r)};function he(t,e){if(ir(e),t=B(t,e<0?0:Ae(e)|0),!p.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}p.allocUnsafe=function(t){return he(null,t)};p.allocUnsafeSlow=function(t){return he(null,t)};function Yt(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!p.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=ar(e,r)|0;t=B(t,n);var o=t.write(e,r);return o!==n&&(t=t.slice(0,o)),t}function be(t,e){var r=e.length<0?0:Ae(e.length)|0;t=B(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Kt(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),p.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=p.prototype):t=be(t,e),t}function Gt(t,e){if(N(e)){var r=Ae(e.length)|0;return t=B(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||un(e.length)?B(t,0):be(t,e);if(e.type==="Buffer"&&nr(e.data))return be(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Ae(t){if(t>=oe())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+oe().toString(16)+" bytes");return t|0}p.isBuffer=pn;function N(t){return!!(t!=null&&t._isBuffer)}p.compare=function(e,r){if(!N(e)||!N(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,o=r.length,i=0,a=Math.min(n,o);i<a;++i)if(e[i]!==r[i]){n=e[i],o=r[i];break}return n<o?-1:o<n?1:0};p.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};p.concat=function(e,r){if(!nr(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var o=p.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!N(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o};function ar(t,e){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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ie(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return lr(t).length;default:if(n)return ie(t).length;e=(""+e).toLowerCase(),n=!0}}p.byteLength=ar;function Ht(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return en(this,e,r);case"utf8":case"utf-8":return ur(this,e,r);case"ascii":return Qt(this,e,r);case"latin1":case"binary":return Zt(this,e,r);case"base64":return Jt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rn(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}p.prototype._isBuffer=!0;function Y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}p.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Y(this,r,r+1);return this};p.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Y(this,r,r+3),Y(this,r+1,r+2);return this};p.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Y(this,r,r+7),Y(this,r+1,r+6),Y(this,r+2,r+5),Y(this,r+3,r+4);return this};p.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?ur(this,0,e):Ht.apply(this,arguments)};p.prototype.equals=function(e){if(!N(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){var e="",r=Ft;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"};p.prototype.compare=function(e,r,n,o,i){if(!N(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;for(var a=i-o,u=n-r,d=Math.min(a,u),l=this.slice(o,i),g=e.slice(r,n),m=0;m<d;++m)if(l[m]!==g[m]){a=l[m],u=g[m];break}return a<u?-1:u<a?1:0};function sr(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,n)),N(e))return e.length===0?-1:Ze(t,e,r,n,o);if(typeof e=="number")return e=e&255,p.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Ze(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Ze(t,e,r,n,o){var i=1,a=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,u/=2,r/=2}function d(f,I){return i===1?f[I]:f.readUInt16BE(I*i)}var l;if(o){var g=-1;for(l=r;l<a;l++)if(d(t,l)===d(e,g===-1?0:l-g)){if(g===-1&&(g=l),l-g+1===u)return g*i}else g!==-1&&(l-=l-g),g=-1}else for(r+u>a&&(r=a-u),l=r;l>=0;l--){for(var m=!0,b=0;b<u;b++)if(d(t,l+b)!==d(e,b)){m=!1;break}if(m)return l}return-1}p.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};p.prototype.indexOf=function(e,r,n){return sr(this,e,r,n,!0)};p.prototype.lastIndexOf=function(e,r,n){return sr(this,e,r,n,!1)};function Vt(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(a*2,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function $t(t,e,r,n){return ue(ie(e,t.length-r),t,r,n)}function cr(t,e,r,n){return ue(sn(e),t,r,n)}function Xt(t,e,r,n){return cr(t,e,r,n)}function zt(t,e,r,n){return ue(lr(e),t,r,n)}function qt(t,e,r,n){return ue(cn(e,t.length-r),t,r,n)}p.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var a=!1;;)switch(o){case"hex":return Vt(this,e,r,n);case"utf8":case"utf-8":return $t(this,e,r,n);case"ascii":return cr(this,e,r,n);case"latin1":case"binary":return Xt(this,e,r,n);case"base64":return zt(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qt(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Jt(t,e,r){return e===0&&r===t.length?Qe(t):Qe(t.slice(e,r))}function ur(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i=t[o],a=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u<=r){var d,l,g,m;switch(u){case 1:i<128&&(a=i);break;case 2:d=t[o+1],(d&192)===128&&(m=(i&31)<<6|d&63,m>127&&(a=m));break;case 3:d=t[o+1],l=t[o+2],(d&192)===128&&(l&192)===128&&(m=(i&15)<<12|(d&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(a=m));break;case 4:d=t[o+1],l=t[o+2],g=t[o+3],(d&192)===128&&(l&192)===128&&(g&192)===128&&(m=(i&15)<<18|(d&63)<<12|(l&63)<<6|g&63,m>65535&&m<1114112&&(a=m))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=u}return jt(n)}var er=4096;function jt(t){var e=t.length;if(e<=er)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=er));return r}function Qt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function Zt(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function en(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=an(t[i]);return o}function rn(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+n[i+1]*256);return o}p.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var o;if(p.TYPED_ARRAY_SUPPORT)o=this.subarray(e,r),o.__proto__=p.prototype;else{var i=r-e;o=new p(i,void 0);for(var a=0;a<i;++a)o[a]=this[a+e]}return o};function h(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return o};p.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e+--r],i=1;r>0&&(i*=256);)o+=this[e+--r]*i;return o};p.prototype.readUInt8=function(e,r){return r||h(e,1,this.length),this[e]};p.prototype.readUInt16LE=function(e,r){return r||h(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUInt16BE=function(e,r){return r||h(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUInt32LE=function(e,r){return r||h(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUInt32BE=function(e,r){return r||h(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=this[e],i=1,a=0;++a<r&&(i*=256);)o+=this[e+a]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};p.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||h(e,r,this.length);for(var o=r,i=1,a=this[e+--o];o>0&&(i*=256);)a+=this[e+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};p.prototype.readInt8=function(e,r){return r||h(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){r||h(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};p.prototype.readInt16BE=function(e,r){r||h(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};p.prototype.readInt32LE=function(e,r){return r||h(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return r||h(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readFloatLE=function(e,r){return r||h(e,4,this.length),ae(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return r||h(e,4,this.length),ae(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return r||h(e,8,this.length),ae(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return r||h(e,8,this.length),ae(this,e,!1,52,8)};function y(t,e,r,n,o,i){if(!N(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}p.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;y(this,e,r,n,i,0)}var a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};p.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r|0,n=n|0,!o){var i=Math.pow(2,8*n)-1;y(this,e,r,n,i,0)}var a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};p.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function se(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>(n?o:1-o)*8}p.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};function ce(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>(n?o:3-o)*8&255}p.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):ce(this,e,r,!0),r+4};p.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};p.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);y(this,e,r,n,i-1,-i)}var a=0,u=1,d=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&d===0&&this[r+a-1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};p.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r|0,!o){var i=Math.pow(2,8*n-1);y(this,e,r,n,i-1,-i)}var a=n-1,u=1,d=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&d===0&&this[r+a+1]!==0&&(d=1),this[r+a]=(e/u>>0)-d&255;return r+n};p.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):se(this,e,r,!0),r+2};p.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):se(this,e,r,!1),r+2};p.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):ce(this,e,r,!0),r+4};p.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||y(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):ce(this,e,r,!1),r+4};function pr(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function dr(t,e,r,n,o){return o||pr(t,e,r,4),tr(t,e,r,n,23,4),r+4}p.prototype.writeFloatLE=function(e,r,n){return dr(this,e,r,!0,n)};p.prototype.writeFloatBE=function(e,r,n){return dr(this,e,r,!1,n)};function mr(t,e,r,n,o){return o||pr(t,e,r,8),tr(t,e,r,n,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,n){return mr(this,e,r,!0,n)};p.prototype.writeDoubleBE=function(e,r,n){return mr(this,e,r,!1,n)};p.prototype.copy=function(e,r,n,o){if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);var i=o-n,a;if(this===e&&n<r&&r<o)for(a=i-1;a>=0;--a)e[a+r]=this[a+n];else if(i<1e3||!p.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+r]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),r);return i};p.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!p.isEncoding(o))throw new TypeError("Unknown encoding: "+o)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{var u=N(e)?e:ie(new p(e,o).toString()),d=u.length;for(a=0;a<n-r;++a)this[a+r]=u[a%d]}return this};var tn=/[^+\/0-9A-Za-z-_]/g;function nn(t){if(t=on(t).replace(tn,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function on(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function an(t){return t<16?"0"+t.toString(16):t.toString(16)}function ie(t,e){e=e||1/0;for(var r,n=t.length,o=null,i=[],a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function sn(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function cn(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}function lr(t){return Ut(nn(t))}function ue(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function un(t){return t!==t}function pn(t){return t!=null&&(!!t._isBuffer||gr(t)||dn(t))}function gr(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function dn(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&gr(t.slice(0,0))}import{encodeAddress as mn,decodeAddress as lo}from"algosdk";function O(t){return t.reduce((e,r)=>Uint8Array.from([...e,...r]))}function Ie(t){return new Uint8Array(p.from(t))}function fr(t){return p.from(t).toString("utf-8")}function br(t){return p.from(t).toString("base64")}function Te(t){return p.from(t,"base64")}import ln from"bignumber.js";ln.config({DECIMAL_PLACES:40,EXPONENTIAL_AT:45});var Po=`{"theme1":{"value":"${c.env.FRONTEND_URL}/Theme%3DDark.svg","active":true},"theme2":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true},"theme3":{"value":"${c.env.FRONTEND_URL}/Theme%3DLight.svg","active":true}}`;var hr={V1_1:"v1_1",V2:"v2"},Mo={[hr.V1_1]:{testnet:62368684,mainnet:552635992},[hr.V2]:{testnet:148607e3,mainnet:1002541853}};var Ar=t=>bn.decodeAddress(t.toUpperCase()).publicKey;import*as A from"ethereumjs-util";function ye(t){let e=A.fromSigned(s.from(t));return BigInt(e.toString())}function hn(t){return A.toUnsigned(new A.BN(String(t)))}function $(t){let e=hn(t);if(e.length>32)throw new Error("Invalid value. The buffer length of the value is more than 32");return new Uint8Array(A.setLengthLeft(e,32))}var Ir=t=>{if(t.length!==32)throw new Error("Invalid address bytes. The address buffer length is not equel 32");let e=s.from(t).toString("hex");if(e.slice(0,24)!=="000000000000000000000000")throw console.log("normalizedAddress",e),new Error("Invalid normalized address");let r="0x"+e.slice(-40);if(!In(r))throw new Error("Invalid hex address");return r},Tr=t=>new Uint8Array(A.setLengthLeft(pe(t),32)),pe=t=>s.from(An(t),"hex"),An=t=>t.startsWith("0x")?t.slice(2):t,In=t=>A.isValidAddress(t);var Ee=t=>new Uint8Array(A.keccak256(s.from(t)));import M from"algosdk";import*as De from"bs58";import ji from"algosdk";import aa from"algosdk";import Nu from"algosdk";var ba={SMALLESTUNIT:c.env.SMALLEST_UNIT},xa={SMALLEST_UNITS:c.env.SMALLEST_UNIT};var ya=["point-system.discordEnabled","point-system.telegramBotName","point-system.telegramBotId","point-system.telegramEnabled","point-system.telegramGroupId","point-system.telegramGroupName","point-system.twitterAccountId","point-system.twitterAccountName","point-system.twitterEnabled","point-system.twitterJobEnabled","point-system.guideLink"];var Er=t=>`By signing this message, you confirm that the wallet is a trusted one ${t}; Data: `;var Ra=c.env.REACT_APP_API_URL,Na=c.env.REACT_APP_SOCKET_URL,Oa=c.env.REACT_APP_ALGO_SERVER,ka=c.env.REACT_APP_ALGO_SERVER_PORT||"",Pa=c.env.REACT_APP_ALGOD_TOKEN||"",Ba=c.env.REACT_APP_DISPENSER_LINK,Ua=c.env.REACT_APP_FRONTEND_LINK||"",La=c.env.REACT_APP_ALGO_EXPLORER_LINK,Ma=c.env.REACT_APP_ALGO_EXPLORER_ASSETS_URL,va=(c.env.REACT_APP_REQUIRE_ACCESS_CODE||"").toLowerCase()==="true",Fa=c.env.REACT_APP_USERBACK_ACCESS_TOKEN,Wa=(c.env.REACT_APP_EXT_ORDER_TYPES||"").toLowerCase()==="true";var Ya=.001*10**6,Ka=.002*10**6;var Ga=c.env.REACT_APP_MASTER_APP_ID||"406",Ha=c.env.REACT_APP_AGG_APP_ID||"408",Va=Number(c.env.REACT_APP_CODEX_APP_ID||"467960617");var yn=c.env.REACT_APP_ALGO_NETWORK||"";var $a=yn.toLowerCase()==="mainnet"?"mainnet":"testnet";var _r=(o=>(o.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",o.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",o.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",o.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",o))(_r||{}),Sr=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(Sr||{}),Js={..._r,...Sr};var gu={1:"canFollowAccounts",4:"canLikeTweets",2:"canCreateTweets",3:"canCreateTweets"};import Fu from"algosdk";import ju from"algosdk";import dp from"algosdk";var E=(t,e,r)=>{switch(e){case"8B":return M.encodeUint64(Number(t));case"32B":return $(t);case"str":return Ie(String(t));case"address":return K(String(t),r);case"token":return wr(String(t),r);case"float":{var n=s.alloc(8);return n.writeDoubleBE(Number(t),0),new Uint8Array(n)}case"bool":return new Uint8Array(s.from(M.encodeUint64(Number(t))).subarray(-1));case"2B":return new Uint8Array(s.from(M.encodeUint64(Number(t))).subarray(-2));case"4B":return new Uint8Array(s.from(M.encodeUint64(Number(t))).subarray(-4));default:return s.from(t.toString())}},C=(t,e,r)=>{switch(e){case"8B":return M.decodeUint64(t,"safe");case"32B":return ye(t);case"str":return fr(t);case"address":return Dr(t,r);case"token":return Nn(t,r);case"float":return s.from(t).readDoubleBE(0);case"bool":case"2B":return C(t,"8B");default:return s.from(t).toString()}};var Dr=(t,e)=>e===8?M.encodeAddress(t):e===1?De.encode(t):Ir(t),Nn=(t,e)=>{let r=s.from(t).toString("hex");return r.startsWith("0x")||(r="0x"+r),V[r]?r:e===8?String(ye(t)):e===1?De.encode(t):Dr(t,e)};var wr=(t,e)=>e===8?$(+t):V[t]?new Uint8Array(pe(String(t))):K(String(t),e);var Ce=(t,e,r,n)=>{let o=K(t,e),i=M.encodeUint64(e),a=M.encodeUint64(n),u=wr(r,n);return O([o,i,u,a])};var we=(t,e)=>O([On(t),Cr(e)]),On=t=>new Uint8Array(s.from(t+`
2
+ `,"utf-8")),Cr=t=>new Uint8Array(s.from(br(t)));var de=t=>s.from(Ee(t)).toString("hex");var z=(t,e,r)=>{let n=s.from(t,e),o=n.subarray(n.length-r),i=s.from(o).toString();return Te(i)};var K=(t,e)=>e===8?Ar(t):e===1?Rr.decode(t):Tr(t);var Pn=new q("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),Bn=new q("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");function Un(t,e,r=!1,n=Pn,o=Bn){if(!r&&!q.isOnCurve(e.toBuffer()))throw new Error("TokenOwnerOffCurveError");let[i]=q.findProgramAddressSync([e.toBuffer(),n.toBuffer(),t.toBuffer()],o);return i}var og=(t,e,r)=>{let n=t==="MainNet"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU";if(Or(e,r))return n},ig=c.env.ALGO_NETWORK==="MainNet"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU",Or=(t,e)=>V[t]&&e===1,Ln=(t,e="hex")=>z(t,e,248),ag=t=>de(Ln(t,"hex")),sg=(t,e="hex")=>{let r=z(t,e,248),n=Number(C(r.subarray(32,40),"8B")),o=Number(C(r.subarray(104,112),"8B"));return{loginAddress:String(C(r.subarray(0,32),"address",n)),loginChainId:n,tokenIndex:String(C(r.subarray(40,72),"token",o)),tokenChainId:o,recipient:String(C(r.subarray(72,104),"address",o)),recipientChainId:o,tokenAmount:String(C(r.subarray(112,144),"32B")),isNative:!!C(r.subarray(144,145),"bool"),fee:Number(C(r.subarray(145,177),"32B")),random:Number(C(r.subarray(177,185),"8B"))}},cg=(t,e)=>{let{loginAddress:r,loginChainId:n,recipient:o,recipientChainId:i,tokenAmount:a,tokenIndex:u,isNative:d,fee:l,random:g,solanaUsdc:m}=t,b=K(o,i);if(Or(String(u),i)){let J=new q(m),Re=Un(J,new q(o));console.log("associatedTokenAddress",Re.toBase58()),b=K(Re.toBase58(),i)}let f=Ce(r,n,u,i),I=O([f.slice(0,72),b,E(i,"8B"),$(a),E(+d,"bool"),$(l),E(g,"8B")]);return we(e||JSON.stringify(t),I)},Mn={EVM:5,ALGORAND:8,SOLANA:1},ug=t=>{let e=[E(t.address,"address",Mn[t.type]),E(t.name,"str"),E(t.type,"str"),E(t.description||"","str")],r=O(e),n=Er(t.address);return we(n,r)};export{Bn as ASSOCIATED_TOKEN_PROGRAM_ID,ig as SOLANA_USDC,Pn as TOKEN_PROGRAM_ID,ag as calcWithdrawHash,ug as createWithdrawalWalletMsg,sg as decodeWithdrawMsg,Un as getAssociatedTokenAddressSync,og as getSolanaUsdc,Ln as getWithdrawBytesFromMsg,Or as isSolanaCctp,cg as makeWithdrawMsg};
3
3
  /*!
4
4
  * The buffer module from node.js, for the browser.
5
5
  *
@@ -1,4 +1,4 @@
1
- function H(){throw new Error("setTimeout has not been defined")}function V(){throw new Error("clearTimeout has not been defined")}var E=H,_=V;typeof globalThis.setTimeout=="function"&&(E=setTimeout);typeof globalThis.clearTimeout=="function"&&(_=clearTimeout);function q(t){if(E===setTimeout)return setTimeout(t,0);if((E===H||!E)&&setTimeout)return E=setTimeout,setTimeout(t,0);try{return E(t,0)}catch{try{return E.call(null,t,0)}catch{return E.call(this,t,0)}}}function Ie(t){if(_===clearTimeout)return clearTimeout(t);if((_===V||!_)&&clearTimeout)return _=clearTimeout,clearTimeout(t);try{return _(t)}catch{try{return _.call(null,t)}catch{return _.call(this,t)}}}var T=[],O=!1,C,N=-1;function he(){!O||!C||(O=!1,C.length?T=C.concat(T):N=-1,T.length&&z())}function z(){if(!O){var t=q(he);O=!0;for(var e=T.length;e;){for(C=T,T=[];++N<e;)C&&C[N].run();N=-1,e=T.length}C=null,O=!1,Ie(t)}}function be(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];T.push(new J(t,e)),T.length===1&&!O&&q(z)}function J(t,e){this.fun=t,this.array=e}J.prototype.run=function(){this.fun.apply(null,this.array)};var xe="browser",Ae="browser",Te=!0,ye={},Ee=[],_e="",Ce={},De={},we={};function D(){}var Se=D,Re=D,Oe=D,Ne=D,ke=D,ve=D,Pe=D;function Le(t){throw new Error("process.binding is not supported")}function Me(){return"/"}function Ue(t){throw new Error("process.chdir is not supported")}function Be(){return 0}var R=globalThis.performance||{},We=R.now||R.mozNow||R.msNow||R.oNow||R.webkitNow||function(){return new Date().getTime()};function Fe(t){var e=We.call(R)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var Ge=new Date;function Ye(){var t=new Date,e=t-Ge;return e/1e3}var p={nextTick:be,title:xe,browser:Te,env:ye,argv:Ee,version:_e,versions:Ce,on:Se,addListener:Re,once:Oe,off:Ne,removeListener:ke,removeAllListeners:ve,emit:Pe,binding:Le,cwd:Me,chdir:Ue,umask:Be,hrtime:Fe,platform:Ae,release:De,config:we,uptime:Ye},K={};Object.keys(K).forEach(t=>{let e=t.split("."),r=p;for(let n=0;n<e.length;n++){let i=e[n];n===e.length-1?r[i]=K[t]:r=r[i]||(r[i]={})}});var x=[],h=[],Ke=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function Z(){W=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)x[e]=t[e],h[t.charCodeAt(e)]=e;h[45]=62,h[95]=63}function He(t){W||Z();var e,r,n,i,o,s,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,s=new Ke(c*3/4-o),n=o>0?c-4:c;var u=0;for(e=0,r=0;e<n;e+=4,r+=3)i=h[t.charCodeAt(e)]<<18|h[t.charCodeAt(e+1)]<<12|h[t.charCodeAt(e+2)]<<6|h[t.charCodeAt(e+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=i&255;return o===2?(i=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,s[u++]=i&255):o===1&&(i=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=i&255),s}function Ve(t){return x[t>>18&63]+x[t>>12&63]+x[t>>6&63]+x[t&63]}function qe(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Ve(n));return i.join("")}function X(t){W||Z();for(var e,r=t.length,n=r%3,i="",o=[],s=16383,c=0,u=r-n;c<u;c+=s)o.push(qe(t,c,c+s>u?u:c+s));return n===1?(e=t[r-1],i+=x[e>>2],i+=x[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=x[e>>10],i+=x[e>>4&63],i+=x[e<<2&63],i+="="),o.push(i),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,e){if(k()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):(t===null&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return F(this,t)}return $(this,t,e,r)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function $(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Xe(t,e,r,n):typeof e=="string"?Je(t,e,r):Qe(t,e)}a.from=function(t,e,r){return $(null,t,e,r)};a.kMaxLength=k();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function ee(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ze(t,e,r,n){return ee(e),e<=0?y(t,e):r!==void 0?typeof n=="string"?y(t,e).fill(r,n):y(t,e).fill(r):y(t,e)}a.alloc=function(t,e,r){return ze(null,t,e,r)};function F(t,e){if(ee(e),t=y(t,e<0?0:G(e)|0),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}a.allocUnsafe=function(t){return F(null,t)};a.allocUnsafeSlow=function(t){return F(null,t)};function Je(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=re(e,r)|0;t=y(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function B(t,e){var r=e.length<0?0:G(e.length)|0;t=y(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Xe(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),a.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=a.prototype):t=B(t,e),t}function Qe(t,e){if(A(e)){var r=G(e.length)|0;return t=y(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||gr(e.length)?y(t,0):B(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return B(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return t|0}a.isBuffer=Ir;function A(t){return!!(t!=null&&t._isBuffer)}a.compare=function(e,r){if(!A(e)||!A(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=a.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!A(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};function re(t,e){if(A(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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return v(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return pe(t).length;default:if(n)return v(t).length;e=(""+e).toLowerCase(),n=!0}}a.byteLength=re;function je(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return sr(this,e,r);case"utf8":case"utf-8":return ie(this,e,r);case"ascii":return ar(this,e,r);case"latin1":case"binary":return or(this,e,r);case"base64":return nr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)w(this,r,r+1);return this};a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)w(this,r,r+3),w(this,r+1,r+2);return this};a.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)w(this,r,r+7),w(this,r+1,r+6),w(this,r+2,r+5),w(this,r+3,r+4);return this};a.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?ie(this,0,e):je.apply(this,arguments)};a.prototype.equals=function(e){if(!A(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0};a.prototype.compare=function(e,r,n,i,o){if(!A(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,c=n-r,u=Math.min(s,c),l=this.slice(i,o),d=e.slice(r,n),m=0;m<u;++m)if(l[m]!==d[m]){s=l[m],c=d[m];break}return s<c?-1:c<s?1:0};function te(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=a.from(e,n)),A(e))return e.length===0?-1:Q(t,e,r,n,i);if(typeof e=="number")return e=e&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Q(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Q(t,e,r,n,i){var o=1,s=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(I,S){return o===1?I[S]:I.readUInt16BE(S*o)}var l;if(i){var d=-1;for(l=r;l<s;l++)if(u(t,l)===u(e,d===-1?0:l-d)){if(d===-1&&(d=l),l-d+1===c)return d*o}else d!==-1&&(l-=l-d),d=-1}else for(r+c>s&&(r=s-c),l=r;l>=0;l--){for(var m=!0,b=0;b<c;b++)if(u(t,l+b)!==u(e,b)){m=!1;break}if(m)return l}return-1}a.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};a.prototype.indexOf=function(e,r,n){return te(this,e,r,n,!0)};a.prototype.lastIndexOf=function(e,r,n){return te(this,e,r,n,!1)};function Ze(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var c=parseInt(e.substr(s*2,2),16);if(isNaN(c))return s;t[r+s]=c}return s}function $e(t,e,r,n){return M(v(e,t.length-r),t,r,n)}function ne(t,e,r,n){return M(lr(e),t,r,n)}function er(t,e,r,n){return ne(t,e,r,n)}function rr(t,e,r,n){return M(pe(e),t,r,n)}function tr(t,e,r,n){return M(fr(e,t.length-r),t,r,n)}a.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|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-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return Ze(this,e,r,n);case"utf8":case"utf-8":return $e(this,e,r,n);case"ascii":return ne(this,e,r,n);case"latin1":case"binary":return er(this,e,r,n);case"base64":return rr(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tr(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nr(t,e,r){return e===0&&r===t.length?X(t):X(t.slice(e,r))}function ie(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],s=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var u,l,d,m;switch(c){case 1:o<128&&(s=o);break;case 2:u=t[i+1],(u&192)===128&&(m=(o&31)<<6|u&63,m>127&&(s=m));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(m=(o&15)<<12|(u&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:u=t[i+1],l=t[i+2],d=t[i+3],(u&192)===128&&(l&192)===128&&(d&192)===128&&(m=(o&15)<<18|(u&63)<<12|(l&63)<<6|d&63,m>65535&&m<1114112&&(s=m))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=c}return ir(n)}var j=4096;function ir(t){var e=t.length;if(e<=j)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=j));return r}function ar(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function or(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function sr(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=mr(t[o]);return i}function pr(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=a.prototype;else{var o=r-e;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i};function f(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i};a.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};a.prototype.readUInt8=function(e,r){return r||f(e,1,this.length),this[e]};a.prototype.readUInt16LE=function(e,r){return r||f(e,2,this.length),this[e]|this[e+1]<<8};a.prototype.readUInt16BE=function(e,r){return r||f(e,2,this.length),this[e]<<8|this[e+1]};a.prototype.readUInt32LE=function(e,r){return r||f(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};a.prototype.readUInt32BE=function(e,r){return r||f(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};a.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};a.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};a.prototype.readInt8=function(e,r){return r||f(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};a.prototype.readInt16LE=function(e,r){r||f(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(e,r){r||f(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(e,r){return r||f(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};a.prototype.readInt32BE=function(e,r){return r||f(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};a.prototype.readFloatLE=function(e,r){return r||f(e,4,this.length),U(this,e,!0,23,4)};a.prototype.readFloatBE=function(e,r){return r||f(e,4,this.length),U(this,e,!1,23,4)};a.prototype.readDoubleLE=function(e,r){return r||f(e,8,this.length),U(this,e,!0,52,8)};a.prototype.readDoubleBE=function(e,r){return r||f(e,8,this.length),U(this,e,!1,52,8)};function g(t,e,r,n,i,o){if(!A(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;g(this,e,r,n,o,0)}var s=1,c=0;for(this[r]=e&255;++c<n&&(s*=256);)this[r+c]=e/s&255;return r+n};a.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;g(this,e,r,n,o,0)}var s=n-1,c=1;for(this[r+s]=e&255;--s>=0&&(c*=256);)this[r+s]=e/c&255;return r+n};a.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function P(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):P(this,e,r,!0),r+2};a.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):P(this,e,r,!1),r+2};function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}a.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):L(this,e,r,!0),r+4};a.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):L(this,e,r,!1),r+4};a.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);g(this,e,r,n,o-1,-o)}var s=0,c=1,u=0;for(this[r]=e&255;++s<n&&(c*=256);)e<0&&u===0&&this[r+s-1]!==0&&(u=1),this[r+s]=(e/c>>0)-u&255;return r+n};a.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);g(this,e,r,n,o-1,-o)}var s=n-1,c=1,u=0;for(this[r+s]=e&255;--s>=0&&(c*=256);)e<0&&u===0&&this[r+s+1]!==0&&(u=1),this[r+s]=(e/c>>0)-u&255;return r+n};a.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};a.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):P(this,e,r,!0),r+2};a.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):P(this,e,r,!1),r+2};a.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):L(this,e,r,!0),r+4};a.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):L(this,e,r,!1),r+4};function ae(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function oe(t,e,r,n,i){return i||ae(t,e,r,4,34028234663852886e22,-34028234663852886e22),ue(t,e,r,n,23,4),r+4}a.prototype.writeFloatLE=function(e,r,n){return oe(this,e,r,!0,n)};a.prototype.writeFloatBE=function(e,r,n){return oe(this,e,r,!1,n)};function se(t,e,r,n,i){return i||ae(t,e,r,8,17976931348623157e292,-17976931348623157e292),ue(t,e,r,n,52,8),r+8}a.prototype.writeDoubleLE=function(e,r,n){return se(this,e,r,!0,n)};a.prototype.writeDoubleBE=function(e,r,n){return se(this,e,r,!1,n)};a.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<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),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,s;if(this===e&&n<r&&r<i)for(s=o-1;s>=0;--s)e[s+r]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};a.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<n;++s)this[s]=e;else{var c=A(e)?e:v(new a(e,i).toString()),u=c.length;for(s=0;s<n-r;++s)this[s+r]=c[s%u]}return this};var cr=/[^+\/0-9A-Za-z-_]/g;function ur(t){if(t=dr(t).replace(cr,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function dr(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function mr(t){return t<16?"0"+t.toString(16):t.toString(16)}function v(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function lr(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function fr(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function pe(t){return He(ur(t))}function M(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function gr(t){return t!==t}function Ir(t){return t!=null&&(!!t._isBuffer||ce(t)||hr(t))}function ce(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function hr(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ce(t.slice(0,0))}function U(t,e,r,n,i){var o,s,c=i*8-n-1,u=(1<<c)-1,l=u>>1,d=-7,m=r?i-1:0,b=r?-1:1,I=t[e+m];for(m+=b,o=I&(1<<-d)-1,I>>=-d,d+=c;d>0;o=o*256+t[e+m],m+=b,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+t[e+m],m+=b,d-=8);if(o===0)o=1-l;else{if(o===u)return s?NaN:(I?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-l}return(I?-1:1)*s*Math.pow(2,o-n)}function ue(t,e,r,n,i,o){var s,c,u,l=o*8-i-1,d=(1<<l)-1,m=d>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:o-1,S=n?1:-1,ge=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+m>=1?e+=b/u:e+=b*Math.pow(2,1-m),e*u>=2&&(s++,u/=2),s+m>=d?(c=0,s=d):s+m>=1?(c=(e*u-1)*Math.pow(2,i),s=s+m):(c=e*Math.pow(2,m-1)*Math.pow(2,i),s=0));i>=8;t[r+I]=c&255,I+=S,c/=256,i-=8);for(s=s<<i|c,l+=i;l>0;t[r+I]=s&255,I+=S,s/=256,l-=8);t[r+I-S]|=ge*128}var Y=(r=>(r.User="User",r.Api="API",r))(Y||{});var de=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(de||{}),me=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(me||{}),Bt={...de,...me};var le=(n=>(n.SOLANA="SOLANA",n.ALGORAND="ALGORAND",n.EVM="EVM",n))(le||{});var br=(d=>(d.PERA="PERA",d.METAMASK="METAMASK",d.TRUST_WALLET="TRUST_WALLET",d.PHANTOM="PHANTOM",d.WALLET_CONNECT="WALLET_CONNECT",d.SOLANA_MOBILE="SOLANA_MOBILE",d.SOLFLARE="SOLFLARE",d.COINBASE="COINBASE",d.BACKPACK="BACKPACK",d.MOBILE="MOBILE",d))(br||{});var fe=class{};export{fe as ISetting,br as PROVIDERS,Y as TradingKeyType,le as WithdrawalWalletType};
1
+ function H(){throw new Error("setTimeout has not been defined")}function V(){throw new Error("clearTimeout has not been defined")}var _=H,E=V;typeof globalThis.setTimeout=="function"&&(_=setTimeout);typeof globalThis.clearTimeout=="function"&&(E=clearTimeout);function q(t){if(_===setTimeout)return setTimeout(t,0);if((_===H||!_)&&setTimeout)return _=setTimeout,setTimeout(t,0);try{return _(t,0)}catch{try{return _.call(null,t,0)}catch{return _.call(this,t,0)}}}function Ie(t){if(E===clearTimeout)return clearTimeout(t);if((E===V||!E)&&clearTimeout)return E=clearTimeout,clearTimeout(t);try{return E(t)}catch{try{return E.call(null,t)}catch{return E.call(this,t)}}}var T=[],R=!1,C,N=-1;function he(){!R||!C||(R=!1,C.length?T=C.concat(T):N=-1,T.length&&z())}function z(){if(!R){var t=q(he);R=!0;for(var e=T.length;e;){for(C=T,T=[];++N<e;)C&&C[N].run();N=-1,e=T.length}C=null,R=!1,Ie(t)}}function be(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];T.push(new J(t,e)),T.length===1&&!R&&q(z)}function J(t,e){this.fun=t,this.array=e}J.prototype.run=function(){this.fun.apply(null,this.array)};var xe="browser",Ae="browser",Te=!0,ye={},_e=[],Ee="",Ce={},De={},we={};function D(){}var Oe=D,Se=D,Re=D,Ne=D,ke=D,ve=D,Pe=D;function Le(t){throw new Error("process.binding is not supported")}function Me(){return"/"}function Ue(t){throw new Error("process.chdir is not supported")}function Be(){return 0}var S=globalThis.performance||{},We=S.now||S.mozNow||S.msNow||S.oNow||S.webkitNow||function(){return new Date().getTime()};function Fe(t){var e=We.call(S)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var Ge=new Date;function Ye(){var t=new Date,e=t-Ge;return e/1e3}var p={nextTick:be,title:xe,browser:Te,env:ye,argv:_e,version:Ee,versions:Ce,on:Oe,addListener:Se,once:Re,off:Ne,removeListener:ke,removeAllListeners:ve,emit:Pe,binding:Le,cwd:Me,chdir:Ue,umask:Be,hrtime:Fe,platform:Ae,release:De,config:we,uptime:Ye},K={};Object.keys(K).forEach(t=>{let e=t.split("."),r=p;for(let n=0;n<e.length;n++){let i=e[n];n===e.length-1?r[i]=K[t]:r=r[i]||(r[i]={})}});var x=[],h=[],Ke=typeof Uint8Array<"u"?Uint8Array:Array,W=!1;function Z(){W=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)x[e]=t[e],h[t.charCodeAt(e)]=e;h[45]=62,h[95]=63}function He(t){W||Z();var e,r,n,i,o,s,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,s=new Ke(c*3/4-o),n=o>0?c-4:c;var u=0;for(e=0,r=0;e<n;e+=4,r+=3)i=h[t.charCodeAt(e)]<<18|h[t.charCodeAt(e+1)]<<12|h[t.charCodeAt(e+2)]<<6|h[t.charCodeAt(e+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=i&255;return o===2?(i=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,s[u++]=i&255):o===1&&(i=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=i&255),s}function Ve(t){return x[t>>18&63]+x[t>>12&63]+x[t>>6&63]+x[t&63]}function qe(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(Ve(n));return i.join("")}function X(t){W||Z();for(var e,r=t.length,n=r%3,i="",o=[],s=16383,c=0,u=r-n;c<u;c+=s)o.push(qe(t,c,c+s>u?u:c+s));return n===1?(e=t[r-1],i+=x[e>>2],i+=x[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=x[e>>10],i+=x[e>>4&63],i+=x[e<<2&63],i+="="),o.push(i),o.join("")}a.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;function k(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,e){if(k()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):(t===null&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return F(this,t)}return $(this,t,e,r)}a.poolSize=8192;a._augment=function(t){return t.__proto__=a.prototype,t};function $(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Xe(t,e,r,n):typeof e=="string"?Je(t,e,r):Qe(t,e)}a.from=function(t,e,r){return $(null,t,e,r)};a.kMaxLength=k();a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&a[Symbol.species]);function ee(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function ze(t,e,r,n){return ee(e),e<=0?y(t,e):r!==void 0?typeof n=="string"?y(t,e).fill(r,n):y(t,e).fill(r):y(t,e)}a.alloc=function(t,e,r){return ze(null,t,e,r)};function F(t,e){if(ee(e),t=y(t,e<0?0:G(e)|0),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}a.allocUnsafe=function(t){return F(null,t)};a.allocUnsafeSlow=function(t){return F(null,t)};function Je(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=re(e,r)|0;t=y(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function B(t,e){var r=e.length<0?0:G(e.length)|0;t=y(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Xe(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),a.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=a.prototype):t=B(t,e),t}function Qe(t,e){if(A(e)){var r=G(e.length)|0;return t=y(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||gr(e.length)?y(t,0):B(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return B(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function G(t){if(t>=k())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k().toString(16)+" bytes");return t|0}a.isBuffer=Ir;function A(t){return!!(t!=null&&t._isBuffer)}a.compare=function(e,r){if(!A(e)||!A(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};a.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=a.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!A(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i};function re(t,e){if(A(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 r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return v(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return pe(t).length;default:if(n)return v(t).length;e=(""+e).toLowerCase(),n=!0}}a.byteLength=re;function je(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return sr(this,e,r);case"utf8":case"utf-8":return ie(this,e,r);case"ascii":return ar(this,e,r);case"latin1":case"binary":return or(this,e,r);case"base64":return nr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pr(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)w(this,r,r+1);return this};a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)w(this,r,r+3),w(this,r+1,r+2);return this};a.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)w(this,r,r+7),w(this,r+1,r+6),w(this,r+2,r+5),w(this,r+3,r+4);return this};a.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?ie(this,0,e):je.apply(this,arguments)};a.prototype.equals=function(e){if(!A(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0};a.prototype.compare=function(e,r,n,i,o){if(!A(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,c=n-r,u=Math.min(s,c),l=this.slice(i,o),d=e.slice(r,n),m=0;m<u;++m)if(l[m]!==d[m]){s=l[m],c=d[m];break}return s<c?-1:c<s?1:0};function te(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=a.from(e,n)),A(e))return e.length===0?-1:Q(t,e,r,n,i);if(typeof e=="number")return e=e&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Q(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Q(t,e,r,n,i){var o=1,s=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(I,O){return o===1?I[O]:I.readUInt16BE(O*o)}var l;if(i){var d=-1;for(l=r;l<s;l++)if(u(t,l)===u(e,d===-1?0:l-d)){if(d===-1&&(d=l),l-d+1===c)return d*o}else d!==-1&&(l-=l-d),d=-1}else for(r+c>s&&(r=s-c),l=r;l>=0;l--){for(var m=!0,b=0;b<c;b++)if(u(t,l+b)!==u(e,b)){m=!1;break}if(m)return l}return-1}a.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};a.prototype.indexOf=function(e,r,n){return te(this,e,r,n,!0)};a.prototype.lastIndexOf=function(e,r,n){return te(this,e,r,n,!1)};function Ze(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var c=parseInt(e.substr(s*2,2),16);if(isNaN(c))return s;t[r+s]=c}return s}function $e(t,e,r,n){return M(v(e,t.length-r),t,r,n)}function ne(t,e,r,n){return M(lr(e),t,r,n)}function er(t,e,r,n){return ne(t,e,r,n)}function rr(t,e,r,n){return M(pe(e),t,r,n)}function tr(t,e,r,n){return M(fr(e,t.length-r),t,r,n)}a.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r|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-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return Ze(this,e,r,n);case"utf8":case"utf-8":return $e(this,e,r,n);case"ascii":return ne(this,e,r,n);case"latin1":case"binary":return er(this,e,r,n);case"base64":return rr(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tr(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nr(t,e,r){return e===0&&r===t.length?X(t):X(t.slice(e,r))}function ie(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],s=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){var u,l,d,m;switch(c){case 1:o<128&&(s=o);break;case 2:u=t[i+1],(u&192)===128&&(m=(o&31)<<6|u&63,m>127&&(s=m));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(m=(o&15)<<12|(u&63)<<6|l&63,m>2047&&(m<55296||m>57343)&&(s=m));break;case 4:u=t[i+1],l=t[i+2],d=t[i+3],(u&192)===128&&(l&192)===128&&(d&192)===128&&(m=(o&15)<<18|(u&63)<<12|(l&63)<<6|d&63,m>65535&&m<1114112&&(s=m))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=c}return ir(n)}var j=4096;function ir(t){var e=t.length;if(e<=j)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=j));return r}function ar(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function or(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function sr(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=mr(t[o]);return i}function pr(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}a.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var i;if(a.TYPED_ARRAY_SUPPORT)i=this.subarray(e,r),i.__proto__=a.prototype;else{var o=r-e;i=new a(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i};function f(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i};a.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i};a.prototype.readUInt8=function(e,r){return r||f(e,1,this.length),this[e]};a.prototype.readUInt16LE=function(e,r){return r||f(e,2,this.length),this[e]|this[e+1]<<8};a.prototype.readUInt16BE=function(e,r){return r||f(e,2,this.length),this[e]<<8|this[e+1]};a.prototype.readUInt32LE=function(e,r){return r||f(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};a.prototype.readUInt32BE=function(e,r){return r||f(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};a.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};a.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||f(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};a.prototype.readInt8=function(e,r){return r||f(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};a.prototype.readInt16LE=function(e,r){r||f(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(e,r){r||f(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(e,r){return r||f(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};a.prototype.readInt32BE=function(e,r){return r||f(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};a.prototype.readFloatLE=function(e,r){return r||f(e,4,this.length),U(this,e,!0,23,4)};a.prototype.readFloatBE=function(e,r){return r||f(e,4,this.length),U(this,e,!1,23,4)};a.prototype.readDoubleLE=function(e,r){return r||f(e,8,this.length),U(this,e,!0,52,8)};a.prototype.readDoubleBE=function(e,r){return r||f(e,8,this.length),U(this,e,!1,52,8)};function g(t,e,r,n,i,o){if(!A(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;g(this,e,r,n,o,0)}var s=1,c=0;for(this[r]=e&255;++c<n&&(s*=256);)this[r+c]=e/s&255;return r+n};a.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;g(this,e,r,n,o,0)}var s=n-1,c=1;for(this[r+s]=e&255;--s>=0&&(c*=256);)this[r+s]=e/c&255;return r+n};a.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function P(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):P(this,e,r,!0),r+2};a.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):P(this,e,r,!1),r+2};function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>(n?i:3-i)*8&255}a.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):L(this,e,r,!0),r+4};a.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):L(this,e,r,!1),r+4};a.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);g(this,e,r,n,o-1,-o)}var s=0,c=1,u=0;for(this[r]=e&255;++s<n&&(c*=256);)e<0&&u===0&&this[r+s-1]!==0&&(u=1),this[r+s]=(e/c>>0)-u&255;return r+n};a.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);g(this,e,r,n,o-1,-o)}var s=n-1,c=1,u=0;for(this[r+s]=e&255;--s>=0&&(c*=256);)e<0&&u===0&&this[r+s+1]!==0&&(u=1),this[r+s]=(e/c>>0)-u&255;return r+n};a.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};a.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):P(this,e,r,!0),r+2};a.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):P(this,e,r,!1),r+2};a.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):L(this,e,r,!0),r+4};a.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||g(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):L(this,e,r,!1),r+4};function ae(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function oe(t,e,r,n,i){return i||ae(t,e,r,4,34028234663852886e22,-34028234663852886e22),ue(t,e,r,n,23,4),r+4}a.prototype.writeFloatLE=function(e,r,n){return oe(this,e,r,!0,n)};a.prototype.writeFloatBE=function(e,r,n){return oe(this,e,r,!1,n)};function se(t,e,r,n,i){return i||ae(t,e,r,8,17976931348623157e292,-17976931348623157e292),ue(t,e,r,n,52,8),r+8}a.prototype.writeDoubleLE=function(e,r,n){return se(this,e,r,!0,n)};a.prototype.writeDoubleBE=function(e,r,n){return se(this,e,r,!1,n)};a.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<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),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,s;if(this===e&&n<r&&r<i)for(s=o-1;s>=0;--s)e[s+r]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o};a.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<n;++s)this[s]=e;else{var c=A(e)?e:v(new a(e,i).toString()),u=c.length;for(s=0;s<n-r;++s)this[s+r]=c[s%u]}return this};var cr=/[^+\/0-9A-Za-z-_]/g;function ur(t){if(t=dr(t).replace(cr,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function dr(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function mr(t){return t<16?"0"+t.toString(16):t.toString(16)}function v(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function lr(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function fr(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function pe(t){return He(ur(t))}function M(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function gr(t){return t!==t}function Ir(t){return t!=null&&(!!t._isBuffer||ce(t)||hr(t))}function ce(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function hr(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ce(t.slice(0,0))}function U(t,e,r,n,i){var o,s,c=i*8-n-1,u=(1<<c)-1,l=u>>1,d=-7,m=r?i-1:0,b=r?-1:1,I=t[e+m];for(m+=b,o=I&(1<<-d)-1,I>>=-d,d+=c;d>0;o=o*256+t[e+m],m+=b,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+t[e+m],m+=b,d-=8);if(o===0)o=1-l;else{if(o===u)return s?NaN:(I?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-l}return(I?-1:1)*s*Math.pow(2,o-n)}function ue(t,e,r,n,i,o){var s,c,u,l=o*8-i-1,d=(1<<l)-1,m=d>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:o-1,O=n?1:-1,ge=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+m>=1?e+=b/u:e+=b*Math.pow(2,1-m),e*u>=2&&(s++,u/=2),s+m>=d?(c=0,s=d):s+m>=1?(c=(e*u-1)*Math.pow(2,i),s=s+m):(c=e*Math.pow(2,m-1)*Math.pow(2,i),s=0));i>=8;t[r+I]=c&255,I+=O,c/=256,i-=8);for(s=s<<i|c,l+=i;l>0;t[r+I]=s&255,I+=O,s/=256,l-=8);t[r+I-O]|=ge*128}var Y=(r=>(r.User="User",r.Api="API",r))(Y||{});var de=(i=>(i.GLOBAL_PAIR_DELISTING="GLOBAL_PAIR_DELISTING",i.GLOBAL_NEW_PAIR_LISTING="GLOBAL_NEW_PAIR_LISTING",i.GLOBAL_SYSTEM_MAINTENANCE="GLOBAL_SYSTEM_MAINTENANCE",i.GLOBAL_SMART_CONTRACT_UPDATE="GLOBAL_SMART_CONTRACT_UPDATE",i))(de||{}),me=(n=>(n.ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT="ACCOUNT_POINTS_UNLOCK_ACHIEVEMENT",n.ACCOUNT_KYC_STATUS_CHANGED="ACCOUNT_KYC_STATUS_CHANGED",n.ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED="ACCOUNT_AFFILIATE_DASHBOARD_UNLOCKED",n))(me||{}),Bt={...de,...me};var le=(n=>(n.SOLANA="SOLANA",n.ALGORAND="ALGORAND",n.EVM="EVM",n))(le||{});var br=(d=>(d.PERA="PERA",d.METAMASK="METAMASK",d.TRUST_WALLET="TRUST_WALLET",d.PHANTOM="PHANTOM",d.WALLET_CONNECT="WALLET_CONNECT",d.SOLANA_MOBILE="SOLANA_MOBILE",d.SOLFLARE="SOLFLARE",d.COINBASE="COINBASE",d.BACKPACK="BACKPACK",d.MOBILE="MOBILE",d))(br||{});var fe=class{};export{fe as ISetting,br as PROVIDERS,Y as TradingKeyType,le as WithdrawalWalletType};
2
2
  /*! Bundled license information:
3
3
 
4
4
  @esbuild-plugins/node-globals-polyfill/Buffer.js: