@dodoex/wallet-web3 0.0.41 → 0.0.42

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 (78) hide show
  1. package/dist/{DefaultJsonRpcProvider-81dbd3f9.js → DefaultJsonRpcProvider-470545c2.js} +1 -1
  2. package/dist/__node-resolve_empty-f90bb206.js +1 -0
  3. package/dist/__tslib-041a522f.js +1 -0
  4. package/dist/{blocto-a553b391.js → blocto-a613e3ea.js} +1 -1
  5. package/dist/{bn-8f7cc9b5.js → bn-a73d500d.js} +1 -1
  6. package/dist/{browser-ponyfill-4134b2b7.js → browser-ponyfill-5a72503b.js} +1 -1
  7. package/dist/cjs/{DefaultJsonRpcProvider-851de86a.cjs → DefaultJsonRpcProvider-1b124fcf.cjs} +1 -1
  8. package/dist/cjs/{__node-resolve_empty-04cc3662.cjs → __node-resolve_empty-c6c4d691.cjs} +1 -1
  9. package/dist/cjs/__tslib-74b92aa0.cjs +1 -0
  10. package/dist/cjs/{blocto-1d2d3abc.cjs → blocto-54eeaf0e.cjs} +1 -1
  11. package/dist/cjs/{bn-8a65a921.cjs → bn-5799deeb.cjs} +1 -1
  12. package/dist/cjs/{browser-ponyfill-96a14706.cjs → browser-ponyfill-98c87b2b.cjs} +1 -1
  13. package/dist/cjs/{draggabilly-326f0353.cjs → draggabilly-0280fdd9.cjs} +1 -1
  14. package/dist/cjs/{ethers-c6e7830c.cjs → ethers-1f3c68c5.cjs} +1 -1
  15. package/dist/cjs/{id-ac2184da.cjs → id-f0a49000.cjs} +1 -1
  16. package/dist/cjs/{index-4685dfbc.cjs → index-1334a219.cjs} +2 -2
  17. package/dist/cjs/{index-c6a78b5c.cjs → index-26ef8efb.cjs} +1 -1
  18. package/dist/cjs/{index-b3a93c7d.cjs → index-47b72555.cjs} +1 -1
  19. package/dist/cjs/{index-97c32dcf.cjs → index-5d2a4d45.cjs} +1 -1
  20. package/dist/cjs/{index-01b3872e.cjs → index-7c8afb3d.cjs} +1 -1
  21. package/dist/cjs/{index-8d32723e.cjs → index-876f807b.cjs} +1 -1
  22. package/dist/cjs/{index-4f46ab04.cjs → index-965f574d.cjs} +1 -1
  23. package/dist/cjs/{index-6130f88a.cjs → index-9c3d3910.cjs} +2 -2
  24. package/dist/cjs/{index-38a82c12.cjs → index-ade355c8.cjs} +1 -1
  25. package/dist/cjs/{index-d89005f4.cjs → index-dbfff00c.cjs} +1 -1
  26. package/dist/cjs/{index-823d3a25.cjs → index-eeb0556a.cjs} +1 -1
  27. package/dist/cjs/index.cjs +1 -1
  28. package/dist/cjs/{index.es-168fe2b1.cjs → index.es-d8a23b8c.cjs} +1 -1
  29. package/dist/cjs/{interface-f6b53727.cjs → interface-32ec049c.cjs} +1 -1
  30. package/dist/cjs/{lib-typedarrays-05755aa6.cjs → lib-typedarrays-c773181b.cjs} +1 -1
  31. package/dist/cjs/{portis-7873ce6a.cjs → portis-7b794882.cjs} +1 -1
  32. package/dist/cjs/{provider-d7c647ea.cjs → provider-73c10a83.cjs} +1 -1
  33. package/dist/cjs/providers/connector/injected.d.ts +1 -1
  34. package/dist/cjs/providers/connector/types.d.ts +1 -0
  35. package/dist/cjs/{rainbow-43c8e5f6.cjs → rainbow-59104eb0.cjs} +1 -1
  36. package/dist/cjs/sha224-c7a50394.cjs +1 -0
  37. package/dist/cjs/{sha256-7cc68713.cjs → sha256-33ca448e.cjs} +1 -1
  38. package/dist/cjs/{uAuth-6aa71b34.cjs → uAuth-2de77cf5.cjs} +1 -1
  39. package/dist/cjs/walletConnect-23c4ab09.cjs +1 -0
  40. package/dist/cjs/{walletLink-eb56d177.cjs → walletLink-e9532414.cjs} +1 -1
  41. package/dist/{draggabilly-291f869b.js → draggabilly-186183f4.js} +1 -1
  42. package/dist/{ethers-f8f094be.js → ethers-5bf5b00b.js} +1 -1
  43. package/dist/{id-dcb529f4.js → id-f73e9185.js} +1 -1
  44. package/dist/{index-a1df7720.js → index-4a260eae.js} +1 -1
  45. package/dist/{index-e3070128.js → index-4a2d9b19.js} +1 -1
  46. package/dist/{index-20ce8a4c.js → index-66448990.js} +1 -1
  47. package/dist/{index-cebac794.js → index-687aa034.js} +2 -2
  48. package/dist/{index-bc061f7b.js → index-8cc67274.js} +1 -1
  49. package/dist/{index-cec5c507.js → index-9ef93cee.js} +1 -1
  50. package/dist/{index-7a7a090a.js → index-b7b5de53.js} +1 -1
  51. package/dist/{index-89a7e976.js → index-d18b1515.js} +1 -1
  52. package/dist/index-ec768c82.js +1 -0
  53. package/dist/{index-914dc773.js → index-fca1a0c3.js} +1 -1
  54. package/dist/{index-4e6b81d8.js → index-fdf822d6.js} +1 -1
  55. package/dist/{index.es-b6986074.js → index.es-d0dcd244.js} +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/{interface-6c3ec32a.js → interface-cd17b51d.js} +1 -1
  58. package/dist/{lib-typedarrays-f1051e37.js → lib-typedarrays-b049d0e6.js} +1 -1
  59. package/dist/{portis-6c321b6b.js → portis-eedfe5a8.js} +1 -1
  60. package/dist/{provider-0a241f15.js → provider-cc8e4040.js} +1 -1
  61. package/dist/providers/connector/injected.d.ts +1 -1
  62. package/dist/providers/connector/types.d.ts +1 -0
  63. package/dist/rainbow-bc431cfa.js +1 -0
  64. package/dist/sha224-882535a5.js +1 -0
  65. package/dist/{sha256-79cd8cb2.js → sha256-081247ed.js} +1 -1
  66. package/dist/{uAuth-57530103.js → uAuth-acbb6033.js} +1 -1
  67. package/dist/walletConnect-622e5dfc.js +1 -0
  68. package/dist/{walletLink-7f641f02.js → walletLink-90f5ac8d.js} +1 -1
  69. package/package.json +1 -1
  70. package/dist/__node-resolve_empty-314df16e.js +0 -1
  71. package/dist/__tslib-895a7349.js +0 -1
  72. package/dist/cjs/__tslib-07f80053.cjs +0 -1
  73. package/dist/cjs/sha224-86e8cc7f.cjs +0 -1
  74. package/dist/cjs/walletConnect-b0df4f12.cjs +0 -1
  75. package/dist/index-cbfb042c.js +0 -1
  76. package/dist/rainbow-43a583fd.js +0 -1
  77. package/dist/sha224-1e5a1736.js +0 -1
  78. package/dist/walletConnect-dc900305.js +0 -1
@@ -1,3 +1,3 @@
1
- "use strict";var t=require("./index-4685dfbc.cjs"),e=require("events"),r=require("./__node-resolve_empty-04cc3662.cjs"),n=require("./inherits_browser-50deae74.cjs"),i=require("buffer"),o=require("./index-70269942.cjs"),s=require("./__tslib-07f80053.cjs");function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}require("@ethersproject/providers"),require("zustand"),require("@ethersproject/address"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/properties"),require("@ethersproject/transactions"),require("@ethersproject/bytes"),require("util");var u=a(e),c=a(i),l={},h={},d={};Object.defineProperty(d,"__esModule",{value:!0}),d.walletLogo=void 0;d.walletLogo=(t,e)=>{let r;switch(t){case"standard":default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}};var f={};Object.defineProperty(f,"__esModule",{value:!0}),f.ScopedLocalStorage=void 0;f.ScopedLocalStorage=class{constructor(t){this.scope=t}setItem(t,e){localStorage.setItem(this.scopedKey(t),e)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),e=[];for(let r=0;r<localStorage.length;r++){const n=localStorage.key(r);"string"==typeof n&&n.startsWith(t)&&e.push(n)}e.forEach((t=>localStorage.removeItem(t)))}scopedKey(t){return`${this.scope}:${t}`}};var p={},g={};Object.defineProperty(g,"__esModule",{value:!0});const b=u.default;function y(t,e,r){try{Reflect.apply(t,e,r)}catch(t){setTimeout((()=>{throw t}))}}class m extends b.EventEmitter{emit(t,...e){let r="error"===t;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let t;if(e.length>0&&([t]=e),t instanceof Error)throw t;const r=new Error("Unhandled error."+(t?` (${t.message})`:""));throw r.context=t,r}const i=n[t];if(void 0===i)return!1;if("function"==typeof i)y(i,this,e);else{const t=i.length,r=function(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}(i);for(let n=0;n<t;n+=1)y(r[n],this,e)}return!0}}g.default=m;var v={exports:{}};!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r.require$$1.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var c=t.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){l(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],l=p[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var g=h.modrn(l).toString(t);r=(h=h.idivn(l)).isZero()?g+r:d[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var b=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,d=l>>>13,f=0|s[1],p=8191&f,g=f>>>13,b=0|s[2],y=8191&b,m=b>>>13,v=0|s[3],_=8191&v,w=v>>>13,S=0|s[4],E=8191&S,M=S>>>13,x=0|s[5],k=8191&x,C=x>>>13,I=0|s[6],R=8191&I,A=I>>>13,N=0|s[7],j=8191&N,O=N>>>13,T=0|s[8],P=8191&T,L=T>>>13,D=0|s[9],B=8191&D,F=D>>>13,U=0|a[0],V=8191&U,H=U>>>13,W=0|a[1],z=8191&W,q=W>>>13,$=0|a[2],J=8191&$,G=$>>>13,Z=0|a[3],Q=8191&Z,Y=Z>>>13,K=0|a[4],X=8191&K,tt=K>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,dt=lt>>>13,ft=0|a[9],pt=8191&ft,gt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(c+(n=Math.imul(h,V))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(d,V)|0))<<13)|0;c=((o=Math.imul(d,H))+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,H))+Math.imul(g,V)|0,o=Math.imul(g,H);var yt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(d,z)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,H))+Math.imul(m,V)|0,o=Math.imul(m,H),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,q)|0;var mt=(c+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(_,V),i=(i=Math.imul(_,H))+Math.imul(w,V)|0,o=Math.imul(w,H),n=n+Math.imul(y,z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,G)|0;var vt=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,H))+Math.imul(M,V)|0,o=Math.imul(M,H),n=n+Math.imul(_,z)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,z)|0,o=o+Math.imul(w,q)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,G)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,Y)|0;var _t=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,X)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,V),i=(i=Math.imul(k,H))+Math.imul(C,V)|0,o=Math.imul(C,H),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,q)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var wt=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;c=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,H))+Math.imul(A,V)|0,o=Math.imul(A,H),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0;var St=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,H))+Math.imul(O,V)|0,o=Math.imul(O,H),n=n+Math.imul(R,z)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,V),i=(i=Math.imul(P,H))+Math.imul(L,V)|0,o=Math.imul(L,H),n=n+Math.imul(j,z)|0,i=(i=i+Math.imul(j,q)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ct)|0;var Mt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,V),i=(i=Math.imul(B,H))+Math.imul(F,V)|0,o=Math.imul(F,H),n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(j,J)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,dt)|0;var xt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(B,z),i=(i=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ct)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,J),i=(i=Math.imul(B,G))+Math.imul(F,J)|0,o=Math.imul(F,G),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,dt)|0;var Ct=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,gt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,Y))+Math.imul(F,Q)|0,o=Math.imul(F,Y),n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var It=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,gt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,X),i=(i=Math.imul(B,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,dt)|0;var Rt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,gt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var At=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,gt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,ot),i=(i=Math.imul(B,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(j,ht)|0,i=(i=i+Math.imul(j,dt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0;var Nt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(F,ut)|0,o=Math.imul(F,ct),n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,dt)|0;var jt=(c+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,gt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,gt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(F,ht)|0,o=Math.imul(F,dt);var Ot=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Tt=(c+(n=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,gt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,gt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=bt,u[1]=yt,u[2]=mt,u[3]=vt,u[4]=_t,u[5]=wt,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=xt,u[10]=kt,u[11]=Ct,u[12]=It,u[13]=Rt,u[14]=At,u[15]=Nt,u[16]=jt,u[17]=Ot,u[18]=Tt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),d=67108863&h;a=67108863&(d=d+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(t,e,r){return y(t,e,r)}Math.imul||(b=g),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):r<63?g(this,t,e):r<1024?y(this,t,e):m(this,t,e)},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(w,_),w.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(S,_),i(E,_),i(M,_),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new S;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(a);){for(var g=f,b=0;0!==g.cmp(a);b++)g=g.redSqr();n(b<p);var y=this.pow(h,new o(1).iushln(p-b-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=b}return d},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(v,t.commonjsGlobal);var _={},w={},S=I;I.default=I,I.stable=j,I.stableStringify=j;var E="[...]",M="[Circular]",x=[],k=[];function C(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function I(t,e,r,n){var i;void 0===n&&(n=C()),A(t,"",0,[],void 0,0,n);try{i=0===k.length?JSON.stringify(t,e,r):JSON.stringify(t,T(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==x.length;){var o=x.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function R(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);void 0!==i.get?i.configurable?(Object.defineProperty(n,r,{value:t}),x.push([n,r,e,i])):k.push([e,r,t]):(n[r]=t,x.push([n,r,e]))}function A(t,e,r,n,i,o,s){var a;if(o+=1,"object"==typeof t&&null!==t){for(a=0;a<n.length;a++)if(n[a]===t)return void R(M,t,e,i);if(void 0!==s.depthLimit&&o>s.depthLimit)return void R(E,t,e,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void R(E,t,e,i);if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)A(t[a],a,a,n,t,o,s);else{var u=Object.keys(t);for(a=0;a<u.length;a++){var c=u[a];A(t[c],c,a,n,t,o,s)}}n.pop()}}function N(t,e){return t<e?-1:t>e?1:0}function j(t,e,r,n){void 0===n&&(n=C());var i,o=O(t,"",0,[],void 0,0,n)||t;try{i=0===k.length?JSON.stringify(o,e,r):JSON.stringify(o,T(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==x.length;){var s=x.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function O(t,e,r,n,i,o,s){var a;if(o+=1,"object"==typeof t&&null!==t){for(a=0;a<n.length;a++)if(n[a]===t)return void R(M,t,e,i);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==s.depthLimit&&o>s.depthLimit)return void R(E,t,e,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void R(E,t,e,i);if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)O(t[a],a,a,n,t,o,s);else{var u={},c=Object.keys(t).sort(N);for(a=0;a<c.length;a++){var l=c[a];O(t[l],l,a,n,t,o,s),u[l]=t[l]}if(void 0===i)return u;x.push([i,e,t]),i[e]=u}n.pop()}}function T(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(k.length>0)for(var n=0;n<k.length;n++){var i=k[n];if(i[1]===e&&i[0]===r){r=i[2],k.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(w,"__esModule",{value:!0}),w.EthereumProviderError=w.EthereumRpcError=void 0;const P=S;class L extends Error{constructor(t,e,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==r&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return P.default(this.serialize(),D,2)}}w.EthereumRpcError=L;function D(t,e){if("[Circular]"!==e)return e}w.EthereumProviderError=class extends L{constructor(t,e,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r)}};var B={},F={};Object.defineProperty(F,"__esModule",{value:!0}),F.errorValues=F.errorCodes=void 0,F.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},F.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=F,r=w,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};function s(r,n=i){if(Number.isInteger(r)){const n=r.toString();if(l(e.errorValues,n))return e.errorValues[n].message;if(u(r))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function a(t){if(!Number.isInteger(t))return!1;const r=t.toString();return!!e.errorValues[r]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=a,t.serializeError=function(t,{fallbackError:e=o,shouldIncludeStack:n=!1}={}){var i,u;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof r.EthereumRpcError)return t.serialize();const h={};if(t&&"object"==typeof t&&!Array.isArray(t)&&l(t,"code")&&a(t.code)){const e=t;h.code=e.code,e.message&&"string"==typeof e.message?(h.message=e.message,l(e,"data")&&(h.data=e.data)):(h.message=s(h.code),h.data={originalError:c(t)})}else{h.code=e.code;const r=null===(i=t)||void 0===i?void 0:i.message;h.message=r&&"string"==typeof r?r:e.message,h.data={originalError:c(t)}}const d=null===(u=t)||void 0===u?void 0:u.stack;return n&&t&&d&&"string"==typeof d&&(h.stack=d),h}}(B);var U={};Object.defineProperty(U,"__esModule",{value:!0}),U.ethErrors=void 0;const V=w,H=B,W=F;function z(t,e){const[r,n]=$(e);return new V.EthereumRpcError(t,r||H.getMessageFromCode(t),n)}function q(t,e){const[r,n]=$(e);return new V.EthereumProviderError(t,r||H.getMessageFromCode(t),n)}function $(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}U.ethErrors={rpc:{parse:t=>z(W.errorCodes.rpc.parse,t),invalidRequest:t=>z(W.errorCodes.rpc.invalidRequest,t),invalidParams:t=>z(W.errorCodes.rpc.invalidParams,t),methodNotFound:t=>z(W.errorCodes.rpc.methodNotFound,t),internal:t=>z(W.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return z(e,t)},invalidInput:t=>z(W.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>z(W.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>z(W.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>z(W.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>z(W.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>z(W.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>q(W.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>q(W.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>q(W.errorCodes.provider.unsupportedMethod,t),disconnected:t=>q(W.errorCodes.provider.disconnected,t),chainDisconnected:t=>q(W.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new V.EthereumProviderError(e,r,n)}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=w;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=B;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=U;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=F;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(_);var J={};Object.defineProperty(J,"__esModule",{value:!0}),J.EVENTS=void 0,J.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var G={},Z={exports:{}},Q={exports:{}};
1
+ "use strict";var t=require("./index-1334a219.cjs"),e=require("events"),r=require("./__node-resolve_empty-c6c4d691.cjs"),n=require("./inherits_browser-50deae74.cjs"),i=require("buffer"),o=require("./index-70269942.cjs"),s=require("./__tslib-74b92aa0.cjs");function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}require("@ethersproject/providers"),require("zustand"),require("@ethersproject/address"),require("@ethersproject/constants"),require("@ethersproject/contracts"),require("@ethersproject/properties"),require("@ethersproject/transactions"),require("@ethersproject/bytes"),require("util");var u=a(e),c=a(i),l={},h={},d={};Object.defineProperty(d,"__esModule",{value:!0}),d.walletLogo=void 0;d.walletLogo=(t,e)=>{let r;switch(t){case"standard":default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}};var f={};Object.defineProperty(f,"__esModule",{value:!0}),f.ScopedLocalStorage=void 0;f.ScopedLocalStorage=class{constructor(t){this.scope=t}setItem(t,e){localStorage.setItem(this.scopedKey(t),e)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),e=[];for(let r=0;r<localStorage.length;r++){const n=localStorage.key(r);"string"==typeof n&&n.startsWith(t)&&e.push(n)}e.forEach((t=>localStorage.removeItem(t)))}scopedKey(t){return`${this.scope}:${t}`}};var p={},g={};Object.defineProperty(g,"__esModule",{value:!0});const b=u.default;function y(t,e,r){try{Reflect.apply(t,e,r)}catch(t){setTimeout((()=>{throw t}))}}class m extends b.EventEmitter{emit(t,...e){let r="error"===t;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let t;if(e.length>0&&([t]=e),t instanceof Error)throw t;const r=new Error("Unhandled error."+(t?` (${t.message})`:""));throw r.context=t,r}const i=n[t];if(void 0===i)return!1;if("function"==typeof i)y(i,this,e);else{const t=i.length,r=function(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}(i);for(let n=0;n<t;n+=1)y(r[n],this,e)}return!0}}g.default=m;var v={exports:{}};!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r.require$$1.Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var c=t.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(t,l,l+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var h=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){l(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,d=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=d;f++){var p=c-f|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[f])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],l=p[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var g=h.modrn(l).toString(t);r=(h=h.idivn(l)).isZero()?g+r:d[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var b=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,l=0|s[0],h=8191&l,d=l>>>13,f=0|s[1],p=8191&f,g=f>>>13,b=0|s[2],y=8191&b,m=b>>>13,v=0|s[3],_=8191&v,w=v>>>13,S=0|s[4],E=8191&S,M=S>>>13,x=0|s[5],k=8191&x,C=x>>>13,I=0|s[6],R=8191&I,A=I>>>13,N=0|s[7],j=8191&N,O=N>>>13,T=0|s[8],P=8191&T,L=T>>>13,D=0|s[9],B=8191&D,F=D>>>13,U=0|a[0],V=8191&U,H=U>>>13,W=0|a[1],z=8191&W,q=W>>>13,$=0|a[2],J=8191&$,G=$>>>13,Z=0|a[3],Q=8191&Z,Y=Z>>>13,K=0|a[4],X=8191&K,tt=K>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191&lt,dt=lt>>>13,ft=0|a[9],pt=8191&ft,gt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(c+(n=Math.imul(h,V))|0)+((8191&(i=(i=Math.imul(h,H))+Math.imul(d,V)|0))<<13)|0;c=((o=Math.imul(d,H))+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,H))+Math.imul(g,V)|0,o=Math.imul(g,H);var yt=(c+(n=n+Math.imul(h,z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(d,z)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,H))+Math.imul(m,V)|0,o=Math.imul(m,H),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,q)|0;var mt=(c+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(_,V),i=(i=Math.imul(_,H))+Math.imul(w,V)|0,o=Math.imul(w,H),n=n+Math.imul(y,z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,G)|0;var vt=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,V),i=(i=Math.imul(E,H))+Math.imul(M,V)|0,o=Math.imul(M,H),n=n+Math.imul(_,z)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,z)|0,o=o+Math.imul(w,q)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,G)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,Y)|0;var _t=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,X)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,V),i=(i=Math.imul(k,H))+Math.imul(C,V)|0,o=Math.imul(C,H),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,q)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,tt)|0;var wt=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;c=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,H))+Math.imul(A,V)|0,o=Math.imul(A,H),n=n+Math.imul(k,z)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(C,z)|0,o=o+Math.imul(C,q)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0;var St=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,H))+Math.imul(O,V)|0,o=Math.imul(O,H),n=n+Math.imul(R,z)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0;var Et=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,V),i=(i=Math.imul(P,H))+Math.imul(L,V)|0,o=Math.imul(L,H),n=n+Math.imul(j,z)|0,i=(i=i+Math.imul(j,q)|0)+Math.imul(O,z)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ct)|0;var Mt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,V),i=(i=Math.imul(B,H))+Math.imul(F,V)|0,o=Math.imul(F,H),n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(j,J)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(g,ht)|0,o=o+Math.imul(g,dt)|0;var xt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,gt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(B,z),i=(i=Math.imul(B,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ct)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,J),i=(i=Math.imul(B,G))+Math.imul(F,J)|0,o=Math.imul(F,G),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,dt)|0;var Ct=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,gt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,Q),i=(i=Math.imul(B,Y))+Math.imul(F,Q)|0,o=Math.imul(F,Y),n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var It=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,gt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,X),i=(i=Math.imul(B,tt))+Math.imul(F,X)|0,o=Math.imul(F,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,dt)|0;var Rt=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,gt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,gt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var At=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,gt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,ot),i=(i=Math.imul(B,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(j,ht)|0,i=(i=i+Math.imul(j,dt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0;var Nt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,gt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(B,ut),i=(i=Math.imul(B,ct))+Math.imul(F,ut)|0,o=Math.imul(F,ct),n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,dt)|0;var jt=(c+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,gt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,gt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(B,ht),i=(i=Math.imul(B,dt))+Math.imul(F,ht)|0,o=Math.imul(F,dt);var Ot=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,gt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,gt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Tt=(c+(n=Math.imul(B,pt))|0)+((8191&(i=(i=Math.imul(B,gt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,gt))+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,u[0]=bt,u[1]=yt,u[2]=mt,u[3]=vt,u[4]=_t,u[5]=wt,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=xt,u[10]=kt,u[11]=Ct,u[12]=It,u[13]=Rt,u[14]=At,u[15]=Nt,u[16]=jt,u[17]=Ot,u[18]=Tt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var l=o-c,h=(0|t.words[l])*(0|e.words[c]),d=67108863&h;a=67108863&(d=d+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(t,e,r){return y(t,e,r)}Math.imul||(b=g),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?b(this,t,e):r<63?g(this,t,e):r<1024?y(this,t,e):m(this,t,e)},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(w,_),w.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(S,_),i(E,_),i(M,_),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new S;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return v[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(a);){for(var g=f,b=0;0!==g.cmp(a);b++)g=g.redSqr();n(b<p);var y=this.pow(h,new o(1).iushln(p-b-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=b}return d},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(v,t.commonjsGlobal);var _={},w={},S=I;I.default=I,I.stable=j,I.stableStringify=j;var E="[...]",M="[Circular]",x=[],k=[];function C(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function I(t,e,r,n){var i;void 0===n&&(n=C()),A(t,"",0,[],void 0,0,n);try{i=0===k.length?JSON.stringify(t,e,r):JSON.stringify(t,T(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==x.length;){var o=x.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function R(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);void 0!==i.get?i.configurable?(Object.defineProperty(n,r,{value:t}),x.push([n,r,e,i])):k.push([e,r,t]):(n[r]=t,x.push([n,r,e]))}function A(t,e,r,n,i,o,s){var a;if(o+=1,"object"==typeof t&&null!==t){for(a=0;a<n.length;a++)if(n[a]===t)return void R(M,t,e,i);if(void 0!==s.depthLimit&&o>s.depthLimit)return void R(E,t,e,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void R(E,t,e,i);if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)A(t[a],a,a,n,t,o,s);else{var u=Object.keys(t);for(a=0;a<u.length;a++){var c=u[a];A(t[c],c,a,n,t,o,s)}}n.pop()}}function N(t,e){return t<e?-1:t>e?1:0}function j(t,e,r,n){void 0===n&&(n=C());var i,o=O(t,"",0,[],void 0,0,n)||t;try{i=0===k.length?JSON.stringify(o,e,r):JSON.stringify(o,T(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==x.length;){var s=x.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function O(t,e,r,n,i,o,s){var a;if(o+=1,"object"==typeof t&&null!==t){for(a=0;a<n.length;a++)if(n[a]===t)return void R(M,t,e,i);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==s.depthLimit&&o>s.depthLimit)return void R(E,t,e,i);if(void 0!==s.edgesLimit&&r+1>s.edgesLimit)return void R(E,t,e,i);if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)O(t[a],a,a,n,t,o,s);else{var u={},c=Object.keys(t).sort(N);for(a=0;a<c.length;a++){var l=c[a];O(t[l],l,a,n,t,o,s),u[l]=t[l]}if(void 0===i)return u;x.push([i,e,t]),i[e]=u}n.pop()}}function T(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(k.length>0)for(var n=0;n<k.length;n++){var i=k[n];if(i[1]===e&&i[0]===r){r=i[2],k.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(w,"__esModule",{value:!0}),w.EthereumProviderError=w.EthereumRpcError=void 0;const P=S;class L extends Error{constructor(t,e,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==r&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return P.default(this.serialize(),D,2)}}w.EthereumRpcError=L;function D(t,e){if("[Circular]"!==e)return e}w.EthereumProviderError=class extends L{constructor(t,e,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r)}};var B={},F={};Object.defineProperty(F,"__esModule",{value:!0}),F.errorValues=F.errorCodes=void 0,F.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},F.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=F,r=w,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};function s(r,n=i){if(Number.isInteger(r)){const n=r.toString();if(l(e.errorValues,n))return e.errorValues[n].message;if(u(r))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function a(t){if(!Number.isInteger(t))return!1;const r=t.toString();return!!e.errorValues[r]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=a,t.serializeError=function(t,{fallbackError:e=o,shouldIncludeStack:n=!1}={}){var i,u;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof r.EthereumRpcError)return t.serialize();const h={};if(t&&"object"==typeof t&&!Array.isArray(t)&&l(t,"code")&&a(t.code)){const e=t;h.code=e.code,e.message&&"string"==typeof e.message?(h.message=e.message,l(e,"data")&&(h.data=e.data)):(h.message=s(h.code),h.data={originalError:c(t)})}else{h.code=e.code;const r=null===(i=t)||void 0===i?void 0:i.message;h.message=r&&"string"==typeof r?r:e.message,h.data={originalError:c(t)}}const d=null===(u=t)||void 0===u?void 0:u.stack;return n&&t&&d&&"string"==typeof d&&(h.stack=d),h}}(B);var U={};Object.defineProperty(U,"__esModule",{value:!0}),U.ethErrors=void 0;const V=w,H=B,W=F;function z(t,e){const[r,n]=$(e);return new V.EthereumRpcError(t,r||H.getMessageFromCode(t),n)}function q(t,e){const[r,n]=$(e);return new V.EthereumProviderError(t,r||H.getMessageFromCode(t),n)}function $(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}U.ethErrors={rpc:{parse:t=>z(W.errorCodes.rpc.parse,t),invalidRequest:t=>z(W.errorCodes.rpc.invalidRequest,t),invalidParams:t=>z(W.errorCodes.rpc.invalidParams,t),methodNotFound:t=>z(W.errorCodes.rpc.methodNotFound,t),internal:t=>z(W.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return z(e,t)},invalidInput:t=>z(W.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>z(W.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>z(W.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>z(W.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>z(W.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>z(W.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>q(W.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>q(W.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>q(W.errorCodes.provider.unsupportedMethod,t),disconnected:t=>q(W.errorCodes.provider.disconnected,t),chainDisconnected:t=>q(W.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new V.EthereumProviderError(e,r,n)}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=w;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=B;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=U;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=F;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(_);var J={};Object.defineProperty(J,"__esModule",{value:!0}),J.EVENTS=void 0,J.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var G={},Z={exports:{}},Q={exports:{}};
2
2
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
3
  !function(t,e){var r=c.default,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function o(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},o.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(Q,Q.exports);var Y=Q.exports.Buffer;function K(t,e){this._block=Y.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}K.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=Y.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,o=this._len,s=0;s<i;){for(var a=o%n,u=Math.min(i-s,n-a),c=0;c<u;c++)r[a+c]=t[s+c];s+=u,(o+=u)%n==0&&this._update(r)}return this._len+=i,this},K.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},K.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var X=K,tt=n.inherits_browser.exports,et=X,rt=Q.exports.Buffer,nt=[1518500249,1859775393,-1894007588,-899497514],it=new Array(80);function ot(){this.init(),this._w=it,et.call(this,64,56)}function st(t){return t<<30|t>>>2}function at(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}tt(ot,et),ot.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},ot.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,u=0;u<16;++u)r[u]=t.readInt32BE(4*u);for(;u<80;++u)r[u]=r[u-3]^r[u-8]^r[u-14]^r[u-16];for(var c=0;c<80;++c){var l=~~(c/20),h=0|((e=n)<<5|e>>>27)+at(l,i,o,s)+a+r[c]+nt[l];a=s,s=o,o=st(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},ot.prototype._hash=function(){var t=rt.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var ut=ot,ct=n.inherits_browser.exports,lt=X,ht=Q.exports.Buffer,dt=[1518500249,1859775393,-1894007588,-899497514],ft=new Array(80);function pt(){this.init(),this._w=ft,lt.call(this,64,56)}function gt(t){return t<<5|t>>>27}function bt(t){return t<<30|t>>>2}function yt(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}ct(pt,lt),pt.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},pt.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,u=0;u<16;++u)r[u]=t.readInt32BE(4*u);for(;u<80;++u)r[u]=(e=r[u-3]^r[u-8]^r[u-14]^r[u-16])<<1|e>>>31;for(var c=0;c<80;++c){var l=~~(c/20),h=gt(n)+yt(l,i,o,s)+a+r[c]+dt[l]|0;a=s,s=o,o=bt(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},pt.prototype._hash=function(){var t=ht.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t};var mt=pt,vt=n.inherits_browser.exports,_t=X,wt=Q.exports.Buffer,St=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Et=new Array(64);function Mt(){this.init(),this._w=Et,_t.call(this,64,56)}function xt(t,e,r){return r^t&(e^r)}function kt(t,e,r){return t&e|r&(t|e)}function Ct(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function It(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Rt(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function At(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}vt(Mt,_t),Mt.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Mt.prototype._update=function(t){for(var e=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._f,u=0|this._g,c=0|this._h,l=0;l<16;++l)e[l]=t.readInt32BE(4*l);for(;l<64;++l)e[l]=At(e[l-2])+e[l-7]+Rt(e[l-15])+e[l-16]|0;for(var h=0;h<64;++h){var d=c+It(s)+xt(s,a,u)+St[h]+e[h]|0,f=Ct(r)+kt(r,n,i)|0;c=u,u=a,a=s,s=o+d|0,o=i,i=n,n=r,r=d+f|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},Mt.prototype._hash=function(){var t=wt.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Nt=Mt,jt=n.inherits_browser.exports,Ot=Nt,Tt=X,Pt=Q.exports.Buffer,Lt=new Array(64);function Dt(){this.init(),this._w=Lt,Tt.call(this,64,56)}jt(Dt,Ot),Dt.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},Dt.prototype._hash=function(){var t=Pt.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Bt=Dt,Ft=n.inherits_browser.exports,Ut=X,Vt=Q.exports.Buffer,Ht=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Wt=new Array(160);function zt(){this.init(),this._w=Wt,Ut.call(this,128,112)}function qt(t,e,r){return r^t&(e^r)}function $t(t,e,r){return t&e|r&(t|e)}function Jt(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Gt(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Zt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function Qt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function Yt(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Kt(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Xt(t,e){return t>>>0<e>>>0?1:0}Ft(zt,Ut),zt.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},zt.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,u=0|this._gh,c=0|this._hh,l=0|this._al,h=0|this._bl,d=0|this._cl,f=0|this._dl,p=0|this._el,g=0|this._fl,b=0|this._gl,y=0|this._hl,m=0;m<32;m+=2)e[m]=t.readInt32BE(4*m),e[m+1]=t.readInt32BE(4*m+4);for(;m<160;m+=2){var v=e[m-30],_=e[m-30+1],w=Zt(v,_),S=Qt(_,v),E=Yt(v=e[m-4],_=e[m-4+1]),M=Kt(_,v),x=e[m-14],k=e[m-14+1],C=e[m-32],I=e[m-32+1],R=S+k|0,A=w+x+Xt(R,S)|0;A=(A=A+E+Xt(R=R+M|0,M)|0)+C+Xt(R=R+I|0,I)|0,e[m]=A,e[m+1]=R}for(var N=0;N<160;N+=2){A=e[N],R=e[N+1];var j=$t(r,n,i),O=$t(l,h,d),T=Jt(r,l),P=Jt(l,r),L=Gt(s,p),D=Gt(p,s),B=Ht[N],F=Ht[N+1],U=qt(s,a,u),V=qt(p,g,b),H=y+D|0,W=c+L+Xt(H,y)|0;W=(W=(W=W+U+Xt(H=H+V|0,V)|0)+B+Xt(H=H+F|0,F)|0)+A+Xt(H=H+R|0,R)|0;var z=P+O|0,q=T+j+Xt(z,P)|0;c=u,y=b,u=a,b=g,a=s,g=p,s=o+W+Xt(p=f+H|0,f)|0,o=i,f=d,i=n,d=h,n=r,h=l,r=W+q+Xt(l=H+z|0,H)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+d|0,this._dl=this._dl+f|0,this._el=this._el+p|0,this._fl=this._fl+g|0,this._gl=this._gl+b|0,this._hl=this._hl+y|0,this._ah=this._ah+r+Xt(this._al,l)|0,this._bh=this._bh+n+Xt(this._bl,h)|0,this._ch=this._ch+i+Xt(this._cl,d)|0,this._dh=this._dh+o+Xt(this._dl,f)|0,this._eh=this._eh+s+Xt(this._el,p)|0,this._fh=this._fh+a+Xt(this._fl,g)|0,this._gh=this._gh+u+Xt(this._gl,b)|0,this._hh=this._hh+c+Xt(this._hl,y)|0},zt.prototype._hash=function(){var t=Vt.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var te=zt,ee=n.inherits_browser.exports,re=te,ne=X,ie=Q.exports.Buffer,oe=new Array(160);function se(){this.init(),this._w=oe,ne.call(this,128,112)}ee(se,re),se.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},se.prototype._hash=function(){var t=ie.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var ae=se,ue=Z.exports=function(t){t=t.toLowerCase();var e=ue[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};ue.sha=ut,ue.sha1=mt,ue.sha224=Bt,ue.sha256=Nt,ue.sha384=ae,ue.sha512=te;var ce,le={},he="undefined"!=typeof Symbol&&Symbol,de=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0},fe=Array.prototype.slice,pe=Object.prototype.toString,ge=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==pe.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,n=fe.call(arguments,1),i=Math.max(0,e.length-n.length),o=[],s=0;s<i;s++)o.push("$"+s);if(r=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var i=e.apply(this,n.concat(fe.call(arguments)));return Object(i)===i?i:this}return e.apply(t,n.concat(fe.call(arguments)))})),e.prototype){var a=function(){};a.prototype=e.prototype,r.prototype=new a,a.prototype=null}return r},be=Function.prototype.bind||ge,ye=be.call(Function.call,Object.prototype.hasOwnProperty),me=SyntaxError,ve=Function,_e=TypeError,we=function(t){try{return ve('"use strict"; return ('+t+").constructor;")()}catch(t){}},Se=Object.getOwnPropertyDescriptor;if(Se)try{Se({},"")}catch(tp){Se=null}var Ee=function(){throw new _e},Me=Se?function(){try{return Ee}catch(t){try{return Se(arguments,"callee").get}catch(t){return Ee}}}():Ee,xe="function"==typeof he&&"function"==typeof Symbol&&"symbol"==typeof he("foo")&&"symbol"==typeof Symbol("bar")&&de(),ke=Object.getPrototypeOf||function(t){return t.__proto__},Ce={},Ie="undefined"==typeof Uint8Array?ce:ke(Uint8Array),Re={"%AggregateError%":"undefined"==typeof AggregateError?ce:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?ce:ArrayBuffer,"%ArrayIteratorPrototype%":xe?ke([][Symbol.iterator]()):ce,"%AsyncFromSyncIteratorPrototype%":ce,"%AsyncFunction%":Ce,"%AsyncGenerator%":Ce,"%AsyncGeneratorFunction%":Ce,"%AsyncIteratorPrototype%":Ce,"%Atomics%":"undefined"==typeof Atomics?ce:Atomics,"%BigInt%":"undefined"==typeof BigInt?ce:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?ce:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?ce:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?ce:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?ce:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?ce:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?ce:FinalizationRegistry,"%Function%":ve,"%GeneratorFunction%":Ce,"%Int8Array%":"undefined"==typeof Int8Array?ce:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?ce:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?ce:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xe?ke(ke([][Symbol.iterator]())):ce,"%JSON%":"object"==typeof JSON?JSON:ce,"%Map%":"undefined"==typeof Map?ce:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&xe?ke((new Map)[Symbol.iterator]()):ce,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?ce:Promise,"%Proxy%":"undefined"==typeof Proxy?ce:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?ce:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?ce:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&xe?ke((new Set)[Symbol.iterator]()):ce,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?ce:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xe?ke(""[Symbol.iterator]()):ce,"%Symbol%":xe?Symbol:ce,"%SyntaxError%":me,"%ThrowTypeError%":Me,"%TypedArray%":Ie,"%TypeError%":_e,"%Uint8Array%":"undefined"==typeof Uint8Array?ce:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?ce:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?ce:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?ce:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?ce:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?ce:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?ce:WeakSet};try{null.error}catch(tp){var Ae=ke(ke(tp));Re["%Error.prototype%"]=Ae}var Ne=function t(e){var r;if("%AsyncFunction%"===e)r=we("async function () {}");else if("%GeneratorFunction%"===e)r=we("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=we("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=ke(i.prototype))}return Re[e]=r,r},je={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Oe=be,Te=ye,Pe=Oe.call(Function.call,Array.prototype.concat),Le=Oe.call(Function.apply,Array.prototype.splice),De=Oe.call(Function.call,String.prototype.replace),Be=Oe.call(Function.call,String.prototype.slice),Fe=Oe.call(Function.call,RegExp.prototype.exec),Ue=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ve=/\\(\\)?/g,He=function(t,e){var r,n=t;if(Te(je,n)&&(n="%"+(r=je[n])[0]+"%"),Te(Re,n)){var i=Re[n];if(i===Ce&&(i=Ne(n)),void 0===i&&!e)throw new _e("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new me("intrinsic "+t+" does not exist!")},We=function(t,e){if("string"!=typeof t||0===t.length)throw new _e("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new _e('"allowMissing" argument must be a boolean');if(null===Fe(/^%?[^%]*%?$/,t))throw new me("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=Be(t,0,1),r=Be(t,-1);if("%"===e&&"%"!==r)throw new me("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new me("invalid intrinsic syntax, expected opening `%`");var n=[];return De(t,Ue,(function(t,e,r,i){n[n.length]=r?De(i,Ve,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=He("%"+n+"%",e),o=i.name,s=i.value,a=!1,u=i.alias;u&&(n=u[0],Le(r,Pe([0,1],u)));for(var c=1,l=!0;c<r.length;c+=1){var h=r[c],d=Be(h,0,1),f=Be(h,-1);if(('"'===d||"'"===d||"`"===d||'"'===f||"'"===f||"`"===f)&&d!==f)throw new me("property names with quotes must have matching quotes");if("constructor"!==h&&l||(a=!0),Te(Re,o="%"+(n+="."+h)+"%"))s=Re[o];else if(null!=s){if(!(h in s)){if(!e)throw new _e("base intrinsic for "+t+" exists, but the property is not available.");return}if(Se&&c+1>=r.length){var p=Se(s,h);s=(l=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:s[h]}else l=Te(s,h),s=s[h];l&&!a&&(Re[o]=s)}}return s},ze={exports:{}};!function(t){var e=be,r=We,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),o=r("%Reflect.apply%",!0)||e.call(i,n),s=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch(t){a=null}t.exports=function(t){var r=o(e,i,arguments);s&&a&&(s(r,"length").configurable&&a(r,"length",{value:1+u(0,t.length-(arguments.length-1))}));return r};var c=function(){return o(e,n,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c}(ze);var qe=We,$e=ze.exports,Je=$e(qe("String.prototype.indexOf")),Ge="function"==typeof Map&&Map.prototype,Ze=Object.getOwnPropertyDescriptor&&Ge?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qe=Ge&&Ze&&"function"==typeof Ze.get?Ze.get:null,Ye=Ge&&Map.prototype.forEach,Ke="function"==typeof Set&&Set.prototype,Xe=Object.getOwnPropertyDescriptor&&Ke?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,tr=Ke&&Xe&&"function"==typeof Xe.get?Xe.get:null,er=Ke&&Set.prototype.forEach,rr="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,nr="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,ir="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,or=Boolean.prototype.valueOf,sr=Object.prototype.toString,ar=Function.prototype.toString,ur=String.prototype.match,cr=String.prototype.slice,lr=String.prototype.replace,hr=String.prototype.toUpperCase,dr=String.prototype.toLowerCase,fr=RegExp.prototype.test,pr=Array.prototype.concat,gr=Array.prototype.join,br=Array.prototype.slice,yr=Math.floor,mr="function"==typeof BigInt?BigInt.prototype.valueOf:null,vr=Object.getOwnPropertySymbols,_r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,wr="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Sr="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wr||"symbol")?Symbol.toStringTag:null,Er=Object.prototype.propertyIsEnumerable,Mr=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function xr(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||fr.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-yr(-t):yr(t);if(n!==t){var i=String(n),o=cr.call(e,i.length+1);return lr.call(i,r,"$&_")+"."+lr.call(lr.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return lr.call(e,r,"$&_")}var kr=r.require$$1,Cr=kr.custom,Ir=Or(Cr)?Cr:null;function Rr(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function Ar(t){return lr.call(String(t),/"/g,"&quot;")}function Nr(t){return!("[object Array]"!==Lr(t)||Sr&&"object"==typeof t&&Sr in t)}function jr(t){return!("[object RegExp]"!==Lr(t)||Sr&&"object"==typeof t&&Sr in t)}function Or(t){if(wr)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!_r)return!1;try{return _r.call(t),!0}catch(t){}return!1}var Tr=Object.prototype.hasOwnProperty||function(t){return t in this};function Pr(t,e){return Tr.call(t,e)}function Lr(t){return sr.call(t)}function Dr(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Br(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Br(cr.call(t,0,e.maxStringLength),e)+n}return Rr(lr.call(lr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Fr),"single",e)}function Fr(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+hr.call(e.toString(16))}function Ur(t){return"Object("+t+")"}function Vr(t){return t+" { ? }"}function Hr(t,e,r,n){return t+" ("+e+") {"+(n?Wr(r,n):gr.call(r,", "))+"}"}function Wr(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+gr.call(t,","+r)+"\n"+e.prev}function zr(t,e){var r=Nr(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Pr(t,i)?e(t[i],t):""}var o,s="function"==typeof vr?vr(t):[];if(wr){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var u in t)Pr(t,u)&&(r&&String(Number(u))===u&&u<t.length||wr&&o["$"+u]instanceof Symbol||(fr.call(/[^\w$]/,u)?n.push(e(u,t)+": "+e(t[u],t)):n.push(u+": "+e(t[u],t))));if("function"==typeof vr)for(var c=0;c<s.length;c++)Er.call(t,s[c])&&n.push("["+e(s[c])+"]: "+e(t[s[c]],t));return n}var qr=We,$r=function(t,e){var r=qe(t,!!e);return"function"==typeof r&&Je(t,".prototype.")>-1?$e(r):r},Jr=function t(e,r,n,i){var o=r||{};if(Pr(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Pr(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!Pr(o,"customInspect")||o.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Pr(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Pr(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Br(e,o);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var u=String(e);return a?xr(e,u):u}if("bigint"==typeof e){var c=String(e)+"n";return a?xr(e,c):c}var l=void 0===o.depth?5:o.depth;if(void 0===n&&(n=0),n>=l&&l>0&&"object"==typeof e)return Nr(e)?"[Array]":"[Object]";var h=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=gr.call(Array(t.indent+1)," ")}return{base:r,prev:gr.call(Array(e+1),r)}}(o,n);if(void 0===i)i=[];else if(Dr(i,e)>=0)return"[Circular]";function d(e,r,s){if(r&&(i=br.call(i)).push(r),s){var a={depth:o.depth};return Pr(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),t(e,a,n+1,i)}return t(e,o,n+1,i)}if("function"==typeof e&&!jr(e)){var f=function(t){if(t.name)return t.name;var e=ur.call(ar.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),p=zr(e,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+gr.call(p,", ")+" }":"")}if(Or(e)){var g=wr?lr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):_r.call(e);return"object"!=typeof e||wr?g:Ur(g)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var b="<"+dr.call(String(e.nodeName)),y=e.attributes||[],m=0;m<y.length;m++)b+=" "+y[m].name+"="+Rr(Ar(y[m].value),"double",o);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+dr.call(String(e.nodeName))+">"}if(Nr(e)){if(0===e.length)return"[]";var v=zr(e,d);return h&&!function(t){for(var e=0;e<t.length;e++)if(Dr(t[e],"\n")>=0)return!1;return!0}(v)?"["+Wr(v,h)+"]":"[ "+gr.call(v,", ")+" ]"}if(function(t){return!("[object Error]"!==Lr(t)||Sr&&"object"==typeof t&&Sr in t)}(e)){var _=zr(e,d);return"cause"in Error.prototype||!("cause"in e)||Er.call(e,"cause")?0===_.length?"["+String(e)+"]":"{ ["+String(e)+"] "+gr.call(_,", ")+" }":"{ ["+String(e)+"] "+gr.call(pr.call("[cause]: "+d(e.cause),_),", ")+" }"}if("object"==typeof e&&s){if(Ir&&"function"==typeof e[Ir]&&kr)return kr(e,{depth:l-n});if("symbol"!==s&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!Qe||!t||"object"!=typeof t)return!1;try{Qe.call(t);try{tr.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var w=[];return Ye&&Ye.call(e,(function(t,r){w.push(d(r,e,!0)+" => "+d(t,e))})),Hr("Map",Qe.call(e),w,h)}if(function(t){if(!tr||!t||"object"!=typeof t)return!1;try{tr.call(t);try{Qe.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var S=[];return er&&er.call(e,(function(t){S.push(d(t,e))})),Hr("Set",tr.call(e),S,h)}if(function(t){if(!rr||!t||"object"!=typeof t)return!1;try{rr.call(t,rr);try{nr.call(t,nr)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Vr("WeakMap");if(function(t){if(!nr||!t||"object"!=typeof t)return!1;try{nr.call(t,nr);try{rr.call(t,rr)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Vr("WeakSet");if(function(t){if(!ir||!t||"object"!=typeof t)return!1;try{return ir.call(t),!0}catch(t){}return!1}(e))return Vr("WeakRef");if(function(t){return!("[object Number]"!==Lr(t)||Sr&&"object"==typeof t&&Sr in t)}(e))return Ur(d(Number(e)));if(function(t){if(!t||"object"!=typeof t||!mr)return!1;try{return mr.call(t),!0}catch(t){}return!1}(e))return Ur(d(mr.call(e)));if(function(t){return!("[object Boolean]"!==Lr(t)||Sr&&"object"==typeof t&&Sr in t)}(e))return Ur(or.call(e));if(function(t){return!("[object String]"!==Lr(t)||Sr&&"object"==typeof t&&Sr in t)}(e))return Ur(d(String(e)));if(!function(t){return!("[object Date]"!==Lr(t)||Sr&&"object"==typeof t&&Sr in t)}(e)&&!jr(e)){var E=zr(e,d),M=Mr?Mr(e)===Object.prototype:e instanceof Object||e.constructor===Object,x=e instanceof Object?"":"null prototype",k=!M&&Sr&&Object(e)===e&&Sr in e?cr.call(Lr(e),8,-1):x?"Object":"",C=(M||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(k||x?"["+gr.call(pr.call([],k||[],x||[]),": ")+"] ":"");return 0===E.length?C+"{}":h?C+"{"+Wr(E,h)+"}":C+"{ "+gr.call(E,", ")+" }"}return String(e)},Gr=qr("%TypeError%"),Zr=qr("%WeakMap%",!0),Qr=qr("%Map%",!0),Yr=$r("WeakMap.prototype.get",!0),Kr=$r("WeakMap.prototype.set",!0),Xr=$r("WeakMap.prototype.has",!0),tn=$r("Map.prototype.get",!0),en=$r("Map.prototype.set",!0),rn=$r("Map.prototype.has",!0),nn=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},on=String.prototype.replace,sn=/%20/g,an="RFC3986",un={default:an,formatters:{RFC1738:function(t){return on.call(t,sn,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:an},cn=un,ln=Object.prototype.hasOwnProperty,hn=Array.isArray,dn=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),fn=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},pn={arrayToObject:fn,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],o=i.obj[i.prop],s=Object.keys(o),a=0;a<s.length;++a){var u=s[a],c=o[u];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(e.push({obj:o,prop:u}),r.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(hn(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,n,i){if(0===t.length)return t;var o=t;if("symbol"==typeof t?o=Symbol.prototype.toString.call(t):"string"!=typeof t&&(o=String(t)),"iso-8859-1"===r)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var s="",a=0;a<o.length;++a){var u=o.charCodeAt(a);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===cn.RFC1738&&(40===u||41===u)?s+=o.charAt(a):u<128?s+=dn[u]:u<2048?s+=dn[192|u>>6]+dn[128|63&u]:u<55296||u>=57344?s+=dn[224|u>>12]+dn[128|u>>6&63]+dn[128|63&u]:(a+=1,u=65536+((1023&u)<<10|1023&o.charCodeAt(a)),s+=dn[240|u>>18]+dn[128|u>>12&63]+dn[128|u>>6&63]+dn[128|63&u])}return s},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(hn(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(hn(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!ln.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var i=e;return hn(e)&&!hn(r)&&(i=fn(e,n)),hn(e)&&hn(r)?(r.forEach((function(r,i){if(ln.call(e,i)){var o=e[i];o&&"object"==typeof o&&r&&"object"==typeof r?e[i]=t(o,r,n):e.push(r)}else e[i]=r})),e):Object.keys(r).reduce((function(e,i){var o=r[i];return ln.call(e,i)?e[i]=t(e[i],o,n):e[i]=o,e}),i)}},gn=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new Gr("Side channel does not contain "+Jr(t))},get:function(n){if(Zr&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Yr(t,n)}else if(Qr){if(e)return tn(e,n)}else if(r)return function(t,e){var r=nn(t,e);return r&&r.value}(r,n)},has:function(n){if(Zr&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Xr(t,n)}else if(Qr){if(e)return rn(e,n)}else if(r)return function(t,e){return!!nn(t,e)}(r,n);return!1},set:function(n,i){Zr&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new Zr),Kr(t,n,i)):Qr?(e||(e=new Qr),en(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=nn(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n},bn=pn,yn=un,mn=Object.prototype.hasOwnProperty,vn={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},_n=Array.isArray,wn=Array.prototype.push,Sn=function(t,e){wn.apply(t,_n(e)?e:[e])},En=Date.prototype.toISOString,Mn=yn.default,xn={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:bn.encode,encodeValuesOnly:!1,format:Mn,formatter:yn.formatters[Mn],indices:!1,serializeDate:function(t){return En.call(t)},skipNulls:!1,strictNullHandling:!1},kn={},Cn=function t(e,r,n,i,o,s,a,u,c,l,h,d,f,p,g,b){for(var y=e,m=b,v=0,_=!1;void 0!==(m=m.get(kn))&&!_;){var w=m.get(e);if(v+=1,void 0!==w){if(w===v)throw new RangeError("Cyclic object value");_=!0}void 0===m.get(kn)&&(v=0)}if("function"==typeof u?y=u(r,y):y instanceof Date?y=h(y):"comma"===n&&_n(y)&&(y=bn.maybeMap(y,(function(t){return t instanceof Date?h(t):t}))),null===y){if(o)return a&&!p?a(r,xn.encoder,g,"key",d):r;y=""}if(function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t}(y)||bn.isBuffer(y))return a?[f(p?r:a(r,xn.encoder,g,"key",d))+"="+f(a(y,xn.encoder,g,"value",d))]:[f(r)+"="+f(String(y))];var S,E=[];if(void 0===y)return E;if("comma"===n&&_n(y))p&&a&&(y=bn.maybeMap(y,a)),S=[{value:y.length>0?y.join(",")||null:void 0}];else if(_n(u))S=u;else{var M=Object.keys(y);S=c?M.sort(c):M}for(var x=i&&_n(y)&&1===y.length?r+"[]":r,k=0;k<S.length;++k){var C=S[k],I="object"==typeof C&&void 0!==C.value?C.value:y[C];if(!s||null!==I){var R=_n(y)?"function"==typeof n?n(x,C):x:x+(l?"."+C:"["+C+"]");b.set(e,v);var A=gn();A.set(kn,b),Sn(E,t(I,R,n,i,o,s,"comma"===n&&p&&_n(y)?null:a,u,c,l,h,d,f,p,g,A))}}return E},In=pn,Rn=Object.prototype.hasOwnProperty,An=Array.isArray,Nn={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:In.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},jn=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},On=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Tn=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),a=s?i.slice(0,s.index):i,u=[];if(a){if(!r.plainObjects&&Rn.call(Object.prototype,a)&&!r.allowPrototypes)return;u.push(a)}for(var c=0;r.depth>0&&null!==(s=o.exec(i))&&c<r.depth;){if(c+=1,!r.plainObjects&&Rn.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+i.slice(s.index)+"]"),function(t,e,r,n){for(var i=n?e:On(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(u,10);r.parseArrays||""!==u?!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[])[c]=i:"__proto__"!==u&&(s[u]=i):s={0:i}}i=s}return i}(u,e,r,n)}},Pn=function(t,e){var r,n=t,i=function(t){if(!t)return xn;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||xn.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=yn.default;if(void 0!==t.format){if(!mn.call(yn.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=yn.formatters[r],i=xn.filter;return("function"==typeof t.filter||_n(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:xn.addQueryPrefix,allowDots:void 0===t.allowDots?xn.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:xn.charsetSentinel,delimiter:void 0===t.delimiter?xn.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:xn.encode,encoder:"function"==typeof t.encoder?t.encoder:xn.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:xn.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:xn.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:xn.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:xn.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):_n(i.filter)&&(r=i.filter);var o,s=[];if("object"!=typeof n||null===n)return"";o=e&&e.arrayFormat in vn?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=vn[o];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u="comma"===a&&e&&e.commaRoundTrip;r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var c=gn(),l=0;l<r.length;++l){var h=r[l];i.skipNulls&&null===n[h]||Sn(s,Cn(n[h],h,a,u,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}var d=s.join(i.delimiter),f=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),d.length>0?f+d:""},Ln=function(t,e){var r=function(t){if(!t)return Nn;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?Nn.charset:t.charset;return{allowDots:void 0===t.allowDots?Nn.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:Nn.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:Nn.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:Nn.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Nn.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:Nn.comma,decoder:"function"==typeof t.decoder?t.decoder:Nn.decoder,delimiter:"string"==typeof t.delimiter||In.isRegExp(t.delimiter)?t.delimiter:Nn.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:Nn.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:Nn.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:Nn.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:Nn.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Nn.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=e.parameterLimit===1/0?void 0:e.parameterLimit,s=i.split(e.delimiter,o),a=-1,u=e.charset;if(e.charsetSentinel)for(r=0;r<s.length;++r)0===s[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[r]?u="utf-8":"utf8=%26%2310003%3B"===s[r]&&(u="iso-8859-1"),a=r,r=s.length);for(r=0;r<s.length;++r)if(r!==a){var c,l,h=s[r],d=h.indexOf("]="),f=-1===d?h.indexOf("="):d+1;-1===f?(c=e.decoder(h,Nn.decoder,u,"key"),l=e.strictNullHandling?null:""):(c=e.decoder(h.slice(0,f),Nn.decoder,u,"key"),l=In.maybeMap(On(h.slice(f+1),e),(function(t){return e.decoder(t,Nn.decoder,u,"value")}))),l&&e.interpretNumericEntities&&"iso-8859-1"===u&&(l=jn(l)),h.indexOf("[]=")>-1&&(l=An(l)?[l]:l),Rn.call(n,c)?n[c]=In.combine(n[c],l):n[c]=l}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s<o.length;++s){var a=o[s],u=Tn(a,n[a],r,"string"==typeof t);i=In.merge(i,u,r)}return!0===r.allowSparse?i:In.compact(i)},Dn={formats:un,parse:Ln,stringify:Pn},Bn={};!function(t){function e(){return t=>t}var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=e,t.HexString=t=>t,t.AddressString=t=>t,t.BigIntString=t=>t,t.IntNumber=function(t){return Math.floor(t)},t.RegExpString=t=>t,(r=t.ProviderType||(t.ProviderType={})).CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(Bn);var Fn=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(le,"__esModule",{value:!0}),le.isInIFrame=le.createQrUrl=le.getFavicon=le.range=le.isBigNumber=le.ensureParsedJSONObject=le.ensureBN=le.ensureRegExpString=le.ensureIntNumber=le.ensureBuffer=le.ensureAddressString=le.ensureEvenLengthHexString=le.ensureHexString=le.isHexString=le.prepend0x=le.strip0x=le.has0xPrefix=le.hexStringFromIntNumber=le.intNumberFromHexString=le.bigIntStringFromBN=le.hexStringFromBuffer=le.hexStringToUint8Array=le.uint8ArrayToHex=le.randomBytesHex=void 0;const Un=Fn(v.exports),Vn=Dn,Hn=Bn,Wn=/^[0-9]*$/,zn=/^[a-f0-9]*$/;function qn(t){return[...t].map((t=>t.toString(16).padStart(2,"0"))).join("")}function $n(t){return t.startsWith("0x")||t.startsWith("0X")}function Jn(t){return $n(t)?t.slice(2):t}function Gn(t){return $n(t)?"0x"+t.slice(2):"0x"+t}function Zn(t){if("string"!=typeof t)return!1;const e=Jn(t).toLowerCase();return zn.test(e)}function Qn(t,e=!1){if("string"==typeof t){const r=Jn(t).toLowerCase();if(zn.test(r))return(0,Hn.HexString)(e?"0x"+r:r)}throw new Error(`"${String(t)}" is not a hexadecimal string`)}function Yn(t,e=!1){let r=Qn(t,!1);return r.length%2==1&&(r=(0,Hn.HexString)("0"+r)),e?(0,Hn.HexString)("0x"+r):r}function Kn(t){if("number"==typeof t&&Number.isInteger(t))return(0,Hn.IntNumber)(t);if("string"==typeof t){if(Wn.test(t))return(0,Hn.IntNumber)(Number(t));if(Zn(t))return(0,Hn.IntNumber)(new Un.default(Yn(t,!1),16).toNumber())}throw new Error(`Not an integer: ${String(t)}`)}function Xn(t){if(null==t||"function"!=typeof t.constructor)return!1;const{constructor:e}=t;return"function"==typeof e.config&&"number"==typeof e.EUCLID}le.randomBytesHex=function(t){return qn(crypto.getRandomValues(new Uint8Array(t)))},le.uint8ArrayToHex=qn,le.hexStringToUint8Array=function(t){return new Uint8Array(t.match(/.{1,2}/g).map((t=>parseInt(t,16))))},le.hexStringFromBuffer=function(t,e=!1){const r=t.toString("hex");return(0,Hn.HexString)(e?"0x"+r:r)},le.bigIntStringFromBN=function(t){return(0,Hn.BigIntString)(t.toString(10))},le.intNumberFromHexString=function(t){return(0,Hn.IntNumber)(new Un.default(Yn(t,!1),16).toNumber())},le.hexStringFromIntNumber=function(t){return(0,Hn.HexString)("0x"+new Un.default(t).toString(16))},le.has0xPrefix=$n,le.strip0x=Jn,le.prepend0x=Gn,le.isHexString=Zn,le.ensureHexString=Qn,le.ensureEvenLengthHexString=Yn,le.ensureAddressString=function(t){if("string"==typeof t){const e=Jn(t).toLowerCase();if(Zn(e)&&40===e.length)return(0,Hn.AddressString)(Gn(e))}throw new Error(`Invalid Ethereum address: ${String(t)}`)},le.ensureBuffer=function(t){if(Buffer.isBuffer(t))return t;if("string"==typeof t){if(Zn(t)){const e=Yn(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw new Error(`Not binary data: ${String(t)}`)},le.ensureIntNumber=Kn,le.ensureRegExpString=function(t){if(t instanceof RegExp)return(0,Hn.RegExpString)(t.toString());throw new Error(`Not a RegExp: ${String(t)}`)},le.ensureBN=function(t){if(null!==t&&(Un.default.isBN(t)||Xn(t)))return new Un.default(t.toString(10),10);if("number"==typeof t)return new Un.default(Kn(t));if("string"==typeof t){if(Wn.test(t))return new Un.default(t,10);if(Zn(t))return new Un.default(Yn(t,!1),16)}throw new Error(`Not an integer: ${String(t)}`)},le.ensureParsedJSONObject=function(t){if("string"==typeof t)return JSON.parse(t);if("object"==typeof t)return t;throw new Error(`Not a JSON string or an object: ${String(t)}`)},le.isBigNumber=Xn,le.range=function(t,e){return Array.from({length:e-t},((e,r)=>t+r))},le.getFavicon=function(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`},le.createQrUrl=function(t,e,r,n,i,o){return`${r}/#/link?${(0,Vn.stringify)({[n?"parent-id":"id"]:t,secret:e,server:r,v:i,chainId:o})}`},le.isInIFrame=function(){try{return null!==window.frameElement}catch(t){return!1}},Object.defineProperty(G,"__esModule",{value:!0}),G.Session=void 0;const ti=Z.exports,ei=le,ri="session:id",ni="session:secret",ii="session:linked";class oi{constructor(t,e,r,n){this._storage=t,this._id=e||(0,ei.randomBytesHex)(16),this._secret=r||(0,ei.randomBytesHex)(32),this._key=(new ti.sha256).update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!n}static load(t){const e=t.getItem(ri),r=t.getItem(ii),n=t.getItem(ni);return e&&n?new oi(t,e,n,"1"===r):null}static hash(t){return(new ti.sha256).update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(ri,this._id),this._storage.setItem(ni,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(ii,this._linked?"1":"0")}}G.Session=oi;var si={};Object.defineProperty(si,"__esModule",{value:!0}),si.WalletSDKRelayAbstract=si.APP_VERSION_KEY=si.LOCAL_STORAGE_ADDRESSES_KEY=si.WALLET_USER_NAME_KEY=void 0;const ai=_;si.WALLET_USER_NAME_KEY="walletUsername",si.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",si.APP_VERSION_KEY="AppVersion";si.WalletSDKRelayAbstract=class{async makeEthereumJSONRPCRequest(t,e){if(!e)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(e,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((t=>t.json())).then((t=>{if(!t)throw ai.ethErrors.rpc.parse({});const e=t,{error:r}=e;if(r)throw(0,ai.serializeError)(r);return e}))}};var ui,ci,li={exports:{}},hi=u.default.EventEmitter;function di(){if(ci)return ui;function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t,e,r){return(e=o(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}ci=1;var s=c.default.Buffer,a=r.require$$1.inspect,u=a&&a.custom||"inspect";function l(t,e,r){s.prototype.copy.call(t,e,r)}return ui=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var r,n,o;return r=t,n=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e=s.allocUnsafe(t>>>0),r=this.head,n=0;r;)l(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,r){return a(this,e(e({},r),{},{depth:0,customInspect:!1}))}}],n&&i(r.prototype,n),o&&i(r,o),Object.defineProperty(r,"prototype",{writable:!1}),t}(),ui}function fi(t,e){gi(t,e),pi(t)}function pi(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function gi(t,e){t.emit("error",e)}var bi={destroy:function(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(gi,this,t)):process.nextTick(gi,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?process.nextTick(pi,r):(r._writableState.errorEmitted=!0,process.nextTick(fi,r,t)):process.nextTick(fi,r,t):e?(process.nextTick(pi,r),e(t)):process.nextTick(pi,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}},yi={};var mi={};function vi(t,e,r){r||(r=Error);var n=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);n.prototype.name=r.name,n.prototype.code=t,mi[t]=n}function _i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}vi("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),vi("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,o,s;if("string"==typeof e&&(i="not ",e.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(_i(e,"type"));else{var a=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(a," ").concat(n," ").concat(_i(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),vi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),vi("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),vi("ERR_STREAM_PREMATURE_CLOSE","Premature close"),vi("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),vi("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),vi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),vi("ERR_STREAM_WRITE_AFTER_END","write after end"),vi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),vi("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),vi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),yi.codes=mi;var wi=yi.codes.ERR_INVALID_OPT_VALUE;var Si,Ei,Mi,xi,ki,Ci,Ii={getHighWaterMark:function(t,e,r,n){var i=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new wi(n?r:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}};function Ri(){if(Ei)return Si;function e(e){try{if(!t.commonjsGlobal.localStorage)return!1}catch(t){return!1}var r=t.commonjsGlobal.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}return Ei=1,Si=function(t,r){if(e("noDeprecation"))return t;var n=!1;return function(){if(!n){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return t.apply(this,arguments)}},Si}function Ai(){if(xi)return Mi;function e(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var r;xi=1,Mi=M,M.WritableState=E;var i={deprecate:Ri()},o=hi,s=c.default.Buffer,a=(void 0!==t.commonjsGlobal?t.commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,l=bi,h=Ii.getHighWaterMark,d=yi.codes,f=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;function S(){}function E(t,n,i){r=r||Ni(),t=t||{},"boolean"!=typeof i&&(i=n instanceof r),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(A,t,e),t._writableState.errorEmitted=!0,w(t,n)):(i(n),t._writableState.errorEmitted=!0,w(t,n),A(t,e))}(t,r,n,e,i);else{var o=I(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||C(t,r),n?process.nextTick(k,t,r,o,i):k(t,r,o,i)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function M(t){var e=this instanceof(r=r||Ni());if(!e&&!u.call(M,this))return new M(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function x(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function k(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),A(t,e)}function C(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var i=r.bufferedRequestCount,o=new Array(i),s=r.corkedRequestsFree;s.entry=n;for(var a=0,u=!0;n;)o[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;o.allBuffers=u,x(t,r,!0,r.length,o,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,h=n.callback;if(x(t,r,!1,r.objectMode?1:c.length,c,l,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function R(t,e){t._final((function(r){e.pendingcb--,r&&w(t,r),e.prefinished=!0,t.emit("prefinish"),A(t,e)}))}function A(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(R,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}return n.inherits_browser.exports(M,o),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:i.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||this===M&&(t&&t._writableState instanceof E)}})):u=function(t){return t instanceof this},M.prototype.pipe=function(){w(this,new b)},M.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,u=!i.objectMode&&(n=t,s.isBuffer(n)||n instanceof a);return u&&!s.isBuffer(t)&&(t=function(t){return s.from(t)}(t)),"function"==typeof e&&(r=e,e=null),u?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(t,e){var r=new v;w(t,r),process.nextTick(e,r)}(this,r):(u||function(t,e,r,n){var i;return null===r?i=new m:"string"==typeof r||e.objectMode||(i=new f("chunk",["string","Buffer"],r)),!i||(w(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,o=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=s.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var u=e.objectMode?1:n.length;e.length+=u;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else x(t,e,!1,u,n,i,o);return c}(this,i,u,t,e,r)),o},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||C(this,t))},M.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new p("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,A(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=l.destroy,M.prototype._undestroy=l.undestroy,M.prototype._destroy=function(t,e){e(t)},Mi}function Ni(){if(Ci)return ki;Ci=1;var t=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};ki=a;var e=qi(),r=Ai();n.inherits_browser.exports(a,e);for(var i=t(r.prototype),o=0;o<i.length;o++){var s=i[o];a.prototype[s]||(a.prototype[s]=r.prototype[s])}function a(t){if(!(this instanceof a))return new a(t);e.call(this,t),r.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||process.nextTick(c,this)}function c(t){t.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),ki}var ji,Oi={};function Ti(){if(ji)return Oi;ji=1;var t=Q.exports.Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(r);if("string"!=typeof n&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=o,this.end=s,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=a,this.end=u,n=3;break;default:return this.write=c,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function n(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function i(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function s(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function a(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}return Oi.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},r.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var o=n(e[i]);if(o>=0)return o>0&&(t.lastNeed=o-1),o;if(--i<r||-2===o)return 0;if(o=n(e[i]),o>=0)return o>0&&(t.lastNeed=o-2),o;if(--i<r||-2===o)return 0;if(o=n(e[i]),o>=0)return o>0&&(2===o?o=0:t.lastNeed=o-3),o;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},Oi}var Pi=yi.codes.ERR_STREAM_PREMATURE_CLOSE;function Li(){}var Di,Bi,Fi,Ui,Vi,Hi,Wi=function t(e,r,n){if("function"==typeof r)return t(e,null,r);r||(r={}),n=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(n||Li);var i=r.readable||!1!==r.readable&&e.readable,o=r.writable||!1!==r.writable&&e.writable,s=function(){e.writable||u()},a=e._writableState&&e._writableState.finished,u=function(){o=!1,a=!0,i||n.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){i=!1,c=!0,o||n.call(e)},h=function(t){n.call(e,t)},d=function(){var t;return i&&!c?(e._readableState&&e._readableState.ended||(t=new Pi),n.call(e,t)):o&&!a?(e._writableState&&e._writableState.ended||(t=new Pi),n.call(e,t)):void 0},f=function(){e.req.on("finish",u)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?o&&!e._writableState&&(e.on("end",s),e.on("close",s)):(e.on("complete",u),e.on("abort",d),e.req?f():e.on("request",f)),e.on("end",l),e.on("finish",u),!1!==r.error&&e.on("error",h),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",f),e.req&&e.req.removeListener("finish",u),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",h),e.removeListener("close",d)}};function zi(){if(Bi)return Di;var t;function e(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Bi=1;var r=Wi,n=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function l(t,e){return{value:t,done:e}}function h(t){var e=t[n];if(null!==e){var r=t[c].read();null!==r&&(t[a]=null,t[n]=null,t[i]=null,e(l(r,!1)))}}function d(t){process.nextTick(h,t)}var f=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((e(t={get stream(){return this[c]},next:function(){var t=this,e=this[o];if(null!==e)return Promise.reject(e);if(this[s])return Promise.resolve(l(void 0,!0));if(this[c].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[o]?r(t[o]):e(l(void 0,!0))}))}));var r,n=this[a];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[s]?r(l(void 0,!0)):e[u](r,n)}),n)}}(n,this));else{var i=this[c].read();if(null!==i)return Promise.resolve(l(i,!1));r=new Promise(this[u])}return this[a]=r,r}},Symbol.asyncIterator,(function(){return this})),e(t,"return",(function(){var t=this;return new Promise((function(e,r){t[c].destroy(null,(function(t){t?r(t):e(l(void 0,!0))}))}))})),t),f);return Di=function(t){var h,f=Object.create(p,(e(h={},c,{value:t,writable:!0}),e(h,n,{value:null,writable:!0}),e(h,i,{value:null,writable:!0}),e(h,o,{value:null,writable:!0}),e(h,s,{value:t._readableState.endEmitted,writable:!0}),e(h,u,{value:function(t,e){var r=f[c].read();r?(f[a]=null,f[n]=null,f[i]=null,t(l(r,!1))):(f[n]=t,f[i]=e)},writable:!0}),h));return f[a]=null,r(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=f[i];return null!==e&&(f[a]=null,f[n]=null,f[i]=null,e(t)),void(f[o]=t)}var r=f[n];null!==r&&(f[a]=null,f[n]=null,f[i]=null,r(l(void 0,!0))),f[s]=!0})),t.on("readable",d.bind(null,f)),f},Di}function qi(){if(Hi)return Vi;var e;Hi=1,Vi=k,k.ReadableState=x,u.default.EventEmitter;var i=function(t,e){return t.listeners(e).length},o=hi,s=c.default.Buffer,a=(void 0!==t.commonjsGlobal?t.commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,h=r.require$$1;l=h&&h.debuglog?h.debuglog("stream"):function(){};var d,f,p,g=di(),b=bi,y=Ii.getHighWaterMark,m=yi.codes,v=m.ERR_INVALID_ARG_TYPE,_=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,S=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n.inherits_browser.exports(k,o);var E=b.errorOrDestroy,M=["error","close","destroy","pause","resume"];function x(t,r,n){e=e||Ni(),t=t||{},"boolean"!=typeof n&&(n=r instanceof e),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=y(this,t,"readableHighWaterMark",n),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=Ti().StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function k(t){if(e=e||Ni(),!(this instanceof k))return new k(t);var r=this instanceof e;this._readableState=new x(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function C(t,e,r,n,i){l("readableAddChunk",e);var o,u=t._readableState;if(null===e)u.reading=!1,function(t,e){if(l("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?N(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,j(t)))}(t,u);else if(i||(o=function(t,e){var r;n=e,s.isBuffer(n)||n instanceof a||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(u,e)),o)E(t,o);else if(u.objectMode||e&&e.length>0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)u.endEmitted?E(t,new S):I(t,u,e,!0);else if(u.ended)E(t,new _);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?I(t,u,e,!1):O(t,u)):I(t,u,e,!1)}else n||(u.reading=!1,O(t,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function I(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&N(t)),O(t,e)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),k.prototype.destroy=b.destroy,k.prototype._undestroy=b.undestroy,k.prototype._destroy=function(t,e){e(t)},k.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=s.from(t,e),e=""),r=!0),C(this,t,e,!1,r)},k.prototype.unshift=function(t){return C(this,t,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(t){d||(d=Ti().StringDecoder);var e=new d(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var R=1073741824;function A(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function N(t){var e=t._readableState;l("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(j,t))}function j(t){var e=t._readableState;l("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,B(t)}function O(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(T,t,e))}function T(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(l("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function P(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L(t){l("readable nexttick read 0"),t.read(0)}function D(t,e){l("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),B(t),e.flowing&&!e.reading&&t.read(0)}function B(t){var e=t._readableState;for(l("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;l("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(V,e,t))}function V(t,e){if(l("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}return k.prototype.read=function(t){l("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):N(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&l("length less than watermark",i=!0),e.ended||e.reading?l("reading or ended",i=!1):i&&(l("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=A(r,e))),null===(n=t>0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(t){E(this,new w("_read()"))},k.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,l("pipe count=%d opts=%j",n.pipesCount,e);var o=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?a:g;function s(e,i){l("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",g),r.removeListener("data",h),c=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function a(){l("onend"),t.end()}n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,B(t))}}(r);t.on("drain",u);var c=!1;function h(e){l("ondata");var i=t.write(e);l("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==H(n.pipes,t))&&!c&&(l("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){l("onerror",e),g(),t.removeListener("error",d),0===i(t,"error")&&E(t,e)}function f(){t.removeListener("finish",p),g()}function p(){l("onfinish"),t.removeListener("close",f),g()}function g(){l("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",f),t.once("finish",p),t.emit("pipe",r),n.flowing||(l("pipe resume"),r.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=H(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},k.prototype.on=function(t,e){var r=o.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,l("on readable",n.length,n.reading),n.length?N(this):n.reading||process.nextTick(L,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var r=o.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(P,this),r},k.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(P,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(l("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(D,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(l("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<M.length;o++)t.on(M[o],this.emit.bind(this,M[o]));return this._read=function(e){l("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=zi()),f(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),k._fromList=F,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(t,e){return void 0===p&&(p=Ui?Fi:(Ui=1,Fi=function(){throw new Error("Readable.from is not available in the browser")})),p(k,t,e)}),Vi}var $i=to,Ji=yi.codes,Gi=Ji.ERR_METHOD_NOT_IMPLEMENTED,Zi=Ji.ERR_MULTIPLE_CALLBACK,Qi=Ji.ERR_TRANSFORM_ALREADY_TRANSFORMING,Yi=Ji.ERR_TRANSFORM_WITH_LENGTH_0,Ki=Ni();function Xi(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new Zi);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function to(t){if(!(this instanceof to))return new to(t);Ki.call(this,t),this._transformState={afterTransform:Xi.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",eo)}function eo(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?ro(this,null,null):this._flush((function(e,r){ro(t,e,r)}))}function ro(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Yi;if(t._transformState.transforming)throw new Qi;return t.push(null)}n.inherits_browser.exports(to,Ki),to.prototype.push=function(t,e){return this._transformState.needTransform=!1,Ki.prototype.push.call(this,t,e)},to.prototype._transform=function(t,e,r){r(new Gi("_transform()"))},to.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},to.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},to.prototype._destroy=function(t,e){Ki.prototype._destroy.call(this,t,(function(t){e(t)}))};var no,io=so,oo=$i;function so(t){if(!(this instanceof so))return new so(t);oo.call(this,t)}n.inherits_browser.exports(so,oo),so.prototype._transform=function(t,e,r){r(null,t)};var ao=yi.codes,uo=ao.ERR_MISSING_ARGS,co=ao.ERR_STREAM_DESTROYED;function lo(t){if(t)throw t}function ho(t){t()}function fo(t,e){return t.pipe(e)}var po=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=function(t){return t.length?"function"!=typeof t[t.length-1]?lo:t.pop():lo}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new uo("streams");var o=e.map((function(t,r){var s=r<e.length-1;return function(t,e,r,n){n=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(n);var i=!1;t.on("close",(function(){i=!0})),void 0===no&&(no=Wi),no(t,{readable:e,writable:r},(function(t){if(t)return n(t);i=!0,n()}));var o=!1;return function(e){if(!i&&!o)return o=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void n(e||new co("pipe"))}}(t,s,r>0,(function(t){n||(n=t),t&&o.forEach(ho),s||(o.forEach(ho),i(n))}))}));return e.reduce(fo)};!function(t,e){(e=li.exports=qi()).Stream=e,e.Readable=e,e.Writable=Ai(),e.Duplex=Ni(),e.Transform=$i,e.PassThrough=io,e.finished=Wi,e.pipeline=po}(0,li.exports);const{Transform:go}=li.exports;const{Transform:bo}=li.exports;const yo=t=>class e extends go{constructor(e,r,n,i,o){super(o),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let n=null;try{this.update(t,e)}catch(t){n=t}r(n)}_flush(t){let e=null;try{this.push(this.digest())}catch(t){e=t}t(e)}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}},mo=t=>class e extends bo{constructor(e,r,n,i){super(i),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let n=null;try{this.update(t,e)}catch(t){n=t}r(n)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(t)||(t=Buffer.from(t,e)),this._state.absorb(t),this}squeeze(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}};var vo={};const _o=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];vo.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let d=l^(i<<1|o>>>31),f=h^(o<<1|i>>>31);const p=t[0]^d,g=t[1]^f,b=t[10]^d,y=t[11]^f,m=t[20]^d,v=t[21]^f,_=t[30]^d,w=t[31]^f,S=t[40]^d,E=t[41]^f;d=r^(s<<1|a>>>31),f=n^(a<<1|s>>>31);const M=t[2]^d,x=t[3]^f,k=t[12]^d,C=t[13]^f,I=t[22]^d,R=t[23]^f,A=t[32]^d,N=t[33]^f,j=t[42]^d,O=t[43]^f;d=i^(u<<1|c>>>31),f=o^(c<<1|u>>>31);const T=t[4]^d,P=t[5]^f,L=t[14]^d,D=t[15]^f,B=t[24]^d,F=t[25]^f,U=t[34]^d,V=t[35]^f,H=t[44]^d,W=t[45]^f;d=s^(l<<1|h>>>31),f=a^(h<<1|l>>>31);const z=t[6]^d,q=t[7]^f,$=t[16]^d,J=t[17]^f,G=t[26]^d,Z=t[27]^f,Q=t[36]^d,Y=t[37]^f,K=t[46]^d,X=t[47]^f;d=u^(r<<1|n>>>31),f=c^(n<<1|r>>>31);const tt=t[8]^d,et=t[9]^f,rt=t[18]^d,nt=t[19]^f,it=t[28]^d,ot=t[29]^f,st=t[38]^d,at=t[39]^f,ut=t[48]^d,ct=t[49]^f,lt=p,ht=g,dt=y<<4|b>>>28,ft=b<<4|y>>>28,pt=m<<3|v>>>29,gt=v<<3|m>>>29,bt=w<<9|_>>>23,yt=_<<9|w>>>23,mt=S<<18|E>>>14,vt=E<<18|S>>>14,_t=M<<1|x>>>31,wt=x<<1|M>>>31,St=C<<12|k>>>20,Et=k<<12|C>>>20,Mt=I<<10|R>>>22,xt=R<<10|I>>>22,kt=N<<13|A>>>19,Ct=A<<13|N>>>19,It=j<<2|O>>>30,Rt=O<<2|j>>>30,At=P<<30|T>>>2,Nt=T<<30|P>>>2,jt=L<<6|D>>>26,Ot=D<<6|L>>>26,Tt=F<<11|B>>>21,Pt=B<<11|F>>>21,Lt=U<<15|V>>>17,Dt=V<<15|U>>>17,Bt=W<<29|H>>>3,Ft=H<<29|W>>>3,Ut=z<<28|q>>>4,Vt=q<<28|z>>>4,Ht=J<<23|$>>>9,Wt=$<<23|J>>>9,zt=G<<25|Z>>>7,qt=Z<<25|G>>>7,$t=Q<<21|Y>>>11,Jt=Y<<21|Q>>>11,Gt=X<<24|K>>>8,Zt=K<<24|X>>>8,Qt=tt<<27|et>>>5,Yt=et<<27|tt>>>5,Kt=rt<<20|nt>>>12,Xt=nt<<20|rt>>>12,te=ot<<7|it>>>25,ee=it<<7|ot>>>25,re=st<<8|at>>>24,ne=at<<8|st>>>24,ie=ut<<14|ct>>>18,oe=ct<<14|ut>>>18;t[0]=lt^~St&Tt,t[1]=ht^~Et&Pt,t[10]=Ut^~Kt&pt,t[11]=Vt^~Xt&gt,t[20]=_t^~jt&zt,t[21]=wt^~Ot&qt,t[30]=Qt^~dt&Mt,t[31]=Yt^~ft&xt,t[40]=At^~Ht&te,t[41]=Nt^~Wt&ee,t[2]=St^~Tt&$t,t[3]=Et^~Pt&Jt,t[12]=Kt^~pt&kt,t[13]=Xt^~gt&Ct,t[22]=jt^~zt&re,t[23]=Ot^~qt&ne,t[32]=dt^~Mt&Lt,t[33]=ft^~xt&Dt,t[42]=Ht^~te&bt,t[43]=Wt^~ee&yt,t[4]=Tt^~$t&ie,t[5]=Pt^~Jt&oe,t[14]=pt^~kt&Bt,t[15]=gt^~Ct&Ft,t[24]=zt^~re&mt,t[25]=qt^~ne&vt,t[34]=Mt^~Lt&Gt,t[35]=xt^~Dt&Zt,t[44]=te^~bt&It,t[45]=ee^~yt&Rt,t[6]=$t^~ie&lt,t[7]=Jt^~oe&ht,t[16]=kt^~Bt&Ut,t[17]=Ct^~Ft&Vt,t[26]=re^~mt&_t,t[27]=ne^~vt&wt,t[36]=Lt^~Gt&Qt,t[37]=Dt^~Zt&Yt,t[46]=bt^~It&At,t[47]=yt^~Rt&Nt,t[8]=ie^~lt&St,t[9]=oe^~ht&Et,t[18]=Bt^~Ut&Kt,t[19]=Ft^~Vt&Xt,t[28]=mt^~_t&jt,t[29]=vt^~wt&Ot,t[38]=Gt^~Qt&dt,t[39]=Zt^~Yt&ft,t[48]=It^~At&Ht,t[49]=Rt^~Nt&Wt,t[0]^=_o[2*e],t[1]^=_o[2*e+1]}};const wo=vo;function So(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}So.prototype.initialize=function(t,e){for(let t=0;t<50;++t)this.state[t]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},So.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(wo.p1600(this.state),this.count=0)},So.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<this.count%4*8,0!=(128&t)&&this.count===this.blockSize-1&&wo.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,wo.p1600(this.state),this.count=0,this.squeezing=!0},So.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=Buffer.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(wo.p1600(this.state),this.count=0);return e},So.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var Eo=function(t){const e=yo(t),r=mo(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}(So);const Mo=Eo,xo=v.exports;function ko(t){return Buffer.allocUnsafe(t).fill(0)}function Co(t,e,r){const n=ko(e);return t=Io(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function Io(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if("string"==typeof t)t=Ro(t)?Buffer.from((e=Ao(t)).length%2?"0"+e:e,"hex"):Buffer.from(t);else if("number"==typeof t)t=intToBuffer(t);else if(null==t)t=Buffer.allocUnsafe(0);else if(xo.isBN(t))t=t.toArrayLike(Buffer);else{if(!t.toArray)throw new Error("invalid type");t=Buffer.from(t.toArray())}var e;return t}function Ro(t){return"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]*$/)}function Ao(t){return"string"==typeof t&&t.startsWith("0x")?t.slice(2):t}var No={zeros:ko,setLength:Co,setLengthRight:function(t,e){return Co(t,e,!0)},isHexString:Ro,stripHexPrefix:Ao,toBuffer:Io,bufferToHex:function(t){return"0x"+(t=Io(t)).toString("hex")},keccak:function(t,e){return t=Io(t),e||(e=256),Mo("keccak"+e).update(t).digest()}};const jo=No,Oo=v.exports;function To(t){return t.startsWith("int[")?"int256"+t.slice(3):"int"===t?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):"uint"===t?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):"fixed"===t?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):"ufixed"===t?"ufixed128x128":t}function Po(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Lo(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Do(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?""===e[2]?"dynamic":parseInt(e[2],10):null}function Bo(t){var e=typeof t;if("string"===e)return jo.isHexString(t)?new Oo(jo.stripHexPrefix(t),16):new Oo(t,10);if("number"===e)return new Oo(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Fo(t,e){var r,n,i,o;if("address"===t)return Fo("uint160",Bo(e));if("bool"===t)return Fo("uint8",e?1:0);if("string"===t)return Fo("bytes",new Buffer(e,"utf8"));if(function(t){return t.lastIndexOf("]")===t.length-1}(t)){if(void 0===e.length)throw new Error("Not an array?");if("dynamic"!==(r=Do(t))&&0!==r&&e.length>r)throw new Error("Elements exceed array size: "+r);for(o in i=[],t=t.slice(0,t.lastIndexOf("[")),"string"==typeof e&&(e=JSON.parse(e)),e)i.push(Fo(t,e[o]));if("dynamic"===r){var s=Fo("uint256",e.length);i.unshift(s)}return Buffer.concat(i)}if("bytes"===t)return e=new Buffer(e),i=Buffer.concat([Fo("uint256",e.length),e]),e.length%32!=0&&(i=Buffer.concat([i,jo.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if((r=Po(t))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return jo.setLengthRight(e,32)}if(t.startsWith("uint")){if((r=Po(t))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((n=Bo(e)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}if(t.startsWith("int")){if((r=Po(t))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((n=Bo(e)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}if(t.startsWith("ufixed")){if(r=Lo(t),(n=Bo(e))<0)throw new Error("Supplied ufixed is negative");return Fo("uint256",n.mul(new Oo(2).pow(new Oo(r[1]))))}if(t.startsWith("fixed"))return r=Lo(t),Fo("int256",Bo(e).mul(new Oo(2).pow(new Oo(r[1]))));throw new Error("Unsupported or invalid type: "+t)}function Uo(t){return"string"===t||"bytes"===t||"dynamic"===Do(t)}function Vo(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],o=0;o<t.length;o++){var s=To(t[o]),a=e[o];if("bytes"===s)i.push(a);else if("string"===s)i.push(new Buffer(a,"utf8"));else if("bool"===s)i.push(new Buffer(a?"01":"00","hex"));else if("address"===s)i.push(jo.setLength(a,20));else if(s.startsWith("bytes")){if((r=Po(s))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(jo.setLengthRight(a,r))}else if(s.startsWith("uint")){if((r=Po(s))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((n=Bo(a)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else{if(!s.startsWith("int"))throw new Error("Unsupported or invalid type: "+s);if((r=Po(s))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((n=Bo(a)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}}return Buffer.concat(i)}var Ho={rawEncode:function(t,e){var r=[],n=[],i=32*t.length;for(var o in t){var s=To(t[o]),a=Fo(s,e[o]);Uo(s)?(r.push(Fo("uint256",i)),n.push(a),i+=a.length):r.push(a)}return Buffer.concat(r.concat(n))},solidityPack:Vo,soliditySHA3:function(t,e){return jo.keccak(Vo(t,e))}};const Wo=No,zo=Ho,qo={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},$o={encodeData(t,e,r,n=!0){const i=["bytes32"],o=[this.hashType(t,r)];if(n){const s=(t,e,i)=>{if(void 0!==r[e])return["bytes32",null==i?"0x0000000000000000000000000000000000000000000000000000000000000000":Wo.keccak(this.encodeData(e,i,r,n))];if(void 0===i)throw new Error(`missing value for field ${t} of type ${e}`);if("bytes"===e)return["bytes32",Wo.keccak(i)];if("string"===e)return"string"==typeof i&&(i=Buffer.from(i,"utf8")),["bytes32",Wo.keccak(i)];if(e.lastIndexOf("]")===e.length-1){const r=e.slice(0,e.lastIndexOf("[")),n=i.map((e=>s(t,r,e)));return["bytes32",Wo.keccak(zo.rawEncode(n.map((([t])=>t)),n.map((([,t])=>t))))]}return[e,i]};for(const n of r[t]){const[t,r]=s(n.name,n.type,e[n.name]);i.push(t),o.push(r)}}else for(const s of r[t]){let t=e[s.name];if(void 0!==t)if("bytes"===s.type)i.push("bytes32"),t=Wo.keccak(t),o.push(t);else if("string"===s.type)i.push("bytes32"),"string"==typeof t&&(t=Buffer.from(t,"utf8")),t=Wo.keccak(t),o.push(t);else if(void 0!==r[s.type])i.push("bytes32"),t=Wo.keccak(this.encodeData(s.type,t,r,n)),o.push(t);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),o.push(t)}}return zo.rawEncode(i,o)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter((e=>e!==t));n=[t].concat(n.sort());for(const t of n){if(!e[t])throw new Error("No type definition specified: "+t);r+=t+"("+e[t].map((({name:t,type:e})=>e+" "+t)).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||void 0===e[t])return r;r.push(t);for(const n of e[t])for(const t of this.findTypeDependencies(n.type,e,r))!r.includes(t)&&r.push(t);return r},hashStruct(t,e,r,n=!0){return Wo.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Wo.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in qo.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),"EIP712Domain"!==r.primaryType&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),Wo.keccak(Buffer.concat(n))}};var Jo={TYPED_MESSAGE_SCHEMA:qo,TypedDataUtils:$o,hashForSignTypedDataLegacy:function(t){return function(t){const e=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!t.length)throw e;const r=t.map((function(t){return"bytes"===t.type?Wo.toBuffer(t.value):t.value})),n=t.map((function(t){return t.type})),i=t.map((function(t){if(!t.name)throw e;return t.type+" "+t.name}));return zo.soliditySHA3(["bytes32","bytes32"],[zo.soliditySHA3(new Array(t.length).fill("string"),i),zo.soliditySHA3(n,r)])}(t.data)},hashForSignTypedData_v3:function(t){return $o.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return $o.hash(t.data)}};var Go={};Object.defineProperty(Go,"__esModule",{value:!0}),Go.filterFromParam=Go.FilterPolyfill=void 0;const Zo=Bn,Qo=le,Yo={jsonrpc:"2.0",id:0};function Ko(t){return{fromBlock:ts(t.fromBlock),toBlock:ts(t.toBlock),addresses:void 0===t.address?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}function Xo(t){const e={fromBlock:es(t.fromBlock),toBlock:es(t.toBlock),topics:t.topics};return null!==t.addresses&&(e.address=t.addresses),e}function ts(t){if(void 0===t||"latest"===t||"pending"===t)return"latest";if("earliest"===t)return(0,Zo.IntNumber)(0);if((0,Qo.isHexString)(t))return(0,Qo.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function es(t){return"latest"===t?t:(0,Qo.hexStringFromIntNumber)(t)}function rs(){return Object.assign(Object.assign({},Yo),{error:{code:-32e3,message:"filter not found"}})}function ns(){return Object.assign(Object.assign({},Yo),{result:[]})}Go.FilterPolyfill=class{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Zo.IntNumber)(1),this.provider=t}async newFilter(t){const e=Ko(t),r=this.makeFilterId(),n=await this.setInitialCursorPosition(r,e.fromBlock);return console.log(`Installing new log filter(${r}):`,e,"initial cursor position:",n),this.logFilters.set(r,e),this.setFilterTimeout(r),(0,Qo.hexStringFromIntNumber)(r)}async newBlockFilter(){const t=this.makeFilterId(),e=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,e),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Qo.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),e=await this.setInitialCursorPosition(t,"latest");return console.log(`Installing new block filter (${t}) with initial cursor position:`,e),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Qo.hexStringFromIntNumber)(t)}uninstallFilter(t){const e=(0,Qo.intNumberFromHexString)(t);return console.log(`Uninstalling filter (${e})`),this.deleteFilter(e),!0}getFilterChanges(t){const e=(0,Qo.intNumberFromHexString)(t);return this.timeouts.has(e)&&this.setFilterTimeout(e),this.logFilters.has(e)?this.getLogFilterChanges(e):this.blockFilters.has(e)?this.getBlockFilterChanges(e):this.pendingTransactionFilters.has(e)?this.getPendingTransactionFilterChanges(e):Promise.resolve(rs())}async getFilterLogs(t){const e=(0,Qo.intNumberFromHexString)(t),r=this.logFilters.get(e);return r?this.sendAsyncPromise(Object.assign(Object.assign({},Yo),{method:"eth_getLogs",params:[Xo(r)]})):rs()}makeFilterId(){return(0,Zo.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise(((e,r)=>{this.provider.sendAsync(t,((t,n)=>t?r(t):Array.isArray(n)||null==n?r(new Error(`unexpected response received: ${JSON.stringify(n)}`)):void e(n)))}))}deleteFilter(t){console.log(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const e=this.logFilters.get(t),r=this.cursors.get(t);if(!r||!e)return rs();const n=await this.getCurrentBlockHeight(),i="latest"===e.toBlock?n:e.toBlock;if(r>n)return ns();if(r>e.toBlock)return ns();console.log(`Fetching logs from ${r} to ${i} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Yo),{method:"eth_getLogs",params:[Xo(Object.assign(Object.assign({},e),{fromBlock:r,toBlock:i}))]}));if(Array.isArray(o.result)){const e=o.result.map((t=>(0,Qo.intNumberFromHexString)(t.blockNumber||"0x0"))),n=Math.max(...e);if(n&&n>r){const e=(0,Zo.IntNumber)(n+1);console.log(`Moving cursor position for filter (${t}) from ${r} to ${e}`),this.cursors.set(t,e)}}return o}async getBlockFilterChanges(t){const e=this.cursors.get(t);if(!e)return rs();const r=await this.getCurrentBlockHeight();if(e>r)return ns();console.log(`Fetching blocks from ${e} to ${r} for filter (${t})`);const n=(await Promise.all((0,Qo.range)(e,r+1).map((t=>this.getBlockHashByNumber((0,Zo.IntNumber)(t)))))).filter((t=>!!t)),i=(0,Zo.IntNumber)(e+n.length);return console.log(`Moving cursor position for filter (${t}) from ${e} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},Yo),{result:n})}async getPendingTransactionFilterChanges(t){return Promise.resolve(ns())}async setInitialCursorPosition(t,e){const r=await this.getCurrentBlockHeight(),n="number"==typeof e&&e>r?e:r;return this.cursors.set(t,n),n}setFilterTimeout(t){const e=this.timeouts.get(t);e&&window.clearTimeout(e);const r=window.setTimeout((()=>{console.log(`Filter (${t}) timed out`),this.deleteFilter(t)}),3e5);this.timeouts.set(t,r)}async getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},Yo),{method:"eth_blockNumber",params:[]}));return(0,Qo.intNumberFromHexString)((0,Qo.ensureHexString)(t))}async getBlockHashByNumber(t){const e=await this.sendAsyncPromise(Object.assign(Object.assign({},Yo),{method:"eth_getBlockByNumber",params:[(0,Qo.hexStringFromIntNumber)(t),!1]}));return e.result&&"string"==typeof e.result.hash?(0,Qo.ensureHexString)(e.result.hash):null}},Go.filterFromParam=Ko;var is={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,(e=t.JSONRPCMethod||(t.JSONRPCMethod={})).eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(is);var os={},ss={},as={},us=function(t){var e=(t=t||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==t.start?t.start:Math.floor(Math.random()*e);return function(){return r%=e,r++}};const cs=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let t=0;t<arguments.length;t++)n[t]=arguments[t];return new r(((r,i)=>{e.errorFirst?n.push((function(t,n){if(e.multiArgs){const e=new Array(arguments.length-1);for(let t=1;t<arguments.length;t++)e[t-1]=arguments[t];t?(e.unshift(t),i(e)):r(e)}else t?i(t):r(n)})):n.push((function(t){if(e.multiArgs){const t=new Array(arguments.length-1);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];r(t)}else r(t)})),t.apply(this,n)}))};var ls={},hs=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ls,"__esModule",{value:!0}),ls.BaseBlockTracker=void 0;const ds=hs(g),fs=(t,e)=>t+e,ps=["sync","latest"];class gs extends ds.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||2e4,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){if(this._currentBlock)return this._currentBlock;return await new Promise((t=>this.once("latest",t)))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){ps.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return ps.map((t=>this.listenerCount(t))).reduce(fs)}_newPotentialLatest(t){const e=this._currentBlock;e&&bs(t)<=bs(e)||this._setCurrentBlock(t)}_setCurrentBlock(t){const e=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:e,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}function bs(t){return Number.parseInt(t,16)}ls.BaseBlockTracker=gs;var ys={},ms={},vs={};class _s extends TypeError{constructor(t,e){let r;const{message:n,explanation:i,...o}=t,{path:s}=t,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}function ws(t){return"object"==typeof t&&null!=t}function Ss(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function Es(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function Ms(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:o}=e,{type:s}=r,{refinement:a,message:u=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${Es(n)}\``}=t;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:u}}function*xs(t,e,r,n){(function(t){return ws(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=Ms(i,e,r,n);t&&(yield t)}}function*ks(t,e,r={}){const{path:n=[],branch:i=[t],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(t=e.coercer(t,a),s&&"type"!==e.type&&ws(e.schema)&&ws(t)&&!Array.isArray(t)))for(const r in t)void 0===e.schema[r]&&delete t[r];let u="valid";for(const n of e.validator(t,a))n.explanation=r.message,u="not_valid",yield[n,void 0];for(let[c,l,h]of e.entries(t,a)){const e=ks(l,h,{path:void 0===c?n:[...n,c],branch:void 0===c?i:[...i,l],coerce:o,mask:s,message:r.message});for(const r of e)r[0]?(u=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):o&&(l=r[1],void 0===c?t=l:t instanceof Map?t.set(c,l):t instanceof Set?t.add(l):ws(t)&&(void 0!==l||c in t)&&(t[c]=l))}if("not_valid"!==u)for(const n of e.refiner(t,a))n.explanation=r.message,u="not_refined",yield[n,void 0];"valid"===u&&(yield[void 0,t])}class Cs{constructor(t){const{type:e,schema:r,validator:n,refiner:i,coercer:o=(t=>t),entries:s=function*(){}}=t;this.type=e,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(t,e)=>xs(n(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>xs(i(t,e),e,this,t):()=>[]}assert(t,e){return Is(t,this,e)}create(t,e){return Rs(t,this,e)}is(t){return Ns(t,this)}mask(t,e){return As(t,this,e)}validate(t,e={}){return js(t,this,e)}}function Is(t,e,r){const n=js(t,e,{message:r});if(n[0])throw n[0]}function Rs(t,e,r){const n=js(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function As(t,e,r){const n=js(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Ns(t,e){return!js(t,e)[0]}function js(t,e,r={}){const n=ks(t,e,r),i=function(t){const{done:e,value:r}=t.next();return e?void 0:r}(n);if(i[0]){const t=new _s(i[0],(function*(){for(const t of n)t[0]&&(yield t[0])}));return[t,void 0]}return[void 0,i[1]]}function Os(t,e){return new Cs({type:t,schema:null,validator:e})}function Ts(){return Os("never",(()=>!1))}function Ps(t){const e=t?Object.keys(t):[],r=Ts();return new Cs({type:"object",schema:t||null,*entries(n){if(t&&ws(n)){const i=new Set(Object.keys(n));for(const r of e)i.delete(r),yield[r,n[r],t[r]];for(const t of i)yield[t,n[t],r]}},validator:t=>ws(t)||`Expected an object, but received: ${Es(t)}`,coercer:t=>ws(t)?{...t}:t})}function Ls(t){return new Cs({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function Ds(){return Os("string",(t=>"string"==typeof t||`Expected a string, but received: ${Es(t)}`))}function Bs(t){const e=Object.keys(t);return new Cs({type:"type",schema:t,*entries(r){if(ws(r))for(const n of e)yield[n,r[n],t[n]]},validator:t=>ws(t)||`Expected an object, but received: ${Es(t)}`,coercer:t=>ws(t)?{...t}:t})}function Fs(){return Os("unknown",(()=>!0))}function Us(t,e,r){return new Cs({...t,coercer:(n,i)=>Ns(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function Vs(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Hs(t,e,r){return new Cs({...t,*refiner(n,i){yield*t.refiner(n,i);const o=xs(r(n,i),i,t,n);for(const t of o)yield{...t,refinement:e}}})}var Ws=Object.freeze({__proto__:null,Struct:Cs,StructError:_s,any:function(){return Os("any",(()=>!0))},array:function(t){return new Cs({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${Es(t)}`})},assert:Is,assign:function(...t){const e="type"===t[0].type,r=t.map((t=>t.schema)),n=Object.assign({},...r);return e?Bs(n):Ps(n)},bigint:function(){return Os("bigint",(t=>"bigint"==typeof t))},boolean:function(){return Os("boolean",(t=>"boolean"==typeof t))},coerce:Us,create:Rs,date:function(){return Os("date",(t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${Es(t)}`))},defaulted:function(t,e,r={}){return Us(t,Fs(),(t=>{const n="function"==typeof e?e():e;if(void 0===t)return n;if(!r.strict&&Ss(t)&&Ss(n)){const e={...t};let r=!1;for(const t in n)void 0===e[t]&&(e[t]=n[t],r=!0);if(r)return e}return t}))},define:Os,deprecated:function(t,e){return new Cs({...t,refiner:(e,r)=>void 0===e||t.refiner(e,r),validator:(r,n)=>void 0===r||(e(r,n),t.validator(r,n))})},dynamic:function(t){return new Cs({type:"dynamic",schema:null,*entries(e,r){const n=t(e,r);yield*n.entries(e,r)},validator:(e,r)=>t(e,r).validator(e,r),coercer:(e,r)=>t(e,r).coercer(e,r),refiner:(e,r)=>t(e,r).refiner(e,r)})},empty:function(t){return Hs(t,"empty",(e=>{const r=Vs(e);return 0===r||`Expected an empty ${t.type} but received one with a size of \`${r}\``}))},enums:function(t){const e={},r=t.map((t=>Es(t))).join();for(const r of t)e[r]=r;return new Cs({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${r}\`, but received: ${Es(e)}`})},func:function(){return Os("func",(t=>"function"==typeof t||`Expected a function, but received: ${Es(t)}`))},instance:function(t){return Os("instance",(e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${Es(e)}`))},integer:function(){return Os("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${Es(t)}`))},intersection:function(t){return new Cs({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})},is:Ns,lazy:function(t){let e;return new Cs({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator:(r,n)=>(e??(e=t()),e.validator(r,n)),coercer:(r,n)=>(e??(e=t()),e.coercer(r,n)),refiner:(r,n)=>(e??(e=t()),e.refiner(r,n))})},literal:function(t){const e=Es(t),r=typeof t;return new Cs({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${Es(r)}`})},map:function(t,e){return new Cs({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer:t=>t instanceof Map?new Map(t):t,validator:t=>t instanceof Map||`Expected a \`Map\` object, but received: ${Es(t)}`})},mask:As,max:function(t,e,r={}){const{exclusive:n}=r;return Hs(t,"max",(r=>n?r<e:r<=e||`Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${r}\``))},min:function(t,e,r={}){const{exclusive:n}=r;return Hs(t,"min",(r=>n?r>e:r>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${r}\``))},never:Ts,nonempty:function(t){return Hs(t,"nonempty",(e=>Vs(e)>0||`Expected a nonempty ${t.type} but received an empty one`))},nullable:function(t){return new Cs({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})},number:function(){return Os("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${Es(t)}`))},object:Ps,omit:function(t,e){const{schema:r}=t,n={...r};for(const t of e)delete n[t];return"type"===t.type?Bs(n):Ps(n)},optional:Ls,partial:function(t){const e=t instanceof Cs?{...t.schema}:{...t};for(const t in e)e[t]=Ls(e[t]);return Ps(e)},pattern:function(t,e){return Hs(t,"pattern",(r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`))},pick:function(t,e){const{schema:r}=t,n={};for(const t of e)n[t]=r[t];return Ps(n)},record:function(t,e){return new Cs({type:"record",schema:null,*entries(r){if(ws(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>ws(t)||`Expected an object, but received: ${Es(t)}`})},refine:Hs,regexp:function(){return Os("regexp",(t=>t instanceof RegExp))},set:function(t){return new Cs({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer:t=>t instanceof Set?new Set(t):t,validator:t=>t instanceof Set||`Expected a \`Set\` object, but received: ${Es(t)}`})},size:function(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Hs(t,"size",(t=>{if("number"==typeof t||t instanceof Date)return e<=t&&t<=r||`${n} ${i} but received \`${t}\``;if(t instanceof Map||t instanceof Set){const{size:o}=t;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}{const{length:o}=t;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}}))},string:Ds,struct:function(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Os(t,e)},trimmed:function(t){return Us(t,Ds(),(t=>t.trim()))},tuple:function(t){const e=Ts();return new Cs({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${Es(t)}`})},type:Bs,union:function(t){const e=t.map((t=>t.type)).join(" | ");return new Cs({type:"union",schema:null,coercer(e){for(const r of t){const[t,n]=r.validate(e,{coerce:!0});if(!t)return n}return e},validator(r,n){const i=[];for(const e of t){const[...t]=ks(r,e,n),[o]=t;if(!o[0])return[];for(const[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${Es(r)}`,...i]}})},unknown:Fs,validate:js}),zs=t.getAugmentedNamespace(Ws);Object.defineProperty(vs,"__esModule",{value:!0}),vs.assertExhaustive=vs.assertStruct=vs.assert=vs.AssertionError=void 0;const qs=zs;function $s(t,e){return r=t,Boolean("string"==typeof(null===(i=null===(n=null==r?void 0:r.prototype)||void 0===n?void 0:n.constructor)||void 0===i?void 0:i.name))?new t({message:e}):t({message:e});var r,n,i}class Js extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}vs.AssertionError=Js,vs.assert=function(t,e="Assertion failed.",r=Js){if(!t){if(e instanceof Error)throw e;throw $s(r,e)}},vs.assertStruct=function(t,e,r="Assertion failed",n=Js){try{(0,qs.assert)(t,e)}catch(t){throw $s(n,`${r}: ${function(t){const e=function(t){return"object"==typeof t&&null!==t&&"message"in t}(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}(t)}.`)}},vs.assertExhaustive=function(t){throw new Error("Invalid branch reached. Should be detected during compilation.")};var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.base64=void 0;const Zs=zs,Qs=vs;Gs.base64=(t,e={})=>{var r,n;const i=null!==(r=e.paddingRequired)&&void 0!==r&&r,o=null!==(n=e.characterSet)&&void 0!==n?n:"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,Qs.assert)("base64url"===o),s=String.raw`[-_A-Za-z0-9]`),a=i?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,Zs.pattern)(t,a)};var Ys={},Ks={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=zs,r=vs;function n(r){return(0,e.is)(r,t.HexStruct)}function i(r){return(0,e.is)(r,t.StrictHexStruct)}t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu),t.isHexString=n,t.isStrictHexString=i,t.assertIsHexString=function(t){(0,r.assert)(n(t),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(t){(0,r.assert)(i(t),'Value must be a hexadecimal string, starting with "0x".')},t.add0x=function(t){return t.startsWith("0x")?t:t.startsWith("0X")?`0x${t.substring(2)}`:`0x${t}`},t.remove0x=function(t){return t.startsWith("0x")||t.startsWith("0X")?t.substring(2):t}}(Ks),Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.createDataView=Ys.concatBytes=Ys.valueToBytes=Ys.stringToBytes=Ys.numberToBytes=Ys.signedBigIntToBytes=Ys.bigIntToBytes=Ys.hexToBytes=Ys.bytesToString=Ys.bytesToNumber=Ys.bytesToSignedBigInt=Ys.bytesToBigInt=Ys.bytesToHex=Ys.assertIsBytes=Ys.isBytes=void 0;const Xs=vs,ta=Ks,ea=48,ra=58,na=87;const ia=function(){const t=[];return()=>{if(0===t.length)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}();function oa(t){return t instanceof Uint8Array}function sa(t){(0,Xs.assert)(oa(t),"Value must be a Uint8Array.")}function aa(t){if(sa(t),0===t.length)return"0x";const e=ia(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,ta.add0x)(r.join(""))}function ua(t){sa(t);const e=aa(t);return BigInt(e)}function ca(t){var e;if("0x"===(null===(e=null==t?void 0:t.toLowerCase)||void 0===e?void 0:e.call(t)))return new Uint8Array;(0,ta.assertIsHexString)(t);const r=(0,ta.remove0x)(t).toLowerCase(),n=r.length%2==0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let t=0;t<i.length;t++){const e=n.charCodeAt(2*t),r=n.charCodeAt(2*t+1),o=e-(e<ra?ea:na),s=r-(r<ra?ea:na);i[t]=16*o+s}return i}function la(t){(0,Xs.assert)("bigint"==typeof t,"Value must be a bigint."),(0,Xs.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");return ca(t.toString(16))}function ha(t){(0,Xs.assert)("number"==typeof t,"Value must be a number."),(0,Xs.assert)(t>=0,"Value must be a non-negative number."),(0,Xs.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");return ca(t.toString(16))}function da(t){return(0,Xs.assert)("string"==typeof t,"Value must be a string."),(new TextEncoder).encode(t)}function fa(t){if("bigint"==typeof t)return la(t);if("number"==typeof t)return ha(t);if("string"==typeof t)return t.startsWith("0x")?ca(t):da(t);if(oa(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}Ys.isBytes=oa,Ys.assertIsBytes=sa,Ys.bytesToHex=aa,Ys.bytesToBigInt=ua,Ys.bytesToSignedBigInt=function(t){sa(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*t.length,e)},Ys.bytesToNumber=function(t){sa(t);const e=ua(t);return(0,Xs.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)},Ys.bytesToString=function(t){return sa(t),(new TextDecoder).decode(t)},Ys.hexToBytes=ca,Ys.bigIntToBytes=la,Ys.signedBigIntToBytes=function(t,e){(0,Xs.assert)("bigint"==typeof t,"Value must be a bigint."),(0,Xs.assert)("number"==typeof e,"Byte length must be a number."),(0,Xs.assert)(e>0,"Byte length must be greater than 0."),(0,Xs.assert)(function(t,e){(0,Xs.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(8*e-1))}(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let t=0;t<n.length;t++)n[t]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},Ys.numberToBytes=ha,Ys.stringToBytes=da,Ys.valueToBytes=fa,Ys.concatBytes=function(t){const e=new Array(t.length);let r=0;for(let n=0;n<t.length;n++){const i=fa(t[n]);e[n]=i,r+=i.length}const n=new Uint8Array(r);for(let t=0,r=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n},Ys.createDataView=function(t){if("undefined"!=typeof Buffer&&t instanceof Buffer){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)};var pa={};Object.defineProperty(pa,"__esModule",{value:!0}),pa.ChecksumStruct=void 0;const ga=zs,ba=Gs;pa.ChecksumStruct=(0,ga.size)((0,ba.base64)((0,ga.string)(),{paddingRequired:!0}),44,44);var ya={};Object.defineProperty(ya,"__esModule",{value:!0}),ya.createHex=ya.createBytes=ya.createBigInt=ya.createNumber=void 0;const ma=zs,va=vs,_a=Ys,wa=Ks,Sa=(0,ma.union)([(0,ma.number)(),(0,ma.bigint)(),(0,ma.string)(),wa.StrictHexStruct]),Ea=(0,ma.coerce)((0,ma.number)(),Sa,Number),Ma=(0,ma.coerce)((0,ma.bigint)(),Sa,BigInt);(0,ma.union)([wa.StrictHexStruct,(0,ma.instance)(Uint8Array)]);const xa=(0,ma.coerce)((0,ma.instance)(Uint8Array),(0,ma.union)([wa.StrictHexStruct]),_a.hexToBytes),ka=(0,ma.coerce)(wa.StrictHexStruct,(0,ma.instance)(Uint8Array),_a.bytesToHex);ya.createNumber=function(t){try{const e=(0,ma.create)(t,Ea);return(0,va.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){if(e instanceof ma.StructError)throw new Error(`Expected a number-like value, got "${t}".`);throw e}},ya.createBigInt=function(t){try{return(0,ma.create)(t,Ma)}catch(t){if(t instanceof ma.StructError)throw new Error(`Expected a number-like value, got "${String(t.value)}".`);throw t}},ya.createBytes=function(t){if("string"==typeof t&&"0x"===t.toLowerCase())return new Uint8Array;try{return(0,ma.create)(t,xa)}catch(t){if(t instanceof ma.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}},ya.createHex=function(t){if(t instanceof Uint8Array&&0===t.length||"string"==typeof t&&"0x"===t.toLowerCase())return"0x";try{return(0,ma.create)(t,ka)}catch(t){if(t instanceof ma.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}};var Ca,Ia,Ra={},Aa=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldSet||function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},Na=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.FrozenSet=Ra.FrozenMap=void 0;class ja{constructor(t){Ca.set(this,void 0),Aa(this,Ca,new Map(t),"f"),Object.freeze(this)}get size(){return Na(this,Ca,"f").size}[(Ca=new WeakMap,Symbol.iterator)](){return Na(this,Ca,"f")[Symbol.iterator]()}entries(){return Na(this,Ca,"f").entries()}forEach(t,e){return Na(this,Ca,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}get(t){return Na(this,Ca,"f").get(t)}has(t){return Na(this,Ca,"f").has(t)}keys(){return Na(this,Ca,"f").keys()}values(){return Na(this,Ca,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([t,e])=>`${String(t)} => ${String(e)}`)).join(", ")} `:""}}`}}Ra.FrozenMap=ja;class Oa{constructor(t){Ia.set(this,void 0),Aa(this,Ia,new Set(t),"f"),Object.freeze(this)}get size(){return Na(this,Ia,"f").size}[(Ia=new WeakMap,Symbol.iterator)](){return Na(this,Ia,"f")[Symbol.iterator]()}entries(){return Na(this,Ia,"f").entries()}forEach(t,e){return Na(this,Ia,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}has(t){return Na(this,Ia,"f").has(t)}keys(){return Na(this,Ia,"f").keys()}values(){return Na(this,Ia,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((t=>String(t))).join(", ")} `:""}}`}}Ra.FrozenSet=Oa,Object.freeze(ja),Object.freeze(ja.prototype),Object.freeze(Oa),Object.freeze(Oa.prototype);var Ta={},Pa={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(t){return Array.isArray(t)&&t.length>0},t.isNullOrUndefined=function(t){return null==t},t.isObject=function(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)};var e;function r(t){return t.charCodeAt(0)<=127}t.hasProperty=(t,e)=>Object.hasOwnProperty.call(t,e),(e=t.JsonSize||(t.JsonSize={}))[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date",t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}},t.isASCII=r,t.calculateStringSize=function(e){var n;return e.split("").reduce(((t,e)=>r(e)?t+1:t+2),0)+(null!==(n=e.match(t.ESCAPE_CHARACTERS_REGEXP))&&void 0!==n?n:[]).length},t.calculateNumberSize=function(t){return t.toString().length}}(Pa),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=zs,r=vs,n=Pa;function i(t,e=!1){const r=new Set;return function t(e,i){if(void 0===e)return[!1,0];if(null===e)return[!0,i?0:n.JsonSize.Null];const o=typeof e;try{if("function"===o)return[!1,0];if("string"===o||e instanceof String)return[!0,i?0:(0,n.calculateStringSize)(e)+2*n.JsonSize.Quote];if("boolean"===o||e instanceof Boolean)return i?[!0,0]:[!0,1==e?n.JsonSize.True:n.JsonSize.False];if("number"===o||e instanceof Number)return i?[!0,0]:[!0,(0,n.calculateNumberSize)(e)];if(e instanceof Date)return i?[!0,0]:[!0,isNaN(e.getDate())?n.JsonSize.Null:n.JsonSize.Date+2*n.JsonSize.Quote]}catch(t){return[!1,0]}if(!(0,n.isPlainObject)(e)&&!Array.isArray(e))return[!1,0];if(r.has(e))return[!1,0];r.add(e);try{return[!0,Object.entries(e).reduce(((o,[s,a],u,c)=>{let[l,h]=t(a,i);if(!l)throw new Error("JSON validation did not pass. Validation process stopped.");if(r.delete(e),i)return 0;return o+(Array.isArray(e)?0:s.length+n.JsonSize.Comma+2*n.JsonSize.Colon)+h+(u<c.length-1?n.JsonSize.Comma:0)}),i?0:2*n.JsonSize.Wrapper)]}catch(t){return[!1,0]}}(t,e)}t.JsonStruct=(0,e.define)("Json",(t=>{const[e]=i(t,!0);return!!e||"Expected a valid JSON-serializable value"})),t.isValidJson=function(r){return(0,e.is)(r,t.JsonStruct)},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]),t.isJsonRpcNotification=function(r){return(0,e.is)(r,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(e,n){(0,r.assertStruct)(e,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",n)},t.isJsonRpcRequest=function(r){return(0,e.is)(r,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(e,n){(0,r.assertStruct)(e,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",n)},t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(r){return(0,e.is)(r,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(e,n){(0,r.assertStruct)(e,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",n)},t.isJsonRpcResponse=function(r){return(0,e.is)(r,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(e,n){(0,r.assertStruct)(e,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",n)},t.isJsonRpcSuccess=function(r){return(0,e.is)(r,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(e,n){(0,r.assertStruct)(e,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",n)},t.isJsonRpcFailure=function(r){return(0,e.is)(r,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(e,n){(0,r.assertStruct)(e,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",n)},t.isJsonRpcError=function(r){return(0,e.is)(r,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(e,n){(0,r.assertStruct)(e,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",n)},t.getJsonRpcIdValidator=function(t){const{permitEmptyString:e,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},t);return t=>Boolean("number"==typeof t&&(r||Number.isInteger(t))||"string"==typeof t&&(e||t.length>0)||n&&null===t)},t.validateJsonAndGetSize=i}(Ta);var La,Da,Ba={},Fa={exports:{}};function Ua(){if(Da)return La;Da=1;var t=1e3,e=60*t,r=60*e,n=24*r,i=7*n,o=365.25*n;function s(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}return La=function(a,u){u=u||{};var c=typeof a;if("string"===c&&a.length>0)return function(s){if((s=String(s)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*o;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*n;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*e;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(a);if("number"===c&&isFinite(a))return u.long?function(i){var o=Math.abs(i);if(o>=n)return s(i,o,n,"day");if(o>=r)return s(i,o,r,"hour");if(o>=e)return s(i,o,e,"minute");if(o>=t)return s(i,o,t,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=n)return Math.round(i/n)+"d";if(o>=r)return Math.round(i/r)+"h";if(o>=e)return Math.round(i/e)+"m";if(o>=t)return Math.round(i/t)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},La}var Va=function(t){function e(t){let n,i,o,s=null;function a(...t){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];n=o.call(r,e),t.splice(s,1),s--}return n})),e.formatArgs.call(r,t);(r.log||e.log).apply(r,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=r,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function r(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function n(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(n),...e.skips.map(n).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=Ua(),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e};!function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=Va(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(Fa,Fa.exports);var Ha=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.createModuleLogger=Ba.createProjectLogger=void 0;const Wa=(0,Ha(Fa.exports).default)("metamask");Ba.createProjectLogger=function(t){return Wa.extend(t)},Ba.createModuleLogger=function(t,e){return t.extend(e)};var za={};Object.defineProperty(za,"__esModule",{value:!0}),za.hexToBigInt=za.hexToNumber=za.bigIntToHex=za.numberToHex=void 0;const qa=vs,$a=Ks;za.numberToHex=t=>((0,qa.assert)("number"==typeof t,"Value must be a number."),(0,qa.assert)(t>=0,"Value must be a non-negative number."),(0,qa.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,$a.add0x)(t.toString(16)));za.bigIntToHex=t=>((0,qa.assert)("bigint"==typeof t,"Value must be a bigint."),(0,qa.assert)(t>=0,"Value must be a non-negative bigint."),(0,$a.add0x)(t.toString(16)));za.hexToNumber=t=>{(0,$a.assertIsHexString)(t);const e=parseInt(t,16);return(0,qa.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};za.hexToBigInt=t=>((0,$a.assertIsHexString)(t),BigInt((0,$a.add0x)(t)));var Ja={};Object.defineProperty(Ja,"__esModule",{value:!0});var Ga={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,(e=t.Duration||(t.Duration={}))[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year";const r=(t,e)=>{if(!(t=>Number.isInteger(t)&&t>=0)(t))throw new Error(`"${e}" must be a non-negative integer. Received: "${t}".`)};t.inMilliseconds=function(t,e){return r(t,"count"),t*e},t.timeSince=function(t){return r(t,"timestamp"),Date.now()-t}}(Ga);var Za={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=o.semver,r=zs,n=vs;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",(t=>null!==(0,e.valid)(t)||`Expected SemVer version, got "${t}"`)),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",(t=>null!==(0,e.validRange)(t)||`Expected SemVer range, got "${t}"`)),t.isValidSemVerVersion=function(e){return(0,r.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,r.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,n.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,n.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(t,r){return(0,e.gt)(t,r)},t.gtRange=function(t,r){return(0,e.gtr)(t,r)},t.satisfiesVersionRange=function(t,r){return(0,e.satisfies)(t,r,{includePrerelease:!0})}}(Za),function(e){var r=t.commonjsGlobal&&t.commonjsGlobal.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=t.commonjsGlobal&&t.commonjsGlobal.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),n(vs,e),n(Gs,e),n(Ys,e),n(pa,e),n(ya,e),n(Ra,e),n(Ks,e),n(Ta,e),n(Ba,e),n(Pa,e),n(za,e),n(Ja,e),n(Ga,e),n(Za,e)}(ms),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=ms;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")}(ys);var Qa=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(as,"__esModule",{value:!0}),as.PollingBlockTracker=void 0;const Ya=Qa(us),Ka=Qa(((t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=t=>{const r=e=>"string"==typeof e?t===e:e.test(t);return e.include?e.include.some(r):!e.exclude.some(r)};let n;n="function"==typeof t?function(){return e.excludeMain?t.apply(this,arguments):cs(t,e).apply(this,arguments)}:Object.create(Object.getPrototypeOf(t));for(const i in t){const o=t[i];n[i]="function"==typeof o&&r(i)?cs(o,e):o}return n})),Xa=ls,tu=(0,ys.createModuleLogger)(ys.projectLogger,"polling-block-tracker"),eu=(0,Ya.default)();class ru extends Xa.BaseBlockTracker{constructor(t={}){var e;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:null!==(e=t.blockResetDuration)&&void 0!==e?e:t.pollingInterval}),this._provider=t.provider,this._pollingInterval=t.pollingInterval||2e4,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=void 0===t.keepEventLoopActive||t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const t=nu(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await t}catch(e){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${null!==(t=e.stack)&&void 0!==t?t:e}`);try{this.emit("error",r)}catch(t){console.error(r)}const n=nu(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:eu(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),tu("Making request",t);const e=await(0,Ka.default)((e=>this._provider.sendAsync(t,e)))();if(tu("Got response",e),e.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${e.error.message}`);return e.result}}function nu(t,e){return new Promise((r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()}))}as.PollingBlockTracker=ru;var iu={},ou=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iu,"__esModule",{value:!0}),iu.SubscribeBlockTracker=void 0;const su=ou(us),au=ls,uu=(0,su.default)();class cu extends au.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(void 0===this._subscriptionId||null===this._subscriptionId)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(null!==this._subscriptionId&&void 0!==this._subscriptionId)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...e){return new Promise(((r,n)=>{this._provider.sendAsync({id:uu(),method:t,params:e,jsonrpc:"2.0"},((t,e)=>{t?n(t):r(e.result)}))}))}_handleSubData(t,e){var r;"eth_subscription"===e.method&&(null===(r=e.params)||void 0===r?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(e.params.result.number)}}iu.SubscribeBlockTracker=cu;var lu={};Object.defineProperty(lu,"__esModule",{value:!0}),function(e){var r=t.commonjsGlobal&&t.commonjsGlobal.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=t.commonjsGlobal&&t.commonjsGlobal.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),n(as,e),n(iu,e),n(lu,e)}(ss);var hu={},du={},fu={};Object.defineProperty(fu,"__esModule",{value:!0}),fu.getUniqueId=void 0;const pu=4294967295;let gu=Math.floor(Math.random()*pu);fu.getUniqueId=function(){return gu=(gu+1)%pu,gu},Object.defineProperty(du,"__esModule",{value:!0}),du.createIdRemapMiddleware=void 0;const bu=fu;du.createIdRemapMiddleware=function(){return(t,e,r,n)=>{const i=t.id,o=bu.getUniqueId();t.id=o,e.id=o,r((r=>{t.id=i,e.id=i,r()}))}};var yu={};Object.defineProperty(yu,"__esModule",{value:!0}),yu.createAsyncMiddleware=void 0,yu.createAsyncMiddleware=function(t){return async(e,r,n,i)=>{let o;const s=new Promise((t=>{o=t}));let a=null,u=!1;const c=async()=>{u=!0,n((t=>{a=t,o()})),await s};try{await t(e,r,c),u?(await s,a(null)):i(null)}catch(t){a?a(t):i(t)}}};var mu={};Object.defineProperty(mu,"__esModule",{value:!0}),mu.createScaffoldMiddleware=void 0,mu.createScaffoldMiddleware=function(t){return(e,r,n,i)=>{const o=t[e.method];return void 0===o?n():"function"==typeof o?o(e,r,n,i):(r.result=o,i())}};var vu={},_u={},wu={};Object.defineProperty(wu,"__esModule",{value:!0}),wu.EthereumProviderError=wu.EthereumRpcError=void 0;const Su=S;class Eu extends Error{constructor(t,e,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==r&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Su.default(this.serialize(),Mu,2)}}wu.EthereumRpcError=Eu;function Mu(t,e){if("[Circular]"!==e)return e}wu.EthereumProviderError=class extends Eu{constructor(t,e,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r)}};var xu={},ku={};Object.defineProperty(ku,"__esModule",{value:!0}),ku.errorValues=ku.errorCodes=void 0,ku.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},ku.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=ku,r=wu,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:n,message:s(n)};function s(r,n=i){if(Number.isInteger(r)){const n=r.toString();if(l(e.errorValues,n))return e.errorValues[n].message;if(u(r))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function a(t){if(!Number.isInteger(t))return!1;const r=t.toString();return!!e.errorValues[r]||!!u(t)}function u(t){return t>=-32099&&t<=-32e3}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=a,t.serializeError=function(t,{fallbackError:e=o,shouldIncludeStack:n=!1}={}){var i,u;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof r.EthereumRpcError)return t.serialize();const h={};if(t&&"object"==typeof t&&!Array.isArray(t)&&l(t,"code")&&a(t.code)){const e=t;h.code=e.code,e.message&&"string"==typeof e.message?(h.message=e.message,l(e,"data")&&(h.data=e.data)):(h.message=s(h.code),h.data={originalError:c(t)})}else{h.code=e.code;const r=null===(i=t)||void 0===i?void 0:i.message;h.message=r&&"string"==typeof r?r:e.message,h.data={originalError:c(t)}}const d=null===(u=t)||void 0===u?void 0:u.stack;return n&&t&&d&&"string"==typeof d&&(h.stack=d),h}}(xu);var Cu={};Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.ethErrors=void 0;const Iu=wu,Ru=xu,Au=ku;function Nu(t,e){const[r,n]=Ou(e);return new Iu.EthereumRpcError(t,r||Ru.getMessageFromCode(t),n)}function ju(t,e){const[r,n]=Ou(e);return new Iu.EthereumProviderError(t,r||Ru.getMessageFromCode(t),n)}function Ou(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}Cu.ethErrors={rpc:{parse:t=>Nu(Au.errorCodes.rpc.parse,t),invalidRequest:t=>Nu(Au.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Nu(Au.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Nu(Au.errorCodes.rpc.methodNotFound,t),internal:t=>Nu(Au.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Nu(e,t)},invalidInput:t=>Nu(Au.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Nu(Au.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Nu(Au.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Nu(Au.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Nu(Au.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Nu(Au.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>ju(Au.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>ju(Au.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>ju(Au.errorCodes.provider.unsupportedMethod,t),disconnected:t=>ju(Au.errorCodes.provider.disconnected,t),chainDisconnected:t=>ju(Au.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new Iu.EthereumProviderError(e,r,n)}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=wu;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=xu;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Cu;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=ku;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(_u);var Tu=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vu,"__esModule",{value:!0}),vu.JsonRpcEngine=void 0;const Pu=Tu(g),Lu=_u;class Du extends Pu.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,e){if(e&&"function"!=typeof e)throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?e?this._handleBatch(t,e):this._handleBatch(t):e?this._handle(t,e):this._promiseHandle(t)}asMiddleware(){return async(t,e,r,n)=>{try{const[i,o,s]=await Du._runAllMiddleware(t,e,this._middleware);return o?(await Du._runReturnHandlers(s),n(i)):r((async t=>{try{await Du._runReturnHandlers(s)}catch(e){return t(e)}return t()}))}catch(t){return n(t)}}}async _handleBatch(t,e){try{const r=await Promise.all(t.map(this._promiseHandle.bind(this)));return e?e(null,r):r}catch(t){if(e)return e(t);throw t}}_promiseHandle(t){return new Promise((e=>{this._handle(t,((t,r)=>{e(r)}))}))}async _handle(t,e){if(!t||Array.isArray(t)||"object"!=typeof t){const r=new Lu.EthereumRpcError(Lu.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof t,{request:t});return e(r,{id:void 0,jsonrpc:"2.0",error:r})}if("string"!=typeof t.method){const r=new Lu.EthereumRpcError(Lu.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof t.method,{request:t});return e(r,{id:t.id,jsonrpc:"2.0",error:r})}const r=Object.assign({},t),n={id:r.id,jsonrpc:r.jsonrpc};let i=null;try{await this._processRequest(r,n)}catch(t){i=t}return i&&(delete n.result,n.error||(n.error=Lu.serializeError(i))),e(i,n)}async _processRequest(t,e){const[r,n,i]=await Du._runAllMiddleware(t,e,this._middleware);if(Du._checkForCompletion(t,e,n),await Du._runReturnHandlers(i),r)throw r}static async _runAllMiddleware(t,e,r){const n=[];let i=null,o=!1;for(const s of r)if([i,o]=await Du._runMiddleware(t,e,s,n),o)break;return[i,o,n.reverse()]}static _runMiddleware(t,e,r,n){return new Promise((i=>{const o=t=>{const r=t||e.error;r&&(e.error=Lu.serializeError(r)),i([r,!0])},s=r=>{e.error?o(e.error):(r&&("function"!=typeof r&&o(new Lu.EthereumRpcError(Lu.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:\n${Bu(t)}`,{request:t})),n.push(r)),i([null,!1]))};try{r(t,e,s,o)}catch(t){o(t)}}))}static async _runReturnHandlers(t){for(const e of t)await new Promise(((t,r)=>{e((e=>e?r(e):t()))}))}static _checkForCompletion(t,e,r){if(!("result"in e)&&!("error"in e))throw new Lu.EthereumRpcError(Lu.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${Bu(t)}`,{request:t});if(!r)throw new Lu.EthereumRpcError(Lu.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${Bu(t)}`,{request:t})}}function Bu(t){return JSON.stringify(t,null,2)}vu.JsonRpcEngine=Du;var Fu={};Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.mergeMiddleware=void 0;const Uu=vu;Fu.mergeMiddleware=function(t){const e=new Uu.JsonRpcEngine;return t.forEach((t=>e.push(t))),e.asMiddleware()},function(e){var r=t.commonjsGlobal&&t.commonjsGlobal.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),n=t.commonjsGlobal&&t.commonjsGlobal.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),n(du,e),n(yu,e),n(mu,e),n(fu,e),n(vu,e),n(Fu,e)}(hu);var Vu={},Hu={},Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});var zu=s.require$$0,qu=function(){function t(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return t.prototype.acquire=function(){var t=this,e=this.isLocked(),r=new Promise((function(e){return t._queue.push(e)}));return e||this._dispatch(),r},t.prototype.runExclusive=function(t){return zu.__awaiter(this,void 0,void 0,(function(){var e,r,n;return zu.__generator(this,(function(i){switch(i.label){case 0:return[4,this.acquire()];case 1:e=i.sent(),r=e[0],n=e[1],i.label=2;case 2:return i.trys.push([2,,4,5]),[4,t(r)];case 3:return[2,i.sent()];case 4:return n(),[7];case 5:return[2]}}))}))},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},t.prototype._dispatch=function(){var t=this,e=this._queue.shift();if(e){var r=!1;this._currentReleaser=function(){r||(r=!0,t._value++,t._dispatch())},e([this._value--,this._currentReleaser])}},t}();Wu.default=qu,Object.defineProperty(Hu,"__esModule",{value:!0});var $u=s.require$$0,Ju=Wu,Gu=function(){function t(){this._semaphore=new Ju.default(1)}return t.prototype.acquire=function(){return $u.__awaiter(this,void 0,void 0,(function(){var t;return $u.__generator(this,(function(e){switch(e.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=e.sent(),[2,t[1]]}}))}))},t.prototype.runExclusive=function(t){return this._semaphore.runExclusive((function(){return t()}))},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();Hu.default=Gu;var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.withTimeout=void 0;var Qu=s.require$$0;Zu.withTimeout=function(t,e,r){var n=this;return void 0===r&&(r=new Error("timeout")),{acquire:function(){return new Promise((function(i,o){return Qu.__awaiter(n,void 0,void 0,(function(){var n,s;return Qu.__generator(this,(function(a){switch(a.label){case 0:return n=!1,setTimeout((function(){n=!0,o(r)}),e),[4,t.acquire()];case 1:return s=a.sent(),n?(Array.isArray(s)?s[1]:s)():i(s),[2]}}))}))}))},runExclusive:function(t){return Qu.__awaiter(this,void 0,void 0,(function(){var e,r;return Qu.__generator(this,(function(n){switch(n.label){case 0:e=function(){},n.label=1;case 1:return n.trys.push([1,,7,8]),[4,this.acquire()];case 2:return r=n.sent(),Array.isArray(r)?(e=r[1],[4,t(r[0])]):[3,4];case 3:return[2,n.sent()];case 4:return e=r,[4,t()];case 5:return[2,n.sent()];case 6:return[3,8];case 7:return e(),[7];case 8:return[2]}}))}))},release:function(){t.release()},isLocked:function(){return t.isLocked()}}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=Hu;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=Wu;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Zu;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})}(Vu);var Yu=function(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)Ku.call(r,n)&&(t[n]=r[n])}return t},Ku=Object.prototype.hasOwnProperty;const Xu=Yu,tc=us();var ec=rc;function rc(t){this.currentProvider=t}function nc(t){return function(){var e=[].slice.call(arguments),r=e.pop();this.sendAsync({method:t,params:e},r)}}function ic(t,e){return function(){var r=[].slice.call(arguments),n=r.pop();r.length<t&&r.push("latest"),this.sendAsync({method:e,params:r},n)}}rc.prototype.getBalance=ic(2,"eth_getBalance"),rc.prototype.getCode=ic(2,"eth_getCode"),rc.prototype.getTransactionCount=ic(2,"eth_getTransactionCount"),rc.prototype.getStorageAt=ic(3,"eth_getStorageAt"),rc.prototype.call=ic(2,"eth_call"),rc.prototype.protocolVersion=nc("eth_protocolVersion"),rc.prototype.syncing=nc("eth_syncing"),rc.prototype.coinbase=nc("eth_coinbase"),rc.prototype.mining=nc("eth_mining"),rc.prototype.hashrate=nc("eth_hashrate"),rc.prototype.gasPrice=nc("eth_gasPrice"),rc.prototype.accounts=nc("eth_accounts"),rc.prototype.blockNumber=nc("eth_blockNumber"),rc.prototype.getBlockTransactionCountByHash=nc("eth_getBlockTransactionCountByHash"),rc.prototype.getBlockTransactionCountByNumber=nc("eth_getBlockTransactionCountByNumber"),rc.prototype.getUncleCountByBlockHash=nc("eth_getUncleCountByBlockHash"),rc.prototype.getUncleCountByBlockNumber=nc("eth_getUncleCountByBlockNumber"),rc.prototype.sign=nc("eth_sign"),rc.prototype.sendTransaction=nc("eth_sendTransaction"),rc.prototype.sendRawTransaction=nc("eth_sendRawTransaction"),rc.prototype.estimateGas=nc("eth_estimateGas"),rc.prototype.getBlockByHash=nc("eth_getBlockByHash"),rc.prototype.getBlockByNumber=nc("eth_getBlockByNumber"),rc.prototype.getTransactionByHash=nc("eth_getTransactionByHash"),rc.prototype.getTransactionByBlockHashAndIndex=nc("eth_getTransactionByBlockHashAndIndex"),rc.prototype.getTransactionByBlockNumberAndIndex=nc("eth_getTransactionByBlockNumberAndIndex"),rc.prototype.getTransactionReceipt=nc("eth_getTransactionReceipt"),rc.prototype.getUncleByBlockHashAndIndex=nc("eth_getUncleByBlockHashAndIndex"),rc.prototype.getUncleByBlockNumberAndIndex=nc("eth_getUncleByBlockNumberAndIndex"),rc.prototype.getCompilers=nc("eth_getCompilers"),rc.prototype.compileLLL=nc("eth_compileLLL"),rc.prototype.compileSolidity=nc("eth_compileSolidity"),rc.prototype.compileSerpent=nc("eth_compileSerpent"),rc.prototype.newFilter=nc("eth_newFilter"),rc.prototype.newBlockFilter=nc("eth_newBlockFilter"),rc.prototype.newPendingTransactionFilter=nc("eth_newPendingTransactionFilter"),rc.prototype.uninstallFilter=nc("eth_uninstallFilter"),rc.prototype.getFilterChanges=nc("eth_getFilterChanges"),rc.prototype.getFilterLogs=nc("eth_getFilterLogs"),rc.prototype.getLogs=nc("eth_getLogs"),rc.prototype.getWork=nc("eth_getWork"),rc.prototype.submitWork=nc("eth_submitWork"),rc.prototype.submitHashrate=nc("eth_submitHashrate"),rc.prototype.sendAsync=function(t,e){var r;this.currentProvider.sendAsync((r=t,Xu({id:tc(),jsonrpc:"2.0",params:[]},r)),(function(t,r){if(!t&&r.error&&(t=new Error("EthQuery - RPC Error - "+r.error.message)),t)return e(t);e(null,r.result)}))};const oc=(t,e,r,n)=>function(...i){return new(0,e.promiseModule)(((o,s)=>{e.multiArgs?i.push(((...t)=>{e.errorFirst?t[0]?s(t):(t.shift(),o(t)):o(t)})):e.errorFirst?i.push(((t,e)=>{t?s(t):o(e)})):i.push(o);const a=this===r?n:this;Reflect.apply(t,a,i)}))},sc=new WeakMap;const ac=g.default;var uc=class extends ac{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach((t=>this.emit("update",t)))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};const cc=uc;var lc={minBlockRef:function(...t){return hc(t)[0]},maxBlockRef:function(...t){const e=hc(t);return e[e.length-1]},sortBlockRefs:hc,bnToHex:function(t){return"0x"+t.toString(16)},blockRefIsNumber:function(t){return t&&!["earliest","latest","pending"].includes(t)},hexToInt:dc,incrementHexInt:function(t){if(null==t)return t;return fc(dc(t)+1)},intToHex:fc,unsafeRandomBytes:function(t){let e="0x";for(let r=0;r<t;r++)e+=pc(),e+=pc();return e}};function hc(t){return t.sort(((t,e)=>"latest"===t||"earliest"===e?1:"latest"===e||"earliest"===t?-1:dc(t)-dc(e)))}function dc(t){return null==t?t:Number.parseInt(t,16)}function fc(t){if(null==t)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function pc(){return Math.floor(16*Math.random()).toString(16)}const gc=ec,bc=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(null===t||"object"!==r&&"function"!==r)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":r}\``);const n=new WeakMap,i=new Proxy(t,{apply(t,r,o){const s=n.get(t);if(s)return Reflect.apply(s,r,o);const a=e.excludeMain?t:oc(t,e,i,t);return n.set(t,a),Reflect.apply(a,r,o)},get(t,r){const o=t[r];if(!((t,r)=>{let n=sc.get(t);if(n||(n={},sc.set(t,n)),r in n)return n[r];const i=t=>"string"==typeof t||"symbol"==typeof r?r===t:t.test(r),o=Reflect.getOwnPropertyDescriptor(t,r),s=void 0===o||o.writable||o.configurable,a=(e.include?e.include.some(i):!e.exclude.some(i))&&s;return n[r]=a,a})(t,r)||o===Function.prototype[r])return o;const s=n.get(o);if(s)return s;if("function"==typeof o){const r=oc(o,e,i,t);return n.set(o,r),r}return o}});return i},yc=class extends cc{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}},{bnToHex:mc,hexToInt:vc,incrementHexInt:_c,minBlockRef:wc,blockRefIsNumber:Sc}=lc;var Ec=class extends yc{constructor({provider:t,params:e}){super(),this.type="log",this.ethQuery=new gc(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},e),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map((t=>t.toLowerCase())))}async initialize({currentBlock:t}){let e=this.params.fromBlock;["latest","pending"].includes(e)&&(e=t),"earliest"===e&&(e="0x0"),this.params.fromBlock=e;const r=wc(this.params.toBlock,t),n=Object.assign({},this.params,{toBlock:r}),i=await this._fetchLogs(n);this.addInitialResults(i)}async update({oldBlock:t,newBlock:e}){const r=e;let n;n=t?_c(t):e;const i=Object.assign({},this.params,{fromBlock:n,toBlock:r}),o=(await this._fetchLogs(i)).filter((t=>this.matchLog(t)));this.addResults(o)}async _fetchLogs(t){return await bc((e=>this.ethQuery.getLogs(t,e)))()}matchLog(t){if(vc(this.params.fromBlock)>=vc(t.blockNumber))return!1;if(Sc(this.params.toBlock)&&vc(this.params.toBlock)<=vc(t.blockNumber))return!1;const e=t.address&&t.address.toLowerCase();if(this.params.address&&e&&!this.params.address.includes(e))return!1;const r=this.params.topics.every(((e,r)=>{let n=t.topics[r];if(!n)return!1;n=n.toLowerCase();let i=Array.isArray(e)?e:[e];if(i.includes(null))return!0;i=i.map((t=>t.toLowerCase()));return i.includes(n)}));return r}},Mc=async function({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=xc(e),i=xc(r),o=Array(i-n+1).fill().map(((t,e)=>n+e)).map(kc);return await Promise.all(o.map((e=>async function(t,e,r){for(let n=0;n<3;n++)try{return await Cc(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(t){console.error(`provider.sendAsync failed: ${t.stack||t.message||t}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}(t,"eth_getBlockByNumber",[e,!1]))))};function xc(t){return null==t?t:Number.parseInt(t,16)}function kc(t){if(null==t)return t;return"0x"+t.toString(16)}function Cc(t,e){return new Promise(((r,n)=>{t.sendAsync(e,((t,e)=>{t?n(t):e.error?n(e.error):e.result?r(e.result):n(new Error("Result was empty"))}))}))}const Ic=uc,Rc=Mc,{incrementHexInt:Ac}=lc;var Nc=class extends Ic{constructor({provider:t,params:e}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:e}){const r=e,n=Ac(t),i=(await Rc({provider:this.provider,fromBlock:n,toBlock:r})).map((t=>t.hash));this.addResults(i)}};const jc=uc,Oc=Mc,{incrementHexInt:Tc}=lc;var Pc=class extends jc{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const e=t,r=Tc(t),n=await Oc({provider:this.provider,fromBlock:r,toBlock:e}),i=[];for(const t of n)i.push(...t.transactions);this.addResults(i)}};const Lc=Vu.Mutex,{createAsyncMiddleware:Dc,createScaffoldMiddleware:Bc}=hu,Fc=Ec,Uc=Nc,Vc=Pc,{intToHex:Hc,hexToInt:Wc}=lc;var zc=function({blockTracker:t,provider:e}){let r=0,n={};const i=new Lc,o=function({mutex:t}){return e=>async(r,n,i,o)=>{(await t.acquire())(),e(r,n,i,o)}}({mutex:i}),s=Bc({eth_newFilter:o(qc(u)),eth_newBlockFilter:o(qc(c)),eth_newPendingTransactionFilter:o(qc(l)),eth_uninstallFilter:o($c(f)),eth_getFilterChanges:o($c(h)),eth_getFilterLogs:o($c(d))}),a=async({oldBlock:t,newBlock:e})=>{if(0===n.length)return;const r=await i.acquire();try{await Promise.all(Jc(n).map((async r=>{try{await r.update({oldBlock:t,newBlock:e})}catch(t){console.error(t)}})))}catch(t){console.error(t)}r()};return s.newLogFilter=u,s.newBlockFilter=c,s.newPendingTransactionFilter=l,s.uninstallFilter=f,s.getFilterChanges=h,s.getFilterLogs=d,s.destroy=()=>{!async function(){const t=Jc(n).length;n={},g({prevFilterCount:t,newFilterCount:0})}()},s;async function u(t){const r=new Fc({provider:e,params:t});return await p(r),r}async function c(){const t=new Uc({provider:e});return await p(t),t}async function l(){const t=new Vc({provider:e});return await p(t),t}async function h(t){const e=Wc(t),r=n[e];if(!r)throw new Error(`No filter for index "${e}"`);return r.getChangesAndClear()}async function d(t){const e=Wc(t),r=n[e];if(!r)throw new Error(`No filter for index "${e}"`);let i=[];return"log"===r.type&&(i=r.getAllResults()),i}async function f(t){const e=Wc(t),r=n[e],i=Boolean(r);return i&&await async function(t){const e=Jc(n).length;delete n[t];const r=Jc(n).length;g({prevFilterCount:e,newFilterCount:r})}(e),i}async function p(e){const i=Jc(n).length,o=await t.getLatestBlock();await e.initialize({currentBlock:o}),r++,n[r]=e,e.id=r,e.idHex=Hc(r);return g({prevFilterCount:i,newFilterCount:Jc(n).length}),r}function g({prevFilterCount:e,newFilterCount:r}){0===e&&r>0?t.on("sync",a):e>0&&0===r&&t.removeListener("sync",a)}};function qc(t){return $c((async(...e)=>{const r=await t(...e);return Hc(r.id)}))}function $c(t){return Dc((async(e,r)=>{const n=await t.apply(null,e.params);r.result=n}))}function Jc(t,e){const r=[];for(let e in t)r.push(t[e]);return r}const Gc=g.default,{createAsyncMiddleware:Zc,createScaffoldMiddleware:Qc}=hu,Yc=zc,{unsafeRandomBytes:Kc,incrementHexInt:Xc}=lc,tl=Mc;var el=function({blockTracker:t,provider:e}){const r={},n=Yc({blockTracker:t,provider:e});let i=!1;const o=new Gc,s=Qc({eth_subscribe:Zc((async function(o,s){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const u=o.params[0],c=Kc(16);let l;switch(u){case"newHeads":l=h({subId:c});break;case"logs":const t=o.params[1];l=d({subId:c,filter:await n.newLogFilter(t)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${u}"`)}return r[c]=l,void(s.result=c);function h({subId:r}){const n={type:u,destroy:async()=>{t.removeListener("sync",n.update)},update:async({oldBlock:t,newBlock:n})=>{const i=n,o=Xc(t);(await tl({provider:e,fromBlock:o,toBlock:i})).map(rl).filter((t=>null!==t)).forEach((t=>{a(r,t)}))}};return t.on("sync",n.update),n}function d({subId:t,filter:e}){e.on("update",(e=>a(t,e)));return{type:u,destroy:async()=>await n.uninstallFilter(e.idHex)}}})),eth_unsubscribe:Zc((async function(t,e){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const n=t.params[0],o=r[n];if(!o)return void(e.result=!1);delete r[n],await o.destroy(),e.result=!0}))});return s.destroy=function(){o.removeAllListeners();for(const t in r)r[t].destroy(),delete r[t];i=!0},{events:o,middleware:s};function a(t,e){o.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:t,result:e}})}};function rl(t){return null==t?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(os,"__esModule",{value:!0}),os.SubscriptionManager=void 0;const nl=ss,il=el,ol=()=>{};os.SubscriptionManager=class{constructor(t){const e=new nl.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:r,middleware:n}=il({blockTracker:e,provider:t});this.events=r,this.subscriptionMiddleware=n}async handleRequest(t){const e={};return await this.subscriptionMiddleware(t,e,ol,ol),e}destroy(){this.subscriptionMiddleware.destroy()}};var sl=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(p,"__esModule",{value:!0}),p.CoinbaseWalletProvider=void 0;const al=sl(g),ul=sl(v.exports),cl=_,ll=J,hl=G,dl=si,fl=le,pl=sl(Jo),gl=Go,bl=is,yl=os,ml="DefaultChainId",vl="DefaultJsonRpcUrl";class _l extends al.default{constructor(t){var e,r;super(),this._filterPolyfill=new gl.FilterPolyfill(this),this._subscriptionManager=new yl.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this._send=this.send.bind(this),this._sendAsync=this.sendAsync.bind(this),this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=null===(e=t.overrideIsCoinbaseWallet)||void 0===e||e,this.isCoinbaseBrowser=null!==(r=t.overrideIsCoinbaseBrowser)&&void 0!==r&&r,this.qrUrl=t.qrUrl,this.supportsAddressSwitching=t.supportsAddressSwitching,this.isLedger=t.isLedger;const n=this.getChainId(),i=(0,fl.prepend0x)(n.toString(16));this.emit("connect",{chainIdStr:i});const o=this._storage.getItem(dl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const t=o.split(" ");""!==t[0]&&(this._addresses=t.map((t=>(0,fl.ensureAddressString)(t))),this.emit("accountsChanged",t))}this._subscriptionManager.events.on("notification",(t=>{this.emit("message",{type:t.method,data:t.params})})),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",(t=>{var e;if(t.origin===location.origin&&t.source===window&&"walletLinkMessage"===t.data.type){if("defaultChainChanged"===t.data.data.action||"dappChainSwitched"===t.data.data.action){const r=t.data.data.chainId,n=null!==(e=t.data.data.jsonRpcUrl)&&void 0!==e?e:this.jsonRpcUrl;this.updateProviderInfo(n,Number(r))}"addressChanged"===t.data.data.action&&this._setAddresses([t.data.data.address])}}))}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,fl.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return null!==(t=this._storage.getItem(vl))&&void 0!==t?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(vl,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,e){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=e,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,e){this.jsonRpcUrl=t;const r=this.getChainId();this._storage.setItem(ml,e.toString(10));!((0,fl.ensureIntNumber)(e)!==r)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,e,r,n,i,o){const s=await this.initializeRelay();return!!(await s.watchAsset(t,e,r,n,i,null==o?void 0:o.toString()).promise).result}async addEthereumChain(t,e,r,n,i,o){var s,a;if((0,fl.ensureIntNumber)(t)===this.getChainId())return!1;const u=await this.initializeRelay(),c=u.inlineAddEthereumChain(t.toString());this._isAuthorized()||c||await u.requestEthereumAccounts().promise;const l=await u.addEthereumChain(t.toString(),e,i,r,n,o).promise;return!0===(null===(s=l.result)||void 0===s?void 0:s.isApproved)&&this.updateProviderInfo(e[0],t),!0===(null===(a=l.result)||void 0===a?void 0:a.isApproved)}async switchEthereumChain(t){const e=await this.initializeRelay(),r=await e.switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if(r.errorCode)throw cl.ethErrors.provider.custom({code:r.errorCode});const n=r.result;n.isApproved&&n.rpcUrl.length>0&&this.updateProviderInfo(n.rpcUrl,t)}setAppInfo(t,e){this.initializeRelay().then((r=>r.setAppInfo(t,e)))}async enable(){var t;return null===(t=this.diagnostic)||void 0===t||t.log(ll.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?hl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this._send(bl.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(t,e){if("string"==typeof t){const r={jsonrpc:"2.0",id:0,method:t,params:Array.isArray(e)?e:void 0!==e?[e]:[]};return this._sendRequestAsync(r).then((t=>t.result))}if("function"==typeof e){const r=t,n=e;return this._sendAsync(r,n)}if(Array.isArray(t)){return t.map((t=>this._sendRequest(t)))}const r=t;return this._sendRequest(r)}async sendAsync(t,e){if("function"!=typeof e)throw new Error("callback is required");if(Array.isArray(t)){const r=e;return void this._sendMultipleRequestsAsync(t).then((t=>r(null,t))).catch((t=>r(t,null)))}const r=e;return this._sendRequestAsync(t).then((t=>r(null,t))).catch((t=>r(t,null)))}async request(t){if(!t||"object"!=typeof t||Array.isArray(t))throw cl.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:r}=t;if("string"!=typeof e||0===e.length)throw cl.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw cl.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const n=void 0===r?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:e,params:n,jsonrpc:"2.0",id:i})).result}async scanQRCode(t){const e=await this.initializeRelay(),r=await e.scanQRCode((0,fl.ensureRegExpString)(t)).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}async genericRequest(t,e){const r=await this.initializeRelay(),n=await r.genericRequest(t,e).promise;if("string"!=typeof n.result)throw new Error("result was not a string");return n.result}async selectProvider(t){const e=await this.initializeRelay(),r=await e.selectProvider(t).promise;if("string"!=typeof r.result)throw new Error("result was not a string");return r.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const e={jsonrpc:"2.0",id:t.id},{method:r}=t;if(e.result=this._handleSynchronousMethods(t),void 0===e.result)throw new Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return e}_setAddresses(t,e){if(!Array.isArray(t))throw new Error("addresses is not an array");const r=t.map((t=>(0,fl.ensureAddressString)(t)));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!e||(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(dl.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" "))))}_sendRequestAsync(t){return new Promise(((e,r)=>{try{const n=this._handleSynchronousMethods(t);if(void 0!==n)return e({jsonrpc:"2.0",id:t.id,result:n});const i=this._handleAsynchronousFilterMethods(t);if(void 0!==i)return void i.then((r=>e(Object.assign(Object.assign({},r),{id:t.id})))).catch((t=>r(t)));const o=this._handleSubscriptionMethods(t);if(void 0!==o)return void o.then((r=>e({jsonrpc:"2.0",id:t.id,result:r.result}))).catch((t=>r(t)))}catch(t){return r(t)}this._handleAsynchronousMethods(t).then((r=>r&&e(Object.assign(Object.assign({},r),{id:t.id})))).catch((t=>r(t)))}))}_sendMultipleRequestsAsync(t){return Promise.all(t.map((t=>this._sendRequestAsync(t))))}_handleSynchronousMethods(t){const{method:e}=t,r=t.params||[];switch(e){case bl.JSONRPCMethod.eth_accounts:return this._eth_accounts();case bl.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case bl.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(r);case bl.JSONRPCMethod.net_version:return this._net_version();case bl.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:e}=t,r=t.params||[];switch(e){case bl.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case bl.JSONRPCMethod.eth_sign:return this._eth_sign(r);case bl.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(r);case bl.JSONRPCMethod.personal_sign:return this._personal_sign(r);case bl.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(r);case bl.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(r);case bl.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(r);case bl.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(r);case bl.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(r);case bl.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case bl.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(r);case bl.JSONRPCMethod.eth_signTypedData_v4:case bl.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(r);case bl.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(r);case bl.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(r);case bl.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(r);case bl.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(t){const{method:e}=t,r=t.params||[];switch(e){case bl.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(r);case bl.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case bl.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case bl.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(r);case bl.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(t){switch(t.method){case bl.JSONRPCMethod.eth_subscribe:case bl.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const e=(0,fl.ensureAddressString)(t);return this._addresses.map((t=>(0,fl.ensureAddressString)(t))).includes(e)}catch(t){}return!1}_ensureKnownAddress(t){var e;if(!this._isKnownAddress(t))throw null===(e=this.diagnostic)||void 0===e||e.log(ll.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const e=t.from?(0,fl.ensureAddressString)(t.from):this.selectedAddress;if(!e)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(e);return{fromAddress:e,toAddress:t.to?(0,fl.ensureAddressString)(t.to):null,weiValue:null!=t.value?(0,fl.ensureBN)(t.value):new ul.default(0),data:t.data?(0,fl.ensureBuffer)(t.data):Buffer.alloc(0),nonce:null!=t.nonce?(0,fl.ensureIntNumber)(t.nonce):null,gasPriceInWei:null!=t.gasPrice?(0,fl.ensureBN)(t.gasPrice):null,maxFeePerGas:null!=t.maxFeePerGas?(0,fl.ensureBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:null!=t.maxPriorityFeePerGas?(0,fl.ensureBN)(t.maxPriorityFeePerGas):null,gasLimit:null!=t.gas?(0,fl.ensureBN)(t.gas):null,chainId:this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw cl.ethErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw cl.ethErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,e,r,n){this._ensureKnownAddress(e);try{const i=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await i.signEthereumMessage(t,e,r,n).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw cl.ethErrors.provider.userRejectedRequest("User denied message signature");throw t}}async _ethereumAddressFromSignedMessage(t,e,r){const n=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await n.ethereumAddressFromSignedMessage(t,e,r).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,fl.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(ml);if(!t)return(0,fl.ensureIntNumber)(this._chainIdFromOpts);const e=parseInt(t,10);return(0,fl.ensureIntNumber)(e)}async _eth_requestAccounts(){var t;if(null===(t=this.diagnostic)||void 0===t||t.log(ll.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?hl.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{const t=await this.initializeRelay();e=await t.requestEthereumAccounts().promise}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw cl.ethErrors.provider.userRejectedRequest("User denied account authorization");throw t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const e=(0,fl.ensureAddressString)(t[0]),r=(0,fl.ensureBuffer)(t[1]);return this._signEthereumMessage(r,e,!1)}_eth_ecRecover(t){const e=(0,fl.ensureBuffer)(t[0]),r=(0,fl.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(e,r,!1)}_personal_sign(t){this._requireAuthorization();const e=(0,fl.ensureBuffer)(t[0]),r=(0,fl.ensureAddressString)(t[1]);return this._signEthereumMessage(e,r,!0)}_personal_ecRecover(t){const e=(0,fl.ensureBuffer)(t[0]),r=(0,fl.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(e,r,!0)}async _eth_signTransaction(t){this._requireAuthorization();const e=this._prepareTransactionParams(t[0]||{});try{const t=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await t.signEthereumTransaction(e).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw cl.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw t}}async _eth_sendRawTransaction(t){const e=(0,fl.ensureBuffer)(t[0]),r=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await r.submitEthereumTransaction(e,this.getChainId()).promise).result}}async _eth_sendTransaction(t){this._requireAuthorization();const e=this._prepareTransactionParams(t[0]||{});try{const t=await this.initializeRelay();return{jsonrpc:"2.0",id:0,result:(await t.signAndSubmitEthereumTransaction(e).promise).result}}catch(t){if("string"==typeof t.message&&t.message.match(/(denied|rejected)/i))throw cl.ethErrors.provider.userRejectedRequest("User denied transaction signature");throw t}}async _eth_signTypedData_v1(t){this._requireAuthorization();const e=(0,fl.ensureParsedJSONObject)(t[0]),r=(0,fl.ensureAddressString)(t[1]);this._ensureKnownAddress(r);const n=pl.default.hashForSignTypedDataLegacy({data:e}),i=JSON.stringify(e,null,2);return this._signEthereumMessage(n,r,!1,i)}async _eth_signTypedData_v3(t){this._requireAuthorization();const e=(0,fl.ensureAddressString)(t[0]),r=(0,fl.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(e);const n=pl.default.hashForSignTypedData_v3({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,e,!1,i)}async _eth_signTypedData_v4(t){this._requireAuthorization();const e=(0,fl.ensureAddressString)(t[0]),r=(0,fl.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(e);const n=pl.default.hashForSignTypedData_v4({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,e,!1,i)}async _cbwallet_arbitrary(t){const e=t[0],r=t[1];if("string"!=typeof r)throw new Error("parameter must be a string");if("object"!=typeof e||null===e)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(e,r)}}async _wallet_addEthereumChain(t){var e,r,n,i;const o=t[0];if(0===(null===(e=o.rpcUrls)||void 0===e?void 0:e.length))return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||""===o.chainName.trim())throw cl.ethErrors.provider.custom({code:0,message:"chainName is a required field"});if(!o.nativeCurrency)throw cl.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});const s=parseInt(o.chainId,16);return await this.addEthereumChain(s,null!==(r=o.rpcUrls)&&void 0!==r?r:[],null!==(n=o.blockExplorerUrls)&&void 0!==n?n:[],o.chainName,null!==(i=o.iconUrls)&&void 0!==i?i:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const e=t[0];return await this.switchEthereumChain(parseInt(e.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const e=Array.isArray(t)?t[0]:t;if(!e.type)throw cl.ethErrors.rpc.invalidParams({message:"Type is required"});if("ERC20"!==(null==e?void 0:e.type))throw cl.ethErrors.rpc.invalidParams({message:`Asset of type '${e.type}' is not supported`});if(!(null==e?void 0:e.options))throw cl.ethErrors.rpc.invalidParams({message:"Options are required"});if(!(null==e?void 0:e.options.address))throw cl.ethErrors.rpc.invalidParams({message:"Address is required"});const r=this.getChainId(),{address:n,symbol:i,image:o,decimals:s}=e.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(e.type,n,i,s,o,r)}}_eth_uninstallFilter(t){const e=(0,fl.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(e)}async _eth_newFilter(t){const e=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(e)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const e=(0,fl.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(e)}_eth_getFilterLogs(t){const e=(0,fl.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(e)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then((t=>(t.setAccountsCallback(((t,e)=>this._setAddresses(t,e))),t.setChainCallback(((t,e)=>{this.updateProviderInfo(e,parseInt(t,10))})),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t)))}}p.CoinbaseWalletProvider=_l;var wl,Sl,El,Ml,xl,kl,Cl,Il,Rl,Al={},Nl={},jl={},Ol=[],Tl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Pl(t,e){for(var r in e)t[r]=e[r];return t}function Ll(t){var e=t.parentNode;e&&e.removeChild(t)}function Dl(t,e,r){var n,i,o,s={};for(o in e)"key"==o?n=e[o]:"ref"==o?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?wl.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===s[o]&&(s[o]=t.defaultProps[o]);return Bl(t,s,n,i,null)}function Bl(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++El:i};return null==i&&null!=Sl.vnode&&Sl.vnode(o),o}function Fl(t){return t.children}function Ul(t,e){this.props=t,this.context=e}function Vl(t,e){if(null==e)return t.__?Vl(t.__,t.__.__k.indexOf(t)+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Vl(t):null}function Hl(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Hl(t)}}function Wl(t){(!t.__d&&(t.__d=!0)&&xl.push(t)&&!zl.__r++||kl!==Sl.debounceRendering)&&((kl=Sl.debounceRendering)||Cl)(zl)}function zl(){var t,e,r,n,i,o,s,a;for(xl.sort(Il);t=xl.shift();)t.__d&&(e=xl.length,n=void 0,i=void 0,s=(o=(r=t).__v).__e,(a=r.__P)&&(n=[],(i=Pl({},o)).__v=o.__v+1,Xl(a,o,i,r.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,n,null==s?Vl(o):s,o.__h),th(n,o),o.__e!=s&&Hl(o)),xl.length>e&&xl.sort(Il));zl.__r=0}function ql(t,e,r,n,i,o,s,a,u,c){var l,h,d,f,p,g,b,y=n&&n.__k||Ol,m=y.length;for(r.__k=[],l=0;l<e.length;l++)if(null!=(f=r.__k[l]=null==(f=e[l])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Bl(null,f,null,null,f):Array.isArray(f)?Bl(Fl,{children:f},null,null,null):f.__b>0?Bl(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=r,f.__b=r.__b+1,null===(d=y[l])||d&&f.key==d.key&&f.type===d.type)y[l]=void 0;else for(h=0;h<m;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}Xl(t,f,d=d||jl,i,o,s,a,u,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(b||(b=[]),d.ref&&b.push(d.ref,null,f),b.push(h,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=u=$l(f,u,t):u=Jl(t,f,d,y,p,u),"function"==typeof r.type&&(r.__d=u)):u&&d.__e==u&&u.parentNode!=t&&(u=Vl(d))}for(r.__e=g,l=m;l--;)null!=y[l]&&("function"==typeof r.type&&null!=y[l].__e&&y[l].__e==r.__d&&(r.__d=Gl(n).nextSibling),nh(y[l],y[l]));if(b)for(l=0;l<b.length;l++)rh(b[l],b[++l],b[++l])}function $l(t,e,r){for(var n,i=t.__k,o=0;i&&o<i.length;o++)(n=i[o])&&(n.__=t,e="function"==typeof n.type?$l(n,e,r):Jl(r,n,n,i,n.__e,e));return e}function Jl(t,e,r,n,i,o){var s,a,u;if(void 0!==e.__d)s=e.__d,e.__d=void 0;else if(null==r||i!=o||null==i.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(i),s=null;else{for(a=o,u=0;(a=a.nextSibling)&&u<n.length;u+=1)if(a==i)break t;t.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function Gl(t){var e,r,n;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((r=t.__k[e])&&(n=Gl(r)))return n;return null}function Zl(t,e,r){"-"===e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Tl.test(e)?r:r+"px"}function Ql(t,e,r,n,i){var o;t:if("style"===e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof n&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Zl(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||Zl(t.style,e,r[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n||t.addEventListener(e,o?Kl:Yl,o):t.removeEventListener(e,o?Kl:Yl,o);else if("dangerouslySetInnerHTML"!==e){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,r))}}function Yl(t){return this.l[t.type+!1](Sl.event?Sl.event(t):t)}function Kl(t){return this.l[t.type+!0](Sl.event?Sl.event(t):t)}function Xl(t,e,r,n,i,o,s,a,u){var c,l,h,d,f,p,g,b,y,m,v,_,w,S,E,M=e.type;if(void 0!==e.constructor)return null;null!=r.__h&&(u=r.__h,a=e.__e=r.__e,e.__h=null,o=[a]),(c=Sl.__b)&&c(e);try{t:if("function"==typeof M){if(b=e.props,y=(c=M.contextType)&&n[c.__c],m=c?y?y.props.value:c.__:n,r.__c?g=(l=e.__c=r.__c).__=l.__E:("prototype"in M&&M.prototype.render?e.__c=l=new M(b,m):(e.__c=l=new Ul(b,m),l.constructor=M,l.render=ih),y&&y.sub(l),l.props=b,l.state||(l.state={}),l.context=m,l.__n=n,h=l.__d=!0,l.__h=[],l._sb=[]),null==l.__s&&(l.__s=l.state),null!=M.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=Pl({},l.__s)),Pl(l.__s,M.getDerivedStateFromProps(b,l.__s))),d=l.props,f=l.state,l.__v=e,h)null==M.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==M.getDerivedStateFromProps&&b!==d&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(b,m),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(b,l.__s,m)||e.__v===r.__v){for(e.__v!==r.__v&&(l.props=b,l.state=l.__s,l.__d=!1),l.__e=!1,e.__e=r.__e,e.__k=r.__k,e.__k.forEach((function(t){t&&(t.__=e)})),v=0;v<l._sb.length;v++)l.__h.push(l._sb[v]);l._sb=[],l.__h.length&&s.push(l);break t}null!=l.componentWillUpdate&&l.componentWillUpdate(b,l.__s,m),null!=l.componentDidUpdate&&l.__h.push((function(){l.componentDidUpdate(d,f,p)}))}if(l.context=m,l.props=b,l.__P=t,_=Sl.__r,w=0,"prototype"in M&&M.prototype.render){for(l.state=l.__s,l.__d=!1,_&&_(e),c=l.render(l.props,l.state,l.context),S=0;S<l._sb.length;S++)l.__h.push(l._sb[S]);l._sb=[]}else do{l.__d=!1,_&&_(e),c=l.render(l.props,l.state,l.context),l.state=l.__s}while(l.__d&&++w<25);l.state=l.__s,null!=l.getChildContext&&(n=Pl(Pl({},n),l.getChildContext())),h||null==l.getSnapshotBeforeUpdate||(p=l.getSnapshotBeforeUpdate(d,f)),E=null!=c&&c.type===Fl&&null==c.key?c.props.children:c,ql(t,Array.isArray(E)?E:[E],e,r,n,i,o,s,a,u),l.base=e.__e,e.__h=null,l.__h.length&&s.push(l),g&&(l.__E=l.__=null),l.__e=!1}else null==o&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=eh(r.__e,e,r,n,i,o,s,u);(c=Sl.diffed)&&c(e)}catch(t){e.__v=null,(u||null!=o)&&(e.__e=a,e.__h=!!u,o[o.indexOf(a)]=null),Sl.__e(t,e,r)}}function th(t,e){Sl.__c&&Sl.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Sl.__e(t,e.__v)}}))}function eh(t,e,r,n,i,o,s,a){var u,c,l,h=r.props,d=e.props,f=e.type,p=0;if("svg"===f&&(i=!0),null!=o)for(;p<o.length;p++)if((u=o[p])&&"setAttribute"in u==!!f&&(f?u.localName===f:3===u.nodeType)){t=u,o[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,a=!1}if(null===f)h===d||a&&t.data===d||(t.data=d);else{if(o=o&&wl.call(t.childNodes),c=(h=r.props||jl).dangerouslySetInnerHTML,l=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(l||c)&&(l&&(c&&l.__html==c.__html||l.__html===t.innerHTML)||(t.innerHTML=l&&l.__html||""))}if(function(t,e,r,n,i){var o;for(o in r)"children"===o||"key"===o||o in e||Ql(t,o,null,r[o],n);for(o in e)i&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||r[o]===e[o]||Ql(t,o,e[o],r[o],n)}(t,d,h,i,a),l)e.__k=[];else if(p=e.props.children,ql(t,Array.isArray(p)?p:[p],e,r,n,i&&"foreignObject"!==f,o,s,o?o[0]:r.__k&&Vl(r,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Ll(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==t.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&Ql(t,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==t.checked&&Ql(t,"checked",p,h.checked,!1))}return t}function rh(t,e,r){try{"function"==typeof t?t(e):t.current=e}catch(t){Sl.__e(t,r)}}function nh(t,e,r){var n,i;if(Sl.unmount&&Sl.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||rh(n,null,e)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(t){Sl.__e(t,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&nh(n[i],e,r||"function"!=typeof t.type);r||null==t.__e||Ll(t.__e),t.__=t.__e=t.__d=void 0}function ih(t,e,r){return this.constructor(t,r)}function oh(t,e,r){var n,i,o;Sl.__&&Sl.__(t,e),i=(n="function"==typeof r)?null:r&&r.__k||e.__k,o=[],Xl(e,t=(!n&&r||e).__k=Dl(Fl,null,[t]),i||jl,jl,void 0!==e.ownerSVGElement,!n&&r?[r]:i?null:e.firstChild?wl.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n),th(o,t)}wl=Ol.slice,Sl={__e:function(t,e,r,n){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(e){t=e}throw t}},El=0,Ml=function(t){return null!=t&&void 0===t.constructor},Ul.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Pl({},this.state),"function"==typeof t&&(t=t(Pl({},r),this.props)),t&&Pl(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Wl(this))},Ul.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Wl(this))},Ul.prototype.render=Fl,xl=[],Cl="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Il=function(t,e){return t.__v.__b-e.__v.__b},zl.__r=0,Rl=0;var sh=Object.freeze({__proto__:null,Component:Ul,Fragment:Fl,cloneElement:function(t,e,r){var n,i,o,s=Pl({},t.props);for(o in e)"key"==o?n=e[o]:"ref"==o?i=e[o]:s[o]=e[o];return arguments.length>2&&(s.children=arguments.length>3?wl.call(arguments,2):r),Bl(t.type,s,n||t.key,i||t.ref,null)},createContext:function(t,e){var r={__c:e="__cC"+Rl++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var r,n;return this.getChildContext||(r=[],(n={})[e]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&r.some((function(t){t.__e=!0,Wl(t)}))},this.sub=function(t){r.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r.splice(r.indexOf(t),1),e&&e.call(t)}}),t.children}};return r.Provider.__=r.Consumer.contextType=r},createElement:Dl,createRef:function(){return{current:null}},h:Dl,hydrate:function t(e,r){oh(e,r,t)},get isValidElement(){return Ml},get options(){return Sl},render:oh,toChildArray:function t(e,r){return r=r||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){t(e,r)})):r.push(e)),r}}),ah=t.getAugmentedNamespace(sh);function uh(t){return"function"==typeof t}var ch=!1,lh={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;ch=t},get useDeprecatedSynchronousErrorHandling(){return ch}};function hh(t){setTimeout((function(){throw t}),0)}var dh={closed:!0,next:function(t){},error:function(t){if(lh.useDeprecatedSynchronousErrorHandling)throw t;hh(t)},complete:function(){}},fh=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function ph(t){return null!==t&&"object"==typeof t}var gh=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),bh=gh,yh=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,o=r._unsubscribe,s=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var a=0;a<n.length;++a){n[a].remove(this)}if(uh(o)){i&&(this._unsubscribe=void 0);try{o.call(this)}catch(t){e=t instanceof bh?mh(t.errors):[t]}}if(fh(s)){a=-1;for(var u=s.length;++a<u;){var c=s[a];if(ph(c))try{c.unsubscribe()}catch(t){e=e||[],t instanceof bh?e=e.concat(mh(t.errors)):e.push(t)}}}if(e)throw new bh(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function mh(t){return t.reduce((function(t,e){return t.concat(e instanceof bh?e.errors:e)}),[])}var vh=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),_h=function(e){function r(t,n,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=dh;break;case 1:if(!t){o.destination=dh;break}if("object"==typeof t){t instanceof r?(o.syncErrorThrowable=t.syncErrorThrowable,o.destination=t,t.add(o)):(o.syncErrorThrowable=!0,o.destination=new wh(o,t));break}default:o.syncErrorThrowable=!0,o.destination=new wh(o,t,n,i)}return o}return t.__extends(r,e),r.prototype[vh]=function(){return this},r.create=function(t,e,n){var i=new r(t,e,n);return i.syncErrorThrowable=!1,i},r.prototype.next=function(t){this.isStopped||this._next(t)},r.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},r.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},r.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},r}(yh),wh=function(e){function r(t,r,n,i){var o,s=e.call(this)||this;s._parentSubscriber=t;var a=s;return uh(r)?o=r:r&&(o=r.next,n=r.error,i=r.complete,r!==dh&&(uh((a=Object.create(r)).unsubscribe)&&s.add(a.unsubscribe.bind(a)),a.unsubscribe=s.unsubscribe.bind(s))),s._context=a,s._next=o,s._error=n,s._complete=i,s}return t.__extends(r,e),r.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;lh.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},r.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=lh.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):hh(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;hh(t)}}},r.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};lh.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),lh.useDeprecatedSynchronousErrorHandling)throw t;hh(t)}},r.prototype.__tryOrSetError=function(t,e,r){if(!lh.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return lh.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(hh(e),!0)}return!1},r.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},r}(_h);function Sh(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;if(r||i)return!1;t=n&&n instanceof _h?n:null}return!0}var Eh=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function Mh(t){return t}function xh(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return kh(t)}function kh(t){return 0===t.length?Mh:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Ch=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,i=function(t,e,r){if(t){if(t instanceof _h)return t;if(t[vh])return t[vh]()}return t||e||r?new _h(t,e,r):new _h(dh)}(t,e,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||lh.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),lh.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){lh.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),Sh(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=Ih(e))((function(e,n){var i;i=r.subscribe((function(e){try{t(e)}catch(t){n(t),i&&i.unsubscribe()}}),n,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[Eh]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:kh(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Ih(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function Ih(t){if(t||(t=lh.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var Rh=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Ah=function(e){function r(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return t.__extends(r,e),r.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},r}(yh),Nh=function(e){function r(t){var r=e.call(this,t)||this;return r.destination=t,r}return t.__extends(r,e),r}(_h),jh=function(e){function r(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.__extends(r,e),r.prototype[vh]=function(){return new Nh(this)},r.prototype.lift=function(t){var e=new Oh(this,this);return e.operator=t,e},r.prototype.next=function(t){if(this.closed)throw new Rh;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},r.prototype.error=function(t){if(this.closed)throw new Rh;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},r.prototype.complete=function(){if(this.closed)throw new Rh;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},r.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},r.prototype._trySubscribe=function(t){if(this.closed)throw new Rh;return e.prototype._trySubscribe.call(this,t)},r.prototype._subscribe=function(t){if(this.closed)throw new Rh;return this.hasError?(t.error(this.thrownError),yh.EMPTY):this.isStopped?(t.complete(),yh.EMPTY):(this.observers.push(t),new Ah(this,t))},r.prototype.asObservable=function(){var t=new Ch;return t.source=this,t},r.create=function(t,e){return new Oh(t,e)},r}(Ch),Oh=function(e){function r(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return t.__extends(r,e),r.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},r.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},r.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},r.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):yh.EMPTY},r}(jh);function Th(){return function(t){return t.lift(new Ph(t))}}var Ph=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var n=new Lh(t,r),i=e.subscribe(n);return n.closed||(n.connection=r.connect()),i},t}(),Lh=function(e){function r(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return t.__extends(r,e),r.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},r}(_h),Dh=function(e){function r(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return t.__extends(r,e),r.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},r.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},r.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new yh).add(this.source.subscribe(new Fh(this.getSubject(),this))),t.closed&&(this._connection=null,t=yh.EMPTY)),t},r.prototype.refCount=function(){return Th()(this)},r}(Ch),Bh=function(){var t=Dh.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),Fh=function(e){function r(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return t.__extends(r,e),r.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},r.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},r.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},r}(Nh);var Uh=function(){function t(t,e,r,n){this.keySelector=t,this.elementSelector=e,this.durationSelector=r,this.subjectSelector=n}return t.prototype.call=function(t,e){return e.subscribe(new Vh(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),Vh=function(e){function r(t,r,n,i,o){var s=e.call(this,t)||this;return s.keySelector=r,s.elementSelector=n,s.durationSelector=i,s.subjectSelector=o,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return t.__extends(r,e),r.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},r.prototype._group=function(t,e){var r=this.groups;r||(r=this.groups=new Map);var n,i=r.get(e);if(this.elementSelector)try{n=this.elementSelector(t)}catch(t){this.error(t)}else n=t;if(!i){i=this.subjectSelector?this.subjectSelector():new jh,r.set(e,i);var o=new Wh(e,i,this);if(this.destination.next(o),this.durationSelector){var s=void 0;try{s=this.durationSelector(new Wh(e,i))}catch(t){return void this.error(t)}this.add(s.subscribe(new Hh(e,i,this)))}}i.closed||i.next(n)},r.prototype._error=function(t){var e=this.groups;e&&(e.forEach((function(e,r){e.error(t)})),e.clear()),this.destination.error(t)},r.prototype._complete=function(){var t=this.groups;t&&(t.forEach((function(t,e){t.complete()})),t.clear()),this.destination.complete()},r.prototype.removeGroup=function(t){this.groups.delete(t)},r.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},r}(_h),Hh=function(e){function r(t,r,n){var i=e.call(this,r)||this;return i.key=t,i.group=r,i.parent=n,i}return t.__extends(r,e),r.prototype._next=function(t){this.complete()},r.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},r}(_h),Wh=function(e){function r(t,r,n){var i=e.call(this)||this;return i.key=t,i.groupSubject=r,i.refCountSubscription=n,i}return t.__extends(r,e),r.prototype._subscribe=function(t){var e=new yh,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&e.add(new zh(r)),e.add(n.subscribe(t)),e},r}(Ch),zh=function(e){function r(t){var r=e.call(this)||this;return r.parent=t,t.count++,r}return t.__extends(r,e),r.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},r}(yh),qh=function(e){function r(t){var r=e.call(this)||this;return r._value=t,r}return t.__extends(r,e),Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),r.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},r.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Rh;return this._value},r.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},r}(jh),$h=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return t.__extends(r,e),r.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},r.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},r.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},r.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},r.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},r.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},r}(function(e){function r(t,r){return e.call(this)||this}return t.__extends(r,e),r.prototype.schedule=function(t,e){return this},r}(yh)),Jh=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return t.__extends(r,e),r.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},r.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},r.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},r}($h),Gh=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}(),Zh=function(e){function r(t,n){void 0===n&&(n=Gh.now);var i=e.call(this,t,(function(){return r.delegate&&r.delegate!==i?r.delegate.now():n()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return t.__extends(r,e),r.prototype.schedule=function(t,n,i){return void 0===n&&(n=0),r.delegate&&r.delegate!==this?r.delegate.schedule(t,n,i):e.prototype.schedule.call(this,t,n,i)},r.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},r}(Gh),Qh=new(function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r}(Zh))(Jh),Yh=Qh,Kh=new Ch((function(t){return t.complete()}));function Xh(t){return t?function(t){return new Ch((function(e){return t.schedule((function(){return e.complete()}))}))}(t):Kh}function td(t){return t&&"function"==typeof t.schedule}var ed,rd=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function nd(t,e){return new Ch((function(r){var n=new yh,i=0;return n.add(e.schedule((function(){i!==t.length?(r.next(t[i++]),r.closed||n.add(this.schedule())):r.complete()}))),n}))}function id(t,e){return e?nd(t,e):new Ch(rd(t))}function od(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return td(r)?(t.pop(),nd(t,r)):id(t)}function sd(t,e){return new Ch(e?function(r){return e.schedule(ad,0,{error:t,subscriber:r})}:function(e){return e.error(t)})}function ad(t){var e=t.error;t.subscriber.error(e)}ed||(ed={});var ud=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return od(this.value);case"E":return sd(this.error);case"C":return Xh()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var cd=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new ld(t,this.scheduler,this.delay))},t}(),ld=function(e){function r(t,r,n){void 0===n&&(n=0);var i=e.call(this,t)||this;return i.scheduler=r,i.delay=n,i}return t.__extends(r,e),r.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},r.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(r.dispatch,this.delay,new hd(t,this.destination)))},r.prototype._next=function(t){this.scheduleMessage(ud.createNext(t))},r.prototype._error=function(t){this.scheduleMessage(ud.createError(t)),this.unsubscribe()},r.prototype._complete=function(){this.scheduleMessage(ud.createComplete()),this.unsubscribe()},r}(_h),hd=function(){return function(t,e){this.notification=t,this.destination=e}}(),dd=function(e){function r(t,r,n){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return t.__extends(r,e),r.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var r=this._events;r.push(t),r.length>this._bufferSize&&r.shift()}e.prototype.next.call(this,t)},r.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new fd(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},r.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=n.length;if(this.closed)throw new Rh;if(this.isStopped||this.hasError?e=yh.EMPTY:(this.observers.push(t),e=new Ah(this,t)),i&&t.add(t=new ld(t,i)),r)for(var s=0;s<o&&!t.closed;s++)t.next(n[s]);else for(s=0;s<o&&!t.closed;s++)t.next(n[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},r.prototype._getNow=function(){return(this.scheduler||Yh).now()},r.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(t-n[o].time<r);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&n.splice(0,o),n},r}(jh),fd=function(){return function(t,e){this.time=t,this.value=e}}(),pd=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return t.__extends(r,e),r.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),yh.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),yh.EMPTY):e.prototype._subscribe.call(this,t)},r.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},r.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},r.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},r}(jh),gd=1,bd=function(){return Promise.resolve()}(),yd={};function md(t){return t in yd&&(delete yd[t],!0)}var vd=function(t){var e=gd++;return yd[e]=!0,bd.then((function(){return md(e)&&t()})),e},_d=function(t){md(t)},wd=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return t.__extends(r,e),r.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=vd(t.flush.bind(t,null))))},r.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(_d(r),t.scheduled=void 0)},r}($h),Sd=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,i=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n<i&&(t=r.shift()));if(this.active=!1,e){for(;++n<i&&(t=r.shift());)t.unsubscribe();throw e}},r}(Zh),Ed=new Sd(wd),Md=Ed,xd=new Zh($h),kd=xd,Cd=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return t.__extends(r,e),r.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame((function(){return t.flush(null)}))))},r.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(cancelAnimationFrame(r),t.scheduled=void 0)},r}($h),Id=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,n=-1,i=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++n<i&&(t=r.shift()));if(this.active=!1,e){for(;++n<i&&(t=r.shift());)t.unsubscribe();throw e}},r}(Zh),Rd=new Id(Cd),Ad=Rd,Nd=function(e){function r(t,r){void 0===t&&(t=jd),void 0===r&&(r=Number.POSITIVE_INFINITY);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}return t.__extends(r,e),r.prototype.flush=function(){for(var t,e,r=this.actions,n=this.maxFrames;(e=r[0])&&e.delay<=n&&(r.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=r.shift();)e.unsubscribe();throw t}},r.frameTimeFactor=10,r}(Zh),jd=function(e){function r(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return t.__extends(r,e),r.prototype.schedule=function(t,n){if(void 0===n&&(n=0),!this.id)return e.prototype.schedule.call(this,t,n);this.active=!1;var i=new r(this.scheduler,this.work);return this.add(i),i.schedule(t,n)},r.prototype.requestAsyncId=function(t,e,n){void 0===n&&(n=0),this.delay=t.frame+n;var i=t.actions;return i.push(this),i.sort(r.sortActions),!0},r.prototype.recycleAsyncId=function(t,e,r){},r.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},r.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},r}($h);function Od(){}var Td=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),Pd=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),Ld=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();function Dd(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new Bd(t,e))}}var Bd=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Fd(t,this.project,this.thisArg))},t}(),Fd=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return t.__extends(r,e),r.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},r}(_h);function Ud(t){var e=this,r=t.args,n=t.subscriber,i=t.params,o=i.callbackFunc,s=i.context,a=i.scheduler,u=i.subject;if(!u){u=i.subject=new pd;try{o.apply(s,r.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.length<=1?t[0]:t;e.add(a.schedule(Vd,0,{value:n,subject:u}))}]))}catch(t){u.error(t)}}this.add(u.subscribe(n))}function Vd(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function Hd(t){var e=this,r=t.params,n=t.subscriber,i=t.context,o=r.callbackFunc,s=r.args,a=r.scheduler,u=r.subject;if(!u){u=r.subject=new pd;try{o.apply(i,s.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t.shift();if(n)e.add(a.schedule(zd,0,{err:n,subject:u}));else{var i=t.length<=1?t[0]:t;e.add(a.schedule(Wd,0,{value:i,subject:u}))}}]))}catch(t){this.add(a.schedule(zd,0,{err:t,subject:u}))}}this.add(u.subscribe(n))}function Wd(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function zd(t){var e=t.err;t.subject.error(e)}var qd=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(e)},r.prototype.notifyError=function(t,e){this.destination.error(t)},r.prototype.notifyComplete=function(t){this.destination.complete()},r}(_h),$d=function(e){function r(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i.index=0,i}return t.__extends(r,e),r.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},r.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},r.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},r}(_h);function Jd(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Gd=Jd(),Zd=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Qd(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var Yd=function(t){if(t&&"function"==typeof t[Eh])return n=t,function(t){var e=n[Eh]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Zd(t))return rd(t);if(Qd(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,hh),t};if(t&&"function"==typeof t[Gd])return e=t,function(t){for(var r=e[Gd]();;){var n=void 0;try{n=r.next()}catch(e){return t.error(e),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,n,i=ph(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function Kd(t,e,r,n,i){if(void 0===i&&(i=new $d(t,r,n)),!i.closed)return e instanceof Ch?e.subscribe(i):Yd(e)(i)}var Xd={};var tf=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ef(t,this.resultSelector))},t}(),ef=function(e){function r(t,r){var n=e.call(this,t)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return t.__extends(r,e),r.prototype._next=function(t){this.values.push(Xd),this.observables.push(t)},r.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var n=t[r];this.add(Kd(this,n,void 0,r))}}},r.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},r.prototype.notifyNext=function(t,e,r){var n=this.values,i=n[r],o=this.toRespond?i===Xd?--this.toRespond:this.toRespond:0;n[r]=e,0===o&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))},r.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},r}(qd);function rf(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[Eh]}(t))return function(t,e){return new Ch((function(r){var n=new yh;return n.add(e.schedule((function(){var i=t[Eh]();n.add(i.subscribe({next:function(t){n.add(e.schedule((function(){return r.next(t)})))},error:function(t){n.add(e.schedule((function(){return r.error(t)})))},complete:function(){n.add(e.schedule((function(){return r.complete()})))}}))}))),n}))}(t,e);if(Qd(t))return function(t,e){return new Ch((function(r){var n=new yh;return n.add(e.schedule((function(){return t.then((function(t){n.add(e.schedule((function(){r.next(t),n.add(e.schedule((function(){return r.complete()})))})))}),(function(t){n.add(e.schedule((function(){return r.error(t)})))}))}))),n}))}(t,e);if(Zd(t))return nd(t,e);if(function(t){return t&&"function"==typeof t[Gd]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new Ch((function(r){var n,i=new yh;return i.add((function(){n&&"function"==typeof n.return&&n.return()})),i.add(e.schedule((function(){n=t[Gd](),i.add(e.schedule((function(){if(!r.closed){var t,e;try{var i=n.next();t=i.value,e=i.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function nf(t,e){return e?rf(t,e):t instanceof Ch?t:new Ch(Yd(t))}var of=function(e){function r(t){var r=e.call(this)||this;return r.parent=t,r}return t.__extends(r,e),r.prototype._next=function(t){this.parent.notifyNext(t)},r.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},r.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},r}(_h),sf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r.prototype.notifyNext=function(t){this.destination.next(t)},r.prototype.notifyError=function(t){this.destination.error(t)},r.prototype.notifyComplete=function(){this.destination.complete()},r}(_h);function af(t,e){if(!e.closed){if(t instanceof Ch)return t.subscribe(e);var r;try{r=Yd(t)(e)}catch(t){e.error(t)}return r}}function uf(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(n){return n.pipe(uf((function(r,n){return nf(t(r,n)).pipe(Dd((function(t,i){return e(r,t,n,i)})))}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new cf(t,r))})}var cf=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new lf(t,this.project,this.concurrent))},t}(),lf=function(e){function r(t,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return t.__extends(r,e),r.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},r.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},r.prototype._innerSub=function(t){var e=new of(this),r=this.destination;r.add(e);var n=af(t,e);n!==e&&r.add(n)},r.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},r.prototype.notifyNext=function(t){this.destination.next(t)},r.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},r}(sf),hf=uf;function df(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),uf(Mh,t)}function ff(){return df(1)}function pf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ff()(od.apply(void 0,t))}function gf(t){return new Ch((function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?nf(r):Xh()).subscribe(e)}))}function bf(t,e){return new Ch((function(r){var n=t.length;if(0!==n)for(var i=new Array(n),o=0,s=0,a=function(a){var u=nf(t[a]),c=!1;r.add(u.subscribe({next:function(t){c||(c=!0,s++),i[a]=t},error:function(t){return r.error(t)},complete:function(){++o!==n&&c||(s===n&&r.next(e?e.reduce((function(t,e,r){return t[e]=i[r],t}),{}):i),r.complete())}}))},u=0;u<n;u++)a(u);else r.complete()}))}function yf(t,e,r,n,i){var o;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var s=t;t.addEventListener(e,r,i),o=function(){return s.removeEventListener(e,r,i)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var a=t;t.on(e,r),o=function(){return a.off(e,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var u=t;t.addListener(e,r),o=function(){return u.removeListener(e,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var c=0,l=t.length;c<l;c++)yf(t[c],e,r,n,i)}n.add(o)}function mf(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(t){return void e.error(t)}if(!n)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function vf(t){return!fh(t)&&t-parseFloat(t)+1>=0}function _f(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function wf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return td(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof i&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof Ch?t[0]:df(r)(id(t,n))}var Sf=new Ch(Od);function Ef(t){var e=t.keys,r=t.index,n=t.subscriber,i=t.subscription,o=t.obj;if(!n.closed)if(r<e.length){var s=e[r];n.next([s,o[s]]),i.add(this.schedule({keys:e,index:r+1,subscriber:n,subscription:i,obj:o}))}else n.complete()}function Mf(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function xf(t,e){return function(r){return r.lift(new kf(t,e))}}var kf=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Cf(t,this.predicate,this.thisArg))},t}(),Cf=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return t.__extends(r,e),r.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},r}(_h);function If(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!fh(t[0]))return t[0];t=t[0]}return id(t,void 0).lift(new Rf)}var Rf=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Af(t))},t}(),Af=function(e){function r(t){var r=e.call(this,t)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return t.__extends(r,e),r.prototype._next=function(t){this.observables.push(t)},r.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var r=0;r<e&&!this.hasFirst;r++){var n=Kd(this,t[r],void 0,r);this.subscriptions&&this.subscriptions.push(n),this.add(n)}this.observables=null}},r.prototype.notifyNext=function(t,e,r){if(!this.hasFirst){this.hasFirst=!0;for(var n=0;n<this.subscriptions.length;n++)if(n!==r){var i=this.subscriptions[n];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(e)},r}(qd);function Nf(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;r>=n?i.complete():(i.next(e),i.closed||(t.index=r+1,t.start=e+1,this.schedule(t)))}function jf(t,e,r){void 0===t&&(t=0);var n=-1;return vf(e)?n=Number(e)<1?1:Number(e):td(e)&&(r=e),td(r)||(r=kd),new Ch((function(e){var i=vf(t)?t:+t-r.now();return r.schedule(Of,i,{index:0,period:n,subscriber:e})}))}function Of(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(-1===r)return n.complete();t.index=e+1,this.schedule(t,r)}}function Tf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),id(t,void 0).lift(new Pf(r))}var Pf=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Lf(t,this.resultSelector))},t}(),Lf=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return t.__extends(r,e),r.prototype._next=function(t){var e=this.iterators;fh(t)?e.push(new Bf(t)):"function"==typeof t[Gd]?e.push(new Df(t[Gd]())):e.push(new Ff(this.destination,this,t))},r.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var r=0;r<e;r++){var n=t[r];if(n.stillUnsubscribed)this.destination.add(n.subscribe());else this.active--}}else this.destination.complete()},r.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},r.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,n=0;n<e;n++){if("function"==typeof(s=t[n]).hasValue&&!s.hasValue())return}var i=!1,o=[];for(n=0;n<e;n++){var s,a=(s=t[n]).next();if(s.hasCompleted()&&(i=!0),a.done)return void r.complete();o.push(a.value)}this.resultSelector?this._tryresultSelector(o):r.next(o),i&&r.complete()},r.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},r}(_h),Df=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),Bf=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[Gd]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Ff=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return t.__extends(r,e),r.prototype[Gd]=function(){return this},r.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},r.prototype.hasValue=function(){return this.buffer.length>0},r.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},r.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},r.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},r.prototype.subscribe=function(){return af(this.observable,new of(this))},r}(sf),Uf=Object.freeze({__proto__:null,Observable:Ch,ConnectableObservable:Dh,GroupedObservable:Wh,observable:Eh,Subject:jh,BehaviorSubject:qh,ReplaySubject:dd,AsyncSubject:pd,asap:Md,asapScheduler:Ed,async:kd,asyncScheduler:xd,queue:Yh,queueScheduler:Qh,animationFrame:Ad,animationFrameScheduler:Rd,VirtualTimeScheduler:Nd,VirtualAction:jd,Scheduler:Gh,Subscription:yh,Subscriber:_h,Notification:ud,get NotificationKind(){return ed},pipe:xh,noop:Od,identity:Mh,isObservable:function(t){return!!t&&(t instanceof Ch||"function"==typeof t.lift&&"function"==typeof t.subscribe)},ArgumentOutOfRangeError:Td,EmptyError:Pd,ObjectUnsubscribedError:Rh,UnsubscriptionError:bh,TimeoutError:Ld,bindCallback:function t(e,r,n){if(r){if(!td(r))return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return t(e,n).apply(void 0,i).pipe(Dd((function(t){return fh(t)?r.apply(void 0,t):r(t)})))};n=r}return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i,o=this,s={context:o,subject:i,callbackFunc:e,scheduler:n};return new Ch((function(r){if(n){var a={args:t,subscriber:r,params:s};return n.schedule(Ud,0,a)}if(!i){i=new pd;try{e.apply(o,t.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.next(t.length<=1?t[0]:t),i.complete()}]))}catch(t){Sh(i)?i.error(t):console.warn(t)}}return i.subscribe(r)}))}},bindNodeCallback:function t(e,r,n){if(r){if(!td(r))return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return t(e,n).apply(void 0,i).pipe(Dd((function(t){return fh(t)?r.apply(void 0,t):r(t)})))};n=r}return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i={subject:void 0,args:t,callbackFunc:e,scheduler:n,context:this};return new Ch((function(r){var o=i.context,s=i.subject;if(n)return n.schedule(Hd,0,{params:i,subscriber:r,context:o});if(!s){s=i.subject=new pd;try{e.apply(o,t.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.shift();r?s.error(r):(s.next(t.length<=1?t[0]:t),s.complete())}]))}catch(t){Sh(s)?s.error(t):console.warn(t)}}return s.subscribe(r)}))}},combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,n=void 0;return td(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&fh(t[0])&&(t=t[0]),id(t,n).lift(new tf(r))},concat:pf,defer:gf,empty:Xh,forkJoin:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var r=t[0];if(fh(r))return bf(r,null);if(ph(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return bf(n.map((function(t){return r[t]})),n)}}if("function"==typeof t[t.length-1]){var i=t.pop();return bf(t=1===t.length&&fh(t[0])?t[0]:t,null).pipe(Dd((function(t){return i.apply(void 0,t)})))}return bf(t,null)},from:nf,fromEvent:function t(e,r,n,i){return uh(n)&&(i=n,n=void 0),i?t(e,r,n).pipe(Dd((function(t){return fh(t)?i.apply(void 0,t):i(t)}))):new Ch((function(t){yf(e,r,(function(e){arguments.length>1?t.next(Array.prototype.slice.call(arguments)):t.next(e)}),t,n)}))},fromEventPattern:function t(e,r,n){return n?t(e,r).pipe(Dd((function(t){return fh(t)?n.apply(void 0,t):n(t)}))):new Ch((function(t){var n,i=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.next(1===e.length?e[0]:e)};try{n=e(i)}catch(e){return void t.error(e)}if(uh(r))return function(){return r(i,n)}}))},generate:function(t,e,r,n,i){var o,s;if(1==arguments.length){var a=t;s=a.initialState,e=a.condition,r=a.iterate,o=a.resultSelector||Mh,i=a.scheduler}else void 0===n||td(n)?(s=t,o=Mh,i=n):(s=t,o=n);return new Ch((function(t){var n=s;if(i)return i.schedule(mf,0,{subscriber:t,iterate:r,condition:e,resultSelector:o,state:n});for(;;){if(e){var a=void 0;try{a=e(n)}catch(e){return void t.error(e)}if(!a){t.complete();break}}var u=void 0;try{u=o(n)}catch(e){return void t.error(e)}if(t.next(u),t.closed)break;try{n=r(n)}catch(e){return void t.error(e)}}}))},iif:function(t,e,r){return void 0===e&&(e=Kh),void 0===r&&(r=Kh),gf((function(){return t()?e:r}))},interval:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=kd),(!vf(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=kd),new Ch((function(r){return r.add(e.schedule(_f,t,{subscriber:r,counter:0,period:t})),r}))},merge:wf,never:function(){return Sf},of:od,onErrorResumeNext:function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(0===e.length)return Kh;var n=e[0],i=e.slice(1);return 1===e.length&&fh(n)?t.apply(void 0,n):new Ch((function(e){var r=function(){return e.add(t.apply(void 0,i).subscribe(e))};return nf(n).subscribe({next:function(t){e.next(t)},error:r,complete:r})}))},pairs:function(t,e){return new Ch(e?function(r){var n=Object.keys(t),i=new yh;return i.add(e.schedule(Ef,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}:function(e){for(var r=Object.keys(t),n=0;n<r.length&&!e.closed;n++){var i=r[n];t.hasOwnProperty(i)&&e.next([i,t[i]])}e.complete()})},partition:function(t,e,r){return[xf(e,r)(new Ch(Yd(t))),xf(Mf(e,r))(new Ch(Yd(t)))]},race:If,range:function(t,e,r){return void 0===t&&(t=0),new Ch((function(n){void 0===e&&(e=t,t=0);var i=0,o=t;if(r)return r.schedule(Nf,0,{index:i,count:e,start:t,subscriber:n});for(;;){if(i++>=e){n.complete();break}if(n.next(o++),n.closed)break}}))},throwError:sd,timer:jf,using:function(t,e){return new Ch((function(r){var n,i;try{n=t()}catch(t){return void r.error(t)}try{i=e(n)}catch(t){return void r.error(t)}var o=(i?nf(i):Kh).subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}}))},zip:Tf,scheduled:rf,EMPTY:Kh,NEVER:Sf,config:lh}),Vf=t.getAugmentedNamespace(Uf),Hf={};function Wf(t){var e,r,n="";if("string"==typeof t||"number"==typeof t)n+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Wf(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function zf(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Wf(t))&&(n&&(n+=" "),n+=e);return n}var qf,$f,Jf,Gf,Zf=Object.freeze({__proto__:null,clsx:zf,default:zf}),Qf=t.getAugmentedNamespace(Zf),Yf=0,Kf=[],Xf=[],tp=Sl.__b,ep=Sl.__r,rp=Sl.diffed,np=Sl.__c,ip=Sl.unmount;function op(t,e){Sl.__h&&Sl.__h($f,t,Yf||e),Yf=0;var r=$f.__H||($f.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Xf}),r.__[t]}function sp(t){return Yf=1,ap(bp,t)}function ap(t,e,r){var n=op(qf++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):bp(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],r=n.t(e,t);e!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=$f,!$f.u)){var i=function(t,e,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(t){return t.__c}));if(i.every((function(t){return!t.__N})))return!o||o.call(this,t,e,r);var s=!1;return i.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}})),!(!s&&n.__c.props===t)&&(!o||o.call(this,t,e,r))};$f.u=!0;var o=$f.shouldComponentUpdate,s=$f.componentWillUpdate;$f.componentWillUpdate=function(t,e,r){if(this.__e){var n=o;o=void 0,i(t,e,r),o=n}s&&s.call(this,t,e,r)},$f.shouldComponentUpdate=i}return n.__N||n.__}function up(t,e){var r=op(qf++,4);!Sl.__s&&gp(r.__H,e)&&(r.__=t,r.i=e,$f.__h.push(r))}function cp(t,e){var r=op(qf++,7);return gp(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function lp(){for(var t;t=Kf.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(fp),t.__H.__h.forEach(pp),t.__H.__h=[]}catch(e){t.__H.__h=[],Sl.__e(e,t.__v)}}Sl.__b=function(t){$f=null,tp&&tp(t)},Sl.__r=function(t){ep&&ep(t),qf=0;var e=($f=t.__c).__H;e&&(Jf===$f?(e.__h=[],$f.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Xf,t.__N=t.i=void 0}))):(e.__h.forEach(fp),e.__h.forEach(pp),e.__h=[])),Jf=$f},Sl.diffed=function(t){rp&&rp(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Kf.push(e)&&Gf===Sl.requestAnimationFrame||((Gf=Sl.requestAnimationFrame)||dp)(lp)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Xf&&(t.__=t.__V),t.i=void 0,t.__V=Xf}))),Jf=$f=null},Sl.__c=function(t,e){e.some((function(t){try{t.__h.forEach(fp),t.__h=t.__h.filter((function(t){return!t.__||pp(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Sl.__e(r,t.__v)}})),np&&np(t,e)},Sl.unmount=function(t){ip&&ip(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{fp(t)}catch(t){e=t}})),r.__H=void 0,e&&Sl.__e(e,r.__v))};var hp="function"==typeof requestAnimationFrame;function dp(t){var e,r=function(){clearTimeout(n),hp&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);hp&&(e=requestAnimationFrame(r))}function fp(t){var e=$f,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),$f=e}function pp(t){var e=$f;t.__c=t.__(),$f=e}function gp(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function bp(t,e){return"function"==typeof e?e(t):e}var yp=Object.freeze({__proto__:null,useCallback:function(t,e){return Yf=8,cp((function(){return t}),e)},useContext:function(t){var e=$f.context[t.__c],r=op(qf++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub($f)),e.props.value):t.__},useDebugValue:function(t,e){Sl.useDebugValue&&Sl.useDebugValue(e?e(t):t)},useEffect:function(t,e){var r=op(qf++,3);!Sl.__s&&gp(r.__H,e)&&(r.__=t,r.i=e,$f.__H.__h.push(r))},useErrorBoundary:function(t){var e=op(qf++,10),r=sp();return e.__=t,$f.componentDidCatch||($f.componentDidCatch=function(t,n){e.__&&e.__(t,n),r[1](t)}),[r[0],function(){r[1](void 0)}]},useId:function(){var t=op(qf++,11);if(!t.__){for(var e=$f.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__},useImperativeHandle:function(t,e,r){Yf=6,up((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==r?r:r.concat(t))},useLayoutEffect:up,useMemo:cp,useReducer:ap,useRef:function(t){return Yf=5,cp((function(){return{current:t}}),[])},useState:sp}),mp=t.getAugmentedNamespace(yp),vp={},_p={};Object.defineProperty(_p,"__esModule",{value:!0}),_p.LIB_VERSION=void 0,_p.LIB_VERSION="3.6.6";var wp={};Object.defineProperty(wp,"__esModule",{value:!0}),wp.CloseIcon=void 0;const Sp=ah;wp.CloseIcon=function(t){return(0,Sp.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,Sp.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))};var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var Mp={};Object.defineProperty(Mp,"__esModule",{value:!0}),Mp.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var xp={};Object.defineProperty(xp,"__esModule",{value:!0}),xp.QRCodeIcon=void 0;const kp=ah;xp.QRCodeIcon=function(t){return(0,kp.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,kp.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,kp.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,kp.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,kp.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,kp.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,kp.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,kp.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,kp.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,kp.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))};var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.default='\n <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>\n <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>\n <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>\n </svg>\n';var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0}),Ip.default='\n <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n <circle cx="50" cy="50" r="50" fill="white"/>\n <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>\n <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>\n </svg>\n';var Rp={};Object.defineProperty(Rp,"__esModule",{value:!0}),Rp.StatusDotIcon=void 0;const Ap=ah;Rp.StatusDotIcon=function(t){return(0,Ap.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ap.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))};var Np={};function jp(t){this.mode=Tp.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);i>65536?(n[0]=240|(1835008&i)>>>18,n[1]=128|(258048&i)>>>12,n[2]=128|(4032&i)>>>6,n[3]=128|63&i):i>2048?(n[0]=224|(61440&i)>>>12,n[1]=128|(4032&i)>>>6,n[2]=128|63&i):i>128?(n[0]=192|(1984&i)>>>6,n[1]=128|63&i):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function Op(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}jp.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}},Op.prototype={addData:function(t){var e=new jp(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=Op.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(this.modules[t+r][e+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=Jp.getLostPoint(this);(0==r||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r);this.make();for(var i=0;i<this.modules.length;i++)for(var o=1*i,s=0;s<this.modules[i].length;s++){var a=1*s;this.modules[i][s]&&(n.beginFill(0,100),n.moveTo(a,o),n.lineTo(a+1,o),n.lineTo(a+1,o+1),n.lineTo(a,o+1),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=Jp.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(null==this.modules[n][i])for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)this.modules[n+o][i+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},setupTypeNumber:function(t){for(var e=Jp.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&1==(e>>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(r=0;r<18;r++){n=!t&&1==(e>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=Jp.getBCHTypeInfo(r),i=0;i<15;i++){var o=!t&&1==(n>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++){o=!t&&1==(n>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var a=0;a<2;a++)if(null==this.modules[n][s-a]){var u=!1;o<t.length&&(u=1==(t[o]>>>i&1)),Jp.getMask(e,n,s-a)&&(u=!u),this.modules[n][s-a]=u,-1==--i&&(o++,i=7)}if((n+=r)<0||this.moduleCount<=n){n-=r,r=-r;break}}}},Op.PAD0=236,Op.PAD1=17,Op.createData=function(t,e,r){for(var n=Yp.getRSBlocks(t,e),i=new Kp,o=0;o<r.length;o++){var s=r[o];i.put(s.mode,4),i.put(s.getLength(),Jp.getLengthInBits(s.mode,t)),s.write(i)}var a=0;for(o=0;o<n.length;o++)a+=n[o].dataCount;if(i.getLengthInBits()>8*a)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*a+")");for(i.getLengthInBits()+4<=8*a&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*a||(i.put(Op.PAD0,8),i.getLengthInBits()>=8*a));)i.put(Op.PAD1,8);return Op.createBytes(i,n)},Op.createBytes=function(t,e){for(var r=0,n=0,i=0,o=new Array(e.length),s=new Array(e.length),a=0;a<e.length;a++){var u=e[a].dataCount,c=e[a].totalCount-u;n=Math.max(n,u),i=Math.max(i,c),o[a]=new Array(u);for(var l=0;l<o[a].length;l++)o[a][l]=255&t.buffer[l+r];r+=u;var h=Jp.getErrorCorrectPolynomial(c),d=new Qp(o[a],h.getLength()-1).mod(h);s[a]=new Array(h.getLength()-1);for(l=0;l<s[a].length;l++){var f=l+d.getLength()-s[a].length;s[a][l]=f>=0?d.get(f):0}}var p=0;for(l=0;l<e.length;l++)p+=e[l].totalCount;var g=new Array(p),b=0;for(l=0;l<n;l++)for(a=0;a<e.length;a++)l<o[a].length&&(g[b++]=o[a][l]);for(l=0;l<i;l++)for(a=0;a<e.length;a++)l<s[a].length&&(g[b++]=s[a][l]);return g};for(var Tp={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Pp=1,Lp=0,Dp=3,Bp=2,Fp=0,Up=1,Vp=2,Hp=3,Wp=4,zp=5,qp=6,$p=7,Jp={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;Jp.getBCHDigit(e)-Jp.getBCHDigit(Jp.G15)>=0;)e^=Jp.G15<<Jp.getBCHDigit(e)-Jp.getBCHDigit(Jp.G15);return(t<<10|e)^Jp.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;Jp.getBCHDigit(e)-Jp.getBCHDigit(Jp.G18)>=0;)e^=Jp.G18<<Jp.getBCHDigit(e)-Jp.getBCHDigit(Jp.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;0!=t;)e++,t>>>=1;return e},getPatternPosition:function(t){return Jp.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Fp:return(e+r)%2==0;case Up:return e%2==0;case Vp:return r%3==0;case Hp:return(e+r)%3==0;case Wp:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case zp:return e*r%2+e*r%3==0;case qp:return(e*r%2+e*r%3)%2==0;case $p:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Qp([1],0),r=0;r<t;r++)e=e.multiply(new Qp([1,Gp.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Tp.MODE_NUMBER:return 10;case Tp.MODE_ALPHA_NUM:return 9;case Tp.MODE_8BIT_BYTE:case Tp.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Tp.MODE_NUMBER:return 12;case Tp.MODE_ALPHA_NUM:return 11;case Tp.MODE_8BIT_BYTE:return 16;case Tp.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case Tp.MODE_NUMBER:return 14;case Tp.MODE_ALPHA_NUM:return 13;case Tp.MODE_8BIT_BYTE:return 16;case Tp.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var o=0,s=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var u=-1;u<=1;u++)i+u<0||e<=i+u||0==a&&0==u||s==t.isDark(n+a,i+u)&&o++;o>5&&(r+=3+o-5)}for(n=0;n<e-1;n++)for(i=0;i<e-1;i++){var c=0;t.isDark(n,i)&&c++,t.isDark(n+1,i)&&c++,t.isDark(n,i+1)&&c++,t.isDark(n+1,i+1)&&c++,0!=c&&4!=c||(r+=3)}for(n=0;n<e;n++)for(i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(i=0;i<e;i++)for(n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);var l=0;for(i=0;i<e;i++)for(n=0;n<e;n++)t.isDark(n,i)&&l++;return r+=10*(Math.abs(100*l/e/e-50)/5)}},Gp={glog:function(t){if(t<1)throw new Error("glog("+t+")");return Gp.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return Gp.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},Zp=0;Zp<8;Zp++)Gp.EXP_TABLE[Zp]=1<<Zp;for(Zp=8;Zp<256;Zp++)Gp.EXP_TABLE[Zp]=Gp.EXP_TABLE[Zp-4]^Gp.EXP_TABLE[Zp-5]^Gp.EXP_TABLE[Zp-6]^Gp.EXP_TABLE[Zp-8];for(Zp=0;Zp<255;Zp++)Gp.LOG_TABLE[Gp.EXP_TABLE[Zp]]=Zp;function Qp(t,e){if(null==t.length)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&0==t[r];)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}function Yp(t,e){this.totalCount=t,this.dataCount=e}function Kp(){this.buffer=[],this.length=0}Qp.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=Gp.gexp(Gp.glog(this.get(r))+Gp.glog(t.get(n)));return new Qp(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Gp.glog(this.get(0))-Gp.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(n=0;n<t.getLength();n++)r[n]^=Gp.gexp(Gp.glog(t.get(n))+e);return new Qp(r,0).mod(t)}},Yp.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],Yp.getRSBlocks=function(t,e){var r=Yp.getRsBlockTable(t,e);if(null==r)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],o=0;o<n;o++)for(var s=r[3*o+0],a=r[3*o+1],u=r[3*o+2],c=0;c<s;c++)i.push(new Yp(a,u));return i},Yp.getRsBlockTable=function(t,e){switch(e){case Pp:return Yp.RS_BLOCK_TABLE[4*(t-1)+0];case Lp:return Yp.RS_BLOCK_TABLE[4*(t-1)+1];case Dp:return Yp.RS_BLOCK_TABLE[4*(t-1)+2];case Bp:return Yp.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},Kp.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Xp=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function tg(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},"string"==typeof t&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if("string"!=typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0&&this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");var r=this.options.content,n=function(t,e){for(var r=function(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}(t),n=1,i=0,o=0,s=Xp.length;o<=s;o++){var a=Xp[o];if(!a)throw new Error("Content too long: expected "+i+" but got "+r);switch(e){case"L":i=a[0];break;case"M":i=a[1];break;case"Q":i=a[2];break;case"H":i=a[3];break;default:throw new Error("Unknwon error correction level: "+e)}if(r<=i)break;n++}if(n>Xp.length)throw new Error("Content too long");return n}(r,this.options.ecl),i=function(t){switch(t){case"L":return Pp;case"M":return Lp;case"Q":return Dp;case"H":return Bp;default:throw new Error("Unknwon error correction level: "+t)}}(this.options.ecl);this.qrcode=new Op(n,i),this.qrcode.addData(r),this.qrcode.make()}tg.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;void 0===t&&(t={container:e.container||"svg"});for(var n=void 0===e.pretty||!!e.pretty,i=n?" ":"",o=n?"\r\n":"",s=e.width,a=e.height,u=r.length,c=s/(u+2*e.padding),l=a/(u+2*e.padding),h=void 0!==e.join&&!!e.join,d=void 0!==e.swap&&!!e.swap,f=void 0===e.xmlDeclaration||!!e.xmlDeclaration,p=void 0!==e.predefined&&!!e.predefined,g=p?i+'<defs><path id="qrmodule" d="M0 0 h'+l+" v"+c+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+o:"",b=i+'<rect x="0" y="0" width="'+s+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+o,y="",m="",v=0;v<u;v++)for(var _=0;_<u;_++){if(r[_][v]){var w=_*c+e.padding*c,S=v*l+e.padding*l;if(d){var E=w;w=S,S=E}if(h){var M=c+w,x=l+S;w=Number.isInteger(w)?Number(w):w.toFixed(2),S=Number.isInteger(S)?Number(S):S.toFixed(2),M=Number.isInteger(M)?Number(M):M.toFixed(2),m+="M"+w+","+S+" V"+(x=Number.isInteger(x)?Number(x):x.toFixed(2))+" H"+M+" V"+S+" H"+w+" Z "}else y+=p?i+'<use x="'+w.toString()+'" y="'+S.toString()+'" href="#qrmodule" />'+o:i+'<rect x="'+w.toString()+'" y="'+S.toString()+'" width="'+c+'" height="'+l+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+o}}h&&(y=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+m+'" />');let k="";if(void 0!==this.options.image&&this.options.image.svg){const t=s*this.options.image.width/100,e=a*this.options.image.height/100;k+=`<svg x="${s/2-t/2}" y="${a/2-e/2}" width="${t}" height="${e}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,k+=this.options.image.svg+o,k+="</svg>"}var C="";switch(t.container){case"svg":f&&(C+='<?xml version="1.0" standalone="yes"?>'+o),C+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+s+'" height="'+a+'">'+o,C+=g+b+y,C+=k,C+="</svg>";break;case"svg-viewbox":f&&(C+='<?xml version="1.0" standalone="yes"?>'+o),C+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+s+" "+a+'">'+o,C+=g+b+y,C+=k,C+="</svg>";break;case"g":C+='<g width="'+s+'" height="'+a+'">'+o,C+=g+b+y,C+=k,C+="</g>";break;default:C+=(g+b+y+k).replace(/^\s+/,"")}return C};var eg=tg,rg=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Np,"__esModule",{value:!0}),Np.QRCode=void 0;const ng=ah,ig=mp,og=rg(eg);Np.QRCode=t=>{const[e,r]=(0,ig.useState)("");return(0,ig.useEffect)((()=>{var e,n;const i=new og.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(e=t.width)&&void 0!==e?e:256,height:null!==(n=t.height)&&void 0!==n?n:256,padding:0,image:t.image}),o=Buffer.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)})),e?(0,ng.h)("img",{src:e,alt:"QR Code"}):null};var sg={},ag={};Object.defineProperty(ag,"__esModule",{value:!0}),ag.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var ug=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sg,"__esModule",{value:!0}),sg.Spinner=void 0;const cg=ah,lg=ug(ag);sg.Spinner=t=>{var e;const r=null!==(e=t.size)&&void 0!==e?e:64,n=t.color||"#000";return(0,cg.h)("div",{class:"-cbwsdk-spinner"},(0,cg.h)("style",null,lg.default),(0,cg.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,cg.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};var hg={};Object.defineProperty(hg,"__esModule",{value:!0}),hg.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var dg=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vp,"__esModule",{value:!0}),vp.CoinbaseAppSteps=vp.CoinbaseWalletSteps=vp.ConnectItem=vp.ConnectContent=void 0;const fg=dg(Qf),pg=ah,gg=mp,bg=le,yg=_p,mg=wp,vg=dg(Ep),_g=dg(Mp),wg=xp,Sg=dg(Cp),Eg=dg(Ip),Mg=Rp,xg=Np,kg=sg,Cg=dg(hg),Ig={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:_g.default,steps:Ng},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:vg.default,steps:jg}},Rg=t=>"light"===t?"#FFFFFF":"#0A0B0D";function Ag({title:t,description:e,icon:r,selected:n,theme:i,onClick:o}){return(0,pg.h)("div",{onClick:o,class:(0,fg.default)("-cbwsdk-connect-item",i,{selected:n})},(0,pg.h)("div",null,(0,pg.h)("img",{src:r,alt:t})),(0,pg.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,pg.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,pg.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}function Ng({theme:t}){return(0,pg.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,pg.h)("li",{class:(0,fg.default)("-cbwsdk-wallet-steps-item",t)},(0,pg.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,pg.h)("li",{class:(0,fg.default)("-cbwsdk-wallet-steps-item",t)},(0,pg.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,pg.h)("span",null,"Tap ",(0,pg.h)("strong",null,"Scan")," "),(0,pg.h)("span",{class:(0,fg.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,pg.h)(wg.QRCodeIcon,{fill:Rg(t)})))))}function jg({theme:t}){return(0,pg.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,pg.h)("li",{class:(0,fg.default)("-cbwsdk-wallet-steps-item",t)},(0,pg.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,pg.h)("li",{class:(0,fg.default)("-cbwsdk-wallet-steps-item",t)},(0,pg.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,pg.h)("span",null,"Tap ",(0,pg.h)("strong",null,"More")),(0,pg.h)("span",{class:(0,fg.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,pg.h)(Mg.StatusDotIcon,{fill:Rg(t)})),(0,pg.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,pg.h)("strong",null,"Scan")),(0,pg.h)("span",{class:(0,fg.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,pg.h)(wg.QRCodeIcon,{fill:Rg(t)})))))}vp.ConnectContent=function(t){const{theme:e}=t,[r,n]=(0,gg.useState)("coinbase-wallet-app"),i=(0,gg.useCallback)((t=>{n(t)}),[]),o=(0,bg.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId);if(!r)return null;const s=Ig[r].steps,a="coinbase-app"===r;return(0,pg.h)("div",{"data-testid":"connect-content",class:(0,fg.default)("-cbwsdk-connect-content",e)},(0,pg.h)("style",null,Cg.default),(0,pg.h)("div",{class:"-cbwsdk-connect-content-header"},(0,pg.h)("h2",{class:(0,fg.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,pg.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,pg.h)(mg.CloseIcon,{fill:"light"===e?"#0A0B0D":"#FFFFFF"}))),(0,pg.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,pg.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,pg.h)("div",null,Object.entries(Ig).map((([t,n])=>(0,pg.h)(Ag,{key:t,title:n.title,description:n.description,icon:n.icon,selected:r===t,onClick:()=>i(t),theme:e})))),a&&(0,pg.h)("div",{class:(0,fg.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,pg.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,pg.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,pg.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,pg.h)(xg.QRCode,{content:o,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(u=r,"coinbase-app"===u?Sg.default:Eg.default),width:25,height:25}}),(0,pg.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:yg.LIB_VERSION}),(0,pg.h)("input",{type:"hidden",value:o})),(0,pg.h)(s,{theme:e}),!t.isConnected&&(0,pg.h)("div",{"data-testid":"connecting-spinner",class:(0,fg.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,pg.h)(kg.Spinner,{size:36,color:"dark"===e?"#FFF":"#000"}),(0,pg.h)("p",null,"Connecting...")))));var u},vp.ConnectItem=Ag,vp.CoinbaseWalletSteps=Ng,vp.CoinbaseAppSteps=jg;var Og={},Tg={};Object.defineProperty(Tg,"__esModule",{value:!0}),Tg.ArrowLeftIcon=void 0;const Pg=ah;Tg.ArrowLeftIcon=function(t){return(0,Pg.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,Pg.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))};var Lg={};Object.defineProperty(Lg,"__esModule",{value:!0}),Lg.LaptopIcon=void 0;const Dg=ah;Lg.LaptopIcon=function(t){return(0,Dg.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Dg.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Dg.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))};var Bg={};Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.SafeIcon=void 0;const Fg=ah;Bg.SafeIcon=function(t){return(0,Fg.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Fg.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))};var Ug={};Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Vg=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Og,"__esModule",{value:!0}),Og.TryExtensionContent=void 0;const Hg=Vg(Qf),Wg=ah,zg=mp,qg=Tg,$g=Lg,Jg=Bg,Gg=Vg(Ug);Og.TryExtensionContent=function({theme:t}){const[e,r]=(0,zg.useState)(!1),n=(0,zg.useCallback)((()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),i=(0,zg.useCallback)((()=>{e?window.location.reload():(n(),r(!0))}),[n,e]);return(0,Wg.h)("div",{class:(0,Hg.default)("-cbwsdk-try-extension",t)},(0,Wg.h)("style",null,Gg.default),(0,Wg.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Wg.h)("h3",{class:(0,Hg.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,Wg.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Wg.h)("button",{class:(0,Hg.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Wg.h)("div",null,!e&&(0,Wg.h)(qg.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===t?"#0052FF":"#588AF5"})))),(0,Wg.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Wg.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Wg.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Wg.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Wg.h)("span",{class:(0,Hg.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Wg.h)($g.LaptopIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,Wg.h)("div",{class:(0,Hg.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Wg.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Wg.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Wg.h)("span",{class:(0,Hg.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Wg.h)(Jg.SafeIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,Wg.h)("div",{class:(0,Hg.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))};var Zg={};Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Qg=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hf,"__esModule",{value:!0}),Hf.ConnectDialog=void 0;const Yg=Qg(Qf),Kg=ah,Xg=mp,tb=vp,eb=Og,rb=Qg(Zg);Hf.ConnectDialog=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,Xg.useState)(!e),[o,s]=(0,Xg.useState)(!e);(0,Xg.useEffect)((()=>{const t=[window.setTimeout((()=>{s(!e)}),10)];return e?i(!1):t.push(window.setTimeout((()=>{i(!0)}),360)),()=>{t.forEach(window.clearTimeout)}}),[t.isOpen]);const a=r?"dark":"light";return(0,Kg.h)("div",{class:(0,Yg.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Kg.h)("style",null,rb.default),(0,Kg.h)("div",{class:(0,Yg.default)("-cbwsdk-connect-dialog-backdrop",a,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Kg.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Kg.h)("div",{class:(0,Yg.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Kg.h)(tb.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,Kg.h)(eb.TryExtensionContent,{theme:a}))))},Object.defineProperty(Nl,"__esModule",{value:!0}),Nl.LinkFlow=void 0;const nb=ah,ib=Vf,ob=Hf;Nl.LinkFlow=class{constructor(t){this.extensionUI$=new ib.BehaviorSubject({}),this.subscriptions=new ib.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((t=>{this.isConnected!==t&&(this.isConnected=t,this.render())}))),this.subscriptions.add(this.chainId$.subscribe((t=>{this.chainId!==t&&(this.chainId=t,this.render())})))}detach(){var t;this.root&&(this.subscriptions.unsubscribe(),(0,nb.render)(null,this.root),null===(t=this.root.parentElement)||void 0===t||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const t=this.extensionUI$.subscribe((()=>{this.root&&(0,nb.render)((0,nb.h)(ob.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}));this.subscriptions.add(t)}};var sb={},ab={};Object.defineProperty(ab,"__esModule",{value:!0}),ab.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",function(e){var r=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const n=r(Qf),i=ah,o=mp,s=r(ab);function a(t){return"coinbase-app"===t?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}e.Snackbar=class{constructor(t){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",t.appendChild(this.root),this.render()}presentItem(t){const e=this.nextItemKey++;return this.items.set(e,t),this.render(),()=>{this.items.delete(e),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,i.render)((0,i.h)("div",null,(0,i.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((([t,r])=>(0,i.h)(e.SnackbarInstance,Object.assign({},r,{key:t})))))),this.root)}};e.SnackbarContainer=t=>(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-container")},(0,i.h)("style",null,s.default),(0,i.h)("div",{class:"-cbwsdk-snackbar"},t.children));e.SnackbarInstance=({autoExpand:t,message:e,menuItems:r,appSrc:s})=>{const[u,c]=(0,o.useState)(!0),[l,h]=(0,o.useState)(null!=t&&t);(0,o.useEffect)((()=>{const t=[window.setTimeout((()=>{c(!1)}),1),window.setTimeout((()=>{h(!0)}),1e4)];return()=>{t.forEach(window.clearTimeout)}}));return(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance",u&&"-cbwsdk-snackbar-instance-hidden",l&&"-cbwsdk-snackbar-instance-expanded")},(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{h(!l)}},(0,i.h)("img",{src:a(s),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),(0,i.h)("div",{class:"-gear-container"},!l&&(0,i.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,i.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,i.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map(((t,e)=>(0,i.h)("div",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item",t.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:t.onClick,key:e},(0,i.h)("svg",{width:t.svgWidth,height:t.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("path",{"fill-rule":t.defaultFillRule,"clip-rule":t.defaultClipRule,d:t.path,fill:"#AAAAAA"})),(0,i.h)("span",{class:(0,n.default)("-cbwsdk-snackbar-instance-menu-item-info",t.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},t.info))))))}}(sb);var ub={},cb={};Object.defineProperty(cb,"__esModule",{value:!0}),cb.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var lb=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ub,"__esModule",{value:!0}),ub.injectCssReset=void 0;const hb=lb(cb);ub.injectCssReset=function(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(hb.default)),document.documentElement.appendChild(t)},Object.defineProperty(Al,"__esModule",{value:!0}),Al.WalletSDKUI=void 0;const db=Nl,fb=sb,pb=ub;Al.WalletSDKUI=class{constructor(t){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new fb.Snackbar({darkMode:t.darkMode}),this.linkFlow=new db.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,e=document.createElement("div");e.className="-cbwsdk-css-reset",t.appendChild(e),this.linkFlow.attach(e),this.snackbar.attach(e),this.attached=!0,(0,pb.injectCssReset)()}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(t){}watchAsset(t){}switchEthereumChain(t){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(t){}signEthereumTransaction(t){}submitEthereumTransaction(t){}ethereumAddressFromSignedMessage(t){}showConnecting(t){let e;return e=t.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:{message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(e)}setAppSrc(t){this.appSrc=t}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(t){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return null!==(t=this.standalone)&&void 0!==t&&t}};var gb,bb={},yb={};function mb(t,e,r){if(!r||typeof r.value!==gb.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:gb.boolTrue,get:function(){var t=r.value.bind(this);return Object.defineProperty(this,e,{value:t,configurable:gb.boolTrue,writable:gb.boolTrue}),t}}}function vb(t){return function(e){return e.lift(new _b(t))}}Object.defineProperty(yb,"__esModule",{value:!0}),function(t){t.typeOfFunction="function",t.boolTrue=!0}(gb||(gb={})),yb.bind=mb,yb.default=mb;var _b=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new wb(t,this.durationSelector))},t}(),wb=function(e){function r(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return t.__extends(r,e),r.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var r=af(e,new of(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},r.prototype.clearThrottle=function(){var t=this,e=t.value,r=t.hasValue,n=t.throttled;n&&(this.remove(n),this.throttled=void 0,n.unsubscribe()),r&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},r.prototype.notifyNext=function(){this.clearThrottle()},r.prototype.notifyComplete=function(){this.clearThrottle()},r}(sf);var Sb=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Eb(t,this.closingNotifier))},t}(),Eb=function(e){function r(t,r){var n=e.call(this,t)||this;return n.buffer=[],n.add(af(r,new of(n))),n}return t.__extends(r,e),r.prototype._next=function(t){this.buffer.push(t)},r.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},r}(sf);var Mb=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?kb:xb}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),xb=function(e){function r(t,r){var n=e.call(this,t)||this;return n.bufferSize=r,n.buffer=[],n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},r.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},r}(_h),kb=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return t.__extends(r,e),r.prototype._next=function(t){var e=this,r=e.bufferSize,n=e.startBufferEvery,i=e.buffers,o=e.count;this.count++,o%n==0&&i.push([]);for(var s=i.length;s--;){var a=i[s];a.push(t),a.length===r&&(i.splice(s,1),this.destination.next(a))}},r.prototype._complete=function(){for(var t=this.buffers,r=this.destination;t.length>0;){var n=t.shift();n.length>0&&r.next(n)}e.prototype._complete.call(this)},r}(_h);var Cb=function(){function t(t,e,r,n){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=r,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new Rb(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),Ib=function(){return function(){this.buffer=[]}}(),Rb=function(e){function r(t,r,n,i,o){var s=e.call(this,t)||this;s.bufferTimeSpan=r,s.bufferCreationInterval=n,s.maxBufferSize=i,s.scheduler=o,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==n||n<0,s.timespanOnly){var u={subscriber:s,context:a,bufferTimeSpan:r};s.add(a.closeAction=o.schedule(Ab,r,u))}else{var c={subscriber:s,context:a},l={bufferTimeSpan:r,bufferCreationInterval:n,subscriber:s,scheduler:o};s.add(a.closeAction=o.schedule(jb,r,c)),s.add(o.schedule(Nb,n,l))}return s}return t.__extends(r,e),r.prototype._next=function(t){for(var e,r=this.contexts,n=r.length,i=0;i<n;i++){var o=r[i],s=o.buffer;s.push(t),s.length==this.maxBufferSize&&(e=o)}e&&this.onBufferFull(e)},r.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},r.prototype._complete=function(){for(var t=this.contexts,r=this.destination;t.length>0;){var n=t.shift();r.next(n.buffer)}e.prototype._complete.call(this)},r.prototype._unsubscribe=function(){this.contexts=null},r.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:t,bufferTimeSpan:r};this.add(t.closeAction=this.scheduler.schedule(Ab,r,n))}},r.prototype.openContext=function(){var t=new Ib;return this.contexts.push(t),t},r.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},r}(_h);function Ab(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function Nb(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,o=n.openContext();n.closed||(n.add(o.closeAction=i.schedule(jb,r,{subscriber:n,context:o})),this.schedule(t,e))}function jb(t){var e=t.subscriber,r=t.context;e.closeContext(r)}var Ob=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Tb(t,this.openings,this.closingSelector))},t}(),Tb=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.closingSelector=n,i.contexts=[],i.add(Kd(i,r)),i}return t.__extends(r,e),r.prototype._next=function(t){for(var e=this.contexts,r=e.length,n=0;n<r;n++)e[n].buffer.push(t)},r.prototype._error=function(t){for(var r=this.contexts;r.length>0;){var n=r.shift();n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},r.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var r=t.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._complete.call(this)},r.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},r.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},r.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},r.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var r=t.buffer,n=t.subscription;this.destination.next(r),e.splice(e.indexOf(t),1),this.remove(n),n.unsubscribe()}},r.prototype.trySubscribe=function(t){var e=this.contexts,r=new yh,n={buffer:[],subscription:r};e.push(n);var i=Kd(this,t,n);!i||i.closed?this.closeBuffer(n):(i.context=n,this.add(i),r.add(i))},r}(qd);var Pb=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Lb(t,this.closingSelector))},t}(),Lb=function(e){function r(t,r){var n=e.call(this,t)||this;return n.closingSelector=r,n.subscribing=!1,n.openBuffer(),n}return t.__extends(r,e),r.prototype._next=function(t){this.buffer.push(t)},r.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},r.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},r.prototype.notifyNext=function(){this.openBuffer()},r.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},r.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new yh,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(af(e,new of(this))),this.subscribing=!1},r}(sf);var Db=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Bb(t,this.selector,this.caught))},t}(),Bb=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return t.__extends(r,e),r.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle();var n=new of(this);this.add(n);var i=af(r,n);i!==n&&this.add(i)}},r}(sf);function Fb(t,e){return uf(t,e,1)}var Ub=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new Vb(t,this.predicate,this.source))},t}(),Vb=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return t.__extends(r,e),r.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},r.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},r.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},r}(_h);var Hb=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Wb(t,this.durationSelector))},t}(),Wb=function(e){function r(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return t.__extends(r,e),r.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},r.prototype._complete=function(){this.emitValue(),this.destination.complete()},r.prototype._tryNext=function(t,e){var r=this.durationSubscription;this.value=t,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=af(e,new of(this)))&&!r.closed&&this.add(this.durationSubscription=r)},r.prototype.notifyNext=function(){this.emitValue()},r.prototype.notifyComplete=function(){this.emitValue()},r.prototype.emitValue=function(){if(this.hasValue){var t=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},r}(sf);var zb=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new qb(t,this.dueTime,this.scheduler))},t}(),qb=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.dueTime=r,i.scheduler=n,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return t.__extends(r,e),r.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule($b,this.dueTime,this))},r.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},r.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},r.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},r}(_h);function $b(t){t.debouncedNext()}function Jb(t){return void 0===t&&(t=null),function(e){return e.lift(new Gb(t))}}var Gb=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new Zb(t,this.defaultValue))},t}(),Zb=function(e){function r(t,r){var n=e.call(this,t)||this;return n.defaultValue=r,n.isEmpty=!0,n}return t.__extends(r,e),r.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},r.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},r}(_h);function Qb(t){return t instanceof Date&&!isNaN(+t)}var Yb=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Kb(t,this.delay,this.scheduler))},t}(),Kb=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.delay=r,i.scheduler=n,i.queue=[],i.active=!1,i.errored=!1,i}return t.__extends(r,e),r.dispatch=function(t){for(var e=t.source,r=e.queue,n=t.scheduler,i=t.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(t,o)}else this.unsubscribe(),e.active=!1},r.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(r.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},r.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,r=new Xb(e.now()+this.delay,t);this.queue.push(r),!1===this.active&&this._schedule(e)}},r.prototype._next=function(t){this.scheduleNotification(ud.createNext(t))},r.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},r.prototype._complete=function(){this.scheduleNotification(ud.createComplete()),this.unsubscribe()},r}(_h),Xb=function(){return function(t,e){this.time=t,this.notification=e}}();var ty=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ey(t,this.delayDurationSelector))},t}(),ey=function(e){function r(t,r){var n=e.call(this,t)||this;return n.delayDurationSelector=r,n.completed=!1,n.delayNotifierSubscriptions=[],n.index=0,n}return t.__extends(r,e),r.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},r.prototype.notifyError=function(t,e){this._error(t)},r.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},r.prototype._next=function(t){var e=this.index++;try{var r=this.delayDurationSelector(t,e);r&&this.tryDelay(r,t)}catch(t){this.destination.error(t)}},r.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},r.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},r.prototype.tryDelay=function(t,e){var r=Kd(this,t,e);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},r.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},r}(qd),ry=function(e){function r(t,r){var n=e.call(this)||this;return n.source=t,n.subscriptionDelay=r,n}return t.__extends(r,e),r.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new ny(t,this.source))},r}(Ch),ny=function(e){function r(t,r){var n=e.call(this)||this;return n.parent=t,n.source=r,n.sourceSubscribed=!1,n}return t.__extends(r,e),r.prototype._next=function(t){this.subscribeToSource()},r.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},r.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},r.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},r}(_h);var iy=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new oy(t))},t}(),oy=function(e){function r(t){return e.call(this,t)||this}return t.__extends(r,e),r.prototype._next=function(t){t.observe(this.destination)},r}(_h);var sy=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new ay(t,this.keySelector,this.flushes))},t}(),ay=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.keySelector=r,i.values=new Set,n&&i.add(af(n,new of(i))),i}return t.__extends(r,e),r.prototype.notifyNext=function(){this.values.clear()},r.prototype.notifyError=function(t){this._error(t)},r.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},r.prototype._useKeySelector=function(t){var e,r=this.destination;try{e=this.keySelector(t)}catch(t){return void r.error(t)}this._finalizeNext(e,t)},r.prototype._finalizeNext=function(t,e){var r=this.values;r.has(t)||(r.add(t),this.destination.next(e))},r}(sf);function uy(t,e){return function(r){return r.lift(new cy(t,e))}}var cy=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new ly(t,this.compare,this.keySelector))},t}(),ly=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return t.__extends(r,e),r.prototype.compare=function(t,e){return t===e},r.prototype._next=function(t){var e;try{var r=this.keySelector;e=r?r(t):t}catch(t){return this.destination.error(t)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;n||(this.key=e,this.destination.next(t))},r}(_h);function hy(t){return void 0===t&&(t=py),function(e){return e.lift(new dy(t))}}var dy=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new fy(t,this.errorFactory))},t}(),fy=function(e){function r(t,r){var n=e.call(this,t)||this;return n.errorFactory=r,n.hasValue=!1,n}return t.__extends(r,e),r.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},r.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},r}(_h);function py(){return new Pd}function gy(t){return function(e){return 0===t?Xh():e.lift(new by(t))}}var by=function(){function t(t){if(this.total=t,this.total<0)throw new Td}return t.prototype.call=function(t,e){return e.subscribe(new yy(t,this.total))},t}(),yy=function(e){function r(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.total,r=++this.count;r<=e&&(this.destination.next(t),r===e&&(this.destination.complete(),this.unsubscribe()))},r}(_h);var my=function(){function t(t,e,r){this.predicate=t,this.thisArg=e,this.source=r}return t.prototype.call=function(t,e){return e.subscribe(new vy(t,this.predicate,this.thisArg,this.source))},t}(),vy=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return o.predicate=r,o.thisArg=n,o.source=i,o.index=0,o.thisArg=n||o,o}return t.__extends(r,e),r.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},r.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},r.prototype._complete=function(){this.notifyComplete(!0)},r}(_h);var _y=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new wy(t))},t}(),wy=function(e){function r(t){var r=e.call(this,t)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return t.__extends(r,e),r.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(af(t,new of(this))))},r.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},r.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},r}(sf);var Sy=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Ey(t,this.project))},t}(),Ey=function(e){function r(t,r){var n=e.call(this,t)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return t.__extends(r,e),r.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},r.prototype.tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},r.prototype._innerSub=function(t){var e=new of(this),r=this.destination;r.add(e);var n=af(t,e);n!==e&&r.add(n)},r.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},r.prototype.notifyNext=function(t){this.destination.next(t)},r.prototype.notifyError=function(t){this.destination.error(t)},r.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},r}(sf);var My=function(){function t(t,e,r){this.project=t,this.concurrent=e,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new xy(t,this.project,this.concurrent,this.scheduler))},t}(),xy=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return o.project=r,o.concurrent=n,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,n<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return t.__extends(r,e),r.dispatch=function(t){var e=t.subscriber,r=t.result,n=t.value,i=t.index;e.subscribeToProjection(r,n,i)},r.prototype._next=function(t){var e=this.destination;if(e.closed)this._complete();else{var n=this.index++;if(this.active<this.concurrent){e.next(t);try{var i=(0,this.project)(t,n);if(this.scheduler){var o={subscriber:this,result:i,value:t,index:n};this.destination.add(this.scheduler.schedule(r.dispatch,0,o))}else this.subscribeToProjection(i,t,n)}catch(t){e.error(t)}}else this.buffer.push(t)}},r.prototype.subscribeToProjection=function(t,e,r){this.active++,this.destination.add(af(t,new of(this)))},r.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},r.prototype.notifyNext=function(t){this._next(t)},r.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},r}(sf);var ky=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new Cy(t,this.callback))},t}(),Cy=function(e){function r(t,r){var n=e.call(this,t)||this;return n.add(new yh(r)),n}return t.__extends(r,e),r}(_h);var Iy=function(){function t(t,e,r,n){this.predicate=t,this.source=e,this.yieldIndex=r,this.thisArg=n}return t.prototype.call=function(t,e){return e.subscribe(new Ry(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),Ry=function(e){function r(t,r,n,i,o){var s=e.call(this,t)||this;return s.predicate=r,s.source=n,s.yieldIndex=i,s.thisArg=o,s.index=0,s}return t.__extends(r,e),r.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},r.prototype._next=function(t){var e=this.predicate,r=this.thisArg,n=this.index++;try{e.call(r||this,t,n,this.source)&&this.notifyComplete(this.yieldIndex?n:t)}catch(t){this.destination.error(t)}},r.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},r}(_h);var Ay=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Ny(t))},t}(),Ny=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t.__extends(r,e),r.prototype._next=function(t){},r}(_h);var jy=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Oy(t))},t}(),Oy=function(e){function r(t){return e.call(this,t)||this}return t.__extends(r,e),r.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},r.prototype._next=function(t){this.notifyComplete(!1)},r.prototype._complete=function(){this.notifyComplete(!0)},r}(_h);function Ty(t){return function(e){return 0===t?Xh():e.lift(new Py(t))}}var Py=function(){function t(t){if(this.total=t,this.total<0)throw new Td}return t.prototype.call=function(t,e){return e.subscribe(new Ly(t,this.total))},t}(),Ly=function(e){function r(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=new Array,n.count=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.ring,r=this.total,n=this.count++;e.length<r?e.push(t):e[n%r]=t},r.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;i<r;i++){var o=e++%r;t.next(n[o])}t.complete()},r}(_h);var Dy=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new By(t,this.value))},t}(),By=function(e){function r(t,r){var n=e.call(this,t)||this;return n.value=r,n}return t.__extends(r,e),r.prototype._next=function(t){this.destination.next(this.value)},r}(_h);var Fy=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Uy(t))},t}(),Uy=function(e){function r(t){return e.call(this,t)||this}return t.__extends(r,e),r.prototype._next=function(t){this.destination.next(ud.createNext(t))},r.prototype._error=function(t){var e=this.destination;e.next(ud.createError(t)),e.complete()},r.prototype._complete=function(){var t=this.destination;t.next(ud.createComplete()),t.complete()},r}(_h);function Vy(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new Hy(t,e,r))}}var Hy=function(){function t(t,e,r){void 0===r&&(r=!1),this.accumulator=t,this.seed=e,this.hasSeed=r}return t.prototype.call=function(t,e){return e.subscribe(new Wy(t,this.accumulator,this.seed,this.hasSeed))},t}(),Wy=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return t.__extends(r,e),Object.defineProperty(r.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),r.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},r.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.accumulator(this.seed,t,r)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},r}(_h);function zy(t,e){return arguments.length>=2?function(r){return xh(Vy(t,e),Ty(1),Jb(e))(r)}:function(e){return xh(Vy((function(e,r,n){return t(e,r,n+1)})),Ty(1))(e)}}var qy=function(){function t(t,e,r){this.accumulator=t,this.seed=e,this.concurrent=r}return t.prototype.call=function(t,e){return e.subscribe(new $y(t,this.accumulator,this.seed,this.concurrent))},t}(),$y=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o.acc=n,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return t.__extends(r,e),r.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,r=this.destination,n=void 0;try{n=(0,this.accumulator)(this.acc,t,e)}catch(t){return r.error(t)}this.active++,this._innerSub(n)}else this.buffer.push(t)},r.prototype._innerSub=function(t){var e=new of(this),r=this.destination;r.add(e);var n=af(t,e);n!==e&&r.add(n)},r.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},r.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},r.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},r}(sf);function Jy(t,e){return function(r){var n;if(n="function"==typeof t?t:function(){return t},"function"==typeof e)return r.lift(new Gy(n,e));var i=Object.create(r,Bh);return i.source=r,i.subjectFactory=n,i}}var Gy=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(t);return i.add(e.subscribe(n)),i},t}();var Zy=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Qy(t,this.nextSources))},t}(),Qy=function(e){function r(t,r){var n=e.call(this,t)||this;return n.destination=t,n.nextSources=r,n}return t.__extends(r,e),r.prototype.notifyError=function(){this.subscribeToNextSource()},r.prototype.notifyComplete=function(){this.subscribeToNextSource()},r.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},r.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},r.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new of(this),r=this.destination;r.add(e);var n=af(t,e);n!==e&&r.add(n)}else this.destination.complete()},r}(sf);var Yy=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Ky(t))},t}(),Ky=function(e){function r(t){var r=e.call(this,t)||this;return r.hasPrev=!1,r}return t.__extends(r,e),r.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},r}(_h);var Xy=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new tm(t,this.count,this.source))},t}(),tm=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return t.__extends(r,e),r.prototype.complete=function(){if(!this.isStopped){var t=this.source,r=this.count;if(0===r)return e.prototype.complete.call(this);r>-1&&(this.count=r-1),t.subscribe(this._unsubscribeAndRecycle())}},r}(_h);var em=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new rm(t,this.notifier,e))},t}(),rm=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i.sourceIsBeingSubscribedTo=!0,i}return t.__extends(r,e),r.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},r.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},r.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},r.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},r.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},r.prototype.subscribeToRetries=function(){var t;this.notifications=new jh;try{t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=af(t,new of(this))},r}(sf);var nm=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new im(t,this.count,this.source))},t}(),im=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return t.__extends(r,e),r.prototype.error=function(t){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return e.prototype.error.call(this,t);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},r}(_h);var om=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new sm(t,this.notifier,this.source))},t}(),sm=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i}return t.__extends(r,e),r.prototype.error=function(t){if(!this.isStopped){var r=this.errors,n=this.retries,i=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{r=new jh;try{n=(0,this.notifier)(r)}catch(t){return e.prototype.error.call(this,t)}i=af(n,new of(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=i,r.next(t)}},r.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},r.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},r}(sf);var am=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new um(t),n=e.subscribe(r);return n.add(af(this.notifier,new of(r))),n},t}(),um=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return t.__extends(r,e),r.prototype._next=function(t){this.value=t,this.hasValue=!0},r.prototype.notifyNext=function(){this.emitValue()},r.prototype.notifyComplete=function(){this.emitValue()},r.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},r}(sf);var cm=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new lm(t,this.period,this.scheduler))},t}(),lm=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(hm,r,{subscriber:i,period:r})),i}return t.__extends(r,e),r.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},r.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},r}(_h);function hm(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}var dm=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new fm(t,this.compareTo,this.comparator))},t}(),fm=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.compareTo=r,i.comparator=n,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(r.subscribe(new pm(t,i))),i}return t.__extends(r,e),r.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},r.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},r.prototype.checkValues=function(){for(var t=this,e=t._a,r=t._b,n=t.comparator;e.length>0&&r.length>0;){var i=e.shift(),o=r.shift(),s=!1;try{s=n?n(i,o):i===o}catch(t){this.destination.error(t)}s||this.emit(!1)}},r.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},r.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},r.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},r}(_h),pm=function(e){function r(t,r){var n=e.call(this,t)||this;return n.parent=r,n}return t.__extends(r,e),r.prototype._next=function(t){this.parent.nextB(t)},r.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},r.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},r}(_h);function gm(){return new jh}var bm=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new ym(t,this.predicate,this.source))},t}(),ym=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return t.__extends(r,e),r.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},r.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},r.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},r.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new Pd)},r}(_h);var mm=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new vm(t,this.total))},t}(),vm=function(e){function r(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return t.__extends(r,e),r.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},r}(_h);var _m=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Td}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new _h(t)):e.subscribe(new wm(t,this._skipCount))},t}(),wm=function(e){function r(t,r){var n=e.call(this,t)||this;return n._skipCount=r,n._count=0,n._ring=new Array(r),n}return t.__extends(r,e),r.prototype._next=function(t){var e=this._skipCount,r=this._count++;if(r<e)this._ring[r]=t;else{var n=r%e,i=this._ring,o=i[n];i[n]=t,this.destination.next(o)}},r}(_h);var Sm=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Em(t,this.notifier))},t}(),Em=function(e){function r(t,r){var n=e.call(this,t)||this;n.hasValue=!1;var i=new of(n);n.add(i),n.innerSubscription=i;var o=af(r,i);return o!==i&&(n.add(o),n.innerSubscription=o),n}return t.__extends(r,e),r.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},r.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},r.prototype.notifyComplete=function(){},r}(sf);var Mm=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new xm(t,this.predicate))},t}(),xm=function(e){function r(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},r.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},r}(_h);var km=function(e){function r(t,r,n){void 0===r&&(r=0),void 0===n&&(n=Md);var i=e.call(this)||this;return i.source=t,i.delayTime=r,i.scheduler=n,(!vf(r)||r<0)&&(i.delayTime=0),n&&"function"==typeof n.schedule||(i.scheduler=Md),i}return t.__extends(r,e),r.create=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=Md),new r(t,e,n)},r.dispatch=function(t){var e=t.source,r=t.subscriber;return this.add(e.subscribe(r))},r.prototype._subscribe=function(t){var e=this.delayTime,n=this.source;return this.scheduler.schedule(r.dispatch,e,{source:n,subscriber:t})},r}(Ch);var Cm=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new km(e,this.delay,this.scheduler).subscribe(t)},t}();function Im(t,e){return"function"==typeof e?function(r){return r.pipe(Im((function(r,n){return nf(t(r,n)).pipe(Dd((function(t,i){return e(r,t,n,i)})))})))}:function(e){return e.lift(new Rm(t))}}var Rm=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Am(t,this.project))},t}(),Am=function(e){function r(t,r){var n=e.call(this,t)||this;return n.project=r,n.index=0,n}return t.__extends(r,e),r.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e)},r.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var r=new of(this),n=this.destination;n.add(r),this.innerSubscription=af(t,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},r.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},r.prototype._unsubscribe=function(){this.innerSubscription=void 0},r.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},r.prototype.notifyNext=function(t){this.destination.next(t)},r}(sf);var Nm=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new jm(t),n=af(this.notifier,new of(r));return n&&!r.seenValue?(r.add(n),e.subscribe(r)):r},t}(),jm=function(e){function r(t){var r=e.call(this,t)||this;return r.seenValue=!1,r}return t.__extends(r,e),r.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},r.prototype.notifyComplete=function(){},r}(sf);var Om=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new Tm(t,this.predicate,this.inclusive))},t}(),Tm=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return t.__extends(r,e),r.prototype._next=function(t){var e,r=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void r.error(t)}this.nextOrComplete(t,e)},r.prototype.nextOrComplete=function(t,e){var r=this.destination;Boolean(e)?r.next(t):(this.inclusive&&r.next(t),r.complete())},r}(_h);var Pm=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new Lm(t,this.nextOrObserver,this.error,this.complete))},t}(),Lm=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return o._tapNext=Od,o._tapError=Od,o._tapComplete=Od,o._tapError=n||Od,o._tapComplete=i||Od,uh(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||Od,o._tapError=r.error||Od,o._tapComplete=r.complete||Od),o}return t.__extends(r,e),r.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},r.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},r.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},r}(_h),Dm={leading:!0,trailing:!1};var Bm=function(){function t(t,e,r){this.durationSelector=t,this.leading=e,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Fm(t,this.durationSelector,this.leading,this.trailing))},t}(),Fm=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=r,o._leading=n,o._trailing=i,o._hasValue=!1,o}return t.__extends(r,e),r.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},r.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},r.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=af(e,new of(this)))},r.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},r.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},r.prototype.notifyNext=function(){this.throttlingDone()},r.prototype.notifyComplete=function(){this.throttlingDone()},r}(sf);var Um=function(){function t(t,e,r,n){this.duration=t,this.scheduler=e,this.leading=r,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new Vm(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Vm=function(e){function r(t,r,n,i,o){var s=e.call(this,t)||this;return s.duration=r,s.scheduler=n,s.leading=i,s.trailing=o,s._hasTrailingValue=!1,s._trailingValue=null,s}return t.__extends(r,e),r.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Hm,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},r.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},r.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},r}(_h);function Hm(t){t.subscriber.clearThrottle()}var Wm=function(){return function(t,e){this.value=t,this.interval=e}}();function zm(t,e,r){return void 0===r&&(r=kd),function(n){var i=Qb(t),o=i?+t-r.now():Math.abs(t);return n.lift(new qm(o,i,e,r))}}var qm=function(){function t(t,e,r,n){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=r,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new $m(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),$m=function(e){function r(t,r,n,i,o){var s=e.call(this,t)||this;return s.absoluteTimeout=r,s.waitFor=n,s.withObservable=i,s.scheduler=o,s.scheduleTimeout(),s}return t.__extends(r,e),r.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(af(e,new of(t)))},r.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(r.dispatchTimeout,this.waitFor,this))},r.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},r.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},r}(sf);var Jm=function(){return function(t,e){this.value=t,this.timestamp=e}}();function Gm(t,e,r){return 0===r?[e]:(t.push(e),t)}var Zm=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var r=new Qm(t),n=e.subscribe(r);return n.closed||r.add(af(this.windowBoundaries,new of(r))),n},t}(),Qm=function(e){function r(t){var r=e.call(this,t)||this;return r.window=new jh,t.next(r.window),r}return t.__extends(r,e),r.prototype.notifyNext=function(){this.openWindow()},r.prototype.notifyError=function(t){this._error(t)},r.prototype.notifyComplete=function(){this._complete()},r.prototype._next=function(t){this.window.next(t)},r.prototype._error=function(t){this.window.error(t),this.destination.error(t)},r.prototype._complete=function(){this.window.complete(),this.destination.complete()},r.prototype._unsubscribe=function(){this.window=null},r.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,r=this.window=new jh;e.next(r)},r}(sf);var Ym=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new Km(t,this.windowSize,this.startWindowEvery))},t}(),Km=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=r,i.startWindowEvery=n,i.windows=[new jh],i.count=0,t.next(i.windows[0]),i}return t.__extends(r,e),r.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,n=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(t);var a=this.count-n+1;if(a>=0&&a%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var u=new jh;i.push(u),r.next(u)}},r.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},r.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},r.prototype._unsubscribe=function(){this.count=0,this.windows=null},r}(_h);var Xm=function(){function t(t,e,r,n){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=r,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new ev(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),tv=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return t.__extends(r,e),r.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(r.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),r}(jh),ev=function(e){function r(t,r,n,i,o){var s=e.call(this,t)||this;s.destination=t,s.windowTimeSpan=r,s.windowCreationInterval=n,s.maxWindowSize=i,s.scheduler=o,s.windows=[];var a=s.openWindow();if(null!==n&&n>=0){var u={subscriber:s,window:a,context:null},c={windowTimeSpan:r,windowCreationInterval:n,subscriber:s,scheduler:o};s.add(o.schedule(iv,r,u)),s.add(o.schedule(nv,n,c))}else{var l={subscriber:s,window:a,windowTimeSpan:r};s.add(o.schedule(rv,r,l))}return s}return t.__extends(r,e),r.prototype._next=function(t){for(var e=this.windows,r=e.length,n=0;n<r;n++){var i=e[n];i.closed||(i.next(t),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},r.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},r.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},r.prototype.openWindow=function(){var t=new tv;return this.windows.push(t),this.destination.next(t),t},r.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},r}(_h);function rv(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function nv(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,o=r.openWindow(),s=this,a={action:s,subscription:null},u={subscriber:r,window:o,context:a};a.subscription=n.schedule(iv,e,u),s.add(a.subscription),s.schedule(t,i)}function iv(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}var ov=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new sv(t,this.openings,this.closingSelector))},t}(),sv=function(e){function r(t,r,n){var i=e.call(this,t)||this;return i.openings=r,i.closingSelector=n,i.contexts=[],i.add(i.openSubscription=Kd(i,r,r)),i}return t.__extends(r,e),r.prototype._next=function(t){var e=this.contexts;if(e)for(var r=e.length,n=0;n<r;n++)e[n].window.next(t)},r.prototype._error=function(t){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.error(t),o.subscription.unsubscribe()}e.prototype._error.call(this,t)},r.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var r=t.length,n=-1;++n<r;){var i=t[n];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},r.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,r=-1;++r<e;){var n=t[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},r.prototype.notifyNext=function(t,e,r,n,i){if(t===this.openings){var o=void 0;try{o=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var s=new jh,a=new yh,u={window:s,subscription:a};this.contexts.push(u);var c=Kd(this,o,u);c.closed?this.closeWindow(this.contexts.length-1):(c.context=u,a.add(c)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(t))},r.prototype.notifyError=function(t){this.error(t)},r.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},r.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,r=e[t],n=r.window,i=r.subscription;e.splice(t,1),n.complete(),i.unsubscribe()}},r}(qd);var av=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new uv(t,this.closingSelector))},t}(),uv=function(e){function r(t,r){var n=e.call(this,t)||this;return n.destination=t,n.closingSelector=r,n.openWindow(),n}return t.__extends(r,e),r.prototype.notifyNext=function(t,e,r,n,i){this.openWindow(i)},r.prototype.notifyError=function(t){this._error(t)},r.prototype.notifyComplete=function(t){this.openWindow(t)},r.prototype._next=function(t){this.window.next(t)},r.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},r.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},r.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},r.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var r,n=this.window=new jh;this.destination.next(n);try{r=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=Kd(this,r))},r}(qd);var cv=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new lv(t,this.observables,this.project))},t}(),lv=function(e){function r(t,r,n){var i=e.call(this,t)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=new Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(s=0;s<o;s++){var a=r[s];i.add(Kd(i,a,void 0,s))}return i}return t.__extends(r,e),r.prototype.notifyNext=function(t,e,r){this.values[r]=e;var n=this.toRespond;if(n.length>0){var i=n.indexOf(r);-1!==i&&n.splice(i,1)}},r.prototype.notifyComplete=function(){},r.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},r.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},r}(qd);var hv=Object.freeze({__proto__:null,audit:vb,auditTime:function(t,e){return void 0===e&&(e=kd),vb((function(){return jf(t,e)}))},buffer:function(t){return function(e){return e.lift(new Sb(t))}},bufferCount:function(t,e){return void 0===e&&(e=null),function(r){return r.lift(new Mb(t,e))}},bufferTime:function(t){var e=arguments.length,r=kd;td(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new Cb(t,n,i,r))}},bufferToggle:function(t,e){return function(r){return r.lift(new Ob(t,e))}},bufferWhen:function(t){return function(e){return e.lift(new Pb(t))}},catchError:function(t){return function(e){var r=new Db(t),n=e.lift(r);return r.caught=n}},combineAll:function(t){return function(e){return e.lift(new tf(t))}},combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&fh(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(nf([e].concat(t)),new tf(r))}},concat:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(pf.apply(void 0,[e].concat(t)))}},concatAll:ff,concatMap:Fb,concatMapTo:function(t,e){return Fb((function(){return t}),e)},count:function(t){return function(e){return e.lift(new Ub(t,e))}},debounce:function(t){return function(e){return e.lift(new Hb(t))}},debounceTime:function(t,e){return void 0===e&&(e=kd),function(r){return r.lift(new zb(t,e))}},defaultIfEmpty:Jb,delay:function(t,e){void 0===e&&(e=kd);var r=Qb(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new Yb(r,e))}},delayWhen:function(t,e){return e?function(r){return new ry(r,e).lift(new ty(t))}:function(e){return e.lift(new ty(t))}},dematerialize:function(){return function(t){return t.lift(new iy)}},distinct:function(t,e){return function(r){return r.lift(new sy(t,e))}},distinctUntilChanged:uy,distinctUntilKeyChanged:function(t,e){return uy((function(r,n){return e?e(r[t],n[t]):r[t]===n[t]}))},elementAt:function(t,e){if(t<0)throw new Td;var r=arguments.length>=2;return function(n){return n.pipe(xf((function(e,r){return r===t})),gy(1),r?Jb(e):hy((function(){return new Td})))}},endWith:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return pf(e,od.apply(void 0,t))}},every:function(t,e){return function(r){return r.lift(new my(t,e,r))}},exhaust:function(){return function(t){return t.lift(new _y)}},exhaustMap:function t(e,r){return r?function(n){return n.pipe(t((function(t,n){return nf(e(t,n)).pipe(Dd((function(e,i){return r(t,e,n,i)})))})))}:function(t){return t.lift(new Sy(e))}},expand:function(t,e,r){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(n){return n.lift(new My(t,e,r))}},filter:xf,finalize:function(t){return function(e){return e.lift(new ky(t))}},find:function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(r){return r.lift(new Iy(t,r,!1,e))}},findIndex:function(t,e){return function(r){return r.lift(new Iy(t,r,!0,e))}},first:function(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?xf((function(e,r){return t(e,r,n)})):Mh,gy(1),r?Jb(e):hy((function(){return new Pd})))}},groupBy:function(t,e,r,n){return function(i){return i.lift(new Uh(t,e,r,n))}},ignoreElements:function(){return function(t){return t.lift(new Ay)}},isEmpty:function(){return function(t){return t.lift(new jy)}},last:function(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?xf((function(e,r){return t(e,r,n)})):Mh,Ty(1),r?Jb(e):hy((function(){return new Pd})))}},map:Dd,mapTo:function(t){return function(e){return e.lift(new Dy(t))}},materialize:function(){return function(t){return t.lift(new Fy)}},max:function(t){var e="function"==typeof t?function(e,r){return t(e,r)>0?e:r}:function(t,e){return t>e?t:e};return zy(e)},merge:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(wf.apply(void 0,[e].concat(t)))}},mergeAll:df,mergeMap:uf,flatMap:hf,mergeMapTo:function(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?uf((function(){return t}),e,r):("number"==typeof e&&(r=e),uf((function(){return t}),r))},mergeScan:function(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new qy(t,e,r))}},min:function(t){var e="function"==typeof t?function(e,r){return t(e,r)<0?e:r}:function(t,e){return t<e?t:e};return zy(e)},multicast:Jy,observeOn:function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new cd(t,e))}},onErrorResumeNext:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&fh(t[0])&&(t=t[0]),function(e){return e.lift(new Zy(t))}},pairwise:function(){return function(t){return t.lift(new Yy)}},partition:function(t,e){return function(r){return[xf(t,e)(r),xf(Mf(t,e))(r)]}},pluck:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(0===r)throw new Error("list of properties cannot be empty.");return function(e){return Dd(function(t,e){var r=function(r){for(var n=r,i=0;i<e;i++){var o=null!=n?n[t[i]]:void 0;if(void 0===o)return;n=o}return n};return r}(t,r))(e)}},publish:function(t){return t?Jy((function(){return new jh}),t):Jy(new jh)},publishBehavior:function(t){return function(e){return Jy(new qh(t))(e)}},publishLast:function(){return function(t){return Jy(new pd)(t)}},publishReplay:function(t,e,r,n){r&&"function"!=typeof r&&(n=r);var i="function"==typeof r?r:void 0,o=new dd(t,e,n);return function(t){return Jy((function(){return o}),i)(t)}},race:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&fh(t[0])&&(t=t[0]),e.lift.call(If.apply(void 0,[e].concat(t)))}},reduce:zy,repeat:function(t){return void 0===t&&(t=-1),function(e){return 0===t?Xh():t<0?e.lift(new Xy(-1,e)):e.lift(new Xy(t-1,e))}},repeatWhen:function(t){return function(e){return e.lift(new em(t))}},retry:function(t){return void 0===t&&(t=-1),function(e){return e.lift(new nm(t,e))}},retryWhen:function(t){return function(e){return e.lift(new om(t,e))}},refCount:Th,sample:function(t){return function(e){return e.lift(new am(t))}},sampleTime:function(t,e){return void 0===e&&(e=kd),function(r){return r.lift(new cm(t,e))}},scan:Vy,sequenceEqual:function(t,e){return function(r){return r.lift(new dm(t,e))}},share:function(){return function(t){return Th()(Jy(gm)(t))}},shareReplay:function(t,e,r){var n;return n=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(t){return t.lift(function(t){var e,r,n=t.bufferSize,i=void 0===n?Number.POSITIVE_INFINITY:n,o=t.windowTime,s=void 0===o?Number.POSITIVE_INFINITY:o,a=t.refCount,u=t.scheduler,c=0,l=!1,h=!1;return function(t){var n;c++,!e||l?(l=!1,e=new dd(i,s,u),n=e.subscribe(this),r=t.subscribe({next:function(t){e.next(t)},error:function(t){l=!0,e.error(t)},complete:function(){h=!0,r=void 0,e.complete()}}),h&&(r=void 0)):n=e.subscribe(this),this.add((function(){c--,n.unsubscribe(),n=void 0,r&&!h&&a&&0===c&&(r.unsubscribe(),r=void 0,e=void 0)}))}}(n))}},single:function(t){return function(e){return e.lift(new bm(t,e))}},skip:function(t){return function(e){return e.lift(new mm(t))}},skipLast:function(t){return function(e){return e.lift(new _m(t))}},skipUntil:function(t){return function(e){return e.lift(new Sm(t))}},skipWhile:function(t){return function(e){return e.lift(new Mm(t))}},startWith:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return td(r)?(t.pop(),function(e){return pf(t,e,r)}):function(e){return pf(t,e)}},subscribeOn:function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new Cm(t,e))}},switchAll:function(){return Im(Mh)},switchMap:Im,switchMapTo:function(t,e){return e?Im((function(){return t}),e):Im((function(){return t}))},take:gy,takeLast:Ty,takeUntil:function(t){return function(e){return e.lift(new Nm(t))}},takeWhile:function(t,e){return void 0===e&&(e=!1),function(r){return r.lift(new Om(t,e))}},tap:function(t,e,r){return function(n){return n.lift(new Pm(t,e,r))}},throttle:function(t,e){return void 0===e&&(e=Dm),function(r){return r.lift(new Bm(t,!!e.leading,!!e.trailing))}},throttleTime:function(t,e,r){return void 0===e&&(e=kd),void 0===r&&(r=Dm),function(n){return n.lift(new Um(t,e,r.leading,r.trailing))}},throwIfEmpty:hy,timeInterval:function(t){return void 0===t&&(t=kd),function(e){return gf((function(){return e.pipe(Vy((function(e,r){var n=e.current;return{value:r,current:t.now(),last:n}}),{current:t.now(),value:void 0,last:void 0}),Dd((function(t){var e=t.current,r=t.last,n=t.value;return new Wm(n,e-r)})))}))}},timeout:function(t,e){return void 0===e&&(e=kd),zm(t,sd(new Ld),e)},timeoutWith:zm,timestamp:function(t){return void 0===t&&(t=kd),Dd((function(e){return new Jm(e,t.now())}))},toArray:function(){return zy(Gm,[])},window:function(t){return function(e){return e.lift(new Zm(t))}},windowCount:function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new Ym(t,e))}},windowTime:function(t){var e=kd,r=null,n=Number.POSITIVE_INFINITY;return td(arguments[3])&&(e=arguments[3]),td(arguments[2])?e=arguments[2]:vf(arguments[2])&&(n=Number(arguments[2])),td(arguments[1])?e=arguments[1]:vf(arguments[1])&&(r=Number(arguments[1])),function(i){return i.lift(new Xm(t,r,n,e))}},windowToggle:function(t,e){return function(r){return r.lift(new ov(t,e))}},windowWhen:function(t){return function(e){return e.lift(new av(t))}},withLatestFrom:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var r;"function"==typeof t[t.length-1]&&(r=t.pop());var n=t;return e.lift(new cv(n,r))}},zip:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Tf.apply(void 0,[e].concat(t)))}},zipAll:function(t){return function(e){return e.lift(new Pf(t))}}}),dv=t.getAugmentedNamespace(hv),fv={},pv={};Object.defineProperty(pv,"__esModule",{value:!0}),pv.ClientMessagePublishEvent=pv.ClientMessageSetSessionConfig=pv.ClientMessageGetSessionConfig=pv.ClientMessageIsLinked=pv.ClientMessageHostSession=void 0,pv.ClientMessageHostSession=function(t){return Object.assign({type:"HostSession"},t)},pv.ClientMessageIsLinked=function(t){return Object.assign({type:"IsLinked"},t)},pv.ClientMessageGetSessionConfig=function(t){return Object.assign({type:"GetSessionConfig"},t)},pv.ClientMessageSetSessionConfig=function(t){return Object.assign({type:"SetSessionConfig"},t)},pv.ClientMessagePublishEvent=function(t){return Object.assign({type:"PublishEvent"},t)};var gv={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=Vf,r=dv;var n;!function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(n=t.ConnectionState||(t.ConnectionState={}));t.RxWebSocket=class{constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=t.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable((t=>{let e;try{this.webSocket=e=new this.WebSocketClass(this.url)}catch(e){return void t.error(e)}this.connectionStateSubject.next(n.CONNECTING),e.onclose=e=>{this.clearWebSocket(),t.error(new Error(`websocket error ${e.code}: ${e.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},e.onopen=e=>{t.next(),t.complete(),this.connectionStateSubject.next(n.CONNECTED)},e.onmessage=t=>{this.incomingDataSubject.next(t.data)}})).pipe((0,r.take)(1))}disconnect(){const{webSocket:t}=this;if(t){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{t.close()}catch(t){}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)((t=>{let r;try{r=JSON.parse(t)}catch(t){return(0,e.empty)()}return(0,e.of)(r)})))}sendData(t){const{webSocket:e}=this;if(!e)throw new Error("websocket is not connected");e.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}}(gv);var bv={};Object.defineProperty(bv,"__esModule",{value:!0}),bv.isServerMessageFail=void 0,bv.isServerMessageFail=function(t){return t&&"Fail"===t.type&&"number"==typeof t.id&&"string"==typeof t.sessionId&&"string"==typeof t.error},Object.defineProperty(fv,"__esModule",{value:!0}),fv.WalletSDKConnection=void 0;const yv=Vf,mv=dv,vv=G,_v=Bn,wv=pv,Sv=J,Ev=gv,Mv=bv;fv.WalletSDKConnection=class{constructor(t,e,r,n,i=WebSocket){this.sessionId=t,this.sessionKey=e,this.diagnostic=n,this.subscriptions=new yv.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,_v.IntNumber)(1),this.connectedSubject=new yv.BehaviorSubject(!1),this.linkedSubject=new yv.BehaviorSubject(!1),this.sessionConfigSubject=new yv.ReplaySubject(1);const o=new Ev.RxWebSocket(r+"/rpc",i);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,mv.tap)((e=>{var r;return null===(r=this.diagnostic)||void 0===r?void 0:r.log(Sv.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:vv.Session.hash(t)})})),(0,mv.skip)(1),(0,mv.filter)((t=>t===Ev.ConnectionState.DISCONNECTED&&!this.destroyed)),(0,mv.delay)(5e3),(0,mv.filter)((t=>!this.destroyed)),(0,mv.flatMap)((t=>o.connect())),(0,mv.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,mv.skip)(2),(0,mv.switchMap)((t=>(0,yv.iif)((()=>t===Ev.ConnectionState.CONNECTED),this.authenticate().pipe((0,mv.tap)((t=>this.sendIsLinked())),(0,mv.tap)((t=>this.sendGetSessionConfig())),(0,mv.map)((t=>!0))),(0,yv.of)(!1)))),(0,mv.distinctUntilChanged)(),(0,mv.catchError)((t=>(0,yv.of)(!1)))).subscribe((t=>this.connectedSubject.next(t)))),this.subscriptions.add(o.connectionState$.pipe((0,mv.skip)(1),(0,mv.switchMap)((t=>(0,yv.iif)((()=>t===Ev.ConnectionState.CONNECTED),(0,yv.timer)(0,1e4))))).subscribe((t=>0===t?this.updateLastHeartbeat():this.heartbeat()))),this.subscriptions.add(o.incomingData$.pipe((0,mv.filter)((t=>"h"===t))).subscribe((t=>this.updateLastHeartbeat()))),this.subscriptions.add(o.incomingJSONData$.pipe((0,mv.filter)((t=>["IsLinkedOK","Linked"].includes(t.type)))).subscribe((e=>{var r;const n=e;null===(r=this.diagnostic)||void 0===r||r.log(Sv.EVENTS.LINKED,{sessionIdHash:vv.Session.hash(t),linked:n.linked,type:e.type,onlineGuests:n.onlineGuests}),this.linkedSubject.next(n.linked||n.onlineGuests>0)}))),this.subscriptions.add(o.incomingJSONData$.pipe((0,mv.filter)((t=>["GetSessionConfigOK","SessionConfigUpdated"].includes(t.type)))).subscribe((e=>{var r;const n=e;null===(r=this.diagnostic)||void 0===r||r.log(Sv.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:vv.Session.hash(t),metadata_keys:n&&n.metadata?Object.keys(n.metadata):void 0}),this.sessionConfigSubject.next({webhookId:n.webhookId,webhookUrl:n.webhookUrl,metadata:n.metadata})})))}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");null===(t=this.diagnostic)||void 0===t||t.log(Sv.EVENTS.STARTED_CONNECTING,{sessionIdHash:vv.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var t;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(t=this.diagnostic)||void 0===t||t.log(Sv.EVENTS.DISCONNECTED,{sessionIdHash:vv.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,mv.filter)((t=>t)),(0,mv.take)(1),(0,mv.map)((()=>{})))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,mv.filter)((t=>t)),(0,mv.take)(1),(0,mv.map)((()=>{})))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,mv.filter)((t=>{if("Event"!==t.type)return!1;const e=t;return"string"==typeof e.sessionId&&"string"==typeof e.eventId&&"string"==typeof e.event&&"string"==typeof e.data})),(0,mv.map)((t=>t)))}setSessionMetadata(t,e){const r=(0,wv.ClientMessageSetSessionConfig)({id:(0,_v.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[t]:e}});return this.onceConnected$.pipe((0,mv.flatMap)((t=>this.makeRequest(r))),(0,mv.map)((t=>{if((0,Mv.isServerMessageFail)(t))throw new Error(t.error||"failed to set session metadata")})))}publishEvent(t,e,r=!1){const n=(0,wv.ClientMessagePublishEvent)({id:(0,_v.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:t,data:e,callWebhook:r});return this.onceLinked$.pipe((0,mv.flatMap)((t=>this.makeRequest(n))),(0,mv.map)((t=>{if((0,Mv.isServerMessageFail)(t))throw new Error(t.error||"failed to publish event");return t.eventId})))}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(t){}}makeRequest(t,e=6e4){const r=t.id;try{this.sendData(t)}catch(t){return(0,yv.throwError)(t)}return this.ws.incomingJSONData$.pipe((0,mv.timeoutWith)(e,(0,yv.throwError)(new Error(`request ${r} timed out`))),(0,mv.filter)((t=>t.id===r)),(0,mv.take)(1))}authenticate(){const t=(0,wv.ClientMessageHostSession)({id:(0,_v.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(t).pipe((0,mv.map)((t=>{if((0,Mv.isServerMessageFail)(t))throw new Error(t.error||"failed to authentcate")})))}sendIsLinked(){const t=(0,wv.ClientMessageIsLinked)({id:(0,_v.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}sendGetSessionConfig(){const t=(0,wv.ClientMessageGetSessionConfig)({id:(0,_v.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(t)}};var xv={};Object.defineProperty(xv,"__esModule",{value:!0}),xv.WalletUIError=void 0;class kv extends Error{constructor(t,e){super(t),this.message=t,this.errorCode=e}}xv.WalletUIError=kv,kv.UserRejectedRequest=new kv("User rejected request"),kv.SwitchEthereumChainUnsupportedChainId=new kv("Unsupported chainId",4902);var Cv={};Object.defineProperty(Cv,"__esModule",{value:!0}),Cv.decrypt=Cv.encrypt=void 0;const Iv=le;Cv.encrypt=async function(t,e){if(64!==e.length)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,Iv.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),s=o.slice(o.byteLength-16),a=o.slice(0,o.byteLength-16),u=new Uint8Array(s),c=new Uint8Array(a),l=new Uint8Array([...r,...u,...c]);return(0,Iv.uint8ArrayToHex)(l)},Cv.decrypt=function(t,e){if(64!==e.length)throw Error("secret must be 256 bits");return new Promise(((r,n)=>{!async function(){const i=await crypto.subtle.importKey("raw",(0,Iv.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Iv.hexStringToUint8Array)(t),s=o.slice(0,12),a=o.slice(12,28),u=o.slice(28),c=new Uint8Array([...u,...a]),l={name:"AES-GCM",iv:new Uint8Array(s)};try{const t=await window.crypto.subtle.decrypt(l,i,c),e=new TextDecoder;r(e.decode(t))}catch(t){n(t)}}()}))};var Rv={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(t){t.requestEthereumAccounts="requestEthereumAccounts",t.signEthereumMessage="signEthereumMessage",t.signEthereumTransaction="signEthereumTransaction",t.submitEthereumTransaction="submitEthereumTransaction",t.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",t.scanQRCode="scanQRCode",t.generic="generic",t.childRequestEthereumAccounts="childRequestEthereumAccounts",t.addEthereumChain="addEthereumChain",t.switchEthereumChain="switchEthereumChain",t.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",t.watchAsset="watchAsset",t.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))}(Rv);var Av={},Nv={};!function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,(e=t.RelayMessageType||(t.RelayMessageType={})).SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(Nv),Object.defineProperty(Av,"__esModule",{value:!0}),Av.Web3RequestCanceledMessage=void 0;const jv=Nv;Av.Web3RequestCanceledMessage=function(t){return{type:jv.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}};var Ov={};Object.defineProperty(Ov,"__esModule",{value:!0}),Ov.Web3RequestMessage=void 0;const Tv=Nv;Ov.Web3RequestMessage=function(t){return Object.assign({type:Tv.RelayMessageType.WEB3_REQUEST},t)};var Pv={};Object.defineProperty(Pv,"__esModule",{value:!0}),Pv.EthereumAddressFromSignedMessageResponse=Pv.SubmitEthereumTransactionResponse=Pv.SignEthereumTransactionResponse=Pv.SignEthereumMessageResponse=Pv.isRequestEthereumAccountsResponse=Pv.SelectProviderResponse=Pv.WatchAssetReponse=Pv.RequestEthereumAccountsResponse=Pv.SwitchEthereumChainResponse=Pv.AddEthereumChainResponse=Pv.ErrorResponse=void 0;const Lv=Rv;Pv.ErrorResponse=function(t,e,r){return{method:t,errorMessage:e,errorCode:r}},Pv.AddEthereumChainResponse=function(t){return{method:Lv.Web3Method.addEthereumChain,result:t}},Pv.SwitchEthereumChainResponse=function(t){return{method:Lv.Web3Method.switchEthereumChain,result:t}},Pv.RequestEthereumAccountsResponse=function(t){return{method:Lv.Web3Method.requestEthereumAccounts,result:t}},Pv.WatchAssetReponse=function(t){return{method:Lv.Web3Method.watchAsset,result:t}},Pv.SelectProviderResponse=function(t){return{method:Lv.Web3Method.selectProvider,result:t}},Pv.isRequestEthereumAccountsResponse=function(t){return t&&t.method===Lv.Web3Method.requestEthereumAccounts},Pv.SignEthereumMessageResponse=function(t){return{method:Lv.Web3Method.signEthereumMessage,result:t}},Pv.SignEthereumTransactionResponse=function(t){return{method:Lv.Web3Method.signEthereumTransaction,result:t}},Pv.SubmitEthereumTransactionResponse=function(t){return{method:Lv.Web3Method.submitEthereumTransaction,result:t}},Pv.EthereumAddressFromSignedMessageResponse=function(t){return{method:Lv.Web3Method.ethereumAddressFromSignedMessage,result:t}};var Dv={};Object.defineProperty(Dv,"__esModule",{value:!0}),Dv.isWeb3ResponseMessage=Dv.Web3ResponseMessage=void 0;const Bv=Nv;Dv.Web3ResponseMessage=function(t){return Object.assign({type:Bv.RelayMessageType.WEB3_RESPONSE},t)},Dv.isWeb3ResponseMessage=function(t){return t&&t.type===Bv.RelayMessageType.WEB3_RESPONSE};var Fv=t.commonjsGlobal&&t.commonjsGlobal.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),Uv=t.commonjsGlobal&&t.commonjsGlobal.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vv=t.commonjsGlobal&&t.commonjsGlobal.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Hv=t.commonjsGlobal&&t.commonjsGlobal.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&Fv(e,t,r);return Uv(e,t),e},Wv=t.commonjsGlobal&&t.commonjsGlobal.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bb,"__esModule",{value:!0}),bb.WalletSDKRelay=void 0;const zv=Wv(yb),qv=_,$v=Vf,Jv=dv,Gv=J,Zv=fv,Qv=xv,Yv=Bn,Kv=le,Xv=Hv(Cv),t_=G,e_=si,r_=Rv,n_=Av,i_=Ov,o_=Pv,s_=Dv;class a_ extends e_.WalletSDKRelayAbstract{constructor(t){var e;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new $v.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new $v.Subscription,this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:r,ui:n,connection:i}=this.subscribe();if(this._session=r,this.connection=i,this.relayEventManager=t.relayEventManager,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this.diagnostic={log:t.eventListener.onEvent}:this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=null===(e=t.reloadOnDisconnect)||void 0===e||e,this.ui=n}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe((t=>{this.dappDefaultChain!==t&&(this.dappDefaultChain=t)})));const t=t_.Session.load(this.storage)||new t_.Session(this.storage).save(),e=new Zv.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(e.sessionConfig$.subscribe({next:t=>{this.onSessionConfigChanged(t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Gv.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(e.incomingEvent$.pipe((0,Jv.filter)((t=>"Web3Response"===t.event))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(e.linked$.pipe((0,Jv.skip)(1),(0,Jv.tap)((t=>{var e;this.isLinked=t;const r=this.storage.getItem(e_.LOCAL_STORAGE_ADDRESSES_KEY);if(t&&(this.session.linked=t),this.isUnlinkedErrorState=!1,r){const n=r.split(" "),i="true"===this.storage.getItem("IsStandaloneSigning");if(""!==n[0]&&!t&&this.session.linked&&!i){this.isUnlinkedErrorState=!0;const t=this.getSessionIdHash();null===(e=this.diagnostic)||void 0===e||e.log(Gv.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:t})}}}))).subscribe()),this.subscriptions.add(e.sessionConfig$.pipe((0,Jv.filter)((t=>!!t.metadata&&"1"===t.metadata.__destroyed))).subscribe((()=>{var t;const r=e.isDestroyed;return null===(t=this.diagnostic)||void 0===t||t.log(Gv.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:r,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()}))),this.subscriptions.add(e.sessionConfig$.pipe((0,Jv.filter)((t=>t.metadata&&void 0!==t.metadata.WalletUsername))).pipe((0,Jv.mergeMap)((e=>Xv.decrypt(e.metadata.WalletUsername,t.secret)))).subscribe({next:t=>{this.storage.setItem(e_.WALLET_USER_NAME_KEY,t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Gv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Jv.filter)((t=>t.metadata&&void 0!==t.metadata.AppVersion))).pipe((0,Jv.mergeMap)((e=>Xv.decrypt(e.metadata.AppVersion,t.secret)))).subscribe({next:t=>{this.storage.setItem(e_.APP_VERSION_KEY,t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Gv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Jv.filter)((t=>t.metadata&&void 0!==t.metadata.ChainId&&void 0!==t.metadata.JsonRpcUrl))).pipe((0,Jv.mergeMap)((e=>(0,$v.zip)(Xv.decrypt(e.metadata.ChainId,t.secret),Xv.decrypt(e.metadata.JsonRpcUrl,t.secret))))).pipe((0,Jv.distinctUntilChanged)()).subscribe({next:([t,e])=>{this.chainCallback&&this.chainCallback(t,e)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Gv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Jv.filter)((t=>t.metadata&&void 0!==t.metadata.EthereumAddress))).pipe((0,Jv.mergeMap)((e=>Xv.decrypt(e.metadata.EthereumAddress,t.secret)))).subscribe({next:t=>{this.accountsCallback&&this.accountsCallback([t]),a_.accountRequestCallbackIds.size>0&&(Array.from(a_.accountRequestCallbackIds.values()).forEach((e=>{const r=(0,s_.Web3ResponseMessage)({id:e,response:(0,o_.RequestEthereumAccountsResponse)([t])});this.invokeCallback(Object.assign(Object.assign({},r),{id:e}))})),a_.accountRequestCallbackIds.clear())},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Gv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(e.sessionConfig$.pipe((0,Jv.filter)((t=>t.metadata&&void 0!==t.metadata.AppSrc))).pipe((0,Jv.mergeMap)((e=>Xv.decrypt(e.metadata.AppSrc,t.secret)))).subscribe({next:t=>{this.ui.setAppSrc(t)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Gv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const r=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:e.connected$,chainId$:this.dappDefaultChainSubject});return e.connect(),{session:t,ui:r,connection:e}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Jv.timeout)(1e3),(0,Jv.catchError)((t=>(0,$v.of)(null)))).subscribe((t=>{var e,r,n;const i=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch(t){null===(e=this.diagnostic)||void 0===e||e.log(Gv.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(r=this.diagnostic)||void 0===r||r.log(Gv.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=t_.Session.load(this.storage);if((null==o?void 0:o.id)===this._session.id?this.storage.clear():o&&(null===(n=this.diagnostic)||void 0===n||n.log(Gv.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:t_.Session.hash(o.id)})),this._reloadOnDisconnect)return void this.ui.reloadUI();this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new $v.Subscription;const{session:s,ui:a,connection:u}=this.subscribe();this._session=s,this.connection=u,this.ui=a,i&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}),(t=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Gv.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})}))}setAppInfo(t,e){this.appName=t,this.appLogoUrl=e}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,e){this.storage.setItem(t,e)}signEthereumMessage(t,e,r,n){return this.sendRequest({method:r_.Web3Method.signEthereumMessage,params:{message:(0,Kv.hexStringFromBuffer)(t,!0),address:e,addPrefix:r,typedDataJson:n||null}})}ethereumAddressFromSignedMessage(t,e,r){return this.sendRequest({method:r_.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,Kv.hexStringFromBuffer)(t,!0),signature:(0,Kv.hexStringFromBuffer)(e,!0),addPrefix:r}})}signEthereumTransaction(t){return this.sendRequest({method:r_.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Kv.bigIntStringFromBN)(t.weiValue),data:(0,Kv.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Kv.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Kv.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Kv.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Kv.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:r_.Web3Method.signEthereumTransaction,params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Kv.bigIntStringFromBN)(t.weiValue),data:(0,Kv.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Kv.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Kv.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Kv.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Kv.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,e){return this.sendRequest({method:r_.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,Kv.hexStringFromBuffer)(t,!0),chainId:e}})}scanQRCode(t){return this.sendRequest({method:r_.Web3Method.scanQRCode,params:{regExp:t}})}getQRCodeUrl(){return(0,Kv.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,e){return this.sendRequest({method:r_.Web3Method.generic,params:{action:e,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let e=null;const r=(0,Kv.randomBytesHex)(8),n=n=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,n),null==e||e()};return{promise:new Promise(((i,o)=>{this.ui.isStandalone()||(e=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:n,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(r,(t=>{if(null==e||e(),t.errorMessage)return o(new Error(t.errorMessage));i(t)})),this.ui.isStandalone()?this.sendRequestStandalone(r,t):this.publishWeb3RequestEvent(r,t)})),cancel:n}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChainSubject.next(t)}publishWeb3RequestEvent(t,e){var r;const n=(0,i_.Web3RequestMessage)({id:t,request:e}),i=t_.Session.load(this.storage);null===(r=this.diagnostic)||void 0===r||r.log(Gv.EVENTS.WEB3_REQUEST,{eventId:n.id,method:`relay::${n.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?t_.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",n,!0).subscribe({next:t=>{var e;null===(e=this.diagnostic)||void 0===e||e.log(Gv.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:n.id,method:`relay::${n.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?t_.Session.hash(i.id):"",isSessionMismatched:((null==i?void 0:i.id)!==this._session.id).toString()})},error:t=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:n.id,response:{method:n.request.method,errorMessage:t.message}}))}}))}publishWeb3RequestCanceledEvent(t){const e=(0,n_.Web3RequestCanceledMessage)(t);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",e,!1).subscribe())}publishEvent(t,e,r){const n=this.session.secret;return new $v.Observable((t=>{Xv.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{origin:location.origin})),n).then((e=>{t.next(e),t.complete()}))})).pipe((0,Jv.mergeMap)((e=>this.connection.publishEvent(t,e,r))))}handleIncomingEvent(t){try{this.subscriptions.add((0,$v.from)(Xv.decrypt(t.data,this.session.secret)).pipe((0,Jv.map)((t=>JSON.parse(t)))).subscribe({next:t=>{const e=(0,s_.isWeb3ResponseMessage)(t)?t:null;e&&this.handleWeb3ResponseMessage(e)},error:()=>{var t;null===(t=this.diagnostic)||void 0===t||t.log(Gv.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(t){return}}handleWeb3ResponseMessage(t){var e;const{response:r}=t;if(null===(e=this.diagnostic)||void 0===e||e.log(Gv.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash()}),(0,o_.isRequestEthereumAccountsResponse)(r))return a_.accountRequestCallbackIds.forEach((e=>this.invokeCallback(Object.assign(Object.assign({},t),{id:e})))),void a_.accountRequestCallbackIds.clear();this.invokeCallback(t)}handleErrorResponse(t,e,r,n){this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:t,response:(0,o_.ErrorResponse)(e,(null!=r?r:Qv.WalletUIError.UserRejectedRequest).message,n)}))}invokeCallback(t){const e=this.relayEventManager.callbacks.get(t.id);e&&(e(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:r_.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},e=(0,Kv.randomBytesHex)(8),r=r=>{this.publishWeb3RequestCanceledEvent(e),this.handleErrorResponse(e,t.method,r)};return{promise:new Promise(((n,i)=>{var o;this.relayEventManager.callbacks.set(e,(t=>{if(this.ui.hideRequestEthereumAccounts(),t.errorMessage)return i(new Error(t.errorMessage));n(t)}));const s=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)||null;if(s&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s)){let t;try{t=(0,Kv.isInIFrame)()&&window.top?window.top.location:window.location}catch(e){t=window.location}t.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(t.href)}`}else{if(this.ui.inlineAccountsResponse()){const t=t=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:e,response:(0,o_.RequestEthereumAccountsResponse)(t)}))};this.ui.requestEthereumAccounts({onCancel:r,onAccounts:t})}else{const t=qv.ethErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>r(t)})}a_.accountRequestCallbackIds.add(e),this.ui.inlineAccountsResponse()||this.ui.isStandalone()||this.publishWeb3RequestEvent(e,t)}})),cancel:r}}selectProvider(t){const e={method:r_.Web3Method.selectProvider,params:{providerOptions:t}},r=(0,Kv.randomBytesHex)(8);return{cancel:t=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,t)},promise:new Promise(((e,n)=>{this.relayEventManager.callbacks.set(r,(t=>{if(t.errorMessage)return n(new Error(t.errorMessage));e(t)}));this.ui.selectProvider&&this.ui.selectProvider({onApprove:t=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:r,response:(0,o_.SelectProviderResponse)(t)}))},onCancel:t=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:r,response:(0,o_.SelectProviderResponse)(Yv.ProviderType.Unselected)}))},providerOptions:t})}))}}watchAsset(t,e,r,n,i,o){const s={method:r_.Web3Method.watchAsset,params:{type:t,options:{address:e,symbol:r,decimals:n,image:i},chainId:o}};let a=null;const u=(0,Kv.randomBytesHex)(8),c=t=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,s.method,t),null==a||a()};this.ui.inlineWatchAsset()||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:c,onResetConnection:this.resetAndReload}));return{cancel:c,promise:new Promise(((c,l)=>{this.relayEventManager.callbacks.set(u,(t=>{if(null==a||a(),t.errorMessage)return l(new Error(t.errorMessage));c(t)}));const h=t=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:u,response:(0,o_.WatchAssetReponse)(!1)}))},d=()=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:u,response:(0,o_.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:d,onCancel:h,type:t,address:e,symbol:r,decimals:n,image:i,chainId:o}),this.ui.inlineWatchAsset()||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,s)}))}}addEthereumChain(t,e,r,n,i,o){const s={method:r_.Web3Method.addEthereumChain,params:{chainId:t,rpcUrls:e,blockExplorerUrls:n,chainName:i,iconUrls:r,nativeCurrency:o}};let a=null;const u=(0,Kv.randomBytesHex)(8),c=t=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,s.method,t),null==a||a()};this.ui.inlineAddEthereumChain(t)||(a=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:c,onResetConnection:this.resetAndReload}));return{promise:new Promise(((e,r)=>{this.relayEventManager.callbacks.set(u,(t=>{if(null==a||a(),t.errorMessage)return r(new Error(t.errorMessage));e(t)}));const n=t=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:u,response:(0,o_.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},i=t=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:u,response:(0,o_.AddEthereumChainResponse)({isApproved:!0,rpcUrl:t})}))};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:n,onApprove:i,chainId:s.params.chainId,rpcUrls:s.params.rpcUrls,blockExplorerUrls:s.params.blockExplorerUrls,chainName:s.params.chainName,iconUrls:s.params.iconUrls,nativeCurrency:s.params.nativeCurrency}),this.ui.inlineAddEthereumChain(t)||this.ui.isStandalone()||this.publishWeb3RequestEvent(u,s)})),cancel:c}}switchEthereumChain(t,e){const r={method:r_.Web3Method.switchEthereumChain,params:Object.assign({chainId:t},{address:e})},n=(0,Kv.randomBytesHex)(8);return{promise:new Promise(((t,e)=>{this.relayEventManager.callbacks.set(n,(r=>r.errorMessage&&r.errorCode?e(qv.ethErrors.provider.custom({code:r.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):r.errorMessage?e(new Error(r.errorMessage)):void t(r)));this.ui.switchEthereumChain({onCancel:t=>{if("number"==typeof t){const e=t;this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:n,response:(0,o_.ErrorResponse)(r_.Web3Method.switchEthereumChain,Qv.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,e)}))}else t instanceof Qv.WalletUIError?this.handleErrorResponse(n,r_.Web3Method.switchEthereumChain,t,t.errorCode):this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:n,response:(0,o_.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:t=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:n,response:(0,o_.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:t})}))},chainId:r.params.chainId,address:r.params.address}),this.ui.inlineSwitchEthereumChain()||this.ui.isStandalone()||this.publishWeb3RequestEvent(n,r)})),cancel:t=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,t)}}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return t_.Session.hash(this._session.id)}sendRequestStandalone(t,e){const r=r=>{this.handleErrorResponse(t,e.method,r)},n=e=>{this.handleWeb3ResponseMessage((0,s_.Web3ResponseMessage)({id:t,response:e}))};switch(e.method){case r_.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:e,onSuccess:n,onCancel:r});break;case r_.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:e,onSuccess:n,onCancel:r});break;case r_.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:e,onSuccess:n,onCancel:r});break;case r_.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:e,onSuccess:n});break;default:r()}}onSessionConfigChanged(t){}}a_.accountRequestCallbackIds=new Set,Vv([zv.default],a_.prototype,"resetAndReload",null),Vv([zv.default],a_.prototype,"handleIncomingEvent",null),bb.WalletSDKRelay=a_;var u_={};Object.defineProperty(u_,"__esModule",{value:!0}),u_.WalletSDKRelayEventManager=void 0;const c_=le;u_.WalletSDKRelayEventManager=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,e=(0,c_.prepend0x)(t.toString(16));return this.callbacks.get(e)&&this.callbacks.delete(e),t}};var l_="3.6.6";Object.defineProperty(h,"__esModule",{value:!0}),h.CoinbaseWalletSDK=void 0;const h_=d,d_=f,f_=p,p_=Al,g_=bb,b_=u_,y_=le,m_=process.env.LINK_API_URL||"https://www.walletlink.org",v_=process.env.SDK_VERSION||l_||"unknown";class __{constructor(t){var e,r,n;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const i=t.linkAPIUrl||m_;let o;if(o=t.uiConstructor?t.uiConstructor:t=>new p_.WalletSDKUI(t),void 0===t.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(e=t.overrideIsCoinbaseWallet)||void 0===e||e,this._overrideIsCoinbaseBrowser=null!==(r=t.overrideIsCoinbaseBrowser)&&void 0!==r&&r,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=null===(n=t.reloadOnDisconnect)||void 0===n||n;const s=new URL(i),a=`${s.protocol}//${s.host}`;this._storage=new d_.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",__.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new b_.WalletSDKRelayEventManager,this._relay=new g_.WalletSDKRelay({linkAPIUrl:i,version:v_,darkMode:!!t.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(t.appName,t.appLogoUrl),t.headlessMode||this._relay.attachUI())}makeWeb3Provider(t="",e=1){const r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(t,e),!1===this._reloadOnDisconnect&&"function"==typeof r.disableReloadOnDisconnect&&r.disableReloadOnDisconnect(),r;const n=this.coinbaseBrowser;if(n)return n;const i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||i.setConnectDisabled(!0),new f_.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(i),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:e,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,e){var r;this._appName=t||"DApp",this._appLogoUrl=e||(0,y_.getFavicon)();const n=this.walletExtension;n?this.isCipherProvider(n)||n.setAppInfo(this._appName,this._appLogoUrl):null===(r=this._relay)||void 0===r||r.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const e=this.walletExtension;e?e.close():null===(t=this._relay)||void 0===t||t.resetAndReload()}getQrUrl(){var t,e;return null!==(e=null===(t=this._relay)||void 0===t?void 0:t.getQRCodeUrl())&&void 0!==e?e:null}getCoinbaseWalletLogo(t,e=240){return(0,h_.walletLogo)(t,e)}get walletExtension(){var t;return null!==(t=window.coinbaseWalletExtension)&&void 0!==t?t:window.walletLinkExtension}get coinbaseBrowser(){var t,e;try{const r=null!==(t=window.ethereum)&&void 0!==t?t:null===(e=window.top)||void 0===e?void 0:e.ethereum;if(!r)return;return"isCoinbaseBrowser"in r&&r.isCoinbaseBrowser?r:void 0}catch(t){return}}isCipherProvider(t){return"boolean"==typeof t.isCipher&&t.isCipher}}h.CoinbaseWalletSDK=__,__.VERSION=v_,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=h,r=p;var n=h;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=p;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,"undefined"!=typeof window&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)}(l);var w_=t.getDefaultExportFromCjs(l);exports.default=function({chainId:e,rpcUrl:r,appName:n,appLogoUrl:i,darkMode:o},s){return t.__awaiter(this,void 0,void 0,(function*(){if(window.ethereum&&(window.ethereum.isWalletLink||window.ethereum.isToshi))return t.injectedConnect(window.ethereum,s);if(!n)throw new Error("walletLink need appName");const a=new w_({appName:n,appLogoUrl:i,darkMode:o}).makeWeb3Provider(r,e);return yield a.enable(),a.on("connect",s.connect),a.on("disconnect",s.disconnect),a.on("accountsChanged",s.accountsChanged),a.on("chainChanged",s.chainChanged),a.on("message",s.message),t.convertWeb3Provider(a)}))};