@credenza3/passport-evm 0.4.21 → 0.4.23

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 (75) hide show
  1. package/dist/{App-BpcMpO5f.js → App-D_8AiOD9.js} +20 -20
  2. package/dist/{App-BpcMpO5f.js.map → App-D_8AiOD9.js.map} +1 -1
  3. package/dist/{AssetItem-B0ofIyW5.js → AssetItem-MUjXhvaD.js} +2 -2
  4. package/dist/{AssetItem-B0ofIyW5.js.map → AssetItem-MUjXhvaD.js.map} +1 -1
  5. package/dist/{Assets-CwjAN6_1.js → Assets-BdfwK47L.js} +7 -7
  6. package/dist/{Assets-CwjAN6_1.js.map → Assets-BdfwK47L.js.map} +1 -1
  7. package/dist/{Button-C5AEb9bs.js → Button-C4zLgGnW.js} +4 -4
  8. package/dist/{Button-C5AEb9bs.js.map → Button-C4zLgGnW.js.map} +1 -1
  9. package/dist/{ButtonBack-D4Bthq_E.js → ButtonBack-HOPXdU9z.js} +4 -4
  10. package/dist/{ButtonBack-D4Bthq_E.js.map → ButtonBack-HOPXdU9z.js.map} +1 -1
  11. package/dist/{ButtonLink-BusrA_-2.js → ButtonLink-XnC4FRt-.js} +3 -3
  12. package/dist/{ButtonLink-BusrA_-2.js.map → ButtonLink-XnC4FRt-.js.map} +1 -1
  13. package/dist/{ConfirmAccount-G6yysOF4.js → ConfirmAccount-DT4gKsWB.js} +9 -9
  14. package/dist/{ConfirmAccount-G6yysOF4.js.map → ConfirmAccount-DT4gKsWB.js.map} +1 -1
  15. package/dist/{ContentHeader-C3SULqmh.js → ContentHeader-DwO5R4DF.js} +3 -3
  16. package/dist/{ContentHeader-C3SULqmh.js.map → ContentHeader-DwO5R4DF.js.map} +1 -1
  17. package/dist/{Error-DtODKu46.js → Error-6zDsb8hl.js} +5 -5
  18. package/dist/{Error-DtODKu46.js.map → Error-6zDsb8hl.js.map} +1 -1
  19. package/dist/{Input-CclKLI1x.js → Input-Te28W8Yh.js} +4 -4
  20. package/dist/{Input-CclKLI1x.js.map → Input-Te28W8Yh.js.map} +1 -1
  21. package/dist/{Label-CB-N5t4A.js → Label-B4ToSiTv.js} +3 -3
  22. package/dist/{Label-CB-N5t4A.js.map → Label-B4ToSiTv.js.map} +1 -1
  23. package/dist/{Loader-D-g5k50_.js → Loader-WsJ5p9AD.js} +3 -3
  24. package/dist/{Loader-D-g5k50_.js.map → Loader-WsJ5p9AD.js.map} +1 -1
  25. package/dist/{Login-xe6wzj-g.js → Login-lj00714r.js} +10 -10
  26. package/dist/{Login-xe6wzj-g.js.map → Login-lj00714r.js.map} +1 -1
  27. package/dist/{Logout-DlYT-b-N.js → Logout-uGLbDLwA.js} +6 -6
  28. package/dist/{Logout-DlYT-b-N.js.map → Logout-uGLbDLwA.js.map} +1 -1
  29. package/dist/{Nav-CDhcD10P.js → Nav-DIbNENOy.js} +6 -6
  30. package/dist/{Nav-CDhcD10P.js.map → Nav-DIbNENOy.js.map} +1 -1
  31. package/dist/{NavMenu-DivcSnc8.js → NavMenu-DF2klVvr.js} +5 -5
  32. package/dist/{NavMenu-DivcSnc8.js.map → NavMenu-DF2klVvr.js.map} +1 -1
  33. package/dist/{PassportId-BGafLUDX.js → PassportId-DFq0kTjP.js} +6 -6
  34. package/dist/{PassportId-BGafLUDX.js.map → PassportId-DFq0kTjP.js.map} +1 -1
  35. package/dist/{Payment-BnfOGIJ0.js → Payment-BoS-CrfL.js} +11 -11
  36. package/dist/Payment-BoS-CrfL.js.map +1 -0
  37. package/dist/{PaymentResult-DTIhqxfm.js → PaymentResult-CW-nSTdR.js} +4 -4
  38. package/dist/{PaymentResult-DTIhqxfm.js.map → PaymentResult-CW-nSTdR.js.map} +1 -1
  39. package/dist/{Profile-CKEg_wd-.js → Profile-CsxAPSvJ.js} +7 -7
  40. package/dist/{Profile-CKEg_wd-.js.map → Profile-CsxAPSvJ.js.map} +1 -1
  41. package/dist/{ProgressVideo-CNf0dRso.js → ProgressVideo-Blcd2dIu.js} +5 -5
  42. package/dist/{ProgressVideo-CNf0dRso.js.map → ProgressVideo-Blcd2dIu.js.map} +1 -1
  43. package/dist/{RichAlert-BdXiH4K4.js → RichAlert-RJY-mmzq.js} +5 -5
  44. package/dist/{RichAlert-BdXiH4K4.js.map → RichAlert-RJY-mmzq.js.map} +1 -1
  45. package/dist/{Scanner-CV93i6n6.js → Scanner-aHRCEivz.js} +6 -6
  46. package/dist/{Scanner-CV93i6n6.js.map → Scanner-aHRCEivz.js.map} +1 -1
  47. package/dist/{SendTokens-bzAePhXK.js → SendTokens-BxoegtHo.js} +7 -7
  48. package/dist/{SendTokens-bzAePhXK.js.map → SendTokens-BxoegtHo.js.map} +1 -1
  49. package/dist/{Sign-CeE8qZYP.js → Sign-CDJwMgJW.js} +6 -6
  50. package/dist/{Sign-CeE8qZYP.js.map → Sign-CDJwMgJW.js.map} +1 -1
  51. package/dist/{Stripe.service-Cgbvw9E4.js → Stripe.service-COUBWS4u.js} +3 -3
  52. package/dist/{Stripe.service-Cgbvw9E4.js.map → Stripe.service-COUBWS4u.js.map} +1 -1
  53. package/dist/{UpdateProfile-C065ZqNX.js → UpdateProfile-BZlflShR.js} +10 -10
  54. package/dist/{UpdateProfile-C065ZqNX.js.map → UpdateProfile-BZlflShR.js.map} +1 -1
  55. package/dist/{UserInfo-D5-aNsTW.js → UserInfo-UXypyimv.js} +4 -4
  56. package/dist/{UserInfo-D5-aNsTW.js.map → UserInfo-UXypyimv.js.map} +1 -1
  57. package/dist/{Wallet-Ba-n0eZO.js → Wallet-DtotVQMn.js} +7 -7
  58. package/dist/{Wallet-Ba-n0eZO.js.map → Wallet-DtotVQMn.js.map} +1 -1
  59. package/dist/{authMethods.helper-CJVll3mq.js → authMethods.helper-Dj-8KNPW.js} +2 -2
  60. package/dist/{authMethods.helper-CJVll3mq.js.map → authMethods.helper-Dj-8KNPW.js.map} +1 -1
  61. package/dist/{each-eR_yXHEA.js → each-BtNqAT2T.js} +2 -2
  62. package/dist/{each-eR_yXHEA.js.map → each-BtNqAT2T.js.map} +1 -1
  63. package/dist/{html-q56JXOcz.js → html-BdyEcZHZ.js} +3 -3
  64. package/dist/{html-q56JXOcz.js.map → html-BdyEcZHZ.js.map} +1 -1
  65. package/dist/{index-B7xlI3d8.js → index-DP6hVxgX.js} +5 -5
  66. package/dist/{index-B7xlI3d8.js.map → index-DP6hVxgX.js.map} +1 -1
  67. package/dist/{index-client-kg_uoj70.js → index-client-B5YbPsOl.js} +2 -2
  68. package/dist/{index-client-kg_uoj70.js.map → index-client-B5YbPsOl.js.map} +1 -1
  69. package/dist/{input-Bgl67y8N.js → input-B4Bg0SMs.js} +2 -2
  70. package/dist/{input-Bgl67y8N.js.map → input-B4Bg0SMs.js.map} +1 -1
  71. package/dist/passport.es.js +1 -1
  72. package/dist/passport.umd.js +3 -3
  73. package/dist/passport.umd.js.map +1 -1
  74. package/package.json +1 -1
  75. package/dist/Payment-BnfOGIJ0.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@import"https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap";.crdz-ui *,.crdz-ui :before,.crdz-ui :after{font-family:Poppins,serif;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}.crdz-ui :before,.crdz-ui :after{--tw-content: ""}.crdz-ui hr{height:0;color:inherit;border-top-width:1px}.crdz-ui abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.crdz-ui h1,.crdz-ui h2,.crdz-ui h3,.crdz-ui h4,.crdz-ui h5,.crdz-ui h6{font-size:inherit;font-weight:inherit}.crdz-ui a{color:inherit;text-decoration:inherit}.crdz-ui b,.crdz-ui strong{font-weight:bolder}.crdz-ui code,.crdz-ui kbd,.crdz-ui samp,.crdz-ui pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.crdz-ui small{font-size:80%}.crdz-ui sub,.crdz-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.crdz-ui sub{bottom:-.25em}.crdz-ui sup{top:-.5em}.crdz-ui table{text-indent:0;border-color:inherit;border-collapse:collapse}.crdz-ui button,.crdz-ui select{text-transform:none}.crdz-ui button,.crdz-ui [type=button],.crdz-ui [type=reset],.crdz-ui [type=submit]{font-size:100%;-webkit-appearance:button;background-image:none}.crdz-ui :-moz-focusring{outline:auto}.crdz-ui :-moz-ui-invalid{box-shadow:none}.crdz-ui progress{vertical-align:baseline}.crdz-ui ::-webkit-inner-spin-button,.crdz-ui ::-webkit-outer-spin-button{height:auto}.crdz-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.crdz-ui ::-webkit-search-decoration{-webkit-appearance:none}.crdz-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.crdz-ui summary{display:list-item}.crdz-ui blockquote,.crdz-ui dl,.crdz-ui dd,.crdz-ui h1,.crdz-ui h2,.crdz-ui h3,.crdz-ui h4,.crdz-ui h5,.crdz-ui h6,.crdz-ui hr,.crdz-ui figure,.crdz-ui p,.crdz-ui span,.crdz-ui label,.crdz-ui pre{margin:0;letter-spacing:normal!important}.crdz-ui label{text-transform:initial!important}.crdz-ui fieldset{margin:0;padding:0}.crdz-ui legend{padding:0}.crdz-ui ol,.crdz-ui ul,.crdz-ui menu{list-style:none;margin:0;padding:0}.crdz-ui dialog{padding:0}.crdz-ui textarea{resize:vertical}.crdz-ui input::-moz-placeholder,.crdz-ui textarea::-moz-placeholder{opacity:1;color:#9ca3af}.crdz-ui input::placeholder,.crdz-ui textarea::placeholder{opacity:1;color:#9ca3af}.crdz-ui button,.crdz-ui [role=button]{cursor:pointer}.crdz-ui :disabled{cursor:default}.crdz-ui img,.crdz-ui svg,.crdz-ui video,.crdz-ui canvas,.crdz-ui audio,.crdz-ui iframe,.crdz-ui embed,.crdz-ui object{display:block;vertical-align:middle;opacity:1}.crdz-ui [hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.crtw-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border-width:0!important}.crtw-pointer-events-none{pointer-events:none!important}.crtw-invisible{visibility:hidden!important}.crtw-fixed{position:fixed!important}.crtw-absolute{position:absolute!important}.crtw-relative{position:relative!important}.crtw-bottom-0{bottom:0!important}.crtw-left-0{left:0!important}.crtw-left-4{left:1rem!important}.crtw-right-0{right:0!important}.crtw-top-0{top:0!important}.crtw-top-4{top:1rem!important}.crtw-top-\\[8px\\]{top:8px!important}.crtw-z-10{z-index:10!important}.crtw-z-50{z-index:50!important}.crtw-z-\\[-1\\]{z-index:-1!important}.crtw-z-\\[1050\\]{z-index:1050!important}.crtw-float-right{float:right!important}.crtw-m-2{margin:.5rem!important}.crtw-m-3\\.5{margin:.875rem!important}.crtw-m-5{margin:1.25rem!important}.crtw-mx-1\\.5{margin-left:.375rem!important;margin-right:.375rem!important}.crtw-mx-4{margin-left:1rem!important;margin-right:1rem!important}.crtw-mx-\\[50px\\]{margin-left:50px!important;margin-right:50px!important}.crtw-mx-auto{margin-left:auto!important;margin-right:auto!important}.crtw-my-0{margin-top:0!important;margin-bottom:0!important}.crtw-my-0\\.5{margin-top:.125rem!important;margin-bottom:.125rem!important}.crtw-my-4{margin-top:1rem!important;margin-bottom:1rem!important}.crtw-my-5{margin-top:1.25rem!important;margin-bottom:1.25rem!important}.crtw-mb-1{margin-bottom:.25rem!important}.crtw-mb-1\\.5{margin-bottom:.375rem!important}.crtw-mb-2{margin-bottom:.5rem!important}.crtw-mb-2\\.5{margin-bottom:.625rem!important}.crtw-mb-3{margin-bottom:.75rem!important}.crtw-mb-3\\.5{margin-bottom:.875rem!important}.crtw-mb-4{margin-bottom:1rem!important}.crtw-mb-5{margin-bottom:1.25rem!important}.crtw-mb-6{margin-bottom:1.5rem!important}.crtw-mb-9{margin-bottom:2.25rem!important}.crtw-mb-\\[100px\\]{margin-bottom:100px!important}.crtw-mb-\\[15px\\]{margin-bottom:15px!important}.crtw-ml-1{margin-left:.25rem!important}.crtw-ml-1\\.5{margin-left:.375rem!important}.crtw-ml-2\\.5{margin-left:.625rem!important}.crtw-mr-0\\.5{margin-right:.125rem!important}.crtw-mr-1\\.5{margin-right:.375rem!important}.crtw-mr-14{margin-right:3.5rem!important}.crtw-mr-2{margin-right:.5rem!important}.crtw-mt-0\\.5{margin-top:.125rem!important}.crtw-mt-1{margin-top:.25rem!important}.crtw-mt-1\\.5{margin-top:.375rem!important}.crtw-mt-2\\.5{margin-top:.625rem!important}.crtw-mt-3\\.5{margin-top:.875rem!important}.crtw-mt-4{margin-top:1rem!important}.crtw-mt-6{margin-top:1.5rem!important}.crtw-mt-9{margin-top:2.25rem!important}.crtw-mt-\\[-10px\\]{margin-top:-10px!important}.crtw-mt-\\[10px\\]{margin-top:10px!important}.crtw-mt-\\[30px\\]{margin-top:30px!important}.crtw-mt-\\[36px\\]{margin-top:36px!important}.crtw-mt-\\[5px\\]{margin-top:5px!important}.crtw-box-border{box-sizing:border-box!important}.crtw-block{display:block!important}.crtw-flex{display:flex!important}.crtw-inline-flex{display:inline-flex!important}.crtw-hidden{display:none!important}.crtw-aspect-square{aspect-ratio:1 / 1!important}.crtw-h-1\\.5{height:.375rem!important}.crtw-h-11{height:2.75rem!important}.crtw-h-3{height:.75rem!important}.crtw-h-4{height:1rem!important}.crtw-h-6{height:1.5rem!important}.crtw-h-64{height:16rem!important}.crtw-h-7{height:1.75rem!important}.crtw-h-8{height:2rem!important}.crtw-h-9{height:2.25rem!important}.crtw-h-\\[120px\\]{height:120px!important}.crtw-h-\\[30px\\]{height:30px!important}.crtw-h-\\[50px\\]{height:50px!important}.crtw-h-\\[53px\\]{height:53px!important}.crtw-h-auto{height:auto!important}.crtw-h-full{height:100%!important}.crtw-max-h-full{max-height:100%!important}.crtw-min-h-\\[155px\\]{min-height:155px!important}.crtw-min-h-screen{min-height:100vh!important}.crtw-w-1\\.5{width:.375rem!important}.crtw-w-1\\/2{width:50%!important}.crtw-w-11{width:2.75rem!important}.crtw-w-16{width:4rem!important}.crtw-w-4{width:1rem!important}.crtw-w-40{width:10rem!important}.crtw-w-56{width:14rem!important}.crtw-w-6{width:1.5rem!important}.crtw-w-64{width:16rem!important}.crtw-w-8{width:2rem!important}.crtw-w-\\[110px\\]{width:110px!important}.crtw-w-\\[200px\\]{width:200px!important}.crtw-w-\\[70px\\]{width:70px!important}.crtw-w-\\[90px\\]{width:90px!important}.crtw-w-full{width:100%!important}.crtw-min-w-16{min-width:4rem!important}.crtw-max-w-\\[120px\\]{max-width:120px!important}.crtw-max-w-\\[30px\\]{max-width:30px!important}.crtw-max-w-\\[380px\\]{max-width:380px!important}.crtw-max-w-full{max-width:100%!important}.crtw-max-w-xs{max-width:20rem!important}.crtw-flex-1{flex:1 1 0%!important}.crtw-flex-shrink{flex-shrink:1!important}.crtw-flex-shrink-0{flex-shrink:0!important}.crtw-flex-grow{flex-grow:1!important}@keyframes crtw-spin{to{transform:rotate(360deg)}}.crtw-animate-spin{animation:crtw-spin 1s linear infinite!important}.crtw-cursor-pointer{cursor:pointer!important}.crtw-appearance-none{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important}.crtw-flex-row{flex-direction:row!important}.crtw-flex-col{flex-direction:column!important}.crtw-flex-wrap{flex-wrap:wrap!important}.crtw-items-start{align-items:flex-start!important}.crtw-items-center{align-items:center!important}.crtw-justify-start{justify-content:flex-start!important}.crtw-justify-center{justify-content:center!important}.crtw-justify-between{justify-content:space-between!important}.crtw-justify-items-center{justify-items:center!important}.crtw-gap-10{gap:2.5rem!important}.crtw-gap-14{gap:3.5rem!important}.crtw-gap-2{gap:.5rem!important}.crtw-gap-2\\.5{gap:.625rem!important}.crtw-gap-3{gap:.75rem!important}.crtw-gap-4{gap:1rem!important}.crtw-gap-6{gap:1.5rem!important}.crtw-gap-9{gap:2.25rem!important}.crtw-gap-\\[22px\\]{gap:22px!important}.crtw-gap-\\[6px\\]{gap:6px!important}.crtw-space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.25rem * var(--tw-space-y-reverse))!important}.crtw-overflow-hidden{overflow:hidden!important}.crtw-overflow-y-scroll{overflow-y:scroll!important}.crtw-whitespace-normal{white-space:normal!important}.crtw-break-words{overflow-wrap:break-word!important}.crtw-break-all{word-break:break-all!important}.crtw-rounded{border-radius:.25rem!important}.crtw-rounded-\\[10px\\]{border-radius:10px!important}.crtw-rounded-\\[3px\\]{border-radius:3px!important}.crtw-rounded-full{border-radius:9999px!important}.crtw-rounded-lg{border-radius:.5rem!important}.crtw-rounded-md{border-radius:.375rem!important}.crtw-rounded-sm{border-radius:.125rem!important}.crtw-rounded-xl{border-radius:.75rem!important}.crtw-border{border-width:1px!important}.crtw-border-0{border-width:0px!important}.crtw-border-2{border-width:2px!important}.crtw-border-t{border-top-width:1px!important}.crtw-border-t-2{border-top-width:2px!important}.crtw-border-\\[\\#990008\\]{--tw-border-opacity: 1 !important;border-color:rgb(153 0 8 / var(--tw-border-opacity, 1))!important}.crtw-border-\\[\\#d9d9d9\\]{--tw-border-opacity: 1 !important;border-color:rgb(217 217 217 / var(--tw-border-opacity, 1))!important}.crtw-border-black{--tw-border-opacity: 1 !important;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))!important}.crtw-border-blue-800{--tw-border-opacity: 1 !important;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))!important}.crtw-border-gray-200{--tw-border-opacity: 1 !important;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))!important}.crtw-border-gray-300{--tw-border-opacity: 1 !important;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))!important}.crtw-border-gray-400{--tw-border-opacity: 1 !important;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))!important}.crtw-border-gray-700{--tw-border-opacity: 1 !important;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))!important}.crtw-bg-\\[\\#B4A7D6\\]{--tw-bg-opacity: 1 !important;background-color:rgb(180 167 214 / var(--tw-bg-opacity, 1))!important}.crtw-bg-black{--tw-bg-opacity: 1 !important;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))!important}.crtw-bg-black\\/70{background-color:#000000b3!important}.crtw-bg-gray-200{--tw-bg-opacity: 1 !important;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))!important}.crtw-bg-gray-300{--tw-bg-opacity: 1 !important;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))!important}.crtw-bg-green-500{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))!important}.crtw-bg-red-500{--tw-bg-opacity: 1 !important;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))!important}.crtw-bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))!important}.crtw-fill-black{fill:#000!important}.crtw-fill-red-500{fill:#ef4444!important}.crtw-object-cover{-o-object-fit:cover!important;object-fit:cover!important}.crtw-p-0{padding:0!important}.crtw-p-2{padding:.5rem!important}.crtw-p-2\\.5{padding:.625rem!important}.crtw-p-px{padding:1px!important}.crtw-px-0{padding-left:0!important;padding-right:0!important}.crtw-px-0\\.5{padding-left:.125rem!important;padding-right:.125rem!important}.crtw-px-2{padding-left:.5rem!important;padding-right:.5rem!important}.crtw-px-2\\.5{padding-left:.625rem!important;padding-right:.625rem!important}.crtw-px-4{padding-left:1rem!important;padding-right:1rem!important}.crtw-px-5{padding-left:1.25rem!important;padding-right:1.25rem!important}.crtw-px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.crtw-px-\\[22px\\]{padding-left:22px!important;padding-right:22px!important}.crtw-px-\\[36px\\]{padding-left:36px!important;padding-right:36px!important}.crtw-py-0{padding-top:0!important;padding-bottom:0!important}.crtw-py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.crtw-py-2\\.5{padding-top:.625rem!important;padding-bottom:.625rem!important}.crtw-py-3{padding-top:.75rem!important;padding-bottom:.75rem!important}.crtw-py-4{padding-top:1rem!important;padding-bottom:1rem!important}.crtw-pb-2{padding-bottom:.5rem!important}.crtw-pb-9{padding-bottom:2.25rem!important}.crtw-pl-5{padding-left:1.25rem!important}.crtw-pr-1\\.5{padding-right:.375rem!important}.crtw-pr-5{padding-right:1.25rem!important}.crtw-pt-11{padding-top:2.75rem!important}.crtw-pt-4{padding-top:1rem!important}.crtw-pt-5{padding-top:1.25rem!important}.crtw-pt-\\[3px\\]{padding-top:3px!important}.crtw-text-left{text-align:left!important}.crtw-text-center{text-align:center!important}.crtw-text-right{text-align:right!important}.crtw-text-justify{text-align:justify!important}.crtw-align-top{vertical-align:top!important}.crtw-font-\\[\\'Poppins\\'\\]{font-family:Poppins!important}.crtw-font-\\[\\'poppins\\'\\],.crtw-font-\\[poppins\\]{font-family:poppins!important}.crtw-text-2xl{font-size:1.5rem!important;line-height:2rem!important}.crtw-text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.crtw-text-\\[10px\\]{font-size:10px!important}.crtw-text-\\[13px\\]{font-size:13px!important}.crtw-text-\\[21px\\]{font-size:21px!important}.crtw-text-\\[24px\\]{font-size:24px!important}.crtw-text-\\[9px\\]{font-size:9px!important}.crtw-text-base{font-size:1rem!important;line-height:1.5rem!important}.crtw-text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.crtw-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.crtw-text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.crtw-text-xs{font-size:.75rem!important;line-height:1rem!important}.crtw-font-bold{font-weight:700!important}.crtw-font-medium{font-weight:500!important}.crtw-font-semibold{font-weight:600!important}.crtw-uppercase{text-transform:uppercase!important}.crtw-leading-tight{line-height:1.25!important}.crtw-text-\\[\\#121e2b\\]{--tw-text-opacity: 1 !important;color:rgb(18 30 43 / var(--tw-text-opacity, 1))!important}.crtw-text-\\[\\#313a2c\\]{--tw-text-opacity: 1 !important;color:rgb(49 58 44 / var(--tw-text-opacity, 1))!important}.crtw-text-\\[\\#747474\\]{--tw-text-opacity: 1 !important;color:rgb(116 116 116 / var(--tw-text-opacity, 1))!important}.crtw-text-\\[\\#990008\\]{--tw-text-opacity: 1 !important;color:rgb(153 0 8 / var(--tw-text-opacity, 1))!important}.crtw-text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity, 1))!important}.crtw-text-blue-600{--tw-text-opacity: 1 !important;color:rgb(37 99 235 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-400{--tw-text-opacity: 1 !important;color:rgb(156 163 175 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-600{--tw-text-opacity: 1 !important;color:rgb(75 85 99 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-700{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-800{--tw-text-opacity: 1 !important;color:rgb(31 41 55 / var(--tw-text-opacity, 1))!important}.crtw-text-gray-900{--tw-text-opacity: 1 !important;color:rgb(17 24 39 / var(--tw-text-opacity, 1))!important}.crtw-text-hightlightColor{--tw-text-opacity: 1 !important;color:rgb(11 114 224 / var(--tw-text-opacity, 1))!important}.crtw-text-red-500{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1))!important}.crtw-text-red-600{--tw-text-opacity: 1 !important;color:rgb(220 38 38 / var(--tw-text-opacity, 1))!important}.crtw-text-stone-200{--tw-text-opacity: 1 !important;color:rgb(231 229 228 / var(--tw-text-opacity, 1))!important}.crtw-text-textMain{--tw-text-opacity: 1 !important;color:rgb(31 31 31 / var(--tw-text-opacity, 1))!important}.crtw-text-warningTextColor{--tw-text-opacity: 1 !important;color:rgb(153 0 8 / var(--tw-text-opacity, 1))!important}.crtw-text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.crtw-underline{text-decoration-line:underline!important}.crtw-no-underline{text-decoration-line:none!important}.crtw-placeholder-\\[\\#d9d9d9\\]::-moz-placeholder{--tw-placeholder-opacity: 1 !important;color:rgb(217 217 217 / var(--tw-placeholder-opacity, 1))!important}.crtw-placeholder-\\[\\#d9d9d9\\]::placeholder{--tw-placeholder-opacity: 1 !important;color:rgb(217 217 217 / var(--tw-placeholder-opacity, 1))!important}.crtw-shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.crtw-outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.crtw-backdrop-blur-lg{--tw-backdrop-blur: blur(16px) !important;-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important;backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important}.crtw-backdrop-blur-md{--tw-backdrop-blur: blur(12px) !important;-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important;backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)!important}.crtw-transition-all{transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.crtw-duration-200{transition-duration:.2s!important}.first\\:crtw-rounded-l:first-child{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.last\\:crtw-rounded-r:last-child{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.hover\\:crtw-bg-gray-100:hover{--tw-bg-opacity: 1 !important;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))!important}.hover\\:crtw-bg-gray-800:hover{--tw-bg-opacity: 1 !important;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))!important}.hover\\:crtw-text-blue-800:hover{--tw-text-opacity: 1 !important;color:rgb(30 64 175 / var(--tw-text-opacity, 1))!important}.focus\\:crtw-border-\\[\\#121e2b\\]:focus{--tw-border-opacity: 1 !important;border-color:rgb(18 30 43 / var(--tw-border-opacity, 1))!important}.focus\\:crtw-border-\\[\\#990008\\]:focus{--tw-border-opacity: 1 !important;border-color:rgb(153 0 8 / var(--tw-border-opacity, 1))!important}.focus\\:crtw-border-blue-800:focus{--tw-border-opacity: 1 !important;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))!important}.focus\\:crtw-border-blue-900:focus{--tw-border-opacity: 1 !important;border-color:rgb(30 58 138 / var(--tw-border-opacity, 1))!important}.focus\\:crtw-text-blue-900:focus{--tw-text-opacity: 1 !important;color:rgb(30 58 138 / var(--tw-text-opacity, 1))!important}.focus\\:crtw-outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.focus\\:crtw-outline-0:focus{outline-width:0px!important}.disabled\\:crtw-bg-\\[\\#d9d9d9\\]:disabled{--tw-bg-opacity: 1 !important;background-color:rgb(217 217 217 / var(--tw-bg-opacity, 1))!important}.crtw-group:hover .group-hover\\:crtw-visible{visibility:visible!important}@media(min-width:640px){.sm\\:crtw-m-4{margin:1rem!important}.sm\\:crtw-mb-px{margin-bottom:1px!important}.sm\\:crtw-max-w-\\[360px\\]{max-width:360px!important}.sm\\:crtw-max-w-md{max-width:28rem!important}.sm\\:crtw-px-1\\.5{padding-left:.375rem!important;padding-right:.375rem!important}.sm\\:crtw-pt-2{padding-top:.5rem!important}.sm\\:crtw-pt-\\[50px\\]{padding-top:50px!important}.sm\\:crtw-text-2xl{font-size:1.5rem!important;line-height:2rem!important}.sm\\:crtw-text-\\[11px\\]{font-size:11px!important}.sm\\:crtw-text-base{font-size:1rem!important;line-height:1.5rem!important}.sm\\:crtw-text-sm{font-size:.875rem!important;line-height:1.25rem!important}}@media(min-width:768px){.md\\:crtw-text-2xl{font-size:1.5rem!important;line-height:2rem!important}}@media(min-height:650px){.sm-tall\\:crtw-max-h-\\[650px\\]{max-height:650px!important}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- (function(Df,j3){typeof exports=="object"&&typeof module<"u"?j3(exports):typeof define=="function"&&define.amd?define(["exports"],j3):(Df=typeof globalThis<"u"?globalThis:Df||self,j3(Df.CredenzaPassport={}))})(this,(function(Df){"use strict";const KW={version:"0.4.21"},Jw=!1;var Yw=Array.isArray,XW=Array.prototype.indexOf,Ff=Array.prototype.includes,G3=Array.from,Kw=Object.defineProperty,Lf=Object.getOwnPropertyDescriptor,$T=Object.getOwnPropertyDescriptors,qW=Object.prototype,ej=Array.prototype,Xw=Object.getPrototypeOf,QT=Object.isExtensible;const au=()=>{};function JT(t){return typeof t?.then=="function"}function tj(t){return t()}function z3(t){for(var e=0;e<t.length;e++)t[e]()}function YT(){var t,e,r=new Promise((n,i)=>{t=n,e=i});return{promise:r,resolve:t,reject:e}}function rj(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const r=[];for(const n of t)if(r.push(n),r.length===e)break;return r}const Ki=2,Z3=4,Ip=8,qw=1<<24,Kc=16,ya=32,kh=64,e8=128,Do=512,Oi=1024,Xi=2048,Fo=4096,lo=8192,Xc=16384,$3=32768,_h=65536,KT=1<<17,XT=1<<18,Vf=1<<19,qT=1<<20,qc=1<<25,Ih=32768,t8=1<<21,r8=1<<22,cu=1<<23,lu=Symbol("$state"),eS=Symbol("legacy props"),nj=Symbol(""),Hf=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Rp=3,Rh=8;function tS(t){return t===this.v}function rS(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function nS(t){return!rS(t,this.v)}function iS(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ij(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function sj(t,e,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function oj(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function aj(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function cj(t){throw new Error("https://svelte.dev/e/effect_orphan")}function lj(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function uj(){throw new Error("https://svelte.dev/e/hydration_failed")}function hj(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function dj(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function fj(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function pj(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function gj(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}let Wf=!1,mj=!1;function yj(){Wf=!0}const wj=1,vj=2,sS=4,bj=8,Aj=16,Ej=1,Tj=2,oS=4,Sj=8,Cj=16,kj=1,_j=2,n8="[",Np="[!",i8="]",Nh={},xi=Symbol(),Ij="http://www.w3.org/1999/xhtml",Rj="@attach";let Zn=null;function jf(t){Zn=t}function Ut(t,e=!1,r){Zn={p:Zn,i:!1,c:null,e:null,s:t,x:null,l:Wf&&!e?{s:null,u:null,$:[]}:null}}function Dt(t){var e=Zn,r=e.e;if(r!==null){e.e=null;for(var n of r)jS(n)}return t!==void 0&&(e.x=t),e.i=!0,Zn=e.p,t??{}}function Gf(){return!Wf||Zn!==null&&Zn.l===null}let Oh=[];function aS(){var t=Oh;Oh=[],z3(t)}function wa(t){if(Oh.length===0&&!Zf){var e=Oh;queueMicrotask(()=>{e===Oh&&aS()})}Oh.push(t)}function Nj(){for(;Oh.length>0;)aS()}function Op(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function Oj(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function xj(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let gr=!1;function Qs(t){gr=t}let Zr;function qi(t){if(t===null)throw Op(),Nh;return Zr=t}function el(){return qi(ba(Zr))}function Je(t){if(gr){if(ba(Zr)!==null)throw Op(),Nh;Zr=t}}function Pi(t=1){if(gr){for(var e=t,r=Zr;e--;)r=ba(r);Zr=r}}function xp(t=!0){for(var e=0,r=Zr;;){if(r.nodeType===Rh){var n=r.data;if(n===i8){if(e===0)return r;e-=1}else(n===n8||n===Np||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var i=ba(r);t&&r.remove(),r=i}}function cS(t){if(!t||t.nodeType!==Rh)throw Op(),Nh;return t.data}function xh(t){if(typeof t!="object"||t===null||lu in t)return t;const e=Xw(t);if(e!==qW&&e!==ej)return t;var r=new Map,n=Yw(t),i=Ta(0),s=Mh,o=a=>{if(Mh===s)return a();var l=$r,u=Mh;Lo(null),US(s);var d=a();return Lo(l),US(u),d};return n&&r.set("length",Ta(t.length)),new Proxy(t,{defineProperty(a,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&dj();var d=r.get(l);return d===void 0?o(()=>{var f=Ta(u.value);return r.set(l,f),f}):Ye(d,u.value,!0),!0},deleteProperty(a,l){var u=r.get(l);if(u===void 0){if(l in a){const d=o(()=>Ta(xi));r.set(l,d),Mp(i)}}else Ye(u,xi),Mp(i);return!0},get(a,l,u){if(l===lu)return t;var d=r.get(l),f=l in a;if(d===void 0&&(!f||Lf(a,l)?.writable)&&(d=o(()=>{var m=xh(f?a[l]:xi),v=Ta(m);return v}),r.set(l,d)),d!==void 0){var g=ae(d);return g===xi?void 0:g}return Reflect.get(a,l,u)},getOwnPropertyDescriptor(a,l){var u=Reflect.getOwnPropertyDescriptor(a,l);if(u&&"value"in u){var d=r.get(l);d&&(u.value=ae(d))}else if(u===void 0){var f=r.get(l),g=f?.v;if(f!==void 0&&g!==xi)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return u},has(a,l){if(l===lu)return!0;var u=r.get(l),d=u!==void 0&&u.v!==xi||Reflect.has(a,l);if(u!==void 0||Hr!==null&&(!d||Lf(a,l)?.writable)){u===void 0&&(u=o(()=>{var g=d?xh(a[l]):xi,m=Ta(g);return m}),r.set(l,u));var f=ae(u);if(f===xi)return!1}return d},set(a,l,u,d){var f=r.get(l),g=l in a;if(n&&l==="length")for(var m=u;m<f.v;m+=1){var v=r.get(m+"");v!==void 0?Ye(v,xi):m in a&&(v=o(()=>Ta(xi)),r.set(m+"",v))}if(f===void 0)(!g||Lf(a,l)?.writable)&&(f=o(()=>Ta(void 0)),Ye(f,xh(u)),r.set(l,f));else{g=f.v!==xi;var A=o(()=>xh(u));Ye(f,A)}var E=Reflect.getOwnPropertyDescriptor(a,l);if(E?.set&&E.set.call(d,u),!g){if(n&&typeof l=="string"){var C=r.get("length"),k=Number(l);Number.isInteger(k)&&k>=C.v&&Ye(C,k+1)}Mp(i)}return!0},ownKeys(a){ae(i);var l=Reflect.ownKeys(a).filter(f=>{var g=r.get(f);return g===void 0||g.v!==xi});for(var[u,d]of r)d.v!==xi&&!(u in a)&&l.push(u);return l},setPrototypeOf(){fj()}})}function lS(t){try{if(t!==null&&typeof t=="object"&&lu in t)return t[lu]}catch{}return t}function Pj(t,e){return Object.is(lS(t),lS(e))}var uS,hS,dS,fS;function s8(){if(uS===void 0){uS=window,hS=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;dS=Lf(e,"firstChild").get,fS=Lf(e,"nextSibling").get,QT(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),QT(r)&&(r.__t=void 0)}}function Js(t=""){return document.createTextNode(t)}function va(t){return dS.call(t)}function ba(t){return fS.call(t)}function Xe(t,e){if(!gr)return va(t);var r=va(Zr);if(r===null)r=Zr.appendChild(Js());else if(e&&r.nodeType!==Rp){var n=Js();return r?.before(n),qi(n),n}return e&&Q3(r),qi(r),r}function It(t,e=!1){if(!gr){var r=va(t);return r instanceof Comment&&r.data===""?ba(r):r}if(e){if(Zr?.nodeType!==Rp){var n=Js();return Zr?.before(n),qi(n),n}Q3(Zr)}return Zr}function tt(t,e=1,r=!1){let n=gr?Zr:t;for(var i;e--;)i=n,n=ba(n);if(!gr)return n;if(r){if(n?.nodeType!==Rp){var s=Js();return n===null?i?.after(s):n.before(s),qi(s),s}Q3(n)}return qi(n),n}function pS(t){t.textContent=""}function gS(){return!1}function Q3(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===Rp;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function mS(t){var e=Hr;if(e===null)return $r.f|=cu,t;if((e.f&$3)===0){if((e.f&e8)===0)throw t;e.b.error(t)}else zf(t,e)}function zf(t,e){for(;e!==null;){if((e.f&e8)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t}const Mj=-7169;function ti(t,e){t.f=t.f&Mj|e}function o8(t){(t.f&Do)!==0||t.deps===null?ti(t,Oi):ti(t,Fo)}function yS(t){if(t!==null)for(const e of t)(e.f&Ki)===0||(e.f&Ih)===0||(e.f^=Ih,yS(e.deps))}function wS(t,e,r){(t.f&Xi)!==0?e.add(t):(t.f&Fo)!==0&&r.add(t),yS(t.deps),ti(t,Oi)}const J3=new Set;let pn=null,a8=null,Aa=null,Ys=[],Y3=null,c8=!1,Zf=!1;class tl{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#o=0;#a=null;#i=new Set;#n=new Set;#s=new Map;is_fork=!1;#c=!1;is_deferred(){return this.is_fork||this.#o>0}skip_effect(e){this.#s.has(e)||this.#s.set(e,{d:[],m:[]})}unskip_effect(e){var r=this.#s.get(e);if(r){this.#s.delete(e);for(var n of r.d)ti(n,Xi),Ea(n);for(n of r.m)ti(n,Fo),Ea(n)}}process(e){Ys=[],this.apply();var r=[],n=[];for(const i of e)this.#l(i,r,n);if(this.is_deferred()){this.#h(n),this.#h(r);for(const[i,s]of this.#s)TS(i,s)}else{for(const i of this.#e)i();this.#e.clear(),this.#r===0&&this.#u(),a8=this,pn=null,bS(n),bS(r),a8=null,this.#a?.resolve()}Aa=null}#l(e,r,n){e.f^=Oi;for(var i=e.first,s=null;i!==null;){var o=i.f,a=(o&(ya|kh))!==0,l=a&&(o&Oi)!==0,u=l||(o&lo)!==0||this.#s.has(i);if(!u&&i.fn!==null){a?i.f^=Oi:s!==null&&(o&(Z3|Ip|qw))!==0?s.b.defer_effect(i):(o&Z3)!==0?r.push(i):$f(i)&&((o&Kc)!==0&&this.#n.add(i),Qf(i));var d=i.first;if(d!==null){i=d;continue}}var f=i.parent;for(i=i.next;i===null&&f!==null;)f===s&&(s=null),i=f.next,f=f.parent}}#h(e){for(var r=0;r<e.length;r+=1)wS(e[r],this.#i,this.#n)}capture(e,r){r!==xi&&!this.previous.has(e)&&this.previous.set(e,r),(e.f&cu)===0&&(this.current.set(e,e.v),Aa?.set(e,e.v))}activate(){pn=this,this.apply()}deactivate(){pn===this&&(pn=null,Aa=null)}flush(){if(this.activate(),Ys.length>0){if(vS(),pn!==null&&pn!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const e of this.#t)e(this);this.#t.clear()}#u(){if(J3.size>1){this.previous.clear();var e=Aa,r=!0;for(const i of J3){if(i===this){r=!1;continue}const s=[];for(const[a,l]of this.current){if(i.current.has(a))if(r&&l!==i.current.get(a))i.current.set(a,l);else continue;s.push(a)}if(s.length===0)continue;const o=[...i.current.keys()].filter(a=>!this.current.has(a));if(o.length>0){var n=Ys;Ys=[];const a=new Set,l=new Map;for(const u of s)AS(u,o,a,l);if(Ys.length>0){pn=i,i.apply();for(const u of Ys)i.#l(u,[],[]);i.deactivate()}Ys=n}}pn=null,Aa=e}this.committed=!0,J3.delete(this)}increment(e){this.#r+=1,e&&(this.#o+=1)}decrement(e){this.#r-=1,e&&(this.#o-=1),!this.#c&&(this.#c=!0,wa(()=>{this.#c=!1,this.is_deferred()?Ys.length>0&&this.flush():this.revive()}))}revive(){for(const e of this.#i)this.#n.delete(e),ti(e,Xi),Ea(e);for(const e of this.#n)ti(e,Fo),Ea(e);this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#a??=YT()).promise}static ensure(){if(pn===null){const e=pn=new tl;J3.add(pn),Zf||wa(()=>{pn===e&&e.flush()})}return pn}apply(){}}function pt(t){var e=Zf;Zf=!0;try{for(var r;;){if(Nj(),Ys.length===0&&(pn?.flush(),Ys.length===0))return Y3=null,r;vS()}}finally{Zf=e}}function vS(){c8=!0;var t=null;try{for(var e=0;Ys.length>0;){var r=tl.ensure();if(e++>1e3){var n,i;Bj()}r.process(Ys),uu.clear()}}finally{Ys=[],c8=!1,Y3=null}}function Bj(){try{lj()}catch(t){zf(t,Y3)}}let rl=null;function bS(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(Xc|lo))===0&&$f(n)&&(rl=new Set,Qf(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?QS(n):n.fn=null),rl?.size>0)){uu.clear();for(const i of rl){if((i.f&(Xc|lo))!==0)continue;const s=[i];let o=i.parent;for(;o!==null;)rl.has(o)&&(rl.delete(o),s.push(o)),o=o.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Xc|lo))===0&&Qf(l)}}rl.clear()}}rl=null}}function AS(t,e,r,n){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const i of t.reactions){const s=i.f;(s&Ki)!==0?AS(i,e,r,n):(s&(r8|Kc))!==0&&(s&Xi)===0&&ES(i,e,n)&&(ti(i,Xi),Ea(i))}}function ES(t,e,r){const n=r.get(t);if(n!==void 0)return n;if(t.deps!==null)for(const i of t.deps){if(Ff.call(e,i))return!0;if((i.f&Ki)!==0&&ES(i,e,r))return r.set(i,!0),!0}return r.set(t,!1),!1}function Ea(t){for(var e=Y3=t;e.parent!==null;){e=e.parent;var r=e.f;if(c8&&e===Hr&&(r&Kc)!==0&&(r&XT)===0)return;if((r&(kh|ya))!==0){if((r&Oi)===0)return;e.f^=Oi}}Ys.push(e)}function TS(t,e){if(!((t.f&ya)!==0&&(t.f&Oi)!==0)){(t.f&Xi)!==0?e.d.push(t):(t.f&Fo)!==0&&e.m.push(t),ti(t,Oi);for(var r=t.first;r!==null;)TS(r,e),r=r.next}}function Uj(t){let e=0,r=fc(0),n;return()=>{f8()&&(ae(r),ny(()=>(e===0&&(n=nt(()=>t(()=>Mp(r)))),e+=1,()=>{wa(()=>{e-=1,e===0&&(n?.(),n=void 0,Mp(r))})})))}}var Dj=_h|Vf|e8;function Fj(t,e,r){new Lj(t,e,r)}class Lj{parent;is_pending=!1;#e;#t=gr?Zr:null;#r;#o;#a;#i=null;#n=null;#s=null;#c=null;#l=null;#h=0;#u=0;#p=!1;#f=!1;#g=new Set;#m=new Set;#d=null;#A=Uj(()=>(this.#d=fc(this.#h),()=>{this.#d=null}));constructor(e,r,n){this.#e=e,this.#r=r,this.#o=n,this.parent=Hr.b,this.is_pending=!!this.#r.pending,this.#a=Bp(()=>{if(Hr.b=this,gr){const s=this.#t;el(),s.nodeType===Rh&&s.data===Np?this.#T():(this.#E(),this.#u===0&&(this.is_pending=!1))}else{var i=this.#v();try{this.#i=Xs(()=>n(i))}catch(s){this.error(s)}this.#u>0?this.#w():this.is_pending=!1}return()=>{this.#l?.remove()}},Dj),gr&&(this.#e=Zr)}#E(){try{this.#i=Xs(()=>this.#o(this.#e))}catch(e){this.error(e)}}#T(){const e=this.#r.pending;e&&(this.#n=Xs(()=>e(this.#e)),wa(()=>{var r=this.#v();this.#i=this.#y(()=>(tl.ensure(),Xs(()=>this.#o(r)))),this.#u>0?this.#w():(Bh(this.#n,()=>{this.#n=null}),this.is_pending=!1)}))}#v(){var e=this.#e;return this.is_pending&&(this.#l=Js(),this.#e.before(this.#l),e=this.#l),e}defer_effect(e){wS(e,this.#g,this.#m)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#y(e){var r=Hr,n=$r,i=Zn;Vo(this.#a),Lo(this.#a),jf(this.#a.ctx);try{return e()}catch(s){return mS(s),null}finally{Vo(r),Lo(n),jf(i)}}#w(){const e=this.#r.pending;this.#i!==null&&(this.#c=document.createDocumentFragment(),this.#c.append(this.#l),KS(this.#i,this.#c)),this.#n===null&&(this.#n=Xs(()=>e(this.#e)))}#b(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#b(e);return}if(this.#u+=e,this.#u===0){this.is_pending=!1;for(const r of this.#g)ti(r,Xi),Ea(r);for(const r of this.#m)ti(r,Fo),Ea(r);this.#g.clear(),this.#m.clear(),this.#n&&Bh(this.#n,()=>{this.#n=null}),this.#c&&(this.#e.before(this.#c),this.#c=null)}}update_pending_count(e){this.#b(e),this.#h+=e,!(!this.#d||this.#p)&&(this.#p=!0,wa(()=>{this.#p=!1,this.#d&&nl(this.#d,this.#h)}))}get_effect_pending(){return this.#A(),ae(this.#d)}error(e){var r=this.#r.onerror;let n=this.#r.failed;if(this.#f||!r&&!n)throw e;this.#i&&(es(this.#i),this.#i=null),this.#n&&(es(this.#n),this.#n=null),this.#s&&(es(this.#s),this.#s=null),gr&&(qi(this.#t),Pi(),qi(xp()));var i=!1,s=!1;const o=()=>{if(i){xj();return}i=!0,s&&gj(),tl.ensure(),this.#h=0,this.#s!==null&&Bh(this.#s,()=>{this.#s=null}),this.is_pending=this.has_pending_snippet(),this.#i=this.#y(()=>(this.#f=!1,Xs(()=>this.#o(this.#e)))),this.#u>0?this.#w():this.is_pending=!1};wa(()=>{try{s=!0,r?.(e,o),s=!1}catch(a){zf(a,this.#a&&this.#a.parent)}n&&(this.#s=this.#y(()=>{tl.ensure(),this.#f=!0;try{return Xs(()=>{n(this.#e,()=>e,()=>o)})}catch(a){return zf(a,this.#a.parent),null}finally{this.#f=!1}}))})}}function SS(t,e,r,n){const i=Gf()?Pp:nr;var s=t.filter(g=>!g.settled);if(r.length===0&&s.length===0){n(e.map(i));return}var o=pn,a=Hr,l=CS(),u=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(g=>g.promise)):null;function d(g){l();try{n(g)}catch(m){(a.f&Xc)===0&&zf(m,a)}o?.deactivate(),K3()}if(r.length===0){u.then(()=>d(e.map(i)));return}function f(){l(),Promise.all(r.map(g=>Vj(g))).then(g=>d([...e.map(i),...g])).catch(g=>zf(g,a))}u?u.then(f):f()}function CS(){var t=Hr,e=$r,r=Zn,n=pn;return function(s=!0){Vo(t),Lo(e),jf(r),s&&n?.activate()}}function K3(){Vo(null),Lo(null),jf(null)}function Pp(t){var e=Ki|Xi,r=$r!==null&&($r.f&Ki)!==0?$r:null;return Hr!==null&&(Hr.f|=Vf),{ctx:Zn,deps:null,effects:null,equals:tS,f:e,fn:t,reactions:null,rv:0,v:xi,wv:0,parent:r??Hr,ac:null}}function Vj(t,e,r){let n=Hr;n===null&&ij();var i=n.b,s=void 0,o=fc(xi),a=!$r,l=new Map;return Xj(()=>{var u=YT();s=u.promise;try{Promise.resolve(t()).then(u.resolve,u.reject).then(()=>{d===pn&&d.committed&&d.deactivate(),K3()})}catch(m){u.reject(m),K3()}var d=pn;if(a){var f=i.is_rendered();i.update_pending_count(1),d.increment(f),l.get(d)?.reject(Hf),l.delete(d),l.set(d,u)}const g=(m,v=void 0)=>{if(d.activate(),v)v!==Hf&&(o.f|=cu,nl(o,v));else{(o.f&cu)!==0&&(o.f^=cu),nl(o,m);for(const[A,E]of l){if(l.delete(A),A===d)break;E.reject(Hf)}}a&&(i.update_pending_count(-1),d.decrement(f))};u.promise.then(g,m=>g(null,m||"unknown"))}),ry(()=>{for(const u of l.values())u.reject(Hf)}),new Promise(u=>{function d(f){function g(){f===s?u(o):d(s)}f.then(g,g)}d(s)})}function X3(t){const e=Pp(t);return MS(e),e}function nr(t){const e=Pp(t);return e.equals=nS,e}function kS(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)es(e[r])}}function Hj(t){for(var e=t.parent;e!==null;){if((e.f&Ki)===0)return(e.f&Xc)===0?e:null;e=e.parent}return null}function l8(t){var e,r=Hr;Vo(Hj(t));try{t.f&=~Ih,kS(t),e=LS(t)}finally{Vo(r)}return e}function _S(t){var e=l8(t);if(!t.equals(e)&&(t.wv=DS(),(!pn?.is_fork||t.deps===null)&&(t.v=e,t.deps===null))){ti(t,Oi);return}hu||(Aa!==null?(f8()||pn?.is_fork)&&Aa.set(t,e):o8(t))}let u8=new Set;const uu=new Map;let IS=!1;function fc(t,e){var r={f:0,v:t,reactions:null,equals:tS,rv:0,wv:0};return r}function Ta(t,e){const r=fc(t);return MS(r),r}function yt(t,e=!1,r=!0){const n=fc(t);return e||(n.equals=nS),Wf&&r&&Zn!==null&&Zn.l!==null&&(Zn.l.s??=[]).push(n),n}function Wj(t,e){return Ye(t,nt(()=>ae(t))),e}function Ye(t,e,r=!1){$r!==null&&(!Sa||($r.f&KT)!==0)&&Gf()&&($r.f&(Ki|Kc|r8|KT))!==0&&(Ho===null||!Ff.call(Ho,t))&&pj();let n=r?xh(e):e;return nl(t,n)}function nl(t,e){if(!t.equals(e)){var r=t.v;hu?uu.set(t,e):uu.set(t,r),t.v=e;var n=tl.ensure();if(n.capture(t,r),(t.f&Ki)!==0){const i=t;(t.f&Xi)!==0&&l8(i),o8(i)}t.wv=DS(),NS(t,Xi),Gf()&&Hr!==null&&(Hr.f&Oi)!==0&&(Hr.f&(ya|kh))===0&&(Wo===null?Zj([t]):Wo.push(t)),!n.is_fork&&u8.size>0&&!IS&&jj()}return e}function jj(){IS=!1;for(const t of u8)(t.f&Oi)!==0&&ti(t,Fo),$f(t)&&Qf(t);u8.clear()}function RS(t,e=1){var r=ae(t),n=e===1?r++:r--;return Ye(t,r),n}function Mp(t){Ye(t,t.v+1)}function NS(t,e){var r=t.reactions;if(r!==null)for(var n=Gf(),i=r.length,s=0;s<i;s++){var o=r[s],a=o.f;if(!(!n&&o===Hr)){var l=(a&Xi)===0;if(l&&ti(o,e),(a&Ki)!==0){var u=o;Aa?.delete(u),(a&Ih)===0&&(a&Do&&(o.f|=Ih),NS(u,Fo))}else l&&((a&Kc)!==0&&rl!==null&&rl.add(o),Ea(o))}}}function Gj(t,e){if(e){const r=document.body;t.autofocus=!0,wa(()=>{document.activeElement===r&&t.focus()})}}let OS=!1;function xS(){OS||(OS=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()})},{capture:!0}))}function q3(t){var e=$r,r=Hr;Lo(null),Vo(null);try{return t()}finally{Lo(e),Vo(r)}}function zj(t,e,r,n=r){t.addEventListener(e,()=>q3(r));const i=t.__on_r;i?t.__on_r=()=>{i(),n(!0)}:t.__on_r=()=>n(!0),xS()}let ey=!1,hu=!1;function PS(t){hu=t}let $r=null,Sa=!1;function Lo(t){$r=t}let Hr=null;function Vo(t){Hr=t}let Ho=null;function MS(t){$r!==null&&(Ho===null?Ho=[t]:Ho.push(t))}let Ks=null,uo=0,Wo=null;function Zj(t){Wo=t}let BS=1,Ph=0,Mh=Ph;function US(t){Mh=t}function DS(){return++BS}function $f(t){var e=t.f;if((e&Xi)!==0)return!0;if(e&Ki&&(t.f&=~Ih),(e&Fo)!==0){for(var r=t.deps,n=r.length,i=0;i<n;i++){var s=r[i];if($f(s)&&_S(s),s.wv>t.wv)return!0}(e&Do)!==0&&Aa===null&&ti(t,Oi)}return!1}function FS(t,e,r=!0){var n=t.reactions;if(n!==null&&!(Ho!==null&&Ff.call(Ho,t)))for(var i=0;i<n.length;i++){var s=n[i];(s.f&Ki)!==0?FS(s,e,!1):e===s&&(r?ti(s,Xi):(s.f&Oi)!==0&&ti(s,Fo),Ea(s))}}function LS(t){var e=Ks,r=uo,n=Wo,i=$r,s=Ho,o=Zn,a=Sa,l=Mh,u=t.f;Ks=null,uo=0,Wo=null,$r=(u&(ya|kh))===0?t:null,Ho=null,jf(t.ctx),Sa=!1,Mh=++Ph,t.ac!==null&&(q3(()=>{t.ac.abort(Hf)}),t.ac=null);try{t.f|=t8;var d=t.fn,f=d(),g=t.deps,m=pn?.is_fork;if(Ks!==null){var v;if(m||ty(t,uo),g!==null&&uo>0)for(g.length=uo+Ks.length,v=0;v<Ks.length;v++)g[uo+v]=Ks[v];else t.deps=g=Ks;if(f8()&&(t.f&Do)!==0)for(v=uo;v<g.length;v++)(g[v].reactions??=[]).push(t)}else!m&&g!==null&&uo<g.length&&(ty(t,uo),g.length=uo);if(Gf()&&Wo!==null&&!Sa&&g!==null&&(t.f&(Ki|Fo|Xi))===0)for(v=0;v<Wo.length;v++)FS(Wo[v],t);if(i!==null&&i!==t){if(Ph++,i.deps!==null)for(let A=0;A<r;A+=1)i.deps[A].rv=Ph;if(e!==null)for(const A of e)A.rv=Ph;Wo!==null&&(n===null?n=Wo:n.push(...Wo))}return(t.f&cu)!==0&&(t.f^=cu),f}catch(A){return mS(A)}finally{t.f^=t8,Ks=e,uo=r,Wo=n,$r=i,Ho=s,jf(o),Sa=a,Mh=l}}function $j(t,e){let r=e.reactions;if(r!==null){var n=XW.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(e.f&Ki)!==0&&(Ks===null||!Ff.call(Ks,e))){var s=e;(s.f&Do)!==0&&(s.f^=Do,s.f&=~Ih),o8(s),kS(s),ty(s,0)}}function ty(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)$j(t,r[n])}function Qf(t){var e=t.f;if((e&Xc)===0){ti(t,Oi);var r=Hr,n=ey;Hr=t,ey=!0;try{(e&(Kc|qw))!==0?qj(t):ZS(t),zS(t);var i=LS(t);t.teardown=typeof i=="function"?i:null,t.wv=BS;var s;Jw&&mj&&(t.f&Xi)!==0&&t.deps}finally{ey=n,Hr=r}}}async function Qj(){await Promise.resolve(),pt()}function ae(t){var e=t.f,r=(e&Ki)!==0;if($r!==null&&!Sa){var n=Hr!==null&&(Hr.f&Xc)!==0;if(!n&&(Ho===null||!Ff.call(Ho,t))){var i=$r.deps;if(($r.f&t8)!==0)t.rv<Ph&&(t.rv=Ph,Ks===null&&i!==null&&i[uo]===t?uo++:Ks===null?Ks=[t]:Ks.push(t));else{($r.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[$r]:Ff.call(s,$r)||s.push($r)}}}if(hu&&uu.has(t))return uu.get(t);if(r){var o=t;if(hu){var a=o.v;return((o.f&Oi)===0&&o.reactions!==null||HS(o))&&(a=l8(o)),uu.set(o,a),a}var l=(o.f&Do)===0&&!Sa&&$r!==null&&(ey||($r.f&Do)!==0),u=o.deps===null;$f(o)&&(l&&(o.f|=Do),_S(o)),l&&!u&&VS(o)}if(Aa?.has(t))return Aa.get(t);if((t.f&cu)!==0)throw t.v;return t.v}function VS(t){if(t.deps!==null){t.f|=Do;for(const e of t.deps)(e.reactions??=[]).push(t),(e.f&Ki)!==0&&(e.f&Do)===0&&VS(e)}}function HS(t){if(t.v===xi)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(uu.has(e)||(e.f&Ki)!==0&&HS(e))return!0;return!1}function h8(t){return t&&ae(t)}function nt(t){var e=Sa;try{return Sa=!0,t()}finally{Sa=e}}function ft(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(lu in t)d8(t);else if(!Array.isArray(t))for(let e in t){const r=t[e];typeof r=="object"&&r&&lu in r&&d8(r)}}}function d8(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let n in t)try{d8(t[n],e)}catch{}const r=Xw(t);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const n=$T(r);for(let i in n){const s=n[i].get;if(s)try{s.call(t)}catch{}}}}}function WS(t){Hr===null&&($r===null&&cj(),aj()),hu&&oj()}function Jj(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Ca(t,e,r){var n=Hr;n!==null&&(n.f&lo)!==0&&(t|=lo);var i={ctx:Zn,deps:null,nodes:null,f:t|Xi|Do,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{Qf(i),i.f|=$3}catch(a){throw es(i),a}else e!==null&&Ea(i);var s=i;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Vf)===0&&(s=s.first,(t&Kc)!==0&&(t&_h)!==0&&s!==null&&(s.f|=_h)),s!==null&&(s.parent=n,n!==null&&Jj(s,n),$r!==null&&($r.f&Ki)!==0&&(t&kh)===0)){var o=$r;(o.effects??=[]).push(s)}return i}function f8(){return $r!==null&&!Sa}function ry(t){const e=Ca(Ip,null,!1);return ti(e,Oi),e.teardown=t,e}function p8(t){WS();var e=Hr.f,r=!$r&&(e&ya)!==0&&(e&$3)===0;if(r){var n=Zn;(n.e??=[]).push(t)}else return jS(t)}function jS(t){return Ca(Z3|qT,t,!1)}function Yj(t){return WS(),Ca(Ip|qT,t,!0)}function Kj(t){tl.ensure();const e=Ca(kh|Vf,t,!0);return(r={})=>new Promise(n=>{r.outro?Bh(e,()=>{es(e),n(void 0)}):(es(e),n(void 0))})}function g8(t){return Ca(Z3,t,!1)}function tr(t,e){var r=Zn,n={effect:null,ran:!1,deps:t};r.l.$.push(n),n.effect=ny(()=>{t(),!n.ran&&(n.ran=!0,nt(e))})}function Rn(){var t=Zn;ny(()=>{for(var e of t.l.$){e.deps();var r=e.effect;(r.f&Oi)!==0&&r.deps!==null&&ti(r,Fo),$f(r)&&Qf(r),e.ran=!1}})}function Xj(t){return Ca(r8|Vf,t,!0)}function ny(t,e=0){return Ca(Ip|e,t,!0)}function Et(t,e=[],r=[],n=[]){SS(n,e,r,i=>{Ca(Ip,()=>t(...i.map(ae)),!0)})}function Bp(t,e=0){var r=Ca(Kc|e,t,!0);return r}function GS(t,e=0){var r=Ca(qw|e,t,!0);return r}function Xs(t){return Ca(ya|Vf,t,!0)}function zS(t){var e=t.teardown;if(e!==null){const r=hu,n=$r;PS(!0),Lo(null);try{e.call(null)}finally{PS(r),Lo(n)}}}function ZS(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&q3(()=>{i.abort(Hf)});var n=r.next;(r.f&kh)!==0?r.parent=null:es(r,e),r=n}}function qj(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&ya)===0&&es(e),e=r}}function es(t,e=!0){var r=!1;(e||(t.f&XT)!==0)&&t.nodes!==null&&t.nodes.end!==null&&($S(t.nodes.start,t.nodes.end),r=!0),ZS(t,e&&!r),ty(t,0),ti(t,Xc);var n=t.nodes&&t.nodes.t;if(n!==null)for(const s of n)s.stop();zS(t);var i=t.parent;i!==null&&i.first!==null&&QS(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function $S(t,e){for(;t!==null;){var r=t===e?null:ba(t);t.remove(),t=r}}function QS(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function Bh(t,e,r=!0){var n=[];JS(t,n,!0);var i=()=>{r&&es(t),e&&e()},s=n.length;if(s>0){var o=()=>--s||i();for(var a of n)a.out(o)}else i()}function JS(t,e,r){if((t.f&lo)===0){t.f^=lo;var n=t.nodes&&t.nodes.t;if(n!==null)for(const a of n)(a.is_global||r)&&e.push(a);for(var i=t.first;i!==null;){var s=i.next,o=(i.f&_h)!==0||(i.f&ya)!==0&&(t.f&Kc)!==0;JS(i,e,o?r:!1),i=s}}}function m8(t){YS(t,!0)}function YS(t,e){if((t.f&lo)!==0){t.f^=lo,(t.f&Oi)===0&&(ti(t,Xi),Ea(t));for(var r=t.first;r!==null;){var n=r.next,i=(r.f&_h)!==0||(r.f&ya)!==0;YS(r,i?e:!1),r=n}var s=t.nodes&&t.nodes.t;if(s!==null)for(const o of s)(o.is_global||e)&&o.in()}}function KS(t,e){if(t.nodes)for(var r=t.nodes.start,n=t.nodes.end;r!==null;){var i=r===n?null:ba(r);e.append(r),r=i}}function eG(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const tG=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function rG(t){return tG.includes(t)}const nG={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function iG(t){return t=t.toLowerCase(),nG[t]??t}const sG=["touchstart","touchmove"];function oG(t){return sG.includes(t)}const XS=new Set,y8=new Set;function qS(t,e,r,n={}){function i(s){if(n.capture||Up.call(e,s),!s.cancelBubble)return q3(()=>r?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?wa(()=>{e.addEventListener(t,i,n)}):e.addEventListener(t,i,n),i}function Ai(t,e,r,n,i){var s={capture:n,passive:i},o=qS(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&ry(()=>{e.removeEventListener(t,o,s)})}function eC(t){for(var e=0;e<t.length;e++)XS.add(t[e]);for(var r of y8)r(t)}let tC=null;function Up(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;tC=t;var o=0,a=tC===t&&t.__root;if(a){var l=i.indexOf(a);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;l<=u&&(o=l)}if(s=i[o]||t.target,s!==e){Kw(t,"currentTarget",{configurable:!0,get(){return s||r}});var d=$r,f=Hr;Lo(null),Vo(null);try{for(var g,m=[];s!==null;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var A=s["__"+n];A!=null&&(!s.disabled||t.target===s)&&A.call(s,t)}catch(E){g?m.push(E):g=E}if(t.cancelBubble||v===e||v===null)break;s=v}if(g){for(let E of m)queueMicrotask(()=>{throw E});throw g}}finally{t.__root=e,delete t.currentTarget,Lo(d),Vo(f)}}}function rC(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function pc(t,e){var r=Hr;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function lt(t,e){var r=(e&kj)!==0,n=(e&_j)!==0,i,s=!t.startsWith("<!>");return()=>{if(gr)return pc(Zr,null),Zr;i===void 0&&(i=rC(s?t:"<!>"+t),r||(i=va(i)));var o=n||hS?document.importNode(i,!0):i.cloneNode(!0);if(r){var a=va(o),l=o.lastChild;pc(a,l)}else pc(o,o);return o}}function Xn(t=""){if(!gr){var e=Js(t+"");return pc(e,e),e}var r=Zr;return r.nodeType!==Rp?(r.before(r=Js()),qi(r)):Q3(r),pc(r,r),r}function er(){if(gr)return pc(Zr,null),Zr;var t=document.createDocumentFragment(),e=document.createComment(""),r=Js();return t.append(e,r),pc(e,r),t}function We(t,e){if(gr){var r=Hr;((r.f&$3)===0||r.nodes.end===null)&&(r.nodes.end=Zr),el();return}t!==null&&t.before(e)}function Zt(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function nC(t,e){return iC(t,e)}function aG(t,e){s8(),e.intro=e.intro??!1;const r=e.target,n=gr,i=Zr;try{for(var s=va(r);s&&(s.nodeType!==Rh||s.data!==n8);)s=ba(s);if(!s)throw Nh;Qs(!0),qi(s);const o=iC(t,{...e,anchor:s});return Qs(!1),o}catch(o){if(o instanceof Error&&o.message.split(`
2
+ (function(Df,j3){typeof exports=="object"&&typeof module<"u"?j3(exports):typeof define=="function"&&define.amd?define(["exports"],j3):(Df=typeof globalThis<"u"?globalThis:Df||self,j3(Df.CredenzaPassport={}))})(this,(function(Df){"use strict";const KW={version:"0.4.23"},Jw=!1;var Yw=Array.isArray,XW=Array.prototype.indexOf,Ff=Array.prototype.includes,G3=Array.from,Kw=Object.defineProperty,Lf=Object.getOwnPropertyDescriptor,$T=Object.getOwnPropertyDescriptors,qW=Object.prototype,ej=Array.prototype,Xw=Object.getPrototypeOf,QT=Object.isExtensible;const au=()=>{};function JT(t){return typeof t?.then=="function"}function tj(t){return t()}function z3(t){for(var e=0;e<t.length;e++)t[e]()}function YT(){var t,e,r=new Promise((n,i)=>{t=n,e=i});return{promise:r,resolve:t,reject:e}}function rj(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const r=[];for(const n of t)if(r.push(n),r.length===e)break;return r}const Ki=2,Z3=4,Ip=8,qw=1<<24,Kc=16,ya=32,kh=64,e8=128,Do=512,Oi=1024,Xi=2048,Fo=4096,lo=8192,Xc=16384,$3=32768,_h=65536,KT=1<<17,XT=1<<18,Vf=1<<19,qT=1<<20,qc=1<<25,Ih=32768,t8=1<<21,r8=1<<22,cu=1<<23,lu=Symbol("$state"),eS=Symbol("legacy props"),nj=Symbol(""),Hf=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Rp=3,Rh=8;function tS(t){return t===this.v}function rS(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function nS(t){return!rS(t,this.v)}function iS(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ij(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function sj(t,e,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function oj(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function aj(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function cj(t){throw new Error("https://svelte.dev/e/effect_orphan")}function lj(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function uj(){throw new Error("https://svelte.dev/e/hydration_failed")}function hj(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function dj(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function fj(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function pj(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function gj(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}let Wf=!1,mj=!1;function yj(){Wf=!0}const wj=1,vj=2,sS=4,bj=8,Aj=16,Ej=1,Tj=2,oS=4,Sj=8,Cj=16,kj=1,_j=2,n8="[",Np="[!",i8="]",Nh={},xi=Symbol(),Ij="http://www.w3.org/1999/xhtml",Rj="@attach";let Zn=null;function jf(t){Zn=t}function Ut(t,e=!1,r){Zn={p:Zn,i:!1,c:null,e:null,s:t,x:null,l:Wf&&!e?{s:null,u:null,$:[]}:null}}function Dt(t){var e=Zn,r=e.e;if(r!==null){e.e=null;for(var n of r)jS(n)}return t!==void 0&&(e.x=t),e.i=!0,Zn=e.p,t??{}}function Gf(){return!Wf||Zn!==null&&Zn.l===null}let Oh=[];function aS(){var t=Oh;Oh=[],z3(t)}function wa(t){if(Oh.length===0&&!Zf){var e=Oh;queueMicrotask(()=>{e===Oh&&aS()})}Oh.push(t)}function Nj(){for(;Oh.length>0;)aS()}function Op(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function Oj(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function xj(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let gr=!1;function Qs(t){gr=t}let Zr;function qi(t){if(t===null)throw Op(),Nh;return Zr=t}function el(){return qi(ba(Zr))}function Je(t){if(gr){if(ba(Zr)!==null)throw Op(),Nh;Zr=t}}function Pi(t=1){if(gr){for(var e=t,r=Zr;e--;)r=ba(r);Zr=r}}function xp(t=!0){for(var e=0,r=Zr;;){if(r.nodeType===Rh){var n=r.data;if(n===i8){if(e===0)return r;e-=1}else(n===n8||n===Np||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var i=ba(r);t&&r.remove(),r=i}}function cS(t){if(!t||t.nodeType!==Rh)throw Op(),Nh;return t.data}function xh(t){if(typeof t!="object"||t===null||lu in t)return t;const e=Xw(t);if(e!==qW&&e!==ej)return t;var r=new Map,n=Yw(t),i=Ta(0),s=Mh,o=a=>{if(Mh===s)return a();var l=$r,u=Mh;Lo(null),US(s);var d=a();return Lo(l),US(u),d};return n&&r.set("length",Ta(t.length)),new Proxy(t,{defineProperty(a,l,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&dj();var d=r.get(l);return d===void 0?o(()=>{var f=Ta(u.value);return r.set(l,f),f}):Ye(d,u.value,!0),!0},deleteProperty(a,l){var u=r.get(l);if(u===void 0){if(l in a){const d=o(()=>Ta(xi));r.set(l,d),Mp(i)}}else Ye(u,xi),Mp(i);return!0},get(a,l,u){if(l===lu)return t;var d=r.get(l),f=l in a;if(d===void 0&&(!f||Lf(a,l)?.writable)&&(d=o(()=>{var m=xh(f?a[l]:xi),v=Ta(m);return v}),r.set(l,d)),d!==void 0){var g=ae(d);return g===xi?void 0:g}return Reflect.get(a,l,u)},getOwnPropertyDescriptor(a,l){var u=Reflect.getOwnPropertyDescriptor(a,l);if(u&&"value"in u){var d=r.get(l);d&&(u.value=ae(d))}else if(u===void 0){var f=r.get(l),g=f?.v;if(f!==void 0&&g!==xi)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return u},has(a,l){if(l===lu)return!0;var u=r.get(l),d=u!==void 0&&u.v!==xi||Reflect.has(a,l);if(u!==void 0||Hr!==null&&(!d||Lf(a,l)?.writable)){u===void 0&&(u=o(()=>{var g=d?xh(a[l]):xi,m=Ta(g);return m}),r.set(l,u));var f=ae(u);if(f===xi)return!1}return d},set(a,l,u,d){var f=r.get(l),g=l in a;if(n&&l==="length")for(var m=u;m<f.v;m+=1){var v=r.get(m+"");v!==void 0?Ye(v,xi):m in a&&(v=o(()=>Ta(xi)),r.set(m+"",v))}if(f===void 0)(!g||Lf(a,l)?.writable)&&(f=o(()=>Ta(void 0)),Ye(f,xh(u)),r.set(l,f));else{g=f.v!==xi;var A=o(()=>xh(u));Ye(f,A)}var E=Reflect.getOwnPropertyDescriptor(a,l);if(E?.set&&E.set.call(d,u),!g){if(n&&typeof l=="string"){var C=r.get("length"),k=Number(l);Number.isInteger(k)&&k>=C.v&&Ye(C,k+1)}Mp(i)}return!0},ownKeys(a){ae(i);var l=Reflect.ownKeys(a).filter(f=>{var g=r.get(f);return g===void 0||g.v!==xi});for(var[u,d]of r)d.v!==xi&&!(u in a)&&l.push(u);return l},setPrototypeOf(){fj()}})}function lS(t){try{if(t!==null&&typeof t=="object"&&lu in t)return t[lu]}catch{}return t}function Pj(t,e){return Object.is(lS(t),lS(e))}var uS,hS,dS,fS;function s8(){if(uS===void 0){uS=window,hS=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;dS=Lf(e,"firstChild").get,fS=Lf(e,"nextSibling").get,QT(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),QT(r)&&(r.__t=void 0)}}function Js(t=""){return document.createTextNode(t)}function va(t){return dS.call(t)}function ba(t){return fS.call(t)}function Xe(t,e){if(!gr)return va(t);var r=va(Zr);if(r===null)r=Zr.appendChild(Js());else if(e&&r.nodeType!==Rp){var n=Js();return r?.before(n),qi(n),n}return e&&Q3(r),qi(r),r}function It(t,e=!1){if(!gr){var r=va(t);return r instanceof Comment&&r.data===""?ba(r):r}if(e){if(Zr?.nodeType!==Rp){var n=Js();return Zr?.before(n),qi(n),n}Q3(Zr)}return Zr}function tt(t,e=1,r=!1){let n=gr?Zr:t;for(var i;e--;)i=n,n=ba(n);if(!gr)return n;if(r){if(n?.nodeType!==Rp){var s=Js();return n===null?i?.after(s):n.before(s),qi(s),s}Q3(n)}return qi(n),n}function pS(t){t.textContent=""}function gS(){return!1}function Q3(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===Rp;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}function mS(t){var e=Hr;if(e===null)return $r.f|=cu,t;if((e.f&$3)===0){if((e.f&e8)===0)throw t;e.b.error(t)}else zf(t,e)}function zf(t,e){for(;e!==null;){if((e.f&e8)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t}const Mj=-7169;function ti(t,e){t.f=t.f&Mj|e}function o8(t){(t.f&Do)!==0||t.deps===null?ti(t,Oi):ti(t,Fo)}function yS(t){if(t!==null)for(const e of t)(e.f&Ki)===0||(e.f&Ih)===0||(e.f^=Ih,yS(e.deps))}function wS(t,e,r){(t.f&Xi)!==0?e.add(t):(t.f&Fo)!==0&&r.add(t),yS(t.deps),ti(t,Oi)}const J3=new Set;let pn=null,a8=null,Aa=null,Ys=[],Y3=null,c8=!1,Zf=!1;class tl{committed=!1;current=new Map;previous=new Map;#e=new Set;#t=new Set;#r=0;#o=0;#a=null;#i=new Set;#n=new Set;#s=new Map;is_fork=!1;#c=!1;is_deferred(){return this.is_fork||this.#o>0}skip_effect(e){this.#s.has(e)||this.#s.set(e,{d:[],m:[]})}unskip_effect(e){var r=this.#s.get(e);if(r){this.#s.delete(e);for(var n of r.d)ti(n,Xi),Ea(n);for(n of r.m)ti(n,Fo),Ea(n)}}process(e){Ys=[],this.apply();var r=[],n=[];for(const i of e)this.#l(i,r,n);if(this.is_deferred()){this.#h(n),this.#h(r);for(const[i,s]of this.#s)TS(i,s)}else{for(const i of this.#e)i();this.#e.clear(),this.#r===0&&this.#u(),a8=this,pn=null,bS(n),bS(r),a8=null,this.#a?.resolve()}Aa=null}#l(e,r,n){e.f^=Oi;for(var i=e.first,s=null;i!==null;){var o=i.f,a=(o&(ya|kh))!==0,l=a&&(o&Oi)!==0,u=l||(o&lo)!==0||this.#s.has(i);if(!u&&i.fn!==null){a?i.f^=Oi:s!==null&&(o&(Z3|Ip|qw))!==0?s.b.defer_effect(i):(o&Z3)!==0?r.push(i):$f(i)&&((o&Kc)!==0&&this.#n.add(i),Qf(i));var d=i.first;if(d!==null){i=d;continue}}var f=i.parent;for(i=i.next;i===null&&f!==null;)f===s&&(s=null),i=f.next,f=f.parent}}#h(e){for(var r=0;r<e.length;r+=1)wS(e[r],this.#i,this.#n)}capture(e,r){r!==xi&&!this.previous.has(e)&&this.previous.set(e,r),(e.f&cu)===0&&(this.current.set(e,e.v),Aa?.set(e,e.v))}activate(){pn=this,this.apply()}deactivate(){pn===this&&(pn=null,Aa=null)}flush(){if(this.activate(),Ys.length>0){if(vS(),pn!==null&&pn!==this)return}else this.#r===0&&this.process([]);this.deactivate()}discard(){for(const e of this.#t)e(this);this.#t.clear()}#u(){if(J3.size>1){this.previous.clear();var e=Aa,r=!0;for(const i of J3){if(i===this){r=!1;continue}const s=[];for(const[a,l]of this.current){if(i.current.has(a))if(r&&l!==i.current.get(a))i.current.set(a,l);else continue;s.push(a)}if(s.length===0)continue;const o=[...i.current.keys()].filter(a=>!this.current.has(a));if(o.length>0){var n=Ys;Ys=[];const a=new Set,l=new Map;for(const u of s)AS(u,o,a,l);if(Ys.length>0){pn=i,i.apply();for(const u of Ys)i.#l(u,[],[]);i.deactivate()}Ys=n}}pn=null,Aa=e}this.committed=!0,J3.delete(this)}increment(e){this.#r+=1,e&&(this.#o+=1)}decrement(e){this.#r-=1,e&&(this.#o-=1),!this.#c&&(this.#c=!0,wa(()=>{this.#c=!1,this.is_deferred()?Ys.length>0&&this.flush():this.revive()}))}revive(){for(const e of this.#i)this.#n.delete(e),ti(e,Xi),Ea(e);for(const e of this.#n)ti(e,Fo),Ea(e);this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#a??=YT()).promise}static ensure(){if(pn===null){const e=pn=new tl;J3.add(pn),Zf||wa(()=>{pn===e&&e.flush()})}return pn}apply(){}}function pt(t){var e=Zf;Zf=!0;try{for(var r;;){if(Nj(),Ys.length===0&&(pn?.flush(),Ys.length===0))return Y3=null,r;vS()}}finally{Zf=e}}function vS(){c8=!0;var t=null;try{for(var e=0;Ys.length>0;){var r=tl.ensure();if(e++>1e3){var n,i;Bj()}r.process(Ys),uu.clear()}}finally{Ys=[],c8=!1,Y3=null}}function Bj(){try{lj()}catch(t){zf(t,Y3)}}let rl=null;function bS(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(Xc|lo))===0&&$f(n)&&(rl=new Set,Qf(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?QS(n):n.fn=null),rl?.size>0)){uu.clear();for(const i of rl){if((i.f&(Xc|lo))!==0)continue;const s=[i];let o=i.parent;for(;o!==null;)rl.has(o)&&(rl.delete(o),s.push(o)),o=o.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Xc|lo))===0&&Qf(l)}}rl.clear()}}rl=null}}function AS(t,e,r,n){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const i of t.reactions){const s=i.f;(s&Ki)!==0?AS(i,e,r,n):(s&(r8|Kc))!==0&&(s&Xi)===0&&ES(i,e,n)&&(ti(i,Xi),Ea(i))}}function ES(t,e,r){const n=r.get(t);if(n!==void 0)return n;if(t.deps!==null)for(const i of t.deps){if(Ff.call(e,i))return!0;if((i.f&Ki)!==0&&ES(i,e,r))return r.set(i,!0),!0}return r.set(t,!1),!1}function Ea(t){for(var e=Y3=t;e.parent!==null;){e=e.parent;var r=e.f;if(c8&&e===Hr&&(r&Kc)!==0&&(r&XT)===0)return;if((r&(kh|ya))!==0){if((r&Oi)===0)return;e.f^=Oi}}Ys.push(e)}function TS(t,e){if(!((t.f&ya)!==0&&(t.f&Oi)!==0)){(t.f&Xi)!==0?e.d.push(t):(t.f&Fo)!==0&&e.m.push(t),ti(t,Oi);for(var r=t.first;r!==null;)TS(r,e),r=r.next}}function Uj(t){let e=0,r=fc(0),n;return()=>{f8()&&(ae(r),ny(()=>(e===0&&(n=nt(()=>t(()=>Mp(r)))),e+=1,()=>{wa(()=>{e-=1,e===0&&(n?.(),n=void 0,Mp(r))})})))}}var Dj=_h|Vf|e8;function Fj(t,e,r){new Lj(t,e,r)}class Lj{parent;is_pending=!1;#e;#t=gr?Zr:null;#r;#o;#a;#i=null;#n=null;#s=null;#c=null;#l=null;#h=0;#u=0;#p=!1;#f=!1;#g=new Set;#m=new Set;#d=null;#A=Uj(()=>(this.#d=fc(this.#h),()=>{this.#d=null}));constructor(e,r,n){this.#e=e,this.#r=r,this.#o=n,this.parent=Hr.b,this.is_pending=!!this.#r.pending,this.#a=Bp(()=>{if(Hr.b=this,gr){const s=this.#t;el(),s.nodeType===Rh&&s.data===Np?this.#T():(this.#E(),this.#u===0&&(this.is_pending=!1))}else{var i=this.#v();try{this.#i=Xs(()=>n(i))}catch(s){this.error(s)}this.#u>0?this.#w():this.is_pending=!1}return()=>{this.#l?.remove()}},Dj),gr&&(this.#e=Zr)}#E(){try{this.#i=Xs(()=>this.#o(this.#e))}catch(e){this.error(e)}}#T(){const e=this.#r.pending;e&&(this.#n=Xs(()=>e(this.#e)),wa(()=>{var r=this.#v();this.#i=this.#y(()=>(tl.ensure(),Xs(()=>this.#o(r)))),this.#u>0?this.#w():(Bh(this.#n,()=>{this.#n=null}),this.is_pending=!1)}))}#v(){var e=this.#e;return this.is_pending&&(this.#l=Js(),this.#e.before(this.#l),e=this.#l),e}defer_effect(e){wS(e,this.#g,this.#m)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#r.pending}#y(e){var r=Hr,n=$r,i=Zn;Vo(this.#a),Lo(this.#a),jf(this.#a.ctx);try{return e()}catch(s){return mS(s),null}finally{Vo(r),Lo(n),jf(i)}}#w(){const e=this.#r.pending;this.#i!==null&&(this.#c=document.createDocumentFragment(),this.#c.append(this.#l),KS(this.#i,this.#c)),this.#n===null&&(this.#n=Xs(()=>e(this.#e)))}#b(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#b(e);return}if(this.#u+=e,this.#u===0){this.is_pending=!1;for(const r of this.#g)ti(r,Xi),Ea(r);for(const r of this.#m)ti(r,Fo),Ea(r);this.#g.clear(),this.#m.clear(),this.#n&&Bh(this.#n,()=>{this.#n=null}),this.#c&&(this.#e.before(this.#c),this.#c=null)}}update_pending_count(e){this.#b(e),this.#h+=e,!(!this.#d||this.#p)&&(this.#p=!0,wa(()=>{this.#p=!1,this.#d&&nl(this.#d,this.#h)}))}get_effect_pending(){return this.#A(),ae(this.#d)}error(e){var r=this.#r.onerror;let n=this.#r.failed;if(this.#f||!r&&!n)throw e;this.#i&&(es(this.#i),this.#i=null),this.#n&&(es(this.#n),this.#n=null),this.#s&&(es(this.#s),this.#s=null),gr&&(qi(this.#t),Pi(),qi(xp()));var i=!1,s=!1;const o=()=>{if(i){xj();return}i=!0,s&&gj(),tl.ensure(),this.#h=0,this.#s!==null&&Bh(this.#s,()=>{this.#s=null}),this.is_pending=this.has_pending_snippet(),this.#i=this.#y(()=>(this.#f=!1,Xs(()=>this.#o(this.#e)))),this.#u>0?this.#w():this.is_pending=!1};wa(()=>{try{s=!0,r?.(e,o),s=!1}catch(a){zf(a,this.#a&&this.#a.parent)}n&&(this.#s=this.#y(()=>{tl.ensure(),this.#f=!0;try{return Xs(()=>{n(this.#e,()=>e,()=>o)})}catch(a){return zf(a,this.#a.parent),null}finally{this.#f=!1}}))})}}function SS(t,e,r,n){const i=Gf()?Pp:nr;var s=t.filter(g=>!g.settled);if(r.length===0&&s.length===0){n(e.map(i));return}var o=pn,a=Hr,l=CS(),u=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(g=>g.promise)):null;function d(g){l();try{n(g)}catch(m){(a.f&Xc)===0&&zf(m,a)}o?.deactivate(),K3()}if(r.length===0){u.then(()=>d(e.map(i)));return}function f(){l(),Promise.all(r.map(g=>Vj(g))).then(g=>d([...e.map(i),...g])).catch(g=>zf(g,a))}u?u.then(f):f()}function CS(){var t=Hr,e=$r,r=Zn,n=pn;return function(s=!0){Vo(t),Lo(e),jf(r),s&&n?.activate()}}function K3(){Vo(null),Lo(null),jf(null)}function Pp(t){var e=Ki|Xi,r=$r!==null&&($r.f&Ki)!==0?$r:null;return Hr!==null&&(Hr.f|=Vf),{ctx:Zn,deps:null,effects:null,equals:tS,f:e,fn:t,reactions:null,rv:0,v:xi,wv:0,parent:r??Hr,ac:null}}function Vj(t,e,r){let n=Hr;n===null&&ij();var i=n.b,s=void 0,o=fc(xi),a=!$r,l=new Map;return Xj(()=>{var u=YT();s=u.promise;try{Promise.resolve(t()).then(u.resolve,u.reject).then(()=>{d===pn&&d.committed&&d.deactivate(),K3()})}catch(m){u.reject(m),K3()}var d=pn;if(a){var f=i.is_rendered();i.update_pending_count(1),d.increment(f),l.get(d)?.reject(Hf),l.delete(d),l.set(d,u)}const g=(m,v=void 0)=>{if(d.activate(),v)v!==Hf&&(o.f|=cu,nl(o,v));else{(o.f&cu)!==0&&(o.f^=cu),nl(o,m);for(const[A,E]of l){if(l.delete(A),A===d)break;E.reject(Hf)}}a&&(i.update_pending_count(-1),d.decrement(f))};u.promise.then(g,m=>g(null,m||"unknown"))}),ry(()=>{for(const u of l.values())u.reject(Hf)}),new Promise(u=>{function d(f){function g(){f===s?u(o):d(s)}f.then(g,g)}d(s)})}function X3(t){const e=Pp(t);return MS(e),e}function nr(t){const e=Pp(t);return e.equals=nS,e}function kS(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)es(e[r])}}function Hj(t){for(var e=t.parent;e!==null;){if((e.f&Ki)===0)return(e.f&Xc)===0?e:null;e=e.parent}return null}function l8(t){var e,r=Hr;Vo(Hj(t));try{t.f&=~Ih,kS(t),e=LS(t)}finally{Vo(r)}return e}function _S(t){var e=l8(t);if(!t.equals(e)&&(t.wv=DS(),(!pn?.is_fork||t.deps===null)&&(t.v=e,t.deps===null))){ti(t,Oi);return}hu||(Aa!==null?(f8()||pn?.is_fork)&&Aa.set(t,e):o8(t))}let u8=new Set;const uu=new Map;let IS=!1;function fc(t,e){var r={f:0,v:t,reactions:null,equals:tS,rv:0,wv:0};return r}function Ta(t,e){const r=fc(t);return MS(r),r}function yt(t,e=!1,r=!0){const n=fc(t);return e||(n.equals=nS),Wf&&r&&Zn!==null&&Zn.l!==null&&(Zn.l.s??=[]).push(n),n}function Wj(t,e){return Ye(t,nt(()=>ae(t))),e}function Ye(t,e,r=!1){$r!==null&&(!Sa||($r.f&KT)!==0)&&Gf()&&($r.f&(Ki|Kc|r8|KT))!==0&&(Ho===null||!Ff.call(Ho,t))&&pj();let n=r?xh(e):e;return nl(t,n)}function nl(t,e){if(!t.equals(e)){var r=t.v;hu?uu.set(t,e):uu.set(t,r),t.v=e;var n=tl.ensure();if(n.capture(t,r),(t.f&Ki)!==0){const i=t;(t.f&Xi)!==0&&l8(i),o8(i)}t.wv=DS(),NS(t,Xi),Gf()&&Hr!==null&&(Hr.f&Oi)!==0&&(Hr.f&(ya|kh))===0&&(Wo===null?Zj([t]):Wo.push(t)),!n.is_fork&&u8.size>0&&!IS&&jj()}return e}function jj(){IS=!1;for(const t of u8)(t.f&Oi)!==0&&ti(t,Fo),$f(t)&&Qf(t);u8.clear()}function RS(t,e=1){var r=ae(t),n=e===1?r++:r--;return Ye(t,r),n}function Mp(t){Ye(t,t.v+1)}function NS(t,e){var r=t.reactions;if(r!==null)for(var n=Gf(),i=r.length,s=0;s<i;s++){var o=r[s],a=o.f;if(!(!n&&o===Hr)){var l=(a&Xi)===0;if(l&&ti(o,e),(a&Ki)!==0){var u=o;Aa?.delete(u),(a&Ih)===0&&(a&Do&&(o.f|=Ih),NS(u,Fo))}else l&&((a&Kc)!==0&&rl!==null&&rl.add(o),Ea(o))}}}function Gj(t,e){if(e){const r=document.body;t.autofocus=!0,wa(()=>{document.activeElement===r&&t.focus()})}}let OS=!1;function xS(){OS||(OS=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()})},{capture:!0}))}function q3(t){var e=$r,r=Hr;Lo(null),Vo(null);try{return t()}finally{Lo(e),Vo(r)}}function zj(t,e,r,n=r){t.addEventListener(e,()=>q3(r));const i=t.__on_r;i?t.__on_r=()=>{i(),n(!0)}:t.__on_r=()=>n(!0),xS()}let ey=!1,hu=!1;function PS(t){hu=t}let $r=null,Sa=!1;function Lo(t){$r=t}let Hr=null;function Vo(t){Hr=t}let Ho=null;function MS(t){$r!==null&&(Ho===null?Ho=[t]:Ho.push(t))}let Ks=null,uo=0,Wo=null;function Zj(t){Wo=t}let BS=1,Ph=0,Mh=Ph;function US(t){Mh=t}function DS(){return++BS}function $f(t){var e=t.f;if((e&Xi)!==0)return!0;if(e&Ki&&(t.f&=~Ih),(e&Fo)!==0){for(var r=t.deps,n=r.length,i=0;i<n;i++){var s=r[i];if($f(s)&&_S(s),s.wv>t.wv)return!0}(e&Do)!==0&&Aa===null&&ti(t,Oi)}return!1}function FS(t,e,r=!0){var n=t.reactions;if(n!==null&&!(Ho!==null&&Ff.call(Ho,t)))for(var i=0;i<n.length;i++){var s=n[i];(s.f&Ki)!==0?FS(s,e,!1):e===s&&(r?ti(s,Xi):(s.f&Oi)!==0&&ti(s,Fo),Ea(s))}}function LS(t){var e=Ks,r=uo,n=Wo,i=$r,s=Ho,o=Zn,a=Sa,l=Mh,u=t.f;Ks=null,uo=0,Wo=null,$r=(u&(ya|kh))===0?t:null,Ho=null,jf(t.ctx),Sa=!1,Mh=++Ph,t.ac!==null&&(q3(()=>{t.ac.abort(Hf)}),t.ac=null);try{t.f|=t8;var d=t.fn,f=d(),g=t.deps,m=pn?.is_fork;if(Ks!==null){var v;if(m||ty(t,uo),g!==null&&uo>0)for(g.length=uo+Ks.length,v=0;v<Ks.length;v++)g[uo+v]=Ks[v];else t.deps=g=Ks;if(f8()&&(t.f&Do)!==0)for(v=uo;v<g.length;v++)(g[v].reactions??=[]).push(t)}else!m&&g!==null&&uo<g.length&&(ty(t,uo),g.length=uo);if(Gf()&&Wo!==null&&!Sa&&g!==null&&(t.f&(Ki|Fo|Xi))===0)for(v=0;v<Wo.length;v++)FS(Wo[v],t);if(i!==null&&i!==t){if(Ph++,i.deps!==null)for(let A=0;A<r;A+=1)i.deps[A].rv=Ph;if(e!==null)for(const A of e)A.rv=Ph;Wo!==null&&(n===null?n=Wo:n.push(...Wo))}return(t.f&cu)!==0&&(t.f^=cu),f}catch(A){return mS(A)}finally{t.f^=t8,Ks=e,uo=r,Wo=n,$r=i,Ho=s,jf(o),Sa=a,Mh=l}}function $j(t,e){let r=e.reactions;if(r!==null){var n=XW.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}if(r===null&&(e.f&Ki)!==0&&(Ks===null||!Ff.call(Ks,e))){var s=e;(s.f&Do)!==0&&(s.f^=Do,s.f&=~Ih),o8(s),kS(s),ty(s,0)}}function ty(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)$j(t,r[n])}function Qf(t){var e=t.f;if((e&Xc)===0){ti(t,Oi);var r=Hr,n=ey;Hr=t,ey=!0;try{(e&(Kc|qw))!==0?qj(t):ZS(t),zS(t);var i=LS(t);t.teardown=typeof i=="function"?i:null,t.wv=BS;var s;Jw&&mj&&(t.f&Xi)!==0&&t.deps}finally{ey=n,Hr=r}}}async function Qj(){await Promise.resolve(),pt()}function ae(t){var e=t.f,r=(e&Ki)!==0;if($r!==null&&!Sa){var n=Hr!==null&&(Hr.f&Xc)!==0;if(!n&&(Ho===null||!Ff.call(Ho,t))){var i=$r.deps;if(($r.f&t8)!==0)t.rv<Ph&&(t.rv=Ph,Ks===null&&i!==null&&i[uo]===t?uo++:Ks===null?Ks=[t]:Ks.push(t));else{($r.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[$r]:Ff.call(s,$r)||s.push($r)}}}if(hu&&uu.has(t))return uu.get(t);if(r){var o=t;if(hu){var a=o.v;return((o.f&Oi)===0&&o.reactions!==null||HS(o))&&(a=l8(o)),uu.set(o,a),a}var l=(o.f&Do)===0&&!Sa&&$r!==null&&(ey||($r.f&Do)!==0),u=o.deps===null;$f(o)&&(l&&(o.f|=Do),_S(o)),l&&!u&&VS(o)}if(Aa?.has(t))return Aa.get(t);if((t.f&cu)!==0)throw t.v;return t.v}function VS(t){if(t.deps!==null){t.f|=Do;for(const e of t.deps)(e.reactions??=[]).push(t),(e.f&Ki)!==0&&(e.f&Do)===0&&VS(e)}}function HS(t){if(t.v===xi)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(uu.has(e)||(e.f&Ki)!==0&&HS(e))return!0;return!1}function h8(t){return t&&ae(t)}function nt(t){var e=Sa;try{return Sa=!0,t()}finally{Sa=e}}function ft(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(lu in t)d8(t);else if(!Array.isArray(t))for(let e in t){const r=t[e];typeof r=="object"&&r&&lu in r&&d8(r)}}}function d8(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let n in t)try{d8(t[n],e)}catch{}const r=Xw(t);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const n=$T(r);for(let i in n){const s=n[i].get;if(s)try{s.call(t)}catch{}}}}}function WS(t){Hr===null&&($r===null&&cj(),aj()),hu&&oj()}function Jj(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Ca(t,e,r){var n=Hr;n!==null&&(n.f&lo)!==0&&(t|=lo);var i={ctx:Zn,deps:null,nodes:null,f:t|Xi|Do,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{Qf(i),i.f|=$3}catch(a){throw es(i),a}else e!==null&&Ea(i);var s=i;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Vf)===0&&(s=s.first,(t&Kc)!==0&&(t&_h)!==0&&s!==null&&(s.f|=_h)),s!==null&&(s.parent=n,n!==null&&Jj(s,n),$r!==null&&($r.f&Ki)!==0&&(t&kh)===0)){var o=$r;(o.effects??=[]).push(s)}return i}function f8(){return $r!==null&&!Sa}function ry(t){const e=Ca(Ip,null,!1);return ti(e,Oi),e.teardown=t,e}function p8(t){WS();var e=Hr.f,r=!$r&&(e&ya)!==0&&(e&$3)===0;if(r){var n=Zn;(n.e??=[]).push(t)}else return jS(t)}function jS(t){return Ca(Z3|qT,t,!1)}function Yj(t){return WS(),Ca(Ip|qT,t,!0)}function Kj(t){tl.ensure();const e=Ca(kh|Vf,t,!0);return(r={})=>new Promise(n=>{r.outro?Bh(e,()=>{es(e),n(void 0)}):(es(e),n(void 0))})}function g8(t){return Ca(Z3,t,!1)}function tr(t,e){var r=Zn,n={effect:null,ran:!1,deps:t};r.l.$.push(n),n.effect=ny(()=>{t(),!n.ran&&(n.ran=!0,nt(e))})}function Rn(){var t=Zn;ny(()=>{for(var e of t.l.$){e.deps();var r=e.effect;(r.f&Oi)!==0&&r.deps!==null&&ti(r,Fo),$f(r)&&Qf(r),e.ran=!1}})}function Xj(t){return Ca(r8|Vf,t,!0)}function ny(t,e=0){return Ca(Ip|e,t,!0)}function Et(t,e=[],r=[],n=[]){SS(n,e,r,i=>{Ca(Ip,()=>t(...i.map(ae)),!0)})}function Bp(t,e=0){var r=Ca(Kc|e,t,!0);return r}function GS(t,e=0){var r=Ca(qw|e,t,!0);return r}function Xs(t){return Ca(ya|Vf,t,!0)}function zS(t){var e=t.teardown;if(e!==null){const r=hu,n=$r;PS(!0),Lo(null);try{e.call(null)}finally{PS(r),Lo(n)}}}function ZS(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const i=r.ac;i!==null&&q3(()=>{i.abort(Hf)});var n=r.next;(r.f&kh)!==0?r.parent=null:es(r,e),r=n}}function qj(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&ya)===0&&es(e),e=r}}function es(t,e=!0){var r=!1;(e||(t.f&XT)!==0)&&t.nodes!==null&&t.nodes.end!==null&&($S(t.nodes.start,t.nodes.end),r=!0),ZS(t,e&&!r),ty(t,0),ti(t,Xc);var n=t.nodes&&t.nodes.t;if(n!==null)for(const s of n)s.stop();zS(t);var i=t.parent;i!==null&&i.first!==null&&QS(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function $S(t,e){for(;t!==null;){var r=t===e?null:ba(t);t.remove(),t=r}}function QS(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function Bh(t,e,r=!0){var n=[];JS(t,n,!0);var i=()=>{r&&es(t),e&&e()},s=n.length;if(s>0){var o=()=>--s||i();for(var a of n)a.out(o)}else i()}function JS(t,e,r){if((t.f&lo)===0){t.f^=lo;var n=t.nodes&&t.nodes.t;if(n!==null)for(const a of n)(a.is_global||r)&&e.push(a);for(var i=t.first;i!==null;){var s=i.next,o=(i.f&_h)!==0||(i.f&ya)!==0&&(t.f&Kc)!==0;JS(i,e,o?r:!1),i=s}}}function m8(t){YS(t,!0)}function YS(t,e){if((t.f&lo)!==0){t.f^=lo,(t.f&Oi)===0&&(ti(t,Xi),Ea(t));for(var r=t.first;r!==null;){var n=r.next,i=(r.f&_h)!==0||(r.f&ya)!==0;YS(r,i?e:!1),r=n}var s=t.nodes&&t.nodes.t;if(s!==null)for(const o of s)(o.is_global||e)&&o.in()}}function KS(t,e){if(t.nodes)for(var r=t.nodes.start,n=t.nodes.end;r!==null;){var i=r===n?null:ba(r);e.append(r),r=i}}function eG(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const tG=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function rG(t){return tG.includes(t)}const nG={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function iG(t){return t=t.toLowerCase(),nG[t]??t}const sG=["touchstart","touchmove"];function oG(t){return sG.includes(t)}const XS=new Set,y8=new Set;function qS(t,e,r,n={}){function i(s){if(n.capture||Up.call(e,s),!s.cancelBubble)return q3(()=>r?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?wa(()=>{e.addEventListener(t,i,n)}):e.addEventListener(t,i,n),i}function Ai(t,e,r,n,i){var s={capture:n,passive:i},o=qS(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&ry(()=>{e.removeEventListener(t,o,s)})}function eC(t){for(var e=0;e<t.length;e++)XS.add(t[e]);for(var r of y8)r(t)}let tC=null;function Up(t){var e=this,r=e.ownerDocument,n=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;tC=t;var o=0,a=tC===t&&t.__root;if(a){var l=i.indexOf(a);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;l<=u&&(o=l)}if(s=i[o]||t.target,s!==e){Kw(t,"currentTarget",{configurable:!0,get(){return s||r}});var d=$r,f=Hr;Lo(null),Vo(null);try{for(var g,m=[];s!==null;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var A=s["__"+n];A!=null&&(!s.disabled||t.target===s)&&A.call(s,t)}catch(E){g?m.push(E):g=E}if(t.cancelBubble||v===e||v===null)break;s=v}if(g){for(let E of m)queueMicrotask(()=>{throw E});throw g}}finally{t.__root=e,delete t.currentTarget,Lo(d),Vo(f)}}}function rC(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function pc(t,e){var r=Hr;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function lt(t,e){var r=(e&kj)!==0,n=(e&_j)!==0,i,s=!t.startsWith("<!>");return()=>{if(gr)return pc(Zr,null),Zr;i===void 0&&(i=rC(s?t:"<!>"+t),r||(i=va(i)));var o=n||hS?document.importNode(i,!0):i.cloneNode(!0);if(r){var a=va(o),l=o.lastChild;pc(a,l)}else pc(o,o);return o}}function Xn(t=""){if(!gr){var e=Js(t+"");return pc(e,e),e}var r=Zr;return r.nodeType!==Rp?(r.before(r=Js()),qi(r)):Q3(r),pc(r,r),r}function er(){if(gr)return pc(Zr,null),Zr;var t=document.createDocumentFragment(),e=document.createComment(""),r=Js();return t.append(e,r),pc(e,r),t}function We(t,e){if(gr){var r=Hr;((r.f&$3)===0||r.nodes.end===null)&&(r.nodes.end=Zr),el();return}t!==null&&t.before(e)}function Zt(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function nC(t,e){return iC(t,e)}function aG(t,e){s8(),e.intro=e.intro??!1;const r=e.target,n=gr,i=Zr;try{for(var s=va(r);s&&(s.nodeType!==Rh||s.data!==n8);)s=ba(s);if(!s)throw Nh;Qs(!0),qi(s);const o=iC(t,{...e,anchor:s});return Qs(!1),o}catch(o){if(o instanceof Error&&o.message.split(`
3
3
  `).some(a=>a.startsWith("https://svelte.dev/e/")))throw o;return o!==Nh&&console.warn("Failed to hydrate: ",o),e.recover===!1&&uj(),s8(),pS(r),Qs(!1),nC(t,e)}finally{Qs(n),qi(i)}}const Jf=new Map;function iC(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:o=!0}){s8();var a=new Set,l=f=>{for(var g=0;g<f.length;g++){var m=f[g];if(!a.has(m)){a.add(m);var v=oG(m);e.addEventListener(m,Up,{passive:v});var A=Jf.get(m);A===void 0?(document.addEventListener(m,Up,{passive:v}),Jf.set(m,1)):Jf.set(m,A+1)}}};l(G3(XS)),y8.add(l);var u=void 0,d=Kj(()=>{var f=r??e.appendChild(Js());return Fj(f,{pending:()=>{}},g=>{Ut({});var m=Zn;if(s&&(m.c=s),i&&(n.$$events=i),gr&&pc(g,null),u=t(g,n)||{},gr&&(Hr.nodes.end=Zr,Zr===null||Zr.nodeType!==Rh||Zr.data!==i8))throw Op(),Nh;Dt()}),()=>{for(var g of a){e.removeEventListener(g,Up);var m=Jf.get(g);--m===0?(document.removeEventListener(g,Up),Jf.delete(g)):Jf.set(g,m)}y8.delete(l),f!==r&&f.parentNode?.removeChild(f)}});return w8.set(u,d),u}let w8=new WeakMap;function cG(t,e){const r=w8.get(t);return r?(w8.delete(t),r(e)):Promise.resolve()}class v8{anchor;#e=new Map;#t=new Map;#r=new Map;#o=new Set;#a=!0;constructor(e,r=!0){this.anchor=e,this.#a=r}#i=()=>{var e=pn;if(this.#e.has(e)){var r=this.#e.get(e),n=this.#t.get(r);if(n)m8(n),this.#o.delete(r);else{var i=this.#r.get(r);i&&(this.#t.set(r,i.effect),this.#r.delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[s,o]of this.#e){if(this.#e.delete(s),s===e)break;const a=this.#r.get(o);a&&(es(a.effect),this.#r.delete(o))}for(const[s,o]of this.#t){if(s===r||this.#o.has(s))continue;const a=()=>{if(Array.from(this.#e.values()).includes(s)){var u=document.createDocumentFragment();KS(o,u),u.append(Js()),this.#r.set(s,{effect:o,fragment:u})}else es(o);this.#o.delete(s),this.#t.delete(s)};this.#a||!n?(this.#o.add(s),Bh(o,a,!1)):a()}}};#n=e=>{this.#e.delete(e);const r=Array.from(this.#e.values());for(const[n,i]of this.#r)r.includes(n)||(es(i.effect),this.#r.delete(n))};ensure(e,r){var n=pn,i=gS();if(r&&!this.#t.has(e)&&!this.#r.has(e))if(i){var s=document.createDocumentFragment(),o=Js();s.append(o),this.#r.set(e,{effect:Xs(()=>r(o)),fragment:s})}else this.#t.set(e,Xs(()=>r(this.anchor)));if(this.#e.set(n,e),i){for(const[a,l]of this.#t)a===e?n.unskip_effect(l):n.skip_effect(l);for(const[a,l]of this.#r)a===e?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(this.#i),n.ondiscard(this.#n)}else gr&&(this.anchor=Zr),this.#i()}}const sC=0,b8=1;function Mi(t,e,r,n,i){gr&&el();var s=Gf(),o=xi,a=s?fc(o):yt(o,!1,!1),l=s?fc(o):yt(o,!1,!1),u=new v8(t);Bp(()=>{var d=e(),f=!1;let g=gr&&JT(d)===(t.data===Np);if(g&&(qi(xp()),Qs(!1)),JT(d)){var m=CS(),v=!1;const A=E=>{if(!f){v=!0,m(!1),tl.ensure(),gr&&Qs(!1);try{E()}finally{K3(),Zf||pt()}}};d.then(E=>{A(()=>{nl(a,E),u.ensure(b8,n&&(C=>n(C,a)))})},E=>{A(()=>{if(nl(l,E),u.ensure(b8,i&&(C=>i(C,l))),!i)throw l.v})}),gr?u.ensure(sC,r):wa(()=>{v||A(()=>{u.ensure(sC,r)})})}else nl(a,d),u.ensure(b8,n&&(A=>n(A,a)));return g&&Qs(!0),()=>{f=!0}})}function Rt(t,e,r=!1){gr&&el();var n=new v8(t),i=r?_h:0;function s(o,a){if(gr){const d=cS(t);var l;if(d===n8?l=0:d===Np?l=!1:l=parseInt(d.substring(1)),o!==l){var u=xp();qi(u),n.anchor=u,Qs(!1),n.ensure(o,a),Qs(!0);return}}n.ensure(o,a)}Bp(()=>{var o=!1;e((a,l=0)=>{o=!0,s(l,a)}),o||s(!1,null)},i)}function Uh(t,e){return e}function lG(t,e,r){for(var n=[],i=e.length,s,o=e.length,a=0;a<i;a++){let f=e[a];Bh(f,()=>{if(s){if(s.pending.delete(f),s.done.add(f),s.pending.size===0){var g=t.outrogroups;A8(G3(s.done)),g.delete(s),g.size===0&&(t.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=n.length===0&&r!==null;if(l){var u=r,d=u.parentNode;pS(d),d.append(u),t.items.clear()}A8(e,!l)}else s={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(s)}function A8(t,e=!0){for(var r=0;r<t.length;r++)es(t[r],e)}var oC;function du(t,e,r,n,i,s=null){var o=t,a=new Map,l=(e&sS)!==0;if(l){var u=t;o=gr?qi(va(u)):u.appendChild(Js())}gr&&el();var d=null,f=nr(()=>{var C=r();return Yw(C)?C:C==null?[]:G3(C)}),g,m=!0;function v(){E.fallback=d,uG(E,g,o,e,n),d!==null&&(g.length===0?(d.f&qc)===0?m8(d):(d.f^=qc,Fp(d,null,o)):Bh(d,()=>{d=null}))}var A=Bp(()=>{g=ae(f);var C=g.length;let k=!1;if(gr){var I=cS(o)===Np;I!==(C===0)&&(o=xp(),qi(o),Qs(!1),k=!0)}for(var S=new Set,N=pn,W=gS(),G=0;G<C;G+=1){gr&&Zr.nodeType===Rh&&Zr.data===i8&&(o=Zr,k=!0,Qs(!1));var L=g[G],V=n(L,G),$=m?null:a.get(V);$?($.v&&nl($.v,L),$.i&&nl($.i,G),W&&N.unskip_effect($.e)):($=hG(a,m?o:oC??=Js(),L,V,G,i,e,r),m||($.e.f|=qc),a.set(V,$)),S.add(V)}if(C===0&&s&&!d&&(m?d=Xs(()=>s(o)):(d=Xs(()=>s(oC??=Js())),d.f|=qc)),C>S.size&&sj(),gr&&C>0&&qi(xp()),!m)if(W){for(const[j,B]of a)S.has(j)||N.skip_effect(B.e);N.oncommit(v),N.ondiscard(()=>{})}else v();k&&Qs(!0),ae(f)}),E={effect:A,items:a,outrogroups:null,fallback:d};m=!1,gr&&(o=Zr)}function Dp(t){for(;t!==null&&(t.f&ya)===0;)t=t.next;return t}function uG(t,e,r,n,i){var s=(n&bj)!==0,o=e.length,a=t.items,l=Dp(t.effect.first),u,d=null,f,g=[],m=[],v,A,E,C;if(s)for(C=0;C<o;C+=1)v=e[C],A=i(v,C),E=a.get(A).e,(E.f&qc)===0&&(E.nodes?.a?.measure(),(f??=new Set).add(E));for(C=0;C<o;C+=1){if(v=e[C],A=i(v,C),E=a.get(A).e,t.outrogroups!==null)for(const $ of t.outrogroups)$.pending.delete(E),$.done.delete(E);if((E.f&qc)!==0)if(E.f^=qc,E===l)Fp(E,null,r);else{var k=d?d.next:l;E===t.effect.last&&(t.effect.last=E.prev),E.prev&&(E.prev.next=E.next),E.next&&(E.next.prev=E.prev),fu(t,d,E),fu(t,E,k),Fp(E,k,r),d=E,g=[],m=[],l=Dp(d.next);continue}if((E.f&lo)!==0&&(m8(E),s&&(E.nodes?.a?.unfix(),(f??=new Set).delete(E))),E!==l){if(u!==void 0&&u.has(E)){if(g.length<m.length){var I=m[0],S;d=I.prev;var N=g[0],W=g[g.length-1];for(S=0;S<g.length;S+=1)Fp(g[S],I,r);for(S=0;S<m.length;S+=1)u.delete(m[S]);fu(t,N.prev,W.next),fu(t,d,N),fu(t,W,I),l=I,d=W,C-=1,g=[],m=[]}else u.delete(E),Fp(E,l,r),fu(t,E.prev,E.next),fu(t,E,d===null?t.effect.first:d.next),fu(t,d,E),d=E;continue}for(g=[],m=[];l!==null&&l!==E;)(u??=new Set).add(l),m.push(l),l=Dp(l.next);if(l===null)continue}(E.f&qc)===0&&g.push(E),d=E,l=Dp(E.next)}if(t.outrogroups!==null){for(const $ of t.outrogroups)$.pending.size===0&&(A8(G3($.done)),t.outrogroups?.delete($));t.outrogroups.size===0&&(t.outrogroups=null)}if(l!==null||u!==void 0){var G=[];if(u!==void 0)for(E of u)(E.f&lo)===0&&G.push(E);for(;l!==null;)(l.f&lo)===0&&l!==t.fallback&&G.push(l),l=Dp(l.next);var L=G.length;if(L>0){var V=(n&sS)!==0&&o===0?r:null;if(s){for(C=0;C<L;C+=1)G[C].nodes?.a?.measure();for(C=0;C<L;C+=1)G[C].nodes?.a?.fix()}lG(t,G,V)}}s&&wa(()=>{if(f!==void 0)for(E of f)E.nodes?.a?.apply()})}function hG(t,e,r,n,i,s,o,a){var l=(o&wj)!==0?(o&Aj)===0?yt(r,!1,!1):fc(r):null,u=(o&vj)!==0?fc(i):null;return{v:l,i:u,e:Xs(()=>(s(e,l??r,u??i,a),()=>{t.delete(n)}))}}function Fp(t,e,r){if(t.nodes)for(var n=t.nodes.start,i=t.nodes.end,s=e&&(e.f&qc)===0?e.nodes.start:r;n!==null;){var o=ba(n);if(s.before(n),n===i)return;n=o}}function fu(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function E8(t,e,r=!1,n=!1,i=!1){var s=t,o="";Et(()=>{var a=Hr;if(o===(o=e()??"")){gr&&el();return}if(a.nodes!==null&&($S(a.nodes.start,a.nodes.end),a.nodes=null),o!==""){if(gr){Zr.data;for(var l=el(),u=l;l!==null&&(l.nodeType!==Rh||l.data!=="");)u=l,l=ba(l);if(l===null)throw Op(),Nh;pc(Zr,u),s=qi(l);return}var d=o+"";r?d=`<svg>${d}</svg>`:n&&(d=`<math>${d}</math>`);var f=rC(d);if((r||n)&&(f=va(f)),pc(va(f),f.lastChild),r||n)for(;va(f);)s.before(va(f));else s.before(f)}})}function jo(t,e,r,n,i){gr&&el();var s=e.$$slots?.[r],o=!1;s===!0&&(s=e[r==="default"?"children":r],o=!0),s===void 0||s(t,o?()=>n:n)}function Ei(t,e,r){gr&&el();var n=new v8(t);Bp(()=>{var i=e()??null;n.ensure(i,i&&(s=>r(s,i)))},_h)}function pu(t,e){g8(()=>{var r=t.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,n.appendChild(i)}})}function dG(t,e){var r=void 0,n;GS(()=>{r!==(r=e())&&(n&&(es(n),n=null),r&&(n=Xs(()=>{g8(()=>r(t))})))})}function aC(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=aC(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function fG(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=aC(t))&&(n&&(n+=" "),n+=e);return n}function T8(t){return typeof t=="object"?fG(t):t??""}const cC=[...`
4
4
  \r\f \v\uFEFF`];function pG(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,o=0;(o=n.indexOf(i,o))>=0;){var a=o+s;(o===0||cC.includes(n[o-1]))&&(a===n.length||cC.includes(n[a]))?n=(o===0?"":n.substring(0,o))+n.substring(a+1):o=a}}return n===""?null:n}function lC(t,e=!1){var r=e?" !important;":";",n="";for(var i in t){var s=t[i];s!=null&&s!==""&&(n+=" "+i+": "+s+r)}return n}function S8(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function gG(t,e){if(e){var r="",n,i;if(Array.isArray(e)?(n=e[0],i=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,o=0,a=!1,l=[];n&&l.push(...Object.keys(n).map(S8)),i&&l.push(...Object.keys(i).map(S8));var u=0,d=-1;const A=t.length;for(var f=0;f<A;f++){var g=t[f];if(a?g==="/"&&t[f-1]==="*"&&(a=!1):s?s===g&&(s=!1):g==="/"&&t[f+1]==="*"?a=!0:g==='"'||g==="'"?s=g:g==="("?o++:g===")"&&o--,!a&&s===!1&&o===0){if(g===":"&&d===-1)d=f;else if(g===";"||f===A-1){if(d!==-1){var m=S8(t.substring(u,d).trim());if(!l.includes(m)){g!==";"&&f++;var v=t.substring(u,f).trim();r+=" "+v+";"}}u=f+1,d=-1}}}}return n&&(r+=lC(n)),i&&(r+=lC(i,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function ri(t,e,r,n,i,s){var o=t.__className;if(gr||o!==r||o===void 0){var a=pG(r,n,s);(!gr||a!==t.getAttribute("class"))&&(a==null?t.removeAttribute("class"):e?t.className=a:t.setAttribute("class",a)),t.__className=r}else if(s&&i!==s)for(var l in s){var u=!!s[l];(i==null||u!==!!i[l])&&t.classList.toggle(l,u)}return s}function C8(t,e={},r,n){for(var i in r){var s=r[i];e[i]!==s&&(r[i]==null?t.style.removeProperty(i):t.style.setProperty(i,s,n))}}function Go(t,e,r,n){var i=t.__style;if(gr||i!==e){var s=gG(e,n);(!gr||s!==t.getAttribute("style"))&&(s==null?t.removeAttribute("style"):t.style.cssText=s),t.__style=e}else n&&(Array.isArray(n)?(C8(t,r?.[0],n[0]),C8(t,r?.[1],n[1],"important")):C8(t,r,n));return n}function k8(t,e,r=!1){if(t.multiple){if(e==null)return;if(!Yw(e))return Oj();for(var n of t.options)n.selected=e.includes(uC(n));return}for(n of t.options){var i=uC(n);if(Pj(i,e)){n.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function mG(t){var e=new MutationObserver(()=>{k8(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ry(()=>{e.disconnect()})}function uC(t){return"__value"in t?t.__value:t.value}const Yf=Symbol("class"),Lp=Symbol("style"),hC=Symbol("is custom element"),dC=Symbol("is html");function _8(t){if(gr){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;ar(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var i=t.checked;ar(t,"checked",null),t.checked=i}}};t.__on_r=r,wa(r),xS()}}function I8(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ar(t,e,r,n){var i=pC(t);gr&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||i[e]!==(i[e]=r)&&(e==="loading"&&(t[nj]=r),r==null?t.removeAttribute(e):typeof r!="string"&&mC(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function yG(t,e,r,n,i=!1,s=!1){if(gr&&i&&t.tagName==="INPUT"){var o=t,a=o.type==="checkbox"?"defaultChecked":"defaultValue";a in r||_8(o)}var l=pC(t),u=l[hC],d=!l[dC];let f=gr&&u;f&&Qs(!1);var g=e||{},m=t.tagName==="OPTION";for(var v in e)v in r||(r[v]=null);r.class?r.class=T8(r.class):(n||r[Yf])&&(r.class=null),r[Lp]&&(r.style??=null);var A=mC(t);for(const W in r){let G=r[W];if(m&&W==="value"&&G==null){t.value=t.__value="",g[W]=G;continue}if(W==="class"){var E=t.namespaceURI==="http://www.w3.org/1999/xhtml";ri(t,E,G,n,e?.[Yf],r[Yf]),g[W]=G,g[Yf]=r[Yf];continue}if(W==="style"){Go(t,G,e?.[Lp],r[Lp]),g[W]=G,g[Lp]=r[Lp];continue}var C=g[W];if(!(G===C&&!(G===void 0&&t.hasAttribute(W)))){g[W]=G;var k=W[0]+W[1];if(k!=="$$")if(k==="on"){const L={},V="$$"+W;let $=W.slice(2);var I=rG($);if(eG($)&&($=$.slice(0,-7),L.capture=!0),!I&&C){if(G!=null)continue;t.removeEventListener($,g[V],L),g[V]=null}if(G!=null)if(I)t[`__${$}`]=G,eC([$]);else{let j=function(B){g[W].call(this,B)};g[V]=qS($,t,j,L)}else I&&(t[`__${$}`]=void 0)}else if(W==="style")ar(t,W,G);else if(W==="autofocus")Gj(t,!!G);else if(!u&&(W==="__value"||W==="value"&&G!=null))t.value=t.__value=G;else if(W==="selected"&&m)I8(t,G);else{var S=W;d||(S=iG(S));var N=S==="defaultValue"||S==="defaultChecked";if(G==null&&!u&&!N)if(l[W]=null,S==="value"||S==="checked"){let L=t;const V=e===void 0;if(S==="value"){let $=L.defaultValue;L.removeAttribute(S),L.defaultValue=$,L.value=L.__value=V?$:null}else{let $=L.defaultChecked;L.removeAttribute(S),L.defaultChecked=$,L.checked=V?$:!1}}else t.removeAttribute(W);else N||A.includes(S)&&(u||typeof G!="string")?(t[S]=G,S in l&&(l[S]=xi)):typeof G!="function"&&ar(t,S,G)}}}return f&&Qs(!0),g}function fC(t,e,r=[],n=[],i=[],s,o=!1,a=!1){SS(i,r,n,l=>{var u=void 0,d={},f=t.nodeName==="SELECT",g=!1;if(GS(()=>{var v=e(...l.map(ae)),A=yG(t,u,v,s,o,a);g&&f&&"value"in v&&k8(t,v.value);for(let C of Object.getOwnPropertySymbols(d))v[C]||es(d[C]);for(let C of Object.getOwnPropertySymbols(v)){var E=v[C];C.description===Rj&&(!u||E!==u[C])&&(d[C]&&es(d[C]),d[C]=Xs(()=>dG(t,()=>E))),A[C]=E}u=A}),f){var m=t;g8(()=>{k8(m,u.value,!0),mG(m)})}g=!0})}function pC(t){return t.__attributes??={[hC]:t.nodeName.includes("-"),[dC]:t.namespaceURI===Ij}}var gC=new Map;function mC(t){var e=t.getAttribute("is")||t.nodeName,r=gC.get(e);if(r)return r;gC.set(e,r=[]);for(var n,i=t,s=Element.prototype;s!==i;){n=$T(i);for(var o in n)n[o].set&&r.push(o);i=Xw(i)}return r}function R8(t,e,r=e){var n=new WeakSet;zj(t,"input",async i=>{var s=i?t.defaultValue:t.value;if(s=N8(t)?O8(s):s,r(s),pn!==null&&n.add(pn),await Qj(),s!==(s=e())){var o=t.selectionStart,a=t.selectionEnd,l=t.value.length;if(t.value=s??"",a!==null){var u=t.value.length;o===a&&a===l&&u>l?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=o,t.selectionEnd=Math.min(a,u))}}}),(gr&&t.defaultValue!==t.value||nt(e)==null&&t.value)&&(r(N8(t)?O8(t.value):t.value),pn!==null&&n.add(pn)),ny(()=>{var i=e();if(t===document.activeElement){var s=a8??pn;if(n.has(s))return}N8(t)&&i===O8(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function N8(t){var e=t.type;return e==="number"||e==="range"}function O8(t){return t===""?null:+t}function x8(t){return function(...e){var r=e[0];return r.preventDefault(),t?.apply(this,e)}}function cr(t=!1){const e=Zn,r=e.l.u;if(!r)return;let n=()=>ft(e.s);if(t){let i=0,s={};const o=Pp(()=>{let a=!1;const l=e.s;for(const u in l)l[u]!==s[u]&&(s[u]=l[u],a=!0);return a&&i++,i});n=()=>ae(o)}r.b.length&&Yj(()=>{yC(e,n),z3(r.b)}),p8(()=>{const i=nt(()=>r.m.map(tj));return()=>{for(const s of i)typeof s=="function"&&s()}}),r.a.length&&p8(()=>{yC(e,n),z3(r.a)})}function yC(t,e){if(t.l.s)for(const r of t.l.s)ae(r);e()}function Lt(t,e,r){t.$$events||={},t.$$events[e]||=[],t.$$events[e].push(r)}function Vt(t){for(var e in t)e in this&&(this[e]=t[e])}let iy=!1,P8=Symbol();function wr(t,e,r){const n=r[e]??={store:null,source:yt(void 0),unsubscribe:au};if(n.store!==t&&!(P8 in r))if(n.unsubscribe(),n.store=t??null,t==null)n.source.v=void 0,n.unsubscribe=au;else{var i=!0;n.unsubscribe=M8(t,s=>{i?n.source.v=s:Ye(n.source,s)}),i=!1}return t&&P8 in r?dt(t):ae(n.source)}function Bi(){const t={};function e(){ry(()=>{for(var r in t)t[r].unsubscribe();Kw(t,P8,{enumerable:!1,value:!0})})}return[t,e]}function wG(t,e,r){return t.set(r),e}function vG(t){var e=iy;try{return iy=!1,[t(),iy]}finally{iy=e}}const bG={get(t,e){if(!t.exclude.includes(e))return ae(t.version),e in t.special?t.special[e]():t.props[e]},set(t,e,r){if(!(e in t.special)){var n=Hr;try{Vo(t.parent_effect),t.special[e]=gt({get[e](){return t.props[e]}},e,oS)}finally{Vo(n)}}return t.special[e](r),RS(t.version),!0},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},deleteProperty(t,e){return t.exclude.includes(e)||(t.exclude.push(e),RS(t.version)),!0},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Vp(t,e){return new Proxy({props:t,exclude:e,special:{},version:fc(0),parent_effect:Hr},bG)}function gt(t,e,r,n){var i=!Wf||(r&Tj)!==0,s=(r&Sj)!==0,o=(r&Cj)!==0,a=n,l=!0,u=()=>(l&&(l=!1,a=o?nt(n):n),a),d;if(s){var f=lu in t||eS in t;d=Lf(t,e)?.set??(f&&e in t?I=>t[e]=I:void 0)}var g,m=!1;s?[g,m]=vG(()=>t[e]):g=t[e],g===void 0&&n!==void 0&&(g=u(),d&&(i&&hj(),d(g)));var v;if(i?v=()=>{var I=t[e];return I===void 0?u():(l=!0,I)}:v=()=>{var I=t[e];return I!==void 0&&(a=void 0),I===void 0?a:I},i&&(r&oS)===0)return v;if(d){var A=t.$$legacy;return(function(I,S){return arguments.length>0?((!i||!S||A||m)&&d(S?v():I),I):v()})}var E=!1,C=((r&Ej)!==0?Pp:nr)(()=>(E=!1,v()));s&&ae(C);var k=Hr;return(function(I,S){if(arguments.length>0){const N=S?ae(C):i&&s?xh(I):I;return Ye(C,N),E=!0,a!==void 0&&(a=N),I}return hu&&E||(k.f&Xc)!==0?C.v:ae(C)})}function Ht(t){return new AG(t)}class AG{#e;#t;constructor(e){var r=new Map,n=(s,o)=>{var a=yt(o,!1,!1);return r.set(s,a),a};const i=new Proxy({...e.props||{},$$events:{}},{get(s,o){return ae(r.get(o)??n(o,Reflect.get(s,o)))},has(s,o){return o===eS?!0:(ae(r.get(o)??n(o,Reflect.get(s,o))),Reflect.has(s,o))},set(s,o,a){return Ye(r.get(o)??n(o,a),a),Reflect.set(s,o,a)}});this.#t=(e.hydrate?aG:nC)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&pt(),this.#e=i.$$events;for(const s of Object.keys(this.#t))s==="$set"||s==="$destroy"||s==="$on"||Kw(this,s,{get(){return this.#t[s]},set(o){this.#t[s]=o},enumerable:!0});this.#t.$set=s=>{Object.assign(i,s)},this.#t.$destroy=()=>{cG(this.#t)}}$set(e){this.#t.$set(e)}$on(e,r){this.#e[e]=this.#e[e]||[];const n=(...i)=>r.call(this,...i);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}function Dh(t){Zn===null&&iS(),Wf&&Zn.l!==null?EG(Zn).m.push(t):p8(()=>{const e=nt(t);if(typeof e=="function")return e})}function Kf(t){Zn===null&&iS(),Dh(()=>()=>nt(t))}function EG(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}function M8(t,e,r){if(t==null)return e(void 0),r&&r(void 0),au;const n=nt(()=>t.subscribe(e,r));return n.unsubscribe?()=>n.unsubscribe():n}const Xf=[];function TG(t,e){return{subscribe:ws(t,e).subscribe}}function ws(t,e=au){let r=null;const n=new Set;function i(a){if(rS(t,a)&&(t=a,r)){const l=!Xf.length;for(const u of n)u[1](),Xf.push(u,t);if(l){for(let u=0;u<Xf.length;u+=2)Xf[u][0](Xf[u+1]);Xf.length=0}}}function s(a){i(a(t))}function o(a,l=au){const u=[a,l];return n.add(u),n.size===1&&(r=e(i,s)||au),a(t),()=>{n.delete(u),n.size===0&&r&&(r(),r=null)}}return{set:i,update:s,subscribe:o}}function B8(t,e,r){const n=!Array.isArray(t),i=n?[t]:t;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return TG(r,(o,a)=>{let l=!1;const u=[];let d=0,f=au;const g=()=>{if(d)return;f();const v=e(n?u[0]:u,o,a);s?o(v):f=typeof v=="function"?v:au},m=i.map((v,A)=>M8(v,E=>{u[A]=E,d&=~(1<<A),l&&g()},()=>{d|=1<<A}));return l=!0,g(),function(){z3(m),f(),l=!1}})}function dt(t){let e;return M8(t,r=>e=r)(),e}function SG(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wC={exports:{}},li=wC.exports={},gc,mc;function U8(){throw new Error("setTimeout has not been defined")}function D8(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?gc=setTimeout:gc=U8}catch{gc=U8}try{typeof clearTimeout=="function"?mc=clearTimeout:mc=D8}catch{mc=D8}})();function vC(t){if(gc===setTimeout)return setTimeout(t,0);if((gc===U8||!gc)&&setTimeout)return gc=setTimeout,setTimeout(t,0);try{return gc(t,0)}catch{try{return gc.call(null,t,0)}catch{return gc.call(this,t,0)}}}function CG(t){if(mc===clearTimeout)return clearTimeout(t);if((mc===D8||!mc)&&clearTimeout)return mc=clearTimeout,clearTimeout(t);try{return mc(t)}catch{try{return mc.call(null,t)}catch{return mc.call(this,t)}}}var il=[],qf=!1,Fh,sy=-1;function kG(){!qf||!Fh||(qf=!1,Fh.length?il=Fh.concat(il):sy=-1,il.length&&bC())}function bC(){if(!qf){var t=vC(kG);qf=!0;for(var e=il.length;e;){for(Fh=il,il=[];++sy<e;)Fh&&Fh[sy].run();sy=-1,e=il.length}Fh=null,qf=!1,CG(t)}}li.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];il.push(new AC(t,e)),il.length===1&&!qf&&vC(bC)};function AC(t,e){this.fun=t,this.array=e}AC.prototype.run=function(){this.fun.apply(null,this.array)},li.title="browser",li.browser=!0,li.env={},li.argv=[],li.version="",li.versions={};function sl(){}li.on=sl,li.addListener=sl,li.once=sl,li.off=sl,li.removeListener=sl,li.removeAllListeners=sl,li.emit=sl,li.prependListener=sl,li.prependOnceListener=sl,li.listeners=function(t){return[]},li.binding=function(t){throw new Error("process.binding is not supported")},li.cwd=function(){return"/"},li.chdir=function(t){throw new Error("process.chdir is not supported")},li.umask=function(){return 0};var _G=wC.exports;const F8=SG(_G);var IG=Object.defineProperty,EC=t=>{throw TypeError(t)},RG=(t,e,r)=>e in t?IG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,de=(t,e,r)=>RG(t,typeof e!="symbol"?e+"":e,r),L8=(t,e,r)=>e.has(t)||EC("Cannot "+r),M=(t,e,r)=>(L8(t,e,"read from private field"),r?r.call(t):e.get(t)),Ee=(t,e,r)=>e.has(t)?EC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ne=(t,e,r,n)=>(L8(t,e,"write to private field"),e.set(t,r),r),Le=(t,e,r)=>(L8(t,e,"access private method"),r),yc=(t,e,r,n)=>({set _(i){ne(t,e,i)},get _(){return M(t,e,n)}});const oy="6.13.5";function NG(t,e,r){const n=e.split("|").map(s=>s.trim());for(let s=0;s<n.length;s++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=t,i}async function Ui(t){const e=Object.keys(t);return(await Promise.all(e.map(r=>Promise.resolve(t[r])))).reduce((r,n,i)=>(r[e[i]]=n,r),{})}function Ft(t,e,r){for(let n in e){let i=e[n];const s=r?r[n]:null;s&&NG(i,s,n),Object.defineProperty(t,n,{enumerable:!0,value:i,writable:!1})}}function e0(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(e0).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let r="0x";for(let n=0;n<t.length;n++)r+=e[t[n]>>4],r+=e[t[n]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return e0(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(r=>`${e0(r)}: ${e0(t[r])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function ui(t,e){return t&&t.code===e}function Hp(t){return ui(t,"CALL_EXCEPTION")}function Nn(t,e,r){let n=t;{const s=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${e0(r)}`);for(const o in r){if(o==="shortMessage")continue;const a=r[o];s.push(o+"="+e0(a))}}s.push(`code=${e}`),s.push(`version=${oy}`),s.length&&(t+=" ("+s.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Ft(i,{code:e}),r&&Object.assign(i,r),i.shortMessage==null&&Ft(i,{shortMessage:n}),i}function ot(t,e,r,n){if(!t)throw Nn(e,r,n)}function De(t,e,r,n){ot(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}function ay(t,e,r){r==null&&(r=""),r&&(r=": "+r),ot(t>=e,"missing argument"+r,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ot(t<=e,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const OG=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function cy(t){ot(OG.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function wc(t,e,r){if(r==null&&(r=""),t!==e){let n=r,i="new";r&&(n+=".",i+=" "+r),ot(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function TC(t,e,r){if(t instanceof Uint8Array)return r?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const n=new Uint8Array((t.length-2)/2);let i=2;for(let s=0;s<n.length;s++)n[s]=parseInt(t.substring(i,i+2),16),i+=2;return n}De(!1,"invalid BytesLike value",e||"value",t)}function Ot(t,e){return TC(t,e,!1)}function Di(t,e){return TC(t,e,!0)}function wn(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function t0(t){return wn(t,!0)||t instanceof Uint8Array}const SC="0123456789abcdef";function At(t){const e=Ot(t);let r="0x";for(let n=0;n<e.length;n++){const i=e[n];r+=SC[(i&240)>>4]+SC[i&15]}return r}function Qr(t){return"0x"+t.map(e=>At(e).substring(2)).join("")}function ol(t){return wn(t,!0)?(t.length-2)/2:Ot(t).length}function vn(t,e,r){const n=Ot(t);return r!=null&&r>n.length&&ot(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),At(n.slice(e??0,r??n.length))}function CC(t){let e=At(t).substring(2);for(;e.startsWith("00");)e=e.substring(2);return"0x"+e}function kC(t,e,r){const n=Ot(t);ot(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),r?i.set(n,e-n.length):i.set(n,0),At(i)}function zo(t,e){return kC(t,e,!0)}function Wp(t,e){return kC(t,e,!1)}const ly=BigInt(0),ka=BigInt(1),r0=9007199254740991;function n0(t,e){const r=i0(t,"value"),n=BigInt(ir(e,"width"));if(ot(r>>n===ly,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),r>>n-ka){const i=(ka<<n)-ka;return-((~r&i)+ka)}return r}function jp(t,e){let r=Yt(t,"value");const n=BigInt(ir(e,"width")),i=ka<<n-ka;if(r<ly){r=-r,ot(r<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const s=(ka<<n)-ka;return(~r&s)+ka}else ot(r<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return r}function al(t,e){const r=i0(t,"value"),n=BigInt(ir(e,"bits"));return r&(ka<<n)-ka}function Yt(t,e){switch(typeof t){case"bigint":return t;case"number":return De(Number.isInteger(t),"underflow",e||"value",t),De(t>=-r0&&t<=r0,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(r){De(!1,`invalid BigNumberish string: ${r.message}`,e||"value",t)}}De(!1,"invalid BigNumberish value",e||"value",t)}function i0(t,e){const r=Yt(t,e);return ot(r>=ly,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),r}const _C="0123456789abcdef";function Lh(t){if(t instanceof Uint8Array){let e="0x0";for(const r of t)e+=_C[r>>4],e+=_C[r&15];return BigInt(e)}return Yt(t)}function ir(t,e){switch(typeof t){case"bigint":return De(t>=-r0&&t<=r0,"overflow",e||"value",t),Number(t);case"number":return De(Number.isInteger(t),"underflow",e||"value",t),De(t>=-r0&&t<=r0,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return ir(BigInt(t),e)}catch(r){De(!1,`invalid numeric string: ${r.message}`,e||"value",t)}}De(!1,"invalid numeric value",e||"value",t)}function V8(t){return ir(Lh(t))}function Zo(t,e){let r=i0(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const n=ir(e,"width");for(ot(n*2>=r.length,`value exceeds width (${n} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<n*2;)r="0"+r}return"0x"+r}function Fi(t){const e=i0(t,"value");if(e===ly)return new Uint8Array([]);let r=e.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let i=0;i<n.length;i++){const s=i*2;n[i]=parseInt(r.substring(s,s+2),16)}return n}function cl(t){let e=At(t0(t)?t:Fi(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const uy="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let hy=null;function xG(t){if(hy==null){hy={};for(let r=0;r<uy.length;r++)hy[uy[r]]=BigInt(r)}const e=hy[t];return De(e!=null,"invalid base58 value","letter",t),e}const PG=BigInt(0),H8=BigInt(58);function dy(t){const e=Ot(t);let r=Lh(e),n="";for(;r;)n=uy[Number(r%H8)]+n,r/=H8;for(let i=0;i<e.length&&!e[i];i++)n=uy[0]+n;return n}function W8(t){let e=PG;for(let r=0;r<t.length;r++)e*=H8,e+=xG(t[r]);return e}function j8(t){t=atob(t);const e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return Ot(e)}function G8(t){const e=Ot(t);let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}var Gp;class fy{constructor(e,r,n){de(this,"filter"),de(this,"emitter"),Ee(this,Gp),ne(this,Gp,r),Ft(this,{emitter:e,filter:n})}async removeListener(){M(this,Gp)!=null&&await this.emitter.off(this.filter,M(this,Gp))}}Gp=new WeakMap;function MG(t,e,r,n,i){De(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function IC(t,e,r,n,i){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let s=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)s++;return s}return t==="OVERRUN"?r.length-e-1:0}function BG(t,e,r,n,i){return t==="OVERLONG"?(De(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),IC(t,e,r))}const z8=Object.freeze({error:MG,ignore:IC,replace:BG});function RC(t,e){e==null&&(e=z8.error);const r=Ot(t,"bytes"),n=[];let i=0;for(;i<r.length;){const s=r[i++];if(!(s>>7)){n.push(s);continue}let o=null,a=null;if((s&224)===192)o=1,a=127;else if((s&240)===224)o=2,a=2047;else if((s&248)===240)o=3,a=65535;else{(s&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,r,n):i+=e("BAD_PREFIX",i-1,r,n);continue}if(i-1+o>=r.length){i+=e("OVERRUN",i-1,r,n);continue}let l=s&(1<<8-o-1)-1;for(let u=0;u<o;u++){let d=r[i];if((d&192)!=128){i+=e("MISSING_CONTINUE",i,r,n),l=null;break}l=l<<6|d&63,i++}if(l!==null){if(l>1114111){i+=e("OUT_OF_RANGE",i-1-o,r,n,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,r,n,l);continue}if(l<=a){i+=e("OVERLONG",i-1-o,r,n,l);continue}n.push(l)}}return n}function Ti(t,e){De(typeof t=="string","invalid string value","str",t),e!=null&&(cy(e),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);De(n<t.length&&(s&64512)===56320,"invalid surrogate pair","str",t);const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return new Uint8Array(r)}function UG(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function ll(t,e){return UG(RC(t,e))}function NC(t,e){return RC(Ti(t,e))}function OC(t){async function e(r,n){ot(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");const i=r.url.split(":")[0].toLowerCase();ot(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),ot(i==="https"||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const o=new AbortController,a=setTimeout(()=>{s=Nn("request timeout","TIMEOUT"),o.abort()},r.timeout);n&&n.addListener(()=>{s=Nn("request cancelled","CANCELLED"),o.abort()});const l={method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal};let u;try{u=await fetch(r.url,l)}catch(m){throw clearTimeout(a),s||m}clearTimeout(a);const d={};u.headers.forEach((m,v)=>{d[v.toLowerCase()]=m});const f=await u.arrayBuffer(),g=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:d,body:g}}return e}const DG=12,FG=250;let xC=OC();const LG=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),VG=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Z8=!1;async function PC(t,e){try{const r=t.match(LG);if(!r)throw new Error("invalid data");return new yu(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?j8(r[3]):jG(r[3]))}catch{return new yu(599,"BAD REQUEST (invalid data: URI)",{},null,new vs(t))}}function MC(t){async function e(r,n){try{const i=r.match(VG);if(!i)throw new Error("invalid link");return new vs(`${t}${i[2]}`)}catch{return new yu(599,"BAD REQUEST (invalid IPFS URI)",{},null,new vs(r))}}return e}const py={data:PC,ipfs:MC("https://gateway.ipfs.io/ipfs/")},BC=new WeakMap;var s0,Vh;class $8{constructor(e){Ee(this,s0),Ee(this,Vh),ne(this,s0,[]),ne(this,Vh,!1),BC.set(e,()=>{if(!M(this,Vh)){ne(this,Vh,!0);for(const r of M(this,s0))setTimeout(()=>{r()},0);ne(this,s0,[])}})}addListener(e){ot(!M(this,Vh),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),M(this,s0).push(e)}get cancelled(){return M(this,Vh)}checkSignal(){ot(!this.cancelled,"cancelled","CANCELLED",{})}}s0=new WeakMap,Vh=new WeakMap;function gy(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var zp,Zp,vc,gu,$p,Qp,ts,$o,mu,o0,a0,c0,ul,bc,Hh,l0,Jp;const HG=class VT{constructor(e){Ee(this,l0),Ee(this,zp),Ee(this,Zp),Ee(this,vc),Ee(this,gu),Ee(this,$p),Ee(this,Qp),Ee(this,ts),Ee(this,$o),Ee(this,mu),Ee(this,o0),Ee(this,a0),Ee(this,c0),Ee(this,ul),Ee(this,bc),Ee(this,Hh),ne(this,Qp,String(e)),ne(this,zp,!1),ne(this,Zp,!0),ne(this,vc,{}),ne(this,gu,""),ne(this,$p,3e5),ne(this,bc,{slotInterval:FG,maxAttempts:DG}),ne(this,Hh,null)}get url(){return M(this,Qp)}set url(e){ne(this,Qp,String(e))}get body(){return M(this,ts)==null?null:new Uint8Array(M(this,ts))}set body(e){if(e==null)ne(this,ts,void 0),ne(this,$o,void 0);else if(typeof e=="string")ne(this,ts,Ti(e)),ne(this,$o,"text/plain");else if(e instanceof Uint8Array)ne(this,ts,e),ne(this,$o,"application/octet-stream");else if(typeof e=="object")ne(this,ts,Ti(JSON.stringify(e))),ne(this,$o,"application/json");else throw new Error("invalid body")}hasBody(){return M(this,ts)!=null}get method(){return M(this,gu)?M(this,gu):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),ne(this,gu,String(e).toUpperCase())}get headers(){const e=Object.assign({},M(this,vc));return M(this,mu)&&(e.authorization=`Basic ${G8(Ti(M(this,mu)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&M(this,$o)&&(e["content-type"]=M(this,$o)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,r){M(this,vc)[String(e).toLowerCase()]=String(r)}clearHeaders(){ne(this,vc,{})}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return M(this,mu)||null}setCredentials(e,r){De(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),ne(this,mu,`${e}:${r}`)}get allowGzip(){return M(this,Zp)}set allowGzip(e){ne(this,Zp,!!e)}get allowInsecureAuthentication(){return!!M(this,zp)}set allowInsecureAuthentication(e){ne(this,zp,!!e)}get timeout(){return M(this,$p)}set timeout(e){De(e>=0,"timeout must be non-zero","timeout",e),ne(this,$p,e)}get preflightFunc(){return M(this,o0)||null}set preflightFunc(e){ne(this,o0,e)}get processFunc(){return M(this,a0)||null}set processFunc(e){ne(this,a0,e)}get retryFunc(){return M(this,c0)||null}set retryFunc(e){ne(this,c0,e)}get getUrlFunc(){return M(this,Hh)||xC}set getUrlFunc(e){ne(this,Hh,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${M(this,ts)?At(M(this,ts)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(M(this,bc).slotInterval=e.slotInterval),e.maxAttempts!=null&&(M(this,bc).maxAttempts=e.maxAttempts)}send(){return ot(M(this,ul)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),ne(this,ul,new $8(this)),Le(this,l0,Jp).call(this,0,UC()+this.timeout,0,this,new yu(0,"",{},null,this))}cancel(){ot(M(this,ul)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=BC.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();ot(this.method==="GET"&&(r!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new VT(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,ne(i,vc,Object.assign({},M(this,vc))),M(this,ts)&&ne(i,ts,new Uint8Array(M(this,ts))),ne(i,$o,M(this,$o)),i}clone(){const e=new VT(this.url);return ne(e,gu,M(this,gu)),M(this,ts)&&ne(e,ts,M(this,ts)),ne(e,$o,M(this,$o)),ne(e,vc,Object.assign({},M(this,vc))),ne(e,mu,M(this,mu)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),ne(e,o0,M(this,o0)),ne(e,a0,M(this,a0)),ne(e,c0,M(this,c0)),ne(e,bc,Object.assign({},M(this,bc))),ne(e,Hh,M(this,Hh)),e}static lockConfig(){Z8=!0}static getGateway(e){return py[e.toLowerCase()]||null}static registerGateway(e,r){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Z8)throw new Error("gateways locked");py[e]=r}static registerGetUrl(e){if(Z8)throw new Error("gateways locked");xC=e}static createGetUrlFunc(e){return OC()}static createDataGateway(){return PC}static createIpfsGatewayFunc(e){return MC(e)}};zp=new WeakMap,Zp=new WeakMap,vc=new WeakMap,gu=new WeakMap,$p=new WeakMap,Qp=new WeakMap,ts=new WeakMap,$o=new WeakMap,mu=new WeakMap,o0=new WeakMap,a0=new WeakMap,c0=new WeakMap,ul=new WeakMap,bc=new WeakMap,Hh=new WeakMap,l0=new WeakSet,Jp=async function(t,e,r,n,i){var s,o,a;if(t>=M(this,bc).maxAttempts)return i.makeServerError("exceeded maximum retry limit");ot(UC()<=e,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),r>0&&await GG(r);let l=this.clone();const u=(l.url.split(":")[0]||"").toLowerCase();if(u in py){const g=await py[u](l.url,gy(M(n,ul)));if(g instanceof yu){let m=g;if(this.processFunc){gy(M(n,ul));try{m=await this.processFunc(l,m)}catch(v){(v.throttle==null||typeof v.stall!="number")&&m.makeServerError("error in post-processing function",v).assertOk()}}return m}l=g}this.preflightFunc&&(l=await this.preflightFunc(l));const d=await this.getUrlFunc(l,gy(M(n,ul)));let f=new yu(d.statusCode,d.statusMessage,d.headers,d.body,n);if(f.statusCode===301||f.statusCode===302){try{const g=f.headers.location||"";return Le(s=l.redirect(g),l0,Jp).call(s,t+1,e,0,n,f)}catch{}return f}else if(f.statusCode===429&&(this.retryFunc==null||await this.retryFunc(l,f,t))){const g=f.headers["retry-after"];let m=M(this,bc).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(m=parseInt(g)),Le(o=l.clone(),l0,Jp).call(o,t+1,e,m,n,f)}if(this.processFunc){gy(M(n,ul));try{f=await this.processFunc(l,f)}catch(g){(g.throttle==null||typeof g.stall!="number")&&f.makeServerError("error in post-processing function",g).assertOk();let m=M(this,bc).slotInterval*Math.trunc(Math.random()*Math.pow(2,t));return g.stall>=0&&(m=g.stall),Le(a=l.clone(),l0,Jp).call(a,t+1,e,m,n,f)}}return f};let vs=HG;var my,yy,wy,Qo,Yp,u0;const WG=class PW{constructor(e,r,n,i,s){Ee(this,my),Ee(this,yy),Ee(this,wy),Ee(this,Qo),Ee(this,Yp),Ee(this,u0),ne(this,my,e),ne(this,yy,r),ne(this,wy,Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{})),ne(this,Qo,i==null?null:new Uint8Array(i)),ne(this,Yp,s||null),ne(this,u0,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${M(this,Qo)?At(M(this,Qo)):"null"}>`}get statusCode(){return M(this,my)}get statusMessage(){return M(this,yy)}get headers(){return Object.assign({},M(this,wy))}get body(){return M(this,Qo)==null?null:new Uint8Array(M(this,Qo))}get bodyText(){try{return M(this,Qo)==null?"":ll(M(this,Qo))}catch{ot(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ot(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,r=Object.keys(e);let n=0;return{next:()=>{if(n<r.length){const i=r[n++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,r){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);const i=new PW(599,n,this.headers,this.body,M(this,Yp)||void 0);return ne(i,u0,{message:e,error:r}),i}throwThrottleError(e,r){r==null?r=-1:De(Number.isInteger(r)&&r>=0,"invalid stall timeout","stall",r);const n=new Error(e||"throttling requests");throw Ft(n,{stall:r,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return M(this,Qo)!=null}get request(){return M(this,Yp)}ok(){return M(this,u0).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=M(this,u0);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let i=null;try{M(this,Qo)&&(i=ll(M(this,Qo)))}catch{}ot(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:n,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};my=new WeakMap,yy=new WeakMap,wy=new WeakMap,Qo=new WeakMap,Yp=new WeakMap,u0=new WeakMap;let yu=WG;function UC(){return new Date().getTime()}function jG(t){return Ti(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function GG(t){return new Promise(e=>setTimeout(e,t))}const zG=BigInt(-1),_a=BigInt(0),h0=BigInt(1),ZG=BigInt(5),d0={};let f0="0000";for(;f0.length<80;)f0+=f0;function Wh(t){let e=f0;for(;e.length<t;)e+=e;return BigInt("1"+e.substring(0,t))}function Kp(t,e,r){const n=BigInt(e.width);if(e.signed){const i=h0<<n-h0;ot(r==null||t>=-i&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t>_a?t=n0(al(t,n),n):t=-n0(al(-t,n),n)}else{const i=h0<<n;ot(r==null||t>=0&&t<i,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:t}),t=(t%i+i)%i&i-h0}return t}function Q8(t){typeof t=="number"&&(t=`fixed128x${t}`);let e=!0,r=128,n=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")e=!1;else{const s=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);De(s,"invalid fixed format","format",t),e=s[1]!=="u",r=parseInt(s[2]),n=parseInt(s[3])}}else if(t){const s=t,o=(a,l,u)=>s[a]==null?u:(De(typeof s[a]===l,"invalid fixed format ("+a+" not "+l+")","format."+a,s[a]),s[a]);e=o("signed","boolean",e),r=o("width","number",r),n=o("decimals","number",n)}De(r%8===0,"invalid FixedNumber width (not byte aligned)","format.width",r),De(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);const i=(e?"":"u")+"fixed"+String(r)+"x"+String(n);return{signed:e,width:r,decimals:n,name:i}}function $G(t,e){let r="";t<_a&&(r="-",t*=zG);let n=t.toString();if(e===0)return r+n;for(;n.length<=e;)n=f0+n;const i=n.length-e;for(n=n.substring(0,i)+"."+n.substring(i);n[0]==="0"&&n[1]!==".";)n=n.substring(1);for(;n[n.length-1]==="0"&&n[n.length-2]!==".";)n=n.substring(0,n.length-1);return r+n}var Ac,An,qs,$n,jh,hl,J8,Y8,K8,X8;const DC=class Ep{constructor(e,r,n){Ee(this,$n),de(this,"format"),Ee(this,Ac),Ee(this,An),Ee(this,qs),de(this,"_value"),wc(e,d0,"FixedNumber"),ne(this,An,r),ne(this,Ac,n);const i=$G(r,n.decimals);Ft(this,{format:n.name,_value:i}),ne(this,qs,Wh(n.decimals))}get signed(){return M(this,Ac).signed}get width(){return M(this,Ac).width}get decimals(){return M(this,Ac).decimals}get value(){return M(this,An)}addUnsafe(e){return Le(this,$n,J8).call(this,e)}add(e){return Le(this,$n,J8).call(this,e,"add")}subUnsafe(e){return Le(this,$n,Y8).call(this,e)}sub(e){return Le(this,$n,Y8).call(this,e,"sub")}mulUnsafe(e){return Le(this,$n,K8).call(this,e)}mul(e){return Le(this,$n,K8).call(this,e,"mul")}mulSignal(e){Le(this,$n,jh).call(this,e);const r=M(this,An)*M(e,An);return ot(r%M(this,qs)===_a,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),Le(this,$n,hl).call(this,r/M(this,qs),"mulSignal")}divUnsafe(e){return Le(this,$n,X8).call(this,e)}div(e){return Le(this,$n,X8).call(this,e,"div")}divSignal(e){ot(M(e,An)!==_a,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),Le(this,$n,jh).call(this,e);const r=M(this,An)*M(this,qs);return ot(r%M(e,An)===_a,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),Le(this,$n,hl).call(this,r/M(e,An),"divSignal")}cmp(e){let r=this.value,n=e.value;const i=this.decimals-e.decimals;return i>0?n*=Wh(i):i<0&&(r*=Wh(-i)),r<n?-1:r>n?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=M(this,An);return M(this,An)<_a&&(e-=M(this,qs)-h0),e=M(this,An)/M(this,qs)*M(this,qs),Le(this,$n,hl).call(this,e,"floor")}ceiling(){let e=M(this,An);return M(this,An)>_a&&(e+=M(this,qs)-h0),e=M(this,An)/M(this,qs)*M(this,qs),Le(this,$n,hl).call(this,e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;const r=this.decimals-e,n=ZG*Wh(r-1);let i=this.value+n;const s=Wh(r);return i=i/s*s,Kp(i,M(this,Ac),"round"),new Ep(d0,i,M(this,Ac))}isZero(){return M(this,An)===_a}isNegative(){return M(this,An)<_a}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Ep.fromString(this.toString(),e)}static fromValue(e,r,n){const i=r==null?0:ir(r),s=Q8(n);let o=Yt(e,"value");const a=i-s.decimals;if(a>0){const l=Wh(a);ot(o%l===_a,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=l}else a<0&&(o*=Wh(-a));return Kp(o,s,"fromValue"),new Ep(d0,o,s)}static fromString(e,r){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);De(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const i=Q8(r);let s=n[2]||"0",o=n[3]||"";for(;o.length<i.decimals;)o+=f0;ot(o.substring(i.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),o=o.substring(0,i.decimals);const a=BigInt(n[1]+s+o);return Kp(a,i,"fromString"),new Ep(d0,a,i)}static fromBytes(e,r){let n=Lh(Ot(e,"value"));const i=Q8(r);return i.signed&&(n=n0(n,i.width)),Kp(n,i,"fromBytes"),new Ep(d0,n,i)}};Ac=new WeakMap,An=new WeakMap,qs=new WeakMap,$n=new WeakSet,jh=function(t){De(this.format===t.format,"incompatible format; use fixedNumber.toFormat","other",t)},hl=function(t,e){return t=Kp(t,M(this,Ac),e),new DC(d0,t,M(this,Ac))},J8=function(t,e){return Le(this,$n,jh).call(this,t),Le(this,$n,hl).call(this,M(this,An)+M(t,An),e)},Y8=function(t,e){return Le(this,$n,jh).call(this,t),Le(this,$n,hl).call(this,M(this,An)-M(t,An),e)},K8=function(t,e){return Le(this,$n,jh).call(this,t),Le(this,$n,hl).call(this,M(this,An)*M(t,An)/M(this,qs),e)},X8=function(t,e){return ot(M(t,An)!==_a,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),Le(this,$n,jh).call(this,t),Le(this,$n,hl).call(this,M(this,An)*M(this,qs)/M(t,An),e)};let vy=DC;function QG(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function FC(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function LC(t,e,r,n){const i=[];for(;r<e+1+n;){const s=VC(t,r);i.push(s.result),r+=s.consumed,ot(r<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:t,length:n,offset:e})}return{consumed:1+n,result:i}}function VC(t,e){ot(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const r=n=>{ot(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;r(e+1+n);const i=FC(t,e+1,n);return r(e+1+n+i),LC(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return r(e+1+n),LC(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;r(e+1+n);const i=FC(t,e+1,n);r(e+1+n+i);const s=At(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:s}}else if(t[e]>=128){const n=t[e]-128;r(e+1+n);const i=At(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:QG(t[e])}}function p0(t){const e=Ot(t,"data"),r=VC(e,0);return De(r.consumed===e.length,"unexpected junk after rlp payload","data",t),r.result}function HC(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function WC(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(WC(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=HC(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(Ot(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=HC(e.length);return r.unshift(183+r.length),r.concat(e)}const jC="0123456789abcdef";function dl(t){let e="0x";for(const r of WC(t))e+=jC[r>>4],e+=jC[r&15];return e}const GC=["wei","kwei","mwei","gwei","szabo","finney","ether"];function q8(t,e){let r=18;if(typeof e=="string"){const n=GC.indexOf(e);De(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=ir(e,"unit"));return vy.fromValue(t,r,{decimals:r,width:512}).toString()}function ev(t,e){De(typeof t=="string","value must be a string","value",t);let r=18;if(typeof e=="string"){const n=GC.indexOf(e);De(n>=0,"invalid unit","unit",e),r=3*n}else e!=null&&(r=ir(e,"unit"));return vy.fromString(t,{decimals:r,width:512}).value}function zC(t){return q8(t,18)}function ZC(t){return ev(t,18)}function tv(t){const e=Ot(t,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=At(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const xs=32,rv=new Uint8Array(xs),JG=["then"],by={},$C=new WeakMap;function Gh(t){return $C.get(t)}function QC(t,e){$C.set(t,e)}function Xp(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw r.error=e,r}function nv(t,e,r){return t.indexOf(null)>=0?e.map((n,i)=>n instanceof g0?nv(Gh(n),n,r):n):t.reduce((n,i,s)=>{let o=e.getValue(i);return i in n||(r&&o instanceof g0&&(o=nv(Gh(o),o,r)),n[i]=o),n},{})}var qp;const YG=class L3 extends Array{constructor(...e){const r=e[0];let n=e[1],i=(e[2]||[]).slice(),s=!0;r!==by&&(n=e,i=[],s=!1),super(n.length),Ee(this,qp),n.forEach((l,u)=>{this[u]=l});const o=i.reduce((l,u)=>(typeof u=="string"&&l.set(u,(l.get(u)||0)+1),l),new Map);if(QC(this,Object.freeze(n.map((l,u)=>{const d=i[u];return d!=null&&o.get(d)===1?d:null}))),ne(this,qp,[]),M(this,qp)==null&&M(this,qp),!s)return;Object.freeze(this);const a=new Proxy(this,{get:(l,u,d)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){const g=ir(u,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const m=l[g];return m instanceof Error&&Xp(`index ${g}`,m),m}if(JG.indexOf(u)>=0)return Reflect.get(l,u,d);const f=l[u];if(f instanceof Function)return function(...g){return f.apply(this===d?l:this,g)};if(!(u in l))return l.getValue.apply(this===d?l:this,[u])}return Reflect.get(l,u,d)}});return QC(a,Gh(this)),a}toArray(e){const r=[];return this.forEach((n,i)=>{n instanceof Error&&Xp(`index ${i}`,n),e&&n instanceof L3&&(n=n.toArray(e)),r.push(n)}),r}toObject(e){const r=Gh(this);return r.reduce((n,i,s)=>(ot(i!=null,`value at index ${s} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),nv(r,this,e)),{})}slice(e,r){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const n=Gh(this),i=[],s=[];for(let o=e;o<r;o++)i.push(this[o]),s.push(n[o]);return new L3(by,i,s)}filter(e,r){const n=Gh(this),i=[],s=[];for(let o=0;o<this.length;o++){const a=this[o];a instanceof Error&&Xp(`index ${o}`,a),e.call(r,a,o,this)&&(i.push(a),s.push(n[o]))}return new L3(by,i,s)}map(e,r){const n=[];for(let i=0;i<this.length;i++){const s=this[i];s instanceof Error&&Xp(`index ${i}`,s),n.push(e.call(r,s,i,this))}return n}getValue(e){const r=Gh(this).indexOf(e);if(r===-1)return;const n=this[r];return n instanceof Error&&Xp(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,r){return new L3(by,e,r)}};qp=new WeakMap;let g0=YG;function JC(t){const e=[],r=function(n,i){if(Array.isArray(i))for(let s in i){const o=n.slice();o.push(s);try{r(o,i[s])}catch(a){e.push({path:o,error:a})}}};return r([],t),e}function YC(t){let e=Fi(t);return ot(e.length<=xs,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:xs,offset:e.length}),e.length!==xs&&(e=Di(Qr([rv.slice(e.length%xs),e]))),e}let fl=class{constructor(e,r,n,i){de(this,"name"),de(this,"type"),de(this,"localName"),de(this,"dynamic"),Ft(this,{name:e,type:r,localName:n,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,r){De(!1,e,this.localName,r)}};var wu,vu,e2,Ay;class iv{constructor(){Ee(this,e2),Ee(this,wu),Ee(this,vu),ne(this,wu,[]),ne(this,vu,0)}get data(){return Qr(M(this,wu))}get length(){return M(this,vu)}appendWriter(e){return Le(this,e2,Ay).call(this,Di(e.data))}writeBytes(e){let r=Di(e);const n=r.length%xs;return n&&(r=Di(Qr([r,rv.slice(n)]))),Le(this,e2,Ay).call(this,r)}writeValue(e){return Le(this,e2,Ay).call(this,YC(e))}writeUpdatableValue(){const e=M(this,wu).length;return M(this,wu).push(rv),ne(this,vu,M(this,vu)+xs),r=>{M(this,wu)[e]=YC(r)}}}wu=new WeakMap,vu=new WeakMap,e2=new WeakSet,Ay=function(t){return M(this,wu).push(t),ne(this,vu,M(this,vu)+t.length),t.length};var ho,fo,zh,m0,Zh,t2,sv,KC;const KG=class MW{constructor(e,r,n){Ee(this,t2),de(this,"allowLoose"),Ee(this,ho),Ee(this,fo),Ee(this,zh),Ee(this,m0),Ee(this,Zh),Ft(this,{allowLoose:!!r}),ne(this,ho,Di(e)),ne(this,zh,0),ne(this,m0,null),ne(this,Zh,n??1024),ne(this,fo,0)}get data(){return At(M(this,ho))}get dataLength(){return M(this,ho).length}get consumed(){return M(this,fo)}get bytes(){return new Uint8Array(M(this,ho))}subReader(e){const r=new MW(M(this,ho).slice(M(this,fo)+e),this.allowLoose,M(this,Zh));return ne(r,m0,this),r}readBytes(e,r){let n=Le(this,t2,KC).call(this,0,e,!!r);return Le(this,t2,sv).call(this,e),ne(this,fo,M(this,fo)+n.length),n.slice(0,e)}readValue(){return Lh(this.readBytes(xs))}readIndex(){return V8(this.readBytes(xs))}};ho=new WeakMap,fo=new WeakMap,zh=new WeakMap,m0=new WeakMap,Zh=new WeakMap,t2=new WeakSet,sv=function(t){var e;if(M(this,m0))return Le(e=M(this,m0),t2,sv).call(e,t);ne(this,zh,M(this,zh)+t),ot(M(this,Zh)<1||M(this,zh)<=M(this,Zh)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${M(this,Zh)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Di(M(this,ho)),offset:M(this,fo),length:t,info:{bytesRead:M(this,zh),dataLength:this.dataLength}})},KC=function(t,e,r){let n=Math.ceil(e/xs)*xs;return M(this,fo)+n>M(this,ho).length&&(this.allowLoose&&r&&M(this,fo)+e<=M(this,ho).length?n=e:ot(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Di(M(this,ho)),length:M(this,ho).length,offset:M(this,fo)+n})),M(this,ho).slice(M(this,fo),M(this,fo)+n)};let XG=KG;function po(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ov(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function XC(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");po(t.outputLen),po(t.blockLen)}function y0(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function qC(t,e){ov(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const qG=t=>t instanceof Uint8Array,Ey=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Ty=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ec=(t,e)=>t<<32-e|t>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");const ez=async()=>{};async function ek(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);const s=Date.now()-n;s>=0&&s<e||(await ez(),n+=s)}}function tz(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function w0(t){if(typeof t=="string"&&(t=tz(t)),!qG(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class av{clone(){return this._cloneInto()}}const rz={}.toString;function tk(t,e){if(e!==void 0&&rz.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function Sy(t){const e=n=>t().update(w0(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}class rk extends av{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,XC(e);const n=w0(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return y0(this),this.iHash.update(e),this}digestInto(e){y0(this),ov(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const cv=(t,e,r)=>new rk(t,e).update(r).digest();cv.create=(t,e)=>new rk(t,e);function nz(t,e,r,n){XC(t);const i=tk({dkLen:32,asyncTick:10},n),{c:s,dkLen:o,asyncTick:a}=i;if(po(s),po(o),po(a),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=w0(e),u=w0(r),d=new Uint8Array(o),f=cv.create(t,l),g=f._cloneInto().update(u);return{c:s,dkLen:o,asyncTick:a,DK:d,PRF:f,PRFSalt:g}}function iz(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function lv(t,e,r,n){const{c:i,dkLen:s,DK:o,PRF:a,PRFSalt:l}=nz(t,e,r,n);let u;const d=new Uint8Array(4),f=Ty(d),g=new Uint8Array(a.outputLen);for(let m=1,v=0;v<s;m++,v+=a.outputLen){const A=o.subarray(v,v+a.outputLen);f.setInt32(0,m,!1),(u=l._cloneInto(u)).update(d).digestInto(g),A.set(g.subarray(0,A.length));for(let E=1;E<i;E++){a._cloneInto(u).update(g).digestInto(g);for(let C=0;C<A.length;C++)A[C]^=g[C]}}return iz(a,l,o,u,g)}function sz(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;t.setUint32(e+l,o,n),t.setUint32(e+u,a,n)}class uv extends av{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ty(this.buffer)}update(e){y0(this);const{view:r,buffer:n,blockLen:i}=this;e=w0(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const l=Ty(e);for(;i<=s-o;o+=i)this.process(l,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){y0(this),qC(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let f=o;f<i;f++)r[f]=0;sz(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=Ty(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,d[f],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%r&&e.buffer.set(n),e}}const oz=(t,e,r)=>t&e^~t&r,az=(t,e,r)=>t&e^t&r^e&r,cz=new Uint32Array([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]),bu=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Au=new Uint32Array(64);class lz extends uv{constructor(){super(64,32,8,!1),this.A=bu[0]|0,this.B=bu[1]|0,this.C=bu[2]|0,this.D=bu[3]|0,this.E=bu[4]|0,this.F=bu[5]|0,this.G=bu[6]|0,this.H=bu[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:l}=this;return[e,r,n,i,s,o,a,l]}set(e,r,n,i,s,o,a,l){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=l|0}process(e,r){for(let f=0;f<16;f++,r+=4)Au[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){const g=Au[f-15],m=Au[f-2],v=Ec(g,7)^Ec(g,18)^g>>>3,A=Ec(m,17)^Ec(m,19)^m>>>10;Au[f]=A+Au[f-7]+v+Au[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const g=Ec(a,6)^Ec(a,11)^Ec(a,25),m=d+g+oz(a,l,u)+cz[f]+Au[f]|0,v=(Ec(n,2)^Ec(n,13)^Ec(n,22))+az(n,i,s)|0;d=u,u=l,l=a,a=o+m|0,o=s,s=i,i=n,n=m+v|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(n,i,s,o,a,l,u,d)}roundClean(){Au.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const r2=Sy(()=>new lz),Cy=BigInt(2**32-1),hv=BigInt(32);function nk(t,e=!1){return e?{h:Number(t&Cy),l:Number(t>>hv&Cy)}:{h:Number(t>>hv&Cy)|0,l:Number(t&Cy)|0}}function ik(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=nk(t[i],e);[r[i],n[i]]=[s,o]}return[r,n]}const uz=(t,e)=>BigInt(t>>>0)<<hv|BigInt(e>>>0),hz=(t,e,r)=>t>>>r,dz=(t,e,r)=>t<<32-r|e>>>r,fz=(t,e,r)=>t>>>r|e<<32-r,pz=(t,e,r)=>t<<32-r|e>>>r,gz=(t,e,r)=>t<<64-r|e>>>r-32,mz=(t,e,r)=>t>>>r-32|e<<64-r,yz=(t,e)=>e,wz=(t,e)=>t,sk=(t,e,r)=>t<<r|e>>>32-r,ok=(t,e,r)=>e<<r|t>>>32-r,ak=(t,e,r)=>e<<r-32|t>>>64-r,ck=(t,e,r)=>t<<r-32|e>>>64-r;function vz(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const bz=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Az=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Ez=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Tz=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,Sz=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Cz=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,Ir={fromBig:nk,split:ik,toBig:uz,shrSH:hz,shrSL:dz,rotrSH:fz,rotrSL:pz,rotrBH:gz,rotrBL:mz,rotr32H:yz,rotr32L:wz,rotlSH:sk,rotlSL:ok,rotlBH:ak,rotlBL:ck,add:vz,add3L:bz,add3H:Az,add4L:Ez,add4H:Tz,add5H:Cz,add5L:Sz},[kz,_z]=Ir.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Eu=new Uint32Array(80),Tu=new Uint32Array(80);class Iz extends uv{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:l,Eh:u,El:d,Fh:f,Fl:g,Gh:m,Gl:v,Hh:A,Hl:E}=this;return[e,r,n,i,s,o,a,l,u,d,f,g,m,v,A,E]}set(e,r,n,i,s,o,a,l,u,d,f,g,m,v,A,E){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=l|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=g|0,this.Gh=m|0,this.Gl=v|0,this.Hh=A|0,this.Hl=E|0}process(e,r){for(let I=0;I<16;I++,r+=4)Eu[I]=e.getUint32(r),Tu[I]=e.getUint32(r+=4);for(let I=16;I<80;I++){const S=Eu[I-15]|0,N=Tu[I-15]|0,W=Ir.rotrSH(S,N,1)^Ir.rotrSH(S,N,8)^Ir.shrSH(S,N,7),G=Ir.rotrSL(S,N,1)^Ir.rotrSL(S,N,8)^Ir.shrSL(S,N,7),L=Eu[I-2]|0,V=Tu[I-2]|0,$=Ir.rotrSH(L,V,19)^Ir.rotrBH(L,V,61)^Ir.shrSH(L,V,6),j=Ir.rotrSL(L,V,19)^Ir.rotrBL(L,V,61)^Ir.shrSL(L,V,6),B=Ir.add4L(G,j,Tu[I-7],Tu[I-16]),O=Ir.add4H(B,W,$,Eu[I-7],Eu[I-16]);Eu[I]=O|0,Tu[I]=B|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:l,Dh:u,Dl:d,Eh:f,El:g,Fh:m,Fl:v,Gh:A,Gl:E,Hh:C,Hl:k}=this;for(let I=0;I<80;I++){const S=Ir.rotrSH(f,g,14)^Ir.rotrSH(f,g,18)^Ir.rotrBH(f,g,41),N=Ir.rotrSL(f,g,14)^Ir.rotrSL(f,g,18)^Ir.rotrBL(f,g,41),W=f&m^~f&A,G=g&v^~g&E,L=Ir.add5L(k,N,G,_z[I],Tu[I]),V=Ir.add5H(L,C,S,W,kz[I],Eu[I]),$=L|0,j=Ir.rotrSH(n,i,28)^Ir.rotrBH(n,i,34)^Ir.rotrBH(n,i,39),B=Ir.rotrSL(n,i,28)^Ir.rotrBL(n,i,34)^Ir.rotrBL(n,i,39),O=n&s^n&a^s&a,H=i&o^i&l^o&l;C=A|0,k=E|0,A=m|0,E=v|0,m=f|0,v=g|0,{h:f,l:g}=Ir.add(u|0,d|0,V|0,$|0),u=a|0,d=l|0,a=s|0,l=o|0,s=n|0,o=i|0;const D=Ir.add3L($,B,H);n=Ir.add3H(D,V,j,O),i=D|0}({h:n,l:i}=Ir.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=Ir.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l}=Ir.add(this.Ch|0,this.Cl|0,a|0,l|0),{h:u,l:d}=Ir.add(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:g}=Ir.add(this.Eh|0,this.El|0,f|0,g|0),{h:m,l:v}=Ir.add(this.Fh|0,this.Fl|0,m|0,v|0),{h:A,l:E}=Ir.add(this.Gh|0,this.Gl|0,A|0,E|0),{h:C,l:k}=Ir.add(this.Hh|0,this.Hl|0,C|0,k|0),this.set(n,i,s,o,a,l,u,d,f,g,m,v,A,E,C,k)}roundClean(){Eu.fill(0),Tu.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const dv=Sy(()=>new Iz);function Rz(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}const lk=Rz(),uk=lk.crypto||lk.msCrypto;function hk(t){switch(t){case"sha256":return r2.create();case"sha512":return dv.create()}De(!1,"invalid hashing algorithm name","algorithm",t)}function Nz(t,e){const r={sha256:r2,sha512:dv}[t];return De(r!=null,"invalid hmac algorithm","algorithm",t),cv.create(r,e)}function Oz(t,e,r,n,i){const s={sha256:r2,sha512:dv}[i];return De(s!=null,"invalid pbkdf2 algorithm","algorithm",i),lv(s,t,e,{c:r,dkLen:n})}function xz(t){ot(uk!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),De(Number.isInteger(t)&&t>0&&t<=1024,"invalid length","length",t);const e=new Uint8Array(t);return uk.getRandomValues(e),e}let dk=!1;const fk=function(t,e,r){return Nz(t,e).update(r).digest()};let pk=fk;function pl(t,e,r){const n=Ot(e,"key"),i=Ot(r,"data");return At(pk(t,n,i))}pl._=fk,pl.lock=function(){dk=!0},pl.register=function(t){if(dk)throw new Error("computeHmac is locked");pk=t},Object.freeze(pl);const[gk,mk,yk]=[[],[],[]],Pz=BigInt(0),n2=BigInt(1),Mz=BigInt(2),Bz=BigInt(7),Uz=BigInt(256),Dz=BigInt(113);for(let t=0,e=n2,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],gk.push(2*(5*n+r)),mk.push((t+1)*(t+2)/2%64);let i=Pz;for(let s=0;s<7;s++)e=(e<<n2^(e>>Bz)*Dz)%Uz,e&Mz&&(i^=n2<<(n2<<BigInt(s))-n2);yk.push(i)}const[Fz,Lz]=ik(yk,!0),wk=(t,e,r)=>r>32?ak(t,e,r):sk(t,e,r),vk=(t,e,r)=>r>32?ck(t,e,r):ok(t,e,r);function Vz(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,u=r[l],d=r[l+1],f=wk(u,d,1)^r[a],g=vk(u,d,1)^r[a+1];for(let m=0;m<50;m+=10)t[o+m]^=f,t[o+m+1]^=g}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=mk[o],l=wk(i,s,a),u=vk(i,s,a),d=gk[o];i=t[d],s=t[d+1],t[d]=l,t[d+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Fz[n],t[1]^=Lz[n]}r.fill(0)}let Hz=class BW extends av{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,po(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Ey(this.state)}keccak(){Vz(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){y0(this);const{blockLen:r,state:n}=this;e=w0(e);const i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){y0(this,!1),ov(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return po(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(qC(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new BW(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const Wz=(t,e,r)=>Sy(()=>new Hz(e,t,r)),jz=Wz(1,136,256/8);let bk=!1;const Ak=function(t){return jz(t)};let Ek=Ak;function bn(t){const e=Ot(t,"data");return At(Ek(e))}bn._=Ak,bn.lock=function(){bk=!0},bn.register=function(t){if(bk)throw new TypeError("keccak256 is locked");Ek=t},Object.freeze(bn);const Gz=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Tk=Uint8Array.from({length:16},(t,e)=>e),zz=Tk.map(t=>(9*t+5)%16);let fv=[Tk],pv=[zz];for(let t=0;t<4;t++)for(let e of[fv,pv])e.push(e[t].map(r=>Gz[r]));const Sk=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),Zz=fv.map((t,e)=>t.map(r=>Sk[e][r])),$z=pv.map((t,e)=>t.map(r=>Sk[e][r])),Qz=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Jz=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),ky=(t,e)=>t<<e|t>>>32-e;function Ck(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}const _y=new Uint32Array(16);class Yz extends uv{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:n,h3:i,h4:s}=this;return[e,r,n,i,s]}set(e,r,n,i,s){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=s|0}process(e,r){for(let m=0;m<16;m++,r+=4)_y[m]=e.getUint32(r,!0);let n=this.h0|0,i=n,s=this.h1|0,o=s,a=this.h2|0,l=a,u=this.h3|0,d=u,f=this.h4|0,g=f;for(let m=0;m<5;m++){const v=4-m,A=Qz[m],E=Jz[m],C=fv[m],k=pv[m],I=Zz[m],S=$z[m];for(let N=0;N<16;N++){const W=ky(n+Ck(m,s,a,u)+_y[C[N]]+A,I[N])+f|0;n=f,f=u,u=ky(a,10)|0,a=s,s=W}for(let N=0;N<16;N++){const W=ky(i+Ck(v,o,l,d)+_y[k[N]]+E,S[N])+g|0;i=g,g=d,d=ky(l,10)|0,l=o,o=W}}this.set(this.h1+a+d|0,this.h2+u+g|0,this.h3+f+i|0,this.h4+n+o|0,this.h0+s+l|0)}roundClean(){_y.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const Kz=Sy(()=>new Yz);let kk=!1;const _k=function(t){return Kz(t)};let Ik=_k;function gl(t){const e=Ot(t,"data");return At(Ik(e))}gl._=_k,gl.lock=function(){kk=!0},gl.register=function(t){if(kk)throw new TypeError("ripemd160 is locked");Ik=t},Object.freeze(gl);let Rk=!1;const Nk=function(t,e,r,n,i){return Oz(t,e,r,n,i)};let Ok=Nk;function Ia(t,e,r,n,i){const s=Ot(t,"password"),o=Ot(e,"salt");return At(Ok(s,o,r,n,i))}Ia._=Nk,Ia.lock=function(){Rk=!0},Ia.register=function(t){if(Rk)throw new Error("pbkdf2 is locked");Ok=t},Object.freeze(Ia);let xk=!1;const Pk=function(t){return new Uint8Array(xz(t))};let Mk=Pk;function go(t){return Mk(t)}go._=Pk,go.lock=function(){xk=!0},go.register=function(t){if(xk)throw new Error("randomBytes is locked");Mk=t},Object.freeze(go);const an=(t,e)=>t<<e|t>>>32-e;function Bk(t,e,r,n,i,s){let o=t[e++]^r[n++],a=t[e++]^r[n++],l=t[e++]^r[n++],u=t[e++]^r[n++],d=t[e++]^r[n++],f=t[e++]^r[n++],g=t[e++]^r[n++],m=t[e++]^r[n++],v=t[e++]^r[n++],A=t[e++]^r[n++],E=t[e++]^r[n++],C=t[e++]^r[n++],k=t[e++]^r[n++],I=t[e++]^r[n++],S=t[e++]^r[n++],N=t[e++]^r[n++],W=o,G=a,L=l,V=u,$=d,j=f,B=g,O=m,H=v,D=A,q=E,K=C,te=k,Q=I,X=S,Y=N;for(let re=0;re<8;re+=2)$^=an(W+te|0,7),H^=an($+W|0,9),te^=an(H+$|0,13),W^=an(te+H|0,18),D^=an(j+G|0,7),Q^=an(D+j|0,9),G^=an(Q+D|0,13),j^=an(G+Q|0,18),X^=an(q+B|0,7),L^=an(X+q|0,9),B^=an(L+X|0,13),q^=an(B+L|0,18),V^=an(Y+K|0,7),O^=an(V+Y|0,9),K^=an(O+V|0,13),Y^=an(K+O|0,18),G^=an(W+V|0,7),L^=an(G+W|0,9),V^=an(L+G|0,13),W^=an(V+L|0,18),B^=an(j+$|0,7),O^=an(B+j|0,9),$^=an(O+B|0,13),j^=an($+O|0,18),K^=an(q+D|0,7),H^=an(K+q|0,9),D^=an(H+K|0,13),q^=an(D+H|0,18),te^=an(Y+X|0,7),Q^=an(te+Y|0,9),X^=an(Q+te|0,13),Y^=an(X+Q|0,18);i[s++]=o+W|0,i[s++]=a+G|0,i[s++]=l+L|0,i[s++]=u+V|0,i[s++]=d+$|0,i[s++]=f+j|0,i[s++]=g+B|0,i[s++]=m+O|0,i[s++]=v+H|0,i[s++]=A+D|0,i[s++]=E+q|0,i[s++]=C+K|0,i[s++]=k+te|0,i[s++]=I+Q|0,i[s++]=S+X|0,i[s++]=N+Y|0}function v0(t,e,r,n,i){let s=n+0,o=n+16*i;for(let a=0;a<16;a++)r[o+a]=t[e+(2*i-1)*16+a];for(let a=0;a<i;a++,s+=16,e+=16)Bk(r,o,t,e,r,s),a>0&&(o+=16),Bk(r,s,t,e+=16,r,o)}function Uk(t,e,r){const n=tk({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:s,p:o,dkLen:a,asyncTick:l,maxmem:u,onProgress:d}=n;if(po(i),po(s),po(o),po(a),po(l),po(u),d!==void 0&&typeof d!="function")throw new Error("progressCb should be function");const f=128*s,g=f/4;if(i<=1||i&i-1||i>=2**(f/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const m=f*(i+o);if(m>u)throw new Error(`Scrypt: parameters too large, ${m} (128 * r * (N + p)) > ${u} (maxmem)`);const v=lv(r2,t,e,{c:1,dkLen:f*o}),A=Ey(v),E=Ey(new Uint8Array(f*i)),C=Ey(new Uint8Array(f));let k=()=>{};if(d){const I=2*i*o,S=Math.max(Math.floor(I/1e4),1);let N=0;k=()=>{N++,d&&(!(N%S)||N===I)&&d(N/I)}}return{N:i,r:s,p:o,dkLen:a,blockSize32:g,V:E,B32:A,B:v,tmp:C,blockMixCb:k,asyncTick:l}}function Dk(t,e,r,n,i){const s=lv(r2,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),s}function Xz(t,e,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:l,B32:u,B:d,tmp:f,blockMixCb:g}=Uk(t,e,r);for(let m=0;m<s;m++){const v=a*m;for(let A=0;A<a;A++)l[A]=u[v+A];for(let A=0,E=0;A<n-1;A++)v0(l,E,l,E+=a,i),g();v0(l,(n-1)*a,u,v,i),g();for(let A=0;A<n;A++){const E=u[v+a-16]%n;for(let C=0;C<a;C++)f[C]=u[v+C]^l[E*a+C];v0(f,0,u,v,i),g()}}return Dk(t,o,d,l,f)}async function qz(t,e,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:a,V:l,B32:u,B:d,tmp:f,blockMixCb:g,asyncTick:m}=Uk(t,e,r);for(let v=0;v<s;v++){const A=a*v;for(let C=0;C<a;C++)l[C]=u[A+C];let E=0;await ek(n-1,m,()=>{v0(l,E,l,E+=a,i),g()}),v0(l,(n-1)*a,u,A,i),g(),await ek(n,m,()=>{const C=u[A+a-16]%n;for(let k=0;k<a;k++)f[k]=u[A+k]^l[C*a+k];v0(f,0,u,A,i),g()})}return Dk(t,o,d,l,f)}let Fk=!1,Lk=!1;const Vk=async function(t,e,r,n,i,s,o){return await qz(t,e,{N:r,r:n,p:i,dkLen:s,onProgress:o})},Hk=function(t,e,r,n,i,s){return Xz(t,e,{N:r,r:n,p:i,dkLen:s})};let Wk=Vk,jk=Hk;async function ml(t,e,r,n,i,s,o){const a=Ot(t,"passwd"),l=Ot(e,"salt");return At(await Wk(a,l,r,n,i,s,o))}ml._=Vk,ml.lock=function(){Lk=!0},ml.register=function(t){if(Lk)throw new Error("scrypt is locked");Wk=t},Object.freeze(ml);function yl(t,e,r,n,i,s){const o=Ot(t,"passwd"),a=Ot(e,"salt");return At(jk(o,a,r,n,i,s))}yl._=Hk,yl.lock=function(){Fk=!0},yl.register=function(t){if(Fk)throw new Error("scryptSync is locked");jk=t},Object.freeze(yl);const Gk=function(t){return hk("sha256").update(t).digest()},zk=function(t){return hk("sha512").update(t).digest()};let Zk=Gk,$k=zk,Qk=!1,Jk=!1;function bs(t){const e=Ot(t,"data");return At(Zk(e))}bs._=Gk,bs.lock=function(){Qk=!0},bs.register=function(t){if(Qk)throw new Error("sha256 is locked");Zk=t},Object.freeze(bs);function b0(t){const e=Ot(t,"data");return At($k(e))}b0._=zk,b0.lock=function(){Jk=!0},b0.register=function(t){if(Jk)throw new Error("sha512 is locked");$k=t},Object.freeze(bs);var Br=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function eZ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Yk(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var $h={},i2={},As={},Kk;function s2(){if(Kk)return As;Kk=1,Object.defineProperty(As,"__esModule",{value:!0}),As.output=As.exists=As.hash=As.bytes=As.bool=As.number=void 0;function t(a){if(!Number.isSafeInteger(a)||a<0)throw new Error(`Wrong positive integer: ${a}`)}As.number=t;function e(a){if(typeof a!="boolean")throw new Error(`Expected boolean, not ${a}`)}As.bool=e;function r(a,...l){if(!(a instanceof Uint8Array))throw new Error("Expected Uint8Array");if(l.length>0&&!l.includes(a.length))throw new Error(`Expected Uint8Array of length ${l}, not of length=${a.length}`)}As.bytes=r;function n(a){if(typeof a!="function"||typeof a.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");t(a.outputLen),t(a.blockLen)}As.hash=n;function i(a,l=!0){if(a.destroyed)throw new Error("Hash instance has been destroyed");if(l&&a.finished)throw new Error("Hash#digest() has already been called")}As.exists=i;function s(a,l){r(a);const u=l.outputLen;if(a.length<u)throw new Error(`digestInto() expects output buffer of length at least ${u}`)}As.output=s;const o={number:t,bool:e,bytes:r,hash:n,exists:i,output:s};return As.default=o,As}var Xk={},Iy={},qk;function tZ(){return qk||(qk=1,Object.defineProperty(Iy,"__esModule",{value:!0}),Iy.crypto=void 0,Iy.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),Iy}var e_;function Ra(){return e_||(e_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const e=tZ(),r=W=>W instanceof Uint8Array,n=W=>new Uint8Array(W.buffer,W.byteOffset,W.byteLength);t.u8=n;const i=W=>new Uint32Array(W.buffer,W.byteOffset,Math.floor(W.byteLength/4));t.u32=i;const s=W=>new DataView(W.buffer,W.byteOffset,W.byteLength);t.createView=s;const o=(W,G)=>W<<32-G|W>>>G;if(t.rotr=o,t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!t.isLE)throw new Error("Non little-endian hardware is not supported");const a=Array.from({length:256},(W,G)=>G.toString(16).padStart(2,"0"));function l(W){if(!r(W))throw new Error("Uint8Array expected");let G="";for(let L=0;L<W.length;L++)G+=a[W[L]];return G}t.bytesToHex=l;function u(W){if(typeof W!="string")throw new Error("hex string expected, got "+typeof W);const G=W.length;if(G%2)throw new Error("padded hex string expected, got unpadded hex of length "+G);const L=new Uint8Array(G/2);for(let V=0;V<L.length;V++){const $=V*2,j=W.slice($,$+2),B=Number.parseInt(j,16);if(Number.isNaN(B)||B<0)throw new Error("Invalid byte sequence");L[V]=B}return L}t.hexToBytes=u;const d=async()=>{};t.nextTick=d;async function f(W,G,L){let V=Date.now();for(let $=0;$<W;$++){L($);const j=Date.now()-V;j>=0&&j<G||(await(0,t.nextTick)(),V+=j)}}t.asyncLoop=f;function g(W){if(typeof W!="string")throw new Error(`utf8ToBytes expected string, got ${typeof W}`);return new Uint8Array(new TextEncoder().encode(W))}t.utf8ToBytes=g;function m(W){if(typeof W=="string"&&(W=g(W)),!r(W))throw new Error(`expected Uint8Array, got ${typeof W}`);return W}t.toBytes=m;function v(...W){const G=new Uint8Array(W.reduce((V,$)=>V+$.length,0));let L=0;return W.forEach(V=>{if(!r(V))throw new Error("Uint8Array expected");G.set(V,L),L+=V.length}),G}t.concatBytes=v;class A{clone(){return this._cloneInto()}}t.Hash=A;const E={}.toString;function C(W,G){if(G!==void 0&&E.call(G)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(W,G)}t.checkOpts=C;function k(W){const G=V=>W().update(m(V)).digest(),L=W();return G.outputLen=L.outputLen,G.blockLen=L.blockLen,G.create=()=>W(),G}t.wrapConstructor=k;function I(W){const G=(V,$)=>W($).update(m(V)).digest(),L=W({});return G.outputLen=L.outputLen,G.blockLen=L.blockLen,G.create=V=>W(V),G}t.wrapConstructorWithOpts=I;function S(W){const G=(V,$)=>W($).update(m(V)).digest(),L=W({});return G.outputLen=L.outputLen,G.blockLen=L.blockLen,G.create=V=>W(V),G}t.wrapXOFConstructorWithOpts=S;function N(W=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(W));throw new Error("crypto.getRandomValues must be defined")}t.randomBytes=N})(Xk)),Xk}var t_;function gv(){if(t_)return i2;t_=1,Object.defineProperty(i2,"__esModule",{value:!0}),i2.SHA2=void 0;const t=s2(),e=Ra();function r(i,s,o,a){if(typeof i.setBigUint64=="function")return i.setBigUint64(s,o,a);const l=BigInt(32),u=BigInt(4294967295),d=Number(o>>l&u),f=Number(o&u),g=a?4:0,m=a?0:4;i.setUint32(s+g,d,a),i.setUint32(s+m,f,a)}class n extends e.Hash{constructor(s,o,a,l){super(),this.blockLen=s,this.outputLen=o,this.padOffset=a,this.isLE=l,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(s),this.view=(0,e.createView)(this.buffer)}update(s){(0,t.exists)(this);const{view:o,buffer:a,blockLen:l}=this;s=(0,e.toBytes)(s);const u=s.length;for(let d=0;d<u;){const f=Math.min(l-this.pos,u-d);if(f===l){const g=(0,e.createView)(s);for(;l<=u-d;d+=l)this.process(g,d);continue}a.set(s.subarray(d,d+f),this.pos),this.pos+=f,d+=f,this.pos===l&&(this.process(o,0),this.pos=0)}return this.length+=s.length,this.roundClean(),this}digestInto(s){(0,t.exists)(this),(0,t.output)(s,this),this.finished=!0;const{buffer:o,view:a,blockLen:l,isLE:u}=this;let{pos:d}=this;o[d++]=128,this.buffer.subarray(d).fill(0),this.padOffset>l-d&&(this.process(a,0),d=0);for(let A=d;A<l;A++)o[A]=0;r(a,l-8,BigInt(this.length*8),u),this.process(a,0);const f=(0,e.createView)(s),g=this.outputLen;if(g%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const m=g/4,v=this.get();if(m>v.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<m;A++)f.setUint32(4*A,v[A],u)}digest(){const{buffer:s,outputLen:o}=this;this.digestInto(s);const a=s.slice(0,o);return this.destroy(),a}_cloneInto(s){s||(s=new this.constructor),s.set(...this.get());const{blockLen:o,buffer:a,length:l,finished:u,destroyed:d,pos:f}=this;return s.length=l,s.pos=f,s.finished=u,s.destroyed=d,l%o&&s.buffer.set(a),s}}return i2.SHA2=n,i2}var r_;function Ry(){if(r_)return $h;r_=1,Object.defineProperty($h,"__esModule",{value:!0}),$h.sha224=$h.sha256=void 0;const t=gv(),e=Ra(),r=(u,d,f)=>u&d^~u&f,n=(u,d,f)=>u&d^u&f^d&f,i=new Uint32Array([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]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),o=new Uint32Array(64);class a extends t.SHA2{constructor(){super(64,32,8,!1),this.A=s[0]|0,this.B=s[1]|0,this.C=s[2]|0,this.D=s[3]|0,this.E=s[4]|0,this.F=s[5]|0,this.G=s[6]|0,this.H=s[7]|0}get(){const{A:d,B:f,C:g,D:m,E:v,F:A,G:E,H:C}=this;return[d,f,g,m,v,A,E,C]}set(d,f,g,m,v,A,E,C){this.A=d|0,this.B=f|0,this.C=g|0,this.D=m|0,this.E=v|0,this.F=A|0,this.G=E|0,this.H=C|0}process(d,f){for(let S=0;S<16;S++,f+=4)o[S]=d.getUint32(f,!1);for(let S=16;S<64;S++){const N=o[S-15],W=o[S-2],G=(0,e.rotr)(N,7)^(0,e.rotr)(N,18)^N>>>3,L=(0,e.rotr)(W,17)^(0,e.rotr)(W,19)^W>>>10;o[S]=L+o[S-7]+G+o[S-16]|0}let{A:g,B:m,C:v,D:A,E,F:C,G:k,H:I}=this;for(let S=0;S<64;S++){const N=(0,e.rotr)(E,6)^(0,e.rotr)(E,11)^(0,e.rotr)(E,25),W=I+N+r(E,C,k)+i[S]+o[S]|0,G=((0,e.rotr)(g,2)^(0,e.rotr)(g,13)^(0,e.rotr)(g,22))+n(g,m,v)|0;I=k,k=C,C=E,E=A+W|0,A=v,v=m,m=g,g=W+G|0}g=g+this.A|0,m=m+this.B|0,v=v+this.C|0,A=A+this.D|0,E=E+this.E|0,C=C+this.F|0,k=k+this.G|0,I=I+this.H|0,this.set(g,m,v,A,E,C,k,I)}roundClean(){o.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends a{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}return $h.sha256=(0,e.wrapConstructor)(()=>new a),$h.sha224=(0,e.wrapConstructor)(()=>new l),$h}var rZ=Ry(),n_=Ra();const i_=BigInt(0),Ny=BigInt(1),nZ=BigInt(2),Oy=t=>t instanceof Uint8Array,iZ=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function A0(t){if(!Oy(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=iZ[t[r]];return e}function s_(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function mv(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function E0(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let n=0;n<r.length;n++){const i=n*2,s=t.slice(i,i+2),o=Number.parseInt(s,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[n]=o}return r}function Qh(t){return mv(A0(t))}function yv(t){if(!Oy(t))throw new Error("Uint8Array expected");return mv(A0(Uint8Array.from(t).reverse()))}function T0(t,e){return E0(t.toString(16).padStart(e*2,"0"))}function wv(t,e){return T0(t,e).reverse()}function sZ(t){return E0(s_(t))}function Na(t,e,r){let n;if(typeof e=="string")try{n=E0(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(Oy(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}function o2(...t){const e=new Uint8Array(t.reduce((n,i)=>n+i.length,0));let r=0;return t.forEach(n=>{if(!Oy(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}function oZ(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function aZ(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function cZ(t){let e;for(e=0;t>i_;t>>=Ny,e+=1);return e}function lZ(t,e){return t>>BigInt(e)&Ny}const uZ=(t,e,r)=>t|(r?Ny:i_)<<BigInt(e),vv=t=>(nZ<<BigInt(t-1))-Ny,bv=t=>new Uint8Array(t),o_=t=>Uint8Array.from(t);function a_(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=bv(t),i=bv(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...d)=>r(i,n,...d),l=(d=bv())=>{i=a(o_([0]),d),n=a(),d.length!==0&&(i=a(o_([1]),d),n=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d<e;){n=a();const g=n.slice();f.push(g),d+=n.length}return o2(...f)};return(d,f)=>{o(),l(d);let g;for(;!(g=f(u()));)l();return o(),g}}const hZ={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function a2(t,e,r={}){const n=(i,s,o)=>{const a=hZ[s];if(typeof a!="function")throw new Error(`Invalid validator "${s}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const dZ=Object.freeze(Object.defineProperty({__proto__:null,bitGet:lZ,bitLen:cZ,bitMask:vv,bitSet:uZ,bytesToHex:A0,bytesToNumberBE:Qh,bytesToNumberLE:yv,concatBytes:o2,createHmacDrbg:a_,ensureBytes:Na,equalBytes:oZ,hexToBytes:E0,hexToNumber:mv,numberToBytesBE:T0,numberToBytesLE:wv,numberToHexUnpadded:s_,numberToVarBytesBE:sZ,utf8ToBytes:aZ,validateObject:a2},Symbol.toStringTag,{value:"Module"}));const Zi=BigInt(0),hi=BigInt(1),Jh=BigInt(2),fZ=BigInt(3),Av=BigInt(4),c_=BigInt(5),l_=BigInt(8);BigInt(9),BigInt(16);function eo(t,e){const r=t%e;return r>=Zi?r:e+r}function pZ(t,e,r){if(r<=Zi||e<Zi)throw new Error("Expected power/modulo > 0");if(r===hi)return Zi;let n=hi;for(;e>Zi;)e&hi&&(n=n*t%r),t=t*t%r,e>>=hi;return n}function Jo(t,e,r){let n=t;for(;e-- >Zi;)n*=n,n%=r;return n}function Ev(t,e){if(t===Zi||e<=Zi)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=eo(t,e),n=e,i=Zi,s=hi;for(;r!==Zi;){const o=n/r,a=n%r,l=i-s*o;n=r,r=a,i=s,s=l}if(n!==hi)throw new Error("invert: does not exist");return eo(i,e)}function gZ(t){const e=(t-hi)/Jh;let r,n,i;for(r=t-hi,n=0;r%Jh===Zi;r/=Jh,n++);for(i=Jh;i<t&&pZ(i,e,t)!==t-hi;i++);if(n===1){const o=(t+hi)/Av;return function(a,l){const u=a.pow(l,o);if(!a.eql(a.sqr(u),l))throw new Error("Cannot find square root");return u}}const s=(r+hi)/Jh;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let l=n,u=o.pow(o.mul(o.ONE,i),r),d=o.pow(a,s),f=o.pow(a,r);for(;!o.eql(f,o.ONE);){if(o.eql(f,o.ZERO))return o.ZERO;let g=1;for(let v=o.sqr(f);g<l&&!o.eql(v,o.ONE);g++)v=o.sqr(v);const m=o.pow(u,hi<<BigInt(l-g-1));u=o.sqr(m),d=o.mul(d,m),f=o.mul(f,u),l=g}return d}}function mZ(t){if(t%Av===fZ){const e=(t+hi)/Av;return function(r,n){const i=r.pow(n,e);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(t%l_===c_){const e=(t-c_)/l_;return function(r,n){const i=r.mul(n,Jh),s=r.pow(i,e),o=r.mul(n,s),a=r.mul(r.mul(o,Jh),s),l=r.mul(o,r.sub(a,r.ONE));if(!r.eql(r.sqr(l),n))throw new Error("Cannot find square root");return l}}return gZ(t)}const yZ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function wZ(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=yZ.reduce((n,i)=>(n[i]="function",n),e);return a2(t,r)}function vZ(t,e,r){if(r<Zi)throw new Error("Expected power > 0");if(r===Zi)return t.ONE;if(r===hi)return e;let n=t.ONE,i=e;for(;r>Zi;)r&hi&&(n=t.mul(n,i)),i=t.sqr(i),r>>=hi;return n}function bZ(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function u_(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function AZ(t,e,r=!1,n={}){if(t<=Zi)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:s}=u_(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=mZ(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:vv(i),ZERO:Zi,ONE:hi,create:l=>eo(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return Zi<=l&&l<t},is0:l=>l===Zi,isOdd:l=>(l&hi)===hi,neg:l=>eo(-l,t),eql:(l,u)=>l===u,sqr:l=>eo(l*l,t),add:(l,u)=>eo(l+u,t),sub:(l,u)=>eo(l-u,t),mul:(l,u)=>eo(l*u,t),pow:(l,u)=>vZ(a,l,u),div:(l,u)=>eo(l*Ev(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Ev(l,t),sqrt:n.sqrt||(l=>o(a,l)),invertBatch:l=>bZ(a,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?wv(l,s):T0(l,s),fromBytes:l=>{if(l.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${l.length}`);return r?yv(l):Qh(l)}});return Object.freeze(a)}function h_(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function d_(t){const e=h_(t);return e+Math.ceil(e/2)}function EZ(t,e,r=!1){const n=t.length,i=h_(e),s=d_(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=r?Qh(t):yv(t),a=eo(o,e-hi)+hi;return r?wv(a,i):T0(a,i)}const TZ=BigInt(0),Tv=BigInt(1);function SZ(t,e){const r=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:r,unsafeLadder(i,s){let o=t.ZERO,a=i;for(;s>TZ;)s&Tv&&(o=o.add(a)),a=a.double(),s>>=Tv;return o},precomputeWindow(i,s){const{windows:o,windowSize:a}=n(s),l=[];let u=i,d=u;for(let f=0;f<o;f++){d=u,l.push(d);for(let g=1;g<a;g++)d=d.add(u),l.push(d);u=d.double()}return l},wNAF(i,s,o){const{windows:a,windowSize:l}=n(i);let u=t.ZERO,d=t.BASE;const f=BigInt(2**i-1),g=2**i,m=BigInt(i);for(let v=0;v<a;v++){const A=v*l;let E=Number(o&f);o>>=m,E>l&&(E-=g,o+=Tv);const C=A,k=A+Math.abs(E)-1,I=v%2!==0,S=E<0;E===0?d=d.add(r(I,s[C])):u=u.add(r(S,s[k]))}return{p:u,f:d}},wNAFCached(i,s,o,a){const l=i._WINDOW_SIZE||1;let u=s.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&s.set(i,a(u))),this.wNAF(l,u,o)}}}function f_(t){return wZ(t.Fp),a2(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...u_(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function CZ(t){const e=f_(t);a2(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:kZ,hexToBytes:_Z}=dZ,Yh={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(t){const{Err:e}=Yh;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:kZ(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=Yh,r=typeof t=="string"?_Z(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=Yh._parseInt(r.subarray(2)),{d:o,l:a}=Yh._parseInt(s);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{const d=u.toString(16);return d.length&1?`0${d}`:d},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},wl=BigInt(0),Yo=BigInt(1);BigInt(2);const p_=BigInt(3);BigInt(4);function IZ(t){const e=CZ(t),{Fp:r}=e,n=e.toBytes||((v,A,E)=>{const C=A.toAffine();return o2(Uint8Array.from([4]),r.toBytes(C.x),r.toBytes(C.y))}),i=e.fromBytes||(v=>{const A=v.subarray(1),E=r.fromBytes(A.subarray(0,r.BYTES)),C=r.fromBytes(A.subarray(r.BYTES,2*r.BYTES));return{x:E,y:C}});function s(v){const{a:A,b:E}=e,C=r.sqr(v),k=r.mul(C,v);return r.add(r.add(k,r.mul(v,A)),E)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(v){return typeof v=="bigint"&&wl<v&&v<e.n}function a(v){if(!o(v))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(v){const{allowedPrivateKeyLengths:A,nByteLength:E,wrapPrivateKey:C,n:k}=e;if(A&&typeof v!="bigint"){if(v instanceof Uint8Array&&(v=A0(v)),typeof v!="string"||!A.includes(v.length))throw new Error("Invalid key");v=v.padStart(E*2,"0")}let I;try{I=typeof v=="bigint"?v:Qh(Na("private key",v,E))}catch{throw new Error(`private key must be ${E} bytes, hex or bigint, not ${typeof v}`)}return C&&(I=eo(I,k)),a(I),I}const u=new Map;function d(v){if(!(v instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(A,E,C){if(this.px=A,this.py=E,this.pz=C,A==null||!r.isValid(A))throw new Error("x required");if(E==null||!r.isValid(E))throw new Error("y required");if(C==null||!r.isValid(C))throw new Error("z required")}static fromAffine(A){const{x:E,y:C}=A||{};if(!A||!r.isValid(E)||!r.isValid(C))throw new Error("invalid affine point");if(A instanceof f)throw new Error("projective point not allowed");const k=I=>r.eql(I,r.ZERO);return k(E)&&k(C)?f.ZERO:new f(E,C,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const E=r.invertBatch(A.map(C=>C.pz));return A.map((C,k)=>C.toAffine(E[k])).map(f.fromAffine)}static fromHex(A){const E=f.fromAffine(i(Na("pointHex",A)));return E.assertValidity(),E}static fromPrivateKey(A){return f.BASE.multiply(l(A))}_setWindowSize(A){this._WINDOW_SIZE=A,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:A,y:E}=this.toAffine();if(!r.isValid(A)||!r.isValid(E))throw new Error("bad point: x or y not FE");const C=r.sqr(E),k=s(A);if(!r.eql(C,k))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:A}=this.toAffine();if(r.isOdd)return!r.isOdd(A);throw new Error("Field doesn't support isOdd")}equals(A){d(A);const{px:E,py:C,pz:k}=this,{px:I,py:S,pz:N}=A,W=r.eql(r.mul(E,N),r.mul(I,k)),G=r.eql(r.mul(C,N),r.mul(S,k));return W&&G}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){const{a:A,b:E}=e,C=r.mul(E,p_),{px:k,py:I,pz:S}=this;let N=r.ZERO,W=r.ZERO,G=r.ZERO,L=r.mul(k,k),V=r.mul(I,I),$=r.mul(S,S),j=r.mul(k,I);return j=r.add(j,j),G=r.mul(k,S),G=r.add(G,G),N=r.mul(A,G),W=r.mul(C,$),W=r.add(N,W),N=r.sub(V,W),W=r.add(V,W),W=r.mul(N,W),N=r.mul(j,N),G=r.mul(C,G),$=r.mul(A,$),j=r.sub(L,$),j=r.mul(A,j),j=r.add(j,G),G=r.add(L,L),L=r.add(G,L),L=r.add(L,$),L=r.mul(L,j),W=r.add(W,L),$=r.mul(I,S),$=r.add($,$),L=r.mul($,j),N=r.sub(N,L),G=r.mul($,V),G=r.add(G,G),G=r.add(G,G),new f(N,W,G)}add(A){d(A);const{px:E,py:C,pz:k}=this,{px:I,py:S,pz:N}=A;let W=r.ZERO,G=r.ZERO,L=r.ZERO;const V=e.a,$=r.mul(e.b,p_);let j=r.mul(E,I),B=r.mul(C,S),O=r.mul(k,N),H=r.add(E,C),D=r.add(I,S);H=r.mul(H,D),D=r.add(j,B),H=r.sub(H,D),D=r.add(E,k);let q=r.add(I,N);return D=r.mul(D,q),q=r.add(j,O),D=r.sub(D,q),q=r.add(C,k),W=r.add(S,N),q=r.mul(q,W),W=r.add(B,O),q=r.sub(q,W),L=r.mul(V,D),W=r.mul($,O),L=r.add(W,L),W=r.sub(B,L),L=r.add(B,L),G=r.mul(W,L),B=r.add(j,j),B=r.add(B,j),O=r.mul(V,O),D=r.mul($,D),B=r.add(B,O),O=r.sub(j,O),O=r.mul(V,O),D=r.add(D,O),j=r.mul(B,D),G=r.add(G,j),j=r.mul(q,D),W=r.mul(H,W),W=r.sub(W,j),j=r.mul(H,B),L=r.mul(q,L),L=r.add(L,j),new f(W,G,L)}subtract(A){return this.add(A.negate())}is0(){return this.equals(f.ZERO)}wNAF(A){return m.wNAFCached(this,u,A,E=>{const C=r.invertBatch(E.map(k=>k.pz));return E.map((k,I)=>k.toAffine(C[I])).map(f.fromAffine)})}multiplyUnsafe(A){const E=f.ZERO;if(A===wl)return E;if(a(A),A===Yo)return this;const{endo:C}=e;if(!C)return m.unsafeLadder(this,A);let{k1neg:k,k1:I,k2neg:S,k2:N}=C.splitScalar(A),W=E,G=E,L=this;for(;I>wl||N>wl;)I&Yo&&(W=W.add(L)),N&Yo&&(G=G.add(L)),L=L.double(),I>>=Yo,N>>=Yo;return k&&(W=W.negate()),S&&(G=G.negate()),G=new f(r.mul(G.px,C.beta),G.py,G.pz),W.add(G)}multiply(A){a(A);let E=A,C,k;const{endo:I}=e;if(I){const{k1neg:S,k1:N,k2neg:W,k2:G}=I.splitScalar(E);let{p:L,f:V}=this.wNAF(N),{p:$,f:j}=this.wNAF(G);L=m.constTimeNegate(S,L),$=m.constTimeNegate(W,$),$=new f(r.mul($.px,I.beta),$.py,$.pz),C=L.add($),k=V.add(j)}else{const{p:S,f:N}=this.wNAF(E);C=S,k=N}return f.normalizeZ([C,k])[0]}multiplyAndAddUnsafe(A,E,C){const k=f.BASE,I=(N,W)=>W===wl||W===Yo||!N.equals(k)?N.multiplyUnsafe(W):N.multiply(W),S=I(this,E).add(I(A,C));return S.is0()?void 0:S}toAffine(A){const{px:E,py:C,pz:k}=this,I=this.is0();A==null&&(A=I?r.ONE:r.inv(k));const S=r.mul(E,A),N=r.mul(C,A),W=r.mul(k,A);if(I)return{x:r.ZERO,y:r.ZERO};if(!r.eql(W,r.ONE))throw new Error("invZ was invalid");return{x:S,y:N}}isTorsionFree(){const{h:A,isTorsionFree:E}=e;if(A===Yo)return!0;if(E)return E(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:E}=e;return A===Yo?this:E?E(f,this):this.multiplyUnsafe(e.h)}toRawBytes(A=!0){return this.assertValidity(),n(f,this,A)}toHex(A=!0){return A0(this.toRawBytes(A))}}f.BASE=new f(e.Gx,e.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);const g=e.nBitLength,m=SZ(f,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}function RZ(t){const e=f_(t);return a2(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function NZ(t){const e=RZ(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(D){return wl<D&&D<r.ORDER}function a(D){return eo(D,n)}function l(D){return Ev(D,n)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:g}=IZ({...e,toBytes(D,q,K){const te=q.toAffine(),Q=r.toBytes(te.x),X=o2;return K?X(Uint8Array.from([q.hasEvenY()?2:3]),Q):X(Uint8Array.from([4]),Q,r.toBytes(te.y))},fromBytes(D){const q=D.length,K=D[0],te=D.subarray(1);if(q===i&&(K===2||K===3)){const Q=Qh(te);if(!o(Q))throw new Error("Point is not on curve");const X=f(Q);let Y=r.sqrt(X);const re=(Y&Yo)===Yo;return(K&1)===1!==re&&(Y=r.neg(Y)),{x:Q,y:Y}}else if(q===s&&K===4){const Q=r.fromBytes(te.subarray(0,r.BYTES)),X=r.fromBytes(te.subarray(r.BYTES,2*r.BYTES));return{x:Q,y:X}}else throw new Error(`Point of length ${q} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),m=D=>A0(T0(D,e.nByteLength));function v(D){const q=n>>Yo;return D>q}function A(D){return v(D)?a(-D):D}const E=(D,q,K)=>Qh(D.slice(q,K));class C{constructor(q,K,te){this.r=q,this.s=K,this.recovery=te,this.assertValidity()}static fromCompact(q){const K=e.nByteLength;return q=Na("compactSignature",q,K*2),new C(E(q,0,K),E(q,K,2*K))}static fromDER(q){const{r:K,s:te}=Yh.toSig(Na("DER",q));return new C(K,te)}assertValidity(){if(!g(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!g(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(q){return new C(this.r,this.s,q)}recoverPublicKey(q){const{r:K,s:te,recovery:Q}=this,X=G(Na("msgHash",q));if(Q==null||![0,1,2,3].includes(Q))throw new Error("recovery id invalid");const Y=Q===2||Q===3?K+e.n:K;if(Y>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const re=Q&1?"03":"02",ue=u.fromHex(re+m(Y)),me=l(Y),Re=a(-X*me),Te=a(te*me),ye=u.BASE.multiplyAndAddUnsafe(ue,Re,Te);if(!ye)throw new Error("point at infinify");return ye.assertValidity(),ye}hasHighS(){return v(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return E0(this.toDERHex())}toDERHex(){return Yh.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return E0(this.toCompactHex())}toCompactHex(){return m(this.r)+m(this.s)}}const k={isValidPrivateKey(D){try{return d(D),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const D=d_(e.n);return EZ(e.randomBytes(D),e.n)},precompute(D=8,q=u.BASE){return q._setWindowSize(D),q.multiply(BigInt(3)),q}};function I(D,q=!0){return u.fromPrivateKey(D).toRawBytes(q)}function S(D){const q=D instanceof Uint8Array,K=typeof D=="string",te=(q||K)&&D.length;return q?te===i||te===s:K?te===2*i||te===2*s:D instanceof u}function N(D,q,K=!0){if(S(D))throw new Error("first arg must be private key");if(!S(q))throw new Error("second arg must be public key");return u.fromHex(q).multiply(d(D)).toRawBytes(K)}const W=e.bits2int||function(D){const q=Qh(D),K=D.length*8-e.nBitLength;return K>0?q>>BigInt(K):q},G=e.bits2int_modN||function(D){return a(W(D))},L=vv(e.nBitLength);function V(D){if(typeof D!="bigint")throw new Error("bigint expected");if(!(wl<=D&&D<L))throw new Error(`bigint expected < 2^${e.nBitLength}`);return T0(D,e.nByteLength)}function $(D,q,K=j){if(["recovered","canonical"].some(ke=>ke in K))throw new Error("sign() legacy options not supported");const{hash:te,randomBytes:Q}=e;let{lowS:X,prehash:Y,extraEntropy:re}=K;X==null&&(X=!0),D=Na("msgHash",D),Y&&(D=Na("prehashed msgHash",te(D)));const ue=G(D),me=d(q),Re=[V(me),V(ue)];if(re!=null){const ke=re===!0?Q(r.BYTES):re;Re.push(Na("extraEntropy",ke))}const Te=o2(...Re),ye=ue;function ve(ke){const ee=W(ke);if(!g(ee))return;const Se=l(ee),Oe=u.BASE.multiply(ee).toAffine(),Ae=a(Oe.x);if(Ae===wl)return;const fe=a(Se*a(ye+Ae*me));if(fe===wl)return;let Z=(Oe.x===Ae?0:2)|Number(Oe.y&Yo),se=fe;return X&&v(fe)&&(se=A(fe),Z^=1),new C(Ae,se,Z)}return{seed:Te,k2sig:ve}}const j={lowS:e.lowS,prehash:!1},B={lowS:e.lowS,prehash:!1};function O(D,q,K=j){const{seed:te,k2sig:Q}=$(D,q,K),X=e;return a_(X.hash.outputLen,X.nByteLength,X.hmac)(te,Q)}u.BASE._setWindowSize(8);function H(D,q,K,te=B){var Q;const X=D;if(q=Na("msgHash",q),K=Na("publicKey",K),"strict"in te)throw new Error("options.strict was renamed to lowS");const{lowS:Y,prehash:re}=te;let ue,me;try{if(typeof X=="string"||X instanceof Uint8Array)try{ue=C.fromDER(X)}catch(Oe){if(!(Oe instanceof Yh.Err))throw Oe;ue=C.fromCompact(X)}else if(typeof X=="object"&&typeof X.r=="bigint"&&typeof X.s=="bigint"){const{r:Oe,s:Ae}=X;ue=new C(Oe,Ae)}else throw new Error("PARSE");me=u.fromHex(K)}catch(Oe){if(Oe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Y&&ue.hasHighS())return!1;re&&(q=e.hash(q));const{r:Re,s:Te}=ue,ye=G(q),ve=l(Te),ke=a(ye*ve),ee=a(Re*ve),Se=(Q=u.BASE.multiplyAndAddUnsafe(me,ke,ee))==null?void 0:Q.toAffine();return Se?a(Se.x)===Re:!1}return{CURVE:e,getPublicKey:I,getSharedSecret:N,sign:O,verify:H,ProjectivePoint:u,Signature:C,utils:k}}var g_={},m_;function xy(){return m_||(m_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const e=s2(),r=Ra();class n extends r.Hash{constructor(o,a){super(),this.finished=!1,this.destroyed=!1,(0,e.hash)(o);const l=(0,r.toBytes)(a);if(this.iHash=o.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,d=new Uint8Array(u);d.set(l.length>u?o.create().update(l).digest():l);for(let f=0;f<d.length;f++)d[f]^=54;this.iHash.update(d),this.oHash=o.create();for(let f=0;f<d.length;f++)d[f]^=106;this.oHash.update(d),d.fill(0)}update(o){return(0,e.exists)(this),this.iHash.update(o),this}digestInto(o){(0,e.exists)(this),(0,e.bytes)(o,this.outputLen),this.finished=!0,this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const o=new Uint8Array(this.oHash.outputLen);return this.digestInto(o),o}_cloneInto(o){o||(o=Object.create(Object.getPrototypeOf(this),{}));const{oHash:a,iHash:l,finished:u,destroyed:d,blockLen:f,outputLen:g}=this;return o=o,o.finished=u,o.destroyed=d,o.blockLen=f,o.outputLen=g,o.oHash=a._cloneInto(o.oHash),o.iHash=l._cloneInto(o.iHash),o}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=n;const i=(s,o,a)=>new n(s,o).update(a).digest();t.hmac=i,t.hmac.create=(s,o)=>new n(s,o)})(g_)),g_}var OZ=xy();function xZ(t){return{hash:t,hmac:(e,...r)=>OZ.hmac(t,e,n_.concatBytes(...r)),randomBytes:n_.randomBytes}}function PZ(t,e){const r=n=>NZ({...t,...xZ(n)});return Object.freeze({...r(e),create:r})}const y_=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),w_=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),MZ=BigInt(1),Sv=BigInt(2),v_=(t,e)=>(t+e/Sv)/e;function BZ(t){const e=y_,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,d=u*u*t%e,f=Jo(d,r,e)*d%e,g=Jo(f,r,e)*d%e,m=Jo(g,Sv,e)*u%e,v=Jo(m,i,e)*m%e,A=Jo(v,s,e)*v%e,E=Jo(A,a,e)*A%e,C=Jo(E,l,e)*E%e,k=Jo(C,a,e)*A%e,I=Jo(k,r,e)*d%e,S=Jo(I,o,e)*v%e,N=Jo(S,n,e)*u%e,W=Jo(N,Sv,e);if(!Cv.eql(Cv.sqr(W),t))throw new Error("Cannot find square root");return W}const Cv=AZ(y_,void 0,void 0,{sqrt:BZ}),Su=PZ({a:BigInt(0),b:BigInt(7),Fp:Cv,n:w_,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=w_,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-MZ*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=v_(s*t,e),l=v_(-n*t,e);let u=eo(t-a*r-l*i,e),d=eo(-a*n-l*s,e);const f=u>o,g=d>o;if(f&&(u=e-u),g&&(d=e-d),u>o||d>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:u,k2neg:g,k2:d}}}},rZ.sha256);BigInt(0),Su.ProjectivePoint;const Kh="0x0000000000000000000000000000000000000000",Py="0x0000000000000000000000000000000000000000000000000000000000000000",b_=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),A_=BigInt("1000000000000000000"),E_=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),T_=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1),S_=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),C_="Ξ",kv=`Ethereum Signed Message:
5
5
  `,k_=BigInt(0),__=BigInt(1),I_=BigInt(2),R_=BigInt(27),N_=BigInt(28),My=BigInt(35),S0={};function O_(t){return zo(Fi(t),32)}var c2,l2,u2,C0;const UZ=class Jc{constructor(e,r,n,i){Ee(this,c2),Ee(this,l2),Ee(this,u2),Ee(this,C0),wc(e,S0,"Signature"),ne(this,c2,r),ne(this,l2,n),ne(this,u2,i),ne(this,C0,null)}get r(){return M(this,c2)}set r(e){De(ol(e)===32,"invalid r","value",e),ne(this,c2,At(e))}get s(){return M(this,l2)}set s(e){De(ol(e)===32,"invalid s","value",e);const r=At(e);De(parseInt(r.substring(0,3))<8,"non-canonical s","value",r),ne(this,l2,r)}get v(){return M(this,u2)}set v(e){const r=ir(e,"value");De(r===27||r===28,"invalid v","v",e),ne(this,u2,r)}get networkV(){return M(this,C0)}get legacyChainId(){const e=this.networkV;return e==null?null:Jc.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Ot(this.s);return this.yParity&&(e[0]|=128),At(e)}get compactSerialized(){return Qr([this.r,this.yParityAndS])}get serialized(){return Qr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Jc(S0,this.r,this.s,this.v);return this.networkV&&ne(e,C0,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const r=Yt(e,"v");return r==R_||r==N_?k_:(De(r>=My,"invalid EIP-155 v","v",e),(r-My)/I_)}static getChainIdV(e,r){return Yt(e)*I_+BigInt(35+r-27)}static getNormalizedV(e){const r=Yt(e);return r===k_||r===R_?27:r===__||r===N_?28:(De(r>=My,"invalid v","v",e),r&__?27:28)}static from(e){function r(u,d){De(u,d,"signature",e)}if(e==null)return new Jc(S0,Py,Py,27);if(typeof e=="string"){const u=Ot(e,"signature");if(u.length===64){const d=At(u.slice(0,32)),f=u.slice(32,64),g=f[0]&128?28:27;return f[0]&=127,new Jc(S0,d,At(f),g)}if(u.length===65){const d=At(u.slice(0,32)),f=u.slice(32,64);r((f[0]&128)===0,"non-canonical s");const g=Jc.getNormalizedV(u[64]);return new Jc(S0,d,At(f),g)}r(!1,"invalid raw signature length")}if(e instanceof Jc)return e.clone();const n=e.r;r(n!=null,"missing r");const i=O_(n),s=(function(u,d){if(u!=null)return O_(u);if(d!=null){r(wn(d,32),"invalid yParityAndS");const f=Ot(d);return f[0]&=127,At(f)}r(!1,"missing s")})(e.s,e.yParityAndS);r((Ot(s)[0]&128)==0,"non-canonical s");const{networkV:o,v:a}=(function(u,d,f){if(u!=null){const g=Yt(u);return{networkV:g>=My?g:void 0,v:Jc.getNormalizedV(g)}}if(d!=null)return r(wn(d,32),"invalid yParityAndS"),{v:Ot(d)[0]&128?28:27};if(f!=null){switch(ir(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")})(e.v,e.yParityAndS,e.yParity),l=new Jc(S0,i,s,a);return o&&ne(l,C0,o),r(e.yParity==null||ir(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),r(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};c2=new WeakMap,l2=new WeakMap,u2=new WeakMap,C0=new WeakMap;let Oa=UZ;var Cu;const DZ=class Tp{constructor(e){Ee(this,Cu),De(ol(e)===32,"invalid private key","privateKey","[REDACTED]"),ne(this,Cu,At(e))}get privateKey(){return M(this,Cu)}get publicKey(){return Tp.computePublicKey(M(this,Cu))}get compressedPublicKey(){return Tp.computePublicKey(M(this,Cu),!0)}sign(e){De(ol(e)===32,"invalid digest length","digest",e);const r=Su.sign(Di(e),Di(M(this,Cu)),{lowS:!0});return Oa.from({r:Zo(r.r,32),s:Zo(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=Tp.computePublicKey(e);return At(Su.getSharedSecret(Di(M(this,Cu)),Ot(r),!1))}static computePublicKey(e,r){let n=Ot(e,"key");if(n.length===32){const s=Su.getPublicKey(n,!!r);return At(s)}if(n.length===64){const s=new Uint8Array(65);s[0]=4,s.set(n,1),n=s}const i=Su.ProjectivePoint.fromHex(n);return At(i.toRawBytes(r))}static recoverPublicKey(e,r){De(ol(e)===32,"invalid digest length","digest",e);const n=Oa.from(r);let i=Su.Signature.fromCompact(Di(Qr([n.r,n.s])));i=i.addRecoveryBit(n.yParity);const s=i.recoverPublicKey(Di(e));return De(s!=null,"invalid signautre for digest","signature",r),"0x"+s.toHex(!1)}static addPoints(e,r,n){const i=Su.ProjectivePoint.fromHex(Tp.computePublicKey(e).substring(2)),s=Su.ProjectivePoint.fromHex(Tp.computePublicKey(r).substring(2));return"0x"+i.add(s).toHex(!!n)}};Cu=new WeakMap;let Tc=DZ;function x_(){pl.lock(),bn.lock(),Ia.lock(),go.lock(),gl.lock(),ml.lock(),yl.lock(),bs.lock(),b0.lock(),go.lock()}const FZ=BigInt(0),LZ=BigInt(36);function P_(t){t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Ot(bn(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const _v={};for(let t=0;t<10;t++)_v[String(t)]=String(t);for(let t=0;t<26;t++)_v[String.fromCharCode(65+t)]=String(10+t);const M_=15;function B_(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>_v[n]).join("");for(;e.length>=M_;){let n=e.substring(0,M_);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}const VZ=(function(){const t={};for(let e=0;e<36;e++){const r="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[r]=BigInt(e)}return t})();function HZ(t){t=t.toLowerCase();let e=FZ;for(let r=0;r<t.length;r++)e=e*LZ+VZ[t[r]];return e}function Or(t){if(De(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=P_(t);return De(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){De(t.substring(2,4)===B_(t),"bad icap checksum","address",t);let e=HZ(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return P_("0x"+e)}De(!1,"invalid address","address",t)}function U_(t){let e=BigInt(Or(t)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+B_("XE00"+e)+e}function By(t){const e=Or(t.from);let r=Yt(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,Or(vn(bn(dl([e,r])),12))}function D_(t,e,r){const n=Or(t),i=Ot(e,"salt"),s=Ot(r,"initCodeHash");return De(i.length===32,"salt must be 32 bytes","salt",e),De(s.length===32,"initCodeHash must be 32 bytes","initCodeHash",r),Or(vn(bn(Qr(["0xff",n,i,s])),12))}function Uy(t){return t&&typeof t.getAddress=="function"}function F_(t){try{return Or(t),!0}catch{}return!1}async function Iv(t,e){const r=await e;return(r==null||r==="0x0000000000000000000000000000000000000000")&&(ot(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),De(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),Or(r)}function Li(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?Or(t):(ot(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Iv(t,e.resolveName(t)));if(Uy(t))return Iv(t,t.getAddress());if(t&&typeof t.then=="function")return Iv(t,t);De(!1,"unsupported addressable value","target",t)}const vl={};function $t(t,e){let r=!1;return e<0&&(r=!0,e*=-1),new Es(vl,`${r?"":"u"}int${e}`,t,{signed:r,width:e})}function cn(t,e){return new Es(vl,`bytes${e||""}`,t,{size:e})}const L_=Symbol.for("_ethers_typed");var k0;const WZ=class bh{constructor(e,r,n,i){de(this,"type"),de(this,"value"),Ee(this,k0),de(this,"_typedSymbol"),i==null&&(i=null),wc(vl,e,"Typed"),Ft(this,{_typedSymbol:L_,type:r,value:n}),ne(this,k0,i),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return M(this,k0)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return M(this,k0)===!0?-1:M(this,k0)===!1?this.value.length:null}static from(e,r){return new bh(vl,e,r)}static uint8(e){return $t(e,8)}static uint16(e){return $t(e,16)}static uint24(e){return $t(e,24)}static uint32(e){return $t(e,32)}static uint40(e){return $t(e,40)}static uint48(e){return $t(e,48)}static uint56(e){return $t(e,56)}static uint64(e){return $t(e,64)}static uint72(e){return $t(e,72)}static uint80(e){return $t(e,80)}static uint88(e){return $t(e,88)}static uint96(e){return $t(e,96)}static uint104(e){return $t(e,104)}static uint112(e){return $t(e,112)}static uint120(e){return $t(e,120)}static uint128(e){return $t(e,128)}static uint136(e){return $t(e,136)}static uint144(e){return $t(e,144)}static uint152(e){return $t(e,152)}static uint160(e){return $t(e,160)}static uint168(e){return $t(e,168)}static uint176(e){return $t(e,176)}static uint184(e){return $t(e,184)}static uint192(e){return $t(e,192)}static uint200(e){return $t(e,200)}static uint208(e){return $t(e,208)}static uint216(e){return $t(e,216)}static uint224(e){return $t(e,224)}static uint232(e){return $t(e,232)}static uint240(e){return $t(e,240)}static uint248(e){return $t(e,248)}static uint256(e){return $t(e,256)}static uint(e){return $t(e,256)}static int8(e){return $t(e,-8)}static int16(e){return $t(e,-16)}static int24(e){return $t(e,-24)}static int32(e){return $t(e,-32)}static int40(e){return $t(e,-40)}static int48(e){return $t(e,-48)}static int56(e){return $t(e,-56)}static int64(e){return $t(e,-64)}static int72(e){return $t(e,-72)}static int80(e){return $t(e,-80)}static int88(e){return $t(e,-88)}static int96(e){return $t(e,-96)}static int104(e){return $t(e,-104)}static int112(e){return $t(e,-112)}static int120(e){return $t(e,-120)}static int128(e){return $t(e,-128)}static int136(e){return $t(e,-136)}static int144(e){return $t(e,-144)}static int152(e){return $t(e,-152)}static int160(e){return $t(e,-160)}static int168(e){return $t(e,-168)}static int176(e){return $t(e,-176)}static int184(e){return $t(e,-184)}static int192(e){return $t(e,-192)}static int200(e){return $t(e,-200)}static int208(e){return $t(e,-208)}static int216(e){return $t(e,-216)}static int224(e){return $t(e,-224)}static int232(e){return $t(e,-232)}static int240(e){return $t(e,-240)}static int248(e){return $t(e,-248)}static int256(e){return $t(e,-256)}static int(e){return $t(e,-256)}static bytes1(e){return cn(e,1)}static bytes2(e){return cn(e,2)}static bytes3(e){return cn(e,3)}static bytes4(e){return cn(e,4)}static bytes5(e){return cn(e,5)}static bytes6(e){return cn(e,6)}static bytes7(e){return cn(e,7)}static bytes8(e){return cn(e,8)}static bytes9(e){return cn(e,9)}static bytes10(e){return cn(e,10)}static bytes11(e){return cn(e,11)}static bytes12(e){return cn(e,12)}static bytes13(e){return cn(e,13)}static bytes14(e){return cn(e,14)}static bytes15(e){return cn(e,15)}static bytes16(e){return cn(e,16)}static bytes17(e){return cn(e,17)}static bytes18(e){return cn(e,18)}static bytes19(e){return cn(e,19)}static bytes20(e){return cn(e,20)}static bytes21(e){return cn(e,21)}static bytes22(e){return cn(e,22)}static bytes23(e){return cn(e,23)}static bytes24(e){return cn(e,24)}static bytes25(e){return cn(e,25)}static bytes26(e){return cn(e,26)}static bytes27(e){return cn(e,27)}static bytes28(e){return cn(e,28)}static bytes29(e){return cn(e,29)}static bytes30(e){return cn(e,30)}static bytes31(e){return cn(e,31)}static bytes32(e){return cn(e,32)}static address(e){return new bh(vl,"address",e)}static bool(e){return new bh(vl,"bool",!!e)}static bytes(e){return new bh(vl,"bytes",e)}static string(e){return new bh(vl,"string",e)}static array(e,r){throw new Error("not implemented yet")}static tuple(e,r){throw new Error("not implemented yet")}static overrides(e){return new bh(vl,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===L_}static dereference(e,r){if(bh.isTyped(e)){if(e.type!==r)throw new Error(`invalid type: expecetd ${r}, got ${e.type}`);return e.value}return e}};k0=new WeakMap;let Es=WZ;class jZ extends fl{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){let n=Es.dereference(r,"string");try{n=Or(n)}catch(i){return this._throwError(i.message,r)}return e.writeValue(n)}decode(e){return Or(Zo(e.readValue(),20))}}class GZ extends fl{constructor(e){super(e.name,e.type,"_",e.dynamic),de(this,"coder"),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}function V_(t,e,r){let n=[];if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(u=>{const d=u.localName;return ot(d,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),ot(!l[d],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:r}),l[d]=!0,r[d]})}else De(!1,"invalid tuple value","tuple",r);De(e.length===n.length,"types/value length mismatch","tuple",r);let i=new iv,s=new iv,o=[];e.forEach((l,u)=>{let d=n[u];if(l.dynamic){let f=s.length;l.encode(s,d);let g=i.writeUpdatableValue();o.push(m=>{g(m+f)})}else l.encode(i,d)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function H_(t,e){let r=[],n=[],i=t.subReader(0);return e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readIndex(),l=i.subReader(a);try{o=s.decode(l)}catch(u){if(ui(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(ui(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}if(o==null)throw new Error("investigate");r.push(o),n.push(s.localName||null)}),g0.fromItems(r,n)}class zZ extends fl{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),de(this,"coder"),de(this,"length"),Ft(this,{coder:e,length:r})}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;n<this.length;n++)r.push(e);return r}encode(e,r){const n=Es.dereference(r,"array");Array.isArray(n)||this._throwError("expected array value",n);let i=this.length;i===-1&&(i=n.length,e.writeValue(n.length)),ay(n.length,i,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let o=0;o<n.length;o++)s.push(this.coder);return V_(e,s,n)}decode(e){let r=this.length;r===-1&&(r=e.readIndex(),ot(r*xs<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:r*xs,length:e.dataLength}));let n=[];for(let i=0;i<r;i++)n.push(new GZ(this.coder));return H_(e,n)}}class ZZ extends fl{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){const n=Es.dereference(r,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}}class W_ extends fl{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=Di(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readIndex(),!0)}}class $Z extends W_{constructor(e){super("bytes",e)}decode(e){return At(super.decode(e))}}class QZ extends fl{constructor(e,r){let n="bytes"+String(e);super(n,n,r,!1),de(this,"size"),Ft(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let n=Di(Es.dereference(r,this.type));return n.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(n)}decode(e){return At(e.readBytes(this.size))}}const JZ=new Uint8Array([]);class YZ extends fl{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes(JZ)}decode(e){return e.readBytes(0),null}}const KZ=BigInt(0),XZ=BigInt(1),qZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class e$ extends fl{constructor(e,r,n){const i=(r?"int":"uint")+e*8;super(i,i,n,!1),de(this,"size"),de(this,"signed"),Ft(this,{size:e,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,r){let n=Yt(Es.dereference(r,this.type)),i=al(qZ,xs*8);if(this.signed){let s=al(i,this.size*8-1);(n>s||n<-(s+XZ))&&this._throwError("value out-of-bounds",r),n=jp(n,8*xs)}else(n<KZ||n>al(i,this.size*8))&&this._throwError("value out-of-bounds",r);return e.writeValue(n)}decode(e){let r=al(e.readValue(),this.size*8);return this.signed&&(r=n0(r,this.size*8)),r}}class t$ extends W_{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,Ti(Es.dereference(r,"string")))}decode(e){return ll(super.decode(e))}}class Dy extends fl{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),de(this,"coders"),Ft(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){const n=Es.dereference(r,"tuple");return V_(e,this.coders,n)}decode(e){return H_(e,this.coders)}}function xa(t){return bn(Ti(t))}var r$="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const j_=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),G_=4;function n$(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let N=1;N<n;N++)s.push(i+=r());let o=r(),a=e;e+=o;let l=0,u=0;function d(){return l==0&&(u=u<<8|t[e++],l=8),u>>--l&1}const f=31,g=2**f,m=g>>>1,v=m>>1,A=g-1;let E=0;for(let N=0;N<f;N++)E=E<<1|d();let C=[],k=0,I=g;for(;;){let N=Math.floor(((E-k+1)*i-1)/I),W=0,G=n;for(;G-W>1;){let $=W+G>>>1;N<s[$]?G=$:W=$}if(W==0)break;C.push(W);let L=k+Math.floor(I*s[W]/i),V=k+Math.floor(I*s[W+1]/i)-1;for(;!((L^V)&m);)E=E<<1&A|d(),L=L<<1&A,V=V<<1&A|1;for(;L&~V&v;)E=E&m|E<<1&A>>>1|d(),L=L<<1^m,V=(V^m)<<1|m|1;k=L,I=1+V-L}let S=n-4;return C.map(N=>{switch(N-S){case 3:return S+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return S+256+(t[a++]<<8|t[a++]);case 1:return S+t[a++];default:return N-1}})}function i$(t){let e=0;return()=>t[e++]}function z_(t){return i$(n$(s$(t)))}function s$(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,s)=>e[i.charCodeAt(0)]=s);let r=t.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,o=0,a=0;i<r;i++)a=a<<6|e[t.charCodeAt(i)],o+=6,o>=8&&(n[s++]=a>>(o-=8));return n}function o$(t){return t&1?~t>>1:t>>1}function a$(t,e){let r=Array(t);for(let n=0,i=0;n<t;n++)r[n]=i+=o$(e());return r}function h2(t,e=0){let r=[];for(;;){let n=t(),i=t();if(!i)break;e+=n;for(let s=0;s<i;s++)r.push(e+s);e+=i+1}return r}function Z_(t){return d2(()=>{let e=h2(t);if(e.length)return e})}function $_(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(c$(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(l$(r,t))}return e.flat()}function d2(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function Q_(t,e,r){let n=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)a$(t,r).forEach((s,o)=>n[o].push(s));return n}function c$(t,e){let r=1+e(),n=e(),i=d2(e);return Q_(i.length,1+t,e).flatMap((s,o)=>{let[a,...l]=s;return Array(i[o]).fill().map((u,d)=>{let f=d*n;return[a+d*r,l.map(g=>g+f)]})})}function l$(t,e){let r=1+e();return Q_(r,1+t,e).map(n=>[n[0],n.slice(1)])}function u$(t){let e=[],r=h2(t);return i(n([]),[]),e;function n(s){let o=t(),a=d2(()=>{let l=h2(t).map(u=>r[u]);if(l.length)return n(l)});return{S:o,B:a,Q:s}}function i({S:s,B:o},a,l){if(!(s&4&&l===a[a.length-1])){s&2&&(l=a[a.length-1]),s&1&&e.push(a);for(let u of o)for(let d of u.Q)i(u,[...a,d],l)}}}function h$(t){return t.toString(16).toUpperCase().padStart(2,"0")}function J_(t){return`{${h$(t)}}`}function d$(t){let e=[];for(let r=0,n=t.length;r<n;){let i=t.codePointAt(r);r+=i<65536?1:2,e.push(i)}return e}function _0(t){let e=t.length;if(e<4096)return String.fromCodePoint(...t);let r=[];for(let n=0;n<e;)r.push(String.fromCodePoint(...t.slice(n,n+=4096)));return r.join("")}function f$(t,e){let r=t.length,n=r-e.length;for(let i=0;n==0&&i<r;i++)n=t[i]-e[i];return n}var p$="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const f2=44032,Fy=4352,Ly=4449,Vy=4519,Y_=19,K_=21,I0=28,Hy=K_*I0,g$=Y_*Hy,m$=f2+g$,y$=Fy+Y_,w$=Ly+K_,v$=Vy+I0;function p2(t){return t>>24&255}function X_(t){return t&16777215}let Rv,q_,Nv,Wy;function b$(){let t=z_(p$);Rv=new Map(Z_(t).flatMap((e,r)=>e.map(n=>[n,r+1<<24]))),q_=new Set(h2(t)),Nv=new Map,Wy=new Map;for(let[e,r]of $_(t)){if(!q_.has(e)&&r.length==2){let[n,i]=r,s=Wy.get(n);s||(s=new Map,Wy.set(n,s)),s.set(i,e)}Nv.set(e,r.reverse())}}function eI(t){return t>=f2&&t<m$}function A$(t,e){if(t>=Fy&&t<y$&&e>=Ly&&e<w$)return f2+(t-Fy)*Hy+(e-Ly)*I0;if(eI(t)&&e>Vy&&e<v$&&(t-f2)%I0==0)return t+(e-Vy);{let r=Wy.get(t);return r&&(r=r.get(e),r)?r:-1}}function tI(t){Rv||b$();let e=[],r=[],n=!1;function i(s){let o=Rv.get(s);o&&(n=!0,s|=o),e.push(s)}for(let s of t)for(;;){if(s<128)e.push(s);else if(eI(s)){let o=s-f2,a=o/Hy|0,l=o%Hy/I0|0,u=o%I0;i(Fy+a),i(Ly+l),u>0&&i(Vy+u)}else{let o=Nv.get(s);o?r.push(...o):i(s)}if(!r.length)break;s=r.pop()}if(n&&e.length>1){let s=p2(e[0]);for(let o=1;o<e.length;o++){let a=p2(e[o]);if(a==0||s<=a){s=a;continue}let l=o-1;for(;;){let u=e[l+1];if(e[l+1]=e[l],e[l]=u,!l||(s=p2(e[--l]),s<=a))break}s=p2(e[o])}}return e}function E$(t){let e=[],r=[],n=-1,i=0;for(let s of t){let o=p2(s),a=X_(s);if(n==-1)o==0?n=a:e.push(a);else if(i>0&&i>=o)o==0?(e.push(n,...r),r.length=0,n=a):r.push(a),i=o;else{let l=A$(n,a);l>=0?n=l:i==0&&o==0?(e.push(n),n=a):(r.push(a),i=o)}}return n>=0&&e.push(n,...r),e}function rI(t){return tI(t).map(X_)}function T$(t){return E$(tI(t))}const nI=45,iI=".",sI=65039,oI=1,jy=t=>Array.from(t);function g2(t,e){return t.P.has(e)||t.Q.has(e)}class S$ extends Array{get is_emoji(){return!0}}let Ov,aI,Xh,xv,cI,R0,Pv,N0,qh,lI,Mv;function Bv(){if(Ov)return;let t=z_(r$);const e=()=>h2(t),r=()=>new Set(e()),n=(d,f)=>f.forEach(g=>d.add(g));Ov=new Map($_(t)),aI=r(),Xh=e(),xv=new Set(e().map(d=>Xh[d])),Xh=new Set(Xh),cI=r(),r();let i=Z_(t),s=t();const o=()=>{let d=new Set;return e().forEach(f=>n(d,i[f])),n(d,e()),d};R0=d2(d=>{let f=d2(t).map(g=>g+96);if(f.length){let g=d>=s;f[0]-=32,f=_0(f),g&&(f=`Restricted[${f}]`);let m=o(),v=o(),A=!t();return{N:f,P:m,Q:v,M:A,R:g}}}),Pv=r(),N0=new Map;let a=e().concat(jy(Pv)).sort((d,f)=>d-f);a.forEach((d,f)=>{let g=t(),m=a[f]=g?a[f-g]:{V:[],M:new Map};m.V.push(d),Pv.has(d)||N0.set(d,m)});for(let{V:d,M:f}of new Set(N0.values())){let g=[];for(let v of d){let A=R0.filter(C=>g2(C,v)),E=g.find(({G:C})=>A.some(k=>C.has(k)));E||(E={G:new Set,V:[]},g.push(E)),E.V.push(v),n(E.G,A)}let m=g.flatMap(v=>jy(v.G));for(let{G:v,V:A}of g){let E=new Set(m.filter(C=>!v.has(C)));for(let C of A)f.set(C,E)}}qh=new Set;let l=new Set;const u=d=>qh.has(d)?l.add(d):qh.add(d);for(let d of R0){for(let f of d.P)u(f);for(let f of d.Q)u(f)}for(let d of qh)!N0.has(d)&&!l.has(d)&&N0.set(d,oI);n(qh,rI(qh)),lI=u$(t).map(d=>S$.from(d)).sort(f$),Mv=new Map;for(let d of lI){let f=[Mv];for(let g of d){let m=f.map(v=>{let A=v.get(g);return A||(A=new Map,v.set(g,A)),A});g===sI?f.push(...m):f=m}for(let g of f)g.V=d}}function Uv(t){return(uI(t)?"":`${Dv(Gy([t]))} `)+J_(t)}function Dv(t){return`"${t}"‎`}function C$(t){if(t.length>=4&&t[2]==nI&&t[3]==nI)throw new Error(`invalid label extension: "${_0(t.slice(0,4))}"`)}function k$(t){for(let e=t.lastIndexOf(95);e>0;)if(t[--e]!==95)throw new Error("underscore allowed only at start")}function _$(t){let e=t[0],r=j_.get(e);if(r)throw m2(`leading ${r}`);let n=t.length,i=-1;for(let s=1;s<n;s++){e=t[s];let o=j_.get(e);if(o){if(i==s)throw m2(`${r} + ${o}`);i=s+1,r=o}}if(i==n)throw m2(`trailing ${r}`)}function Gy(t,e=1/0,r=J_){let n=[];I$(t[0])&&n.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,s=t.length;for(let o=0;o<s;o++){let a=t[o];uI(a)&&(n.push(_0(t.slice(i,o))),n.push(r(a)),i=o+1)}return n.push(_0(t.slice(i,s))),n.join("")}function I$(t){return Bv(),Xh.has(t)}function uI(t){return Bv(),cI.has(t)}function R$(t){return P$(N$(t,T$,U$))}function N$(t,e,r){if(!t)return[];Bv();let n=0;return t.split(iI).map(i=>{let s=d$(i),o={input:s,offset:n};n+=s.length+1;try{let a=o.tokens=B$(s,e,r),l=a.length,u;if(!l)throw new Error("empty label");let d=o.output=a.flat();if(k$(d),!(o.emoji=l>1||a[0].is_emoji)&&d.every(f=>f<128))C$(d),u="ASCII";else{let f=a.flatMap(g=>g.is_emoji?[]:g);if(!f.length)u="Emoji";else{if(Xh.has(d[0]))throw m2("leading combining mark");for(let v=1;v<l;v++){let A=a[v];if(!A.is_emoji&&Xh.has(A[0]))throw m2(`emoji + combining mark: "${_0(a[v-1])} + ${Gy([A[0]])}"`)}_$(d);let g=jy(new Set(f)),[m]=x$(g);M$(m,f),O$(m,g),u=m.N}}o.type=u}catch(a){o.error=a}return o})}function O$(t,e){let r,n=[];for(let i of e){let s=N0.get(i);if(s===oI)return;if(s){let o=s.M.get(i);if(r=r?r.filter(a=>o.has(a)):jy(o),!r.length)return}else n.push(i)}if(r){for(let i of r)if(n.every(s=>g2(i,s)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function x$(t){let e=R0;for(let r of t){let n=e.filter(i=>g2(i,r));if(!n.length)throw R0.some(i=>g2(i,r))?dI(e[0],r):hI(r);if(e=n,n.length==1)break}return e}function P$(t){return t.map(({input:e,error:r,output:n})=>{if(r){let i=r.message;throw new Error(t.length==1?i:`Invalid label ${Dv(Gy(e,63))}: ${i}`)}return _0(n)}).join(iI)}function hI(t){return new Error(`disallowed character: ${Uv(t)}`)}function dI(t,e){let r=Uv(e),n=R0.find(i=>i.P.has(e));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function m2(t){return new Error(`illegal placement: ${t}`)}function M$(t,e){for(let r of e)if(!g2(t,r))throw dI(t,r);if(t.M){let r=rI(e);for(let n=1,i=r.length;n<i;n++)if(xv.has(r[n])){let s=n+1;for(let o;s<i&&xv.has(o=r[s]);s++)for(let a=n;a<s;a++)if(r[a]==o)throw new Error(`duplicate non-spacing marks: ${Uv(o)}`);if(s-n>G_)throw new Error(`excessive non-spacing marks: ${Dv(Gy(r.slice(n-1,s)))} (${s-n}/${G_})`);n=s}}}function B$(t,e,r){let n=[],i=[];for(t=t.slice().reverse();t.length;){let s=D$(t);if(s)i.length&&(n.push(e(i)),i=[]),n.push(r(s));else{let o=t.pop();if(qh.has(o))i.push(o);else{let a=Ov.get(o);if(a)i.push(...a);else if(!aI.has(o))throw hI(o)}}}return i.length&&n.push(e(i)),n}function U$(t){return t.filter(e=>e!=sI)}function D$(t,e){let r=Mv,n,i=t.length;for(;i&&(r=r.get(t[--i]),!!r);){let{V:s}=r;s&&(n=s,t.length=i)}return n}const fI=new Uint8Array(32);fI.fill(0);function pI(t){return De(t.length!==0,"invalid ENS name; empty component","comp",t),t}function Fv(t){const e=Ti(Lv(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(pI(e.slice(n,i))),n=i+1);return De(n<e.length,"invalid ENS name; empty component","name",t),r.push(pI(e.slice(n))),r}function Lv(t){try{if(t.length===0)throw new Error("empty label");return R$(t)}catch(e){De(!1,`invalid ENS name (${e.message})`,"name",t)}}function gI(t){try{return Fv(t).length!==0}catch{}return!1}function y2(t){De(typeof t=="string","invalid ENS name; not a string","name",t),De(t.length,"invalid ENS name (empty label)","name",t);let e=fI;const r=Fv(t);for(;r.length;)e=bn(Qr([e,bn(r.pop())]));return At(e)}function Vv(t,e){const r=e??63;return De(r<=255,"DNS encoded label cannot exceed 255","length",r),At(Qr(Fv(t).map(n=>{De(n.length<=r,`label ${JSON.stringify(t)} exceeds ${r} bytes`,"name",t);const i=new Uint8Array(n.length+1);return i.set(n,1),i[0]=i.length-1,i})))+"00"}function Hv(t,e){return{address:Or(t),storageKeys:e.map((r,n)=>(De(wn(r,32),"invalid slot",`storageKeys[${n}]`,r),r.toLowerCase()))}}function Sc(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(De(r.length===2,"invalid slot set",`value[${n}]`,r),Hv(r[0],r[1])):(De(r!=null&&typeof r=="object","invalid address-slot set","value",t),Hv(r.address,r.storageKeys)));De(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Hv(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function ed(t){let e;return typeof t=="string"?e=Tc.computePublicKey(t,!1):e=t.publicKey,Or(bn("0x"+e.substring(4)).substring(26))}function w2(t,e){return ed(Tc.recoverPublicKey(t,e))}const $i=BigInt(0),F$=BigInt(2),L$=BigInt(27),V$=BigInt(28),H$=BigInt(35),W$=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Wv=4096*32;function mI(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=bs(e).substring(4),"0x"+r}function zy(t){return t==="0x"?null:Or(t)}function jv(t,e){try{return Sc(t)}catch(r){De(!1,r.message,e,t)}}function v2(t,e){return t==="0x"?0:ir(t,e)}function di(t,e){if(t==="0x")return $i;const r=Yt(t,e);return De(r<=W$,"value exceeds uint size",e,r),r}function Mn(t,e){const r=Yt(t,"value"),n=Fi(r);return De(n.length<=32,"value too large",`tx.${e}`,r),n}function Gv(t){return Sc(t).map(e=>[e.address,e.storageKeys])}function j$(t,e){De(Array.isArray(t),`invalid ${e}`,"value",t);for(let r=0;r<t.length;r++)De(wn(t[r],32),"invalid ${ param } hash",`value[${r}]`,t[r]);return t}function G$(t){const e=p0(t);De(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const r={type:0,nonce:v2(e[0],"nonce"),gasPrice:di(e[1],"gasPrice"),gasLimit:di(e[2],"gasLimit"),to:zy(e[3]),value:di(e[4],"value"),data:At(e[5]),chainId:$i};if(e.length===6)return r;const n=di(e[6],"v"),i=di(e[7],"r"),s=di(e[8],"s");if(i===$i&&s===$i)r.chainId=n;else{let o=(n-H$)/F$;o<$i&&(o=$i),r.chainId=o,De(o!==$i||n===L$||n===V$,"non-canonical legacy v","v",e[6]),r.signature=Oa.from({r:zo(e[7],32),s:zo(e[8],32),v:n})}return r}function z$(t,e){const r=[Mn(t.nonce,"nonce"),Mn(t.gasPrice||0,"gasPrice"),Mn(t.gasLimit,"gasLimit"),t.to||"0x",Mn(t.value,"value"),t.data];let n=$i;if(t.chainId!=$i)n=Yt(t.chainId,"tx.chainId"),De(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const s=t.signature.legacyChainId;s!=null&&(n=s)}if(!e)return n!==$i&&(r.push(Fi(n)),r.push("0x"),r.push("0x")),dl(r);let i=BigInt(27+e.yParity);return n!==$i?i=Oa.getChainIdV(n,e.v):BigInt(e.v)!==i&&De(!1,"tx.chainId/sig.v mismatch","sig",e),r.push(Fi(i)),r.push(Fi(e.r)),r.push(Fi(e.s)),dl(r)}function zv(t,e){let r;try{if(r=v2(e[0],"yParity"),r!==0&&r!==1)throw new Error("bad yParity")}catch{De(!1,"invalid yParity","yParity",e[0])}const n=zo(e[1],32),i=zo(e[2],32),s=Oa.from({r:n,s:i,yParity:r});t.signature=s}function Z$(t){const e=p0(Ot(t).slice(1));De(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",At(t));const r={type:2,chainId:di(e[0],"chainId"),nonce:v2(e[1],"nonce"),maxPriorityFeePerGas:di(e[2],"maxPriorityFeePerGas"),maxFeePerGas:di(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:di(e[4],"gasLimit"),to:zy(e[5]),value:di(e[6],"value"),data:At(e[7]),accessList:jv(e[8],"accessList")};return e.length===9||zv(r,e.slice(9)),r}function $$(t,e){const r=[Mn(t.chainId,"chainId"),Mn(t.nonce,"nonce"),Mn(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Mn(t.maxFeePerGas||0,"maxFeePerGas"),Mn(t.gasLimit,"gasLimit"),t.to||"0x",Mn(t.value,"value"),t.data,Gv(t.accessList||[])];return e&&(r.push(Mn(e.yParity,"yParity")),r.push(Fi(e.r)),r.push(Fi(e.s))),Qr(["0x02",dl(r)])}function Q$(t){const e=p0(Ot(t).slice(1));De(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",At(t));const r={type:1,chainId:di(e[0],"chainId"),nonce:v2(e[1],"nonce"),gasPrice:di(e[2],"gasPrice"),gasLimit:di(e[3],"gasLimit"),to:zy(e[4]),value:di(e[5],"value"),data:At(e[6]),accessList:jv(e[7],"accessList")};return e.length===8||zv(r,e.slice(8)),r}function J$(t,e){const r=[Mn(t.chainId,"chainId"),Mn(t.nonce,"nonce"),Mn(t.gasPrice||0,"gasPrice"),Mn(t.gasLimit,"gasLimit"),t.to||"0x",Mn(t.value,"value"),t.data,Gv(t.accessList||[])];return e&&(r.push(Mn(e.yParity,"recoveryParam")),r.push(Fi(e.r)),r.push(Fi(e.s))),Qr(["0x01",dl(r)])}function Y$(t){let e=p0(Ot(t).slice(1)),r="3",n=null;if(e.length===4&&Array.isArray(e[0])){r="3 (network format)";const s=e[1],o=e[2],a=e[3];De(Array.isArray(s),"invalid network format: blobs not an array","fields[1]",s),De(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),De(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),De(s.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),De(s.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let l=0;l<e[1].length;l++)n.push({data:s[l],commitment:o[l],proof:a[l]});e=e[0]}De(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${r}`,"data",At(t));const i={type:3,chainId:di(e[0],"chainId"),nonce:v2(e[1],"nonce"),maxPriorityFeePerGas:di(e[2],"maxPriorityFeePerGas"),maxFeePerGas:di(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:di(e[4],"gasLimit"),to:zy(e[5]),value:di(e[6],"value"),data:At(e[7]),accessList:jv(e[8],"accessList"),maxFeePerBlobGas:di(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(i.blobs=n),De(i.to!=null,`invalid address for transaction type: ${r}`,"data",t),De(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let s=0;s<i.blobVersionedHashes.length;s++)De(wn(i.blobVersionedHashes[s],32),`invalid blobVersionedHash at index ${s}: must be length 32`,"data",t);return e.length===11||zv(i,e.slice(11)),i}function K$(t,e,r){const n=[Mn(t.chainId,"chainId"),Mn(t.nonce,"nonce"),Mn(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Mn(t.maxFeePerGas||0,"maxFeePerGas"),Mn(t.gasLimit,"gasLimit"),t.to||Kh,Mn(t.value,"value"),t.data,Gv(t.accessList||[]),Mn(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),j$(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(Mn(e.yParity,"yParity")),n.push(Fi(e.r)),n.push(Fi(e.s)),r)?Qr(["0x03",dl([n,r.map(i=>i.data),r.map(i=>i.commitment),r.map(i=>i.proof)])]):Qr(["0x03",dl(n)])}var bl,b2,A2,E2,T2,S2,C2,k2,_2,I2,R2,N2,O0,td,ku,rd,O2,Zy;const X$=class Ah{constructor(){Ee(this,O2),Ee(this,bl),Ee(this,b2),Ee(this,A2),Ee(this,E2),Ee(this,T2),Ee(this,S2),Ee(this,C2),Ee(this,k2),Ee(this,_2),Ee(this,I2),Ee(this,R2),Ee(this,N2),Ee(this,O0),Ee(this,td),Ee(this,ku),Ee(this,rd),ne(this,bl,null),ne(this,b2,null),ne(this,E2,0),ne(this,T2,$i),ne(this,S2,null),ne(this,C2,null),ne(this,k2,null),ne(this,A2,"0x"),ne(this,_2,$i),ne(this,I2,$i),ne(this,R2,null),ne(this,N2,null),ne(this,O0,null),ne(this,td,null),ne(this,rd,null),ne(this,ku,null)}get type(){return M(this,bl)}set type(e){switch(e){case null:ne(this,bl,null);break;case 0:case"legacy":ne(this,bl,0);break;case 1:case"berlin":case"eip-2930":ne(this,bl,1);break;case 2:case"london":case"eip-1559":ne(this,bl,2);break;case 3:case"cancun":case"eip-4844":ne(this,bl,3);break;default:De(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){const e=M(this,b2);return e==null&&this.type===3?Kh:e}set to(e){ne(this,b2,e==null?null:Or(e))}get nonce(){return M(this,E2)}set nonce(e){ne(this,E2,ir(e,"value"))}get gasLimit(){return M(this,T2)}set gasLimit(e){ne(this,T2,Yt(e))}get gasPrice(){const e=M(this,S2);return e==null&&(this.type===0||this.type===1)?$i:e}set gasPrice(e){ne(this,S2,e==null?null:Yt(e,"gasPrice"))}get maxPriorityFeePerGas(){return M(this,C2)??(this.type===2||this.type===3?$i:null)}set maxPriorityFeePerGas(e){ne(this,C2,e==null?null:Yt(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){return M(this,k2)??(this.type===2||this.type===3?$i:null)}set maxFeePerGas(e){ne(this,k2,e==null?null:Yt(e,"maxFeePerGas"))}get data(){return M(this,A2)}set data(e){ne(this,A2,At(e))}get value(){return M(this,_2)}set value(e){ne(this,_2,Yt(e,"value"))}get chainId(){return M(this,I2)}set chainId(e){ne(this,I2,Yt(e))}get signature(){return M(this,R2)||null}set signature(e){ne(this,R2,e==null?null:Oa.from(e))}get accessList(){return(M(this,N2)||null)??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){ne(this,N2,e==null?null:Sc(e))}get maxFeePerBlobGas(){const e=M(this,O0);return e==null&&this.type===3?$i:e}set maxFeePerBlobGas(e){ne(this,O0,e==null?null:Yt(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=M(this,td);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){De(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;r<e.length;r++)De(wn(e[r],32),"invalid blobVersionedHash",`value[${r}]`,e[r])}ne(this,td,e)}get blobs(){return M(this,rd)==null?null:M(this,rd).map(e=>Object.assign({},e))}set blobs(e){if(e==null){ne(this,rd,null);return}const r=[],n=[];for(let i=0;i<e.length;i++){const s=e[i];if(t0(s)){ot(M(this,ku),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=Ot(s);if(De(o.length<=Wv,"blob is too large",`blobs[${i}]`,s),o.length!==Wv){const u=new Uint8Array(Wv);u.set(o),o=u}const a=M(this,ku).blobToKzgCommitment(o),l=At(M(this,ku).computeBlobKzgProof(o,a));r.push({data:At(o),commitment:At(a),proof:l}),n.push(mI(1,a))}else{const o=At(s.commitment);r.push({data:At(s.data),commitment:o,proof:At(s.proof)}),n.push(mI(1,o))}}ne(this,rd,r),ne(this,td,n)}get kzg(){return M(this,ku)}set kzg(e){ne(this,ku,e)}get hash(){return this.signature==null?null:bn(Le(this,O2,Zy).call(this,!0,!1))}get unsignedHash(){return bn(this.unsignedSerialized)}get from(){return this.signature==null?null:w2(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:Tc.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return Le(this,O2,Zy).call(this,!0,!0)}get unsignedSerialized(){return Le(this,O2,Zy).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,r=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=M(this,O0)!=null||M(this,td);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ot(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ot(!r||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ot(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const s=[];return this.type!=null?s.push(this.type):r?s.push(2):e?(s.push(1),n||s.push(0)):n?(s.push(1),s.push(2)):(i&&this.to||(s.push(0),s.push(1),s.push(2)),s.push(3)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Ah.from(this)}toJSON(){const e=r=>r==null?null:r.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Ah;if(typeof e=="string"){const n=Ot(e);if(n[0]>=127)return Ah.from(G$(n));switch(n[0]){case 1:return Ah.from(Q$(n));case 2:return Ah.from(Z$(n));case 3:return Ah.from(Y$(n))}ot(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new Ah;return e.type!=null&&(r.type=e.type),e.to!=null&&(r.to=e.to),e.nonce!=null&&(r.nonce=e.nonce),e.gasLimit!=null&&(r.gasLimit=e.gasLimit),e.gasPrice!=null&&(r.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(r.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(r.data=e.data),e.value!=null&&(r.value=e.value),e.chainId!=null&&(r.chainId=e.chainId),e.signature!=null&&(r.signature=Oa.from(e.signature)),e.accessList!=null&&(r.accessList=e.accessList),e.blobVersionedHashes!=null&&(r.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(r.kzg=e.kzg),e.blobs!=null&&(r.blobs=e.blobs),e.hash!=null&&(De(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),De(r.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(De(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),De(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}};bl=new WeakMap,b2=new WeakMap,A2=new WeakMap,E2=new WeakMap,T2=new WeakMap,S2=new WeakMap,C2=new WeakMap,k2=new WeakMap,_2=new WeakMap,I2=new WeakMap,R2=new WeakMap,N2=new WeakMap,O0=new WeakMap,td=new WeakMap,ku=new WeakMap,rd=new WeakMap,O2=new WeakSet,Zy=function(t,e){ot(!t||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=t?this.signature:null;switch(this.inferType()){case 0:return z$(this,r);case 1:return J$(this,r);case 2:return $$(this,r);case 3:return K$(this,r,e?this.blobs:null)}ot(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let x0=X$;function $y(t){return typeof t=="string"&&(t=Ti(t)),bn(Qr([Ti(kv),Ti(String(t.length)),t]))}function yI(t,e){const r=$y(t);return w2(r,e)}const q$=new RegExp("^bytes([0-9]+)$"),eQ=new RegExp("^(u?int)([0-9]*)$"),tQ=new RegExp("^(.*)\\[([0-9]*)\\]$");function wI(t,e,r){switch(t){case"address":return Ot(r?zo(e,32):Or(e));case"string":return Ti(e);case"bytes":return Ot(e);case"bool":return e=e?"0x01":"0x00",Ot(r?zo(e,32):e)}let n=t.match(eQ);if(n){let i=n[1]==="int",s=parseInt(n[2]||"256");return De((!n[2]||n[2]===String(s))&&s%8===0&&s!==0&&s<=256,"invalid number type","type",t),r&&(s=256),i&&(e=jp(e,s)),Ot(zo(Fi(e),s/8))}if(n=t.match(q$),n){const i=parseInt(n[1]);return De(String(i)===n[1]&&i!==0&&i<=32,"invalid bytes type","type",t),De(ol(e)===i,`invalid value for ${t}`,"value",e),r?Ot(Wp(e,32)):e}if(n=t.match(tQ),n&&Array.isArray(e)){const i=n[1],s=parseInt(n[2]||String(e.length));De(s===e.length,`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(wI(i,a,!0))}),Ot(Qr(o))}De(!1,"invalid type","type",t)}function Qy(t,e){De(t.length===e.length,"wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(wI(n,e[i]))}),At(Qr(r))}function vI(t,e){return bn(Qy(t,e))}function bI(t,e){return bs(Qy(t,e))}const AI=new Uint8Array(32);AI.fill(0);const rQ=BigInt(-1),EI=BigInt(0),TI=BigInt(1),nQ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function iQ(t){const e=Ot(t),r=e.length%32;return r?Qr([e,AI.slice(r)]):At(e)}const sQ=Zo(TI,32),oQ=Zo(EI,32),SI={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Zv=["name","version","chainId","verifyingContract","salt"];function CI(t){return function(e){return De(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const aQ={name:CI("name"),version:CI("version"),chainId:function(t){const e=Yt(t,"domain.chainId");return De(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):cl(e)},verifyingContract:function(t){try{return Or(t).toLowerCase()}catch{}De(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Ot(t,"domain.salt");return De(e.length===32,'invalid domain value "salt"',"domain.salt",t),At(e)}};function $v(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const r=e[1]==="",n=parseInt(e[2]);De(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",t);const i=al(nQ,r?n-1:n),s=r?(i+TI)*rQ:EI;return function(o){const a=Yt(o,"value");return De(a>=s&&a<=i,`value out-of-bounds for ${t}`,"value",a),Zo(r?jp(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return De(r!==0&&r<=32&&e[1]===String(r),"invalid bytes width","type",t),function(n){const i=Ot(n);return De(i.length===r,`invalid length for ${t}`,"value",n),iQ(n)}}}switch(t){case"address":return function(e){return zo(Or(e),32)};case"bool":return function(e){return e?sQ:oQ};case"bytes":return function(e){return bn(e)};case"string":return function(e){return xa(e)}}return null}function kI(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}function Jy(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var Yy,_u,x2,Qv,_I;const cQ=class lc{constructor(e){Ee(this,Qv),de(this,"primaryType"),Ee(this,Yy),Ee(this,_u),Ee(this,x2),ne(this,_u,new Map),ne(this,x2,new Map);const r=new Map,n=new Map,i=new Map,s={};Object.keys(e).forEach(l=>{s[l]=e[l].map(({name:u,type:d})=>{let{base:f,index:g}=Jy(d);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:u,type:f+(g||"")}}),r.set(l,new Set),n.set(l,[]),i.set(l,new Set)}),ne(this,Yy,JSON.stringify(s));for(const l in s){const u=new Set;for(const d of s[l]){De(!u.has(d.name),`duplicate variable name ${JSON.stringify(d.name)} in ${JSON.stringify(l)}`,"types",e),u.add(d.name);const f=Jy(d.type).base;De(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!$v(f)&&(De(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(l),r.get(l).add(f))}}const o=Array.from(n.keys()).filter(l=>n.get(l).length===0);De(o.length!==0,"missing primary type","types",e),De(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Ft(this,{primaryType:o[0]});function a(l,u){De(!u.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),u.add(l);for(const d of r.get(l))if(n.has(d)){a(d,u);for(const f of u)i.get(f).add(d)}u.delete(l)}a(this.primaryType,new Set);for(const[l,u]of i){const d=Array.from(u);d.sort(),M(this,_u).set(l,kI(l,s[l])+d.map(f=>kI(f,s[f])).join(""))}}get types(){return JSON.parse(M(this,Yy))}getEncoder(e){let r=M(this,x2).get(e);return r||(r=Le(this,Qv,_I).call(this,e),M(this,x2).set(e,r)),r}encodeType(e){const r=M(this,_u).get(e);return De(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return bn(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if($v(e))return n(e,r);const i=Jy(e).array;if(i)return De(i.count===-1||i.count===r.length,`array length mismatch; expected length ${i.count}`,"value",r),r.map(o=>this._visit(i.prefix,o,n));const s=this.types[e];if(s)return s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{});De(!1,`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new lc(e)}static getPrimaryType(e){return lc.from(e).primaryType}static hashStruct(e,r,n){return lc.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){if(e[n]==null)continue;const i=SI[n];De(i,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Zv.indexOf(n.name)-Zv.indexOf(i.name)),lc.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Qr(["0x1901",lc.hashDomain(e),lc.from(r).hash(n)])}static hash(e,r,n){return bn(lc.encode(e,r,n))}static async resolveNames(e,r,n,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const s={};e.verifyingContract&&!wn(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=lc.from(r);o.visit(n,(a,l)=>(a==="address"&&!wn(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=await i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}}static getPayload(e,r,n){lc.hashDomain(e);const i={},s=[];Zv.forEach(l=>{const u=e[l];u!=null&&(i[l]=aQ[l](u),s.push({name:l,type:SI[l]}))});const o=lc.from(r);r=o.types;const a=Object.assign({},r);return De(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return At(Ot(u));if(l.match(/^u?int/))return Yt(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return De(typeof u=="string","invalid string","value",u),u}De(!1,"unsupported type","type",l)})}}};Yy=new WeakMap,_u=new WeakMap,x2=new WeakMap,Qv=new WeakSet,_I=function(t){{const n=$v(t);if(n)return n}const e=Jy(t).array;if(e){const n=e.prefix,i=this.getEncoder(n);return s=>{De(e.count===-1||e.count===s.length,`array length mismatch; expected length ${e.count}`,"value",s);let o=s.map(i);return M(this,_u).has(n)&&(o=o.map(bn)),bn(Qr(o))}}const r=this.types[t];if(r){const n=xa(M(this,_u).get(t));return i=>{const s=r.map(({name:o,type:a})=>{const l=this.getEncoder(a)(i[o]);return M(this,_u).has(a)?bn(l):l});return s.unshift(n),Qr(s)}}De(!1,`unknown type: ${t}`,"type",t)};let nd=cQ;function II(t,e,r,n){return w2(nd.hash(t,e,r),n)}function Ps(t){const e=new Set;return t.forEach(r=>e.add(r)),Object.freeze(e)}const lQ="external public payable override",uQ=Ps(lQ.split(" ")),RI="constant external internal payable private public pure view override",hQ=Ps(RI.split(" ")),NI="constructor error event fallback function receive struct",OI=Ps(NI.split(" ")),xI="calldata memory storage payable indexed",dQ=Ps(xI.split(" ")),fQ="tuple returns",pQ=[NI,xI,fQ,RI].join(" "),gQ=Ps(pQ.split(" ")),mQ={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},yQ=new RegExp("^(\\s*)"),wQ=new RegExp("^([0-9]+)"),vQ=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),PI=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),MI=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Ts,Cc,Ky,Jv;const BI=class UW{constructor(e){Ee(this,Ky),Ee(this,Ts),Ee(this,Cc),ne(this,Ts,0),ne(this,Cc,e.slice())}get offset(){return M(this,Ts)}get length(){return M(this,Cc).length-M(this,Ts)}clone(){return new UW(M(this,Cc))}reset(){ne(this,Ts,0)}popKeyword(e){const r=this.peek();if(r.type!=="KEYWORD"||!e.has(r.text))throw new Error(`expected keyword ${r.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const r=this.peek();throw new Error(`expected ${e}; got ${r.type} ${JSON.stringify(r.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=Le(this,Ky,Jv).call(this,M(this,Ts)+1,e.match+1);return ne(this,Ts,e.match+1),r}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const r=[];for(;M(this,Ts)<e.match-1;){const n=this.peek().linkNext;r.push(Le(this,Ky,Jv).call(this,M(this,Ts)+1,n)),ne(this,Ts,n)}return ne(this,Ts,e.match+1),r}peek(){if(M(this,Ts)>=M(this,Cc).length)throw new Error("out-of-bounds");return M(this,Cc)[M(this,Ts)]}peekKeyword(e){const r=this.peekType("KEYWORD");return r!=null&&e.has(r)?r:null}peekType(e){if(this.length===0)return null;const r=this.peek();return r.type===e?r.text:null}pop(){const e=this.peek();return yc(this,Ts)._++,e}toString(){const e=[];for(let r=M(this,Ts);r<M(this,Cc).length;r++){const n=M(this,Cc)[r];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};Ts=new WeakMap,Cc=new WeakMap,Ky=new WeakSet,Jv=function(t=0,e=0){return new BI(M(this,Cc).slice(t,e).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))};let Al=BI;function Iu(t){const e=[],r=o=>{const a=s<t.length?JSON.stringify(t[s]):"$EOI";throw new Error(`invalid token ${a} at ${s}: ${o}`)};let n=[],i=[],s=0;for(;s<t.length;){let o=t.substring(s),a=o.match(yQ);a&&(s+=a[1].length,o=t.substring(s));const l={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};e.push(l);let u=mQ[o[0]]||"";if(u){if(l.type=u,l.text=o[0],s++,u==="OPEN_PAREN")n.push(e.length-1),i.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&r("no matching open bracket"),l.match=n.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=i.pop(),e[l.linkBack].linkNext=e.length-1;else if(u==="COMMA")l.linkBack=i.pop(),e[l.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(u==="OPEN_BRACKET")l.type="BRACKET";else if(u==="CLOSE_BRACKET"){let d=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;d=f+d,e[e.length-1].value=ir(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=d}continue}if(a=o.match(vQ),a){if(l.text=a[1],s+=l.text.length,gQ.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(MI)){l.type="TYPE";continue}l.type="ID";continue}if(a=o.match(wQ),a){l.text=a[1],l.type="NUMBER",s+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${s}`)}return new Al(e.map(o=>Object.freeze(o)))}function UI(t,e){let r=[];for(const n in e.keys())t.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function Xy(t,e){if(e.peekKeyword(OI)){const r=e.pop().text;if(r!==t)throw new Error(`expected ${t}, got ${r}`)}return e.popType("ID")}function El(t,e){const r=new Set;for(;;){const n=t.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(t.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function DI(t){let e=El(t,hQ);return UI(e,Ps("constant payable nonpayable".split(" "))),UI(e,Ps("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Tl(t,e){return t.popParams().map(r=>rs.from(r,e))}function FI(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Yt(t.pop().text);throw new Error("invalid gas")}return null}function id(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const bQ=new RegExp(/^(.*)\[([0-9]*)\]$/);function LI(t){const e=t.match(MI);if(De(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const r=parseInt(e[2]);De(r!==0&&r<=32,"invalid bytes length","type",t)}else if(e[3]){const r=parseInt(e[3]);De(r!==0&&r<=256&&r%8===0,"invalid numeric width","type",t)}return t}const qn={},to=Symbol.for("_ethers_internal"),VI="_ParamTypeInternal",HI="_ErrorInternal",WI="_EventInternal",jI="_ConstructorInternal",GI="_FallbackInternal",zI="_FunctionInternal",ZI="_StructInternal";var P2,qy;const AQ=class uc{constructor(e,r,n,i,s,o,a,l){if(Ee(this,P2),de(this,"name"),de(this,"type"),de(this,"baseType"),de(this,"indexed"),de(this,"components"),de(this,"arrayLength"),de(this,"arrayChildren"),wc(e,qn,"ParamType"),Object.defineProperty(this,to,{value:VI}),o&&(o=Object.freeze(o.slice())),i==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");Ft(this,{name:r,type:n,baseType:i,indexed:s,components:o,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const n=this.name||"";if(this.isArray()){const s=JSON.parse(this.arrayChildren.format("json"));return s.name=n,s.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(s)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.isArray()?(r+=this.arrayChildren.format(e),r+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?r+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":r+=this.type,e!=="sighash"&&(this.indexed===!0&&(r+=" indexed"),e==="full"&&this.name&&(r+=" "+this.name)),r}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return e.map(i=>n.arrayChildren.walk(i,r))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const n=this;return e.map((i,s)=>n.components[s].walk(i,r))}return r(this.type,e)}async walkAsync(e,r){const n=[],i=[e];return Le(this,P2,qy).call(this,n,e,r,s=>{i[0]=s}),n.length&&await Promise.all(n),i[0]}static from(e,r){if(uc.isParamType(e))return e;if(typeof e=="string")try{return uc.from(Iu(e),r)}catch{De(!1,"invalid param type","obj",e)}else if(e instanceof Al){let a="",l="",u=null;El(e,Ps(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",u=e.popParams().map(v=>uc.from(v)),a=`tuple(${u.map(v=>v.format()).join(",")})`):(a=LI(e.popType("TYPE")),l=a);let d=null,f=null;for(;e.length&&e.peekType("BRACKET");){const v=e.pop();d=new uc(qn,"",a,l,null,u,f,d),f=v.value,a+=v.text,l="array",u=null}let g=null;if(El(e,dQ).has("indexed")){if(!r)throw new Error("");g=!0}const m=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new uc(qn,m,a,l,g,u,f,d)}const n=e.name;De(!n||typeof n=="string"&&n.match(PI),"invalid name","obj.name",n);let i=e.indexed;i!=null&&(De(r,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let s=e.type,o=s.match(bQ);if(o){const a=parseInt(o[2]||"-1"),l=uc.from({type:o[1],components:e.components});return new uc(qn,n||"",s,"array",i,null,a,l)}if(s==="tuple"||s.startsWith("tuple(")||s.startsWith("(")){const a=e.components!=null?e.components.map(l=>uc.from(l)):null;return new uc(qn,n||"",s,"tuple",i,a,null,null)}return s=LI(e.type),new uc(qn,n||"",s,s,i,null,null,null)}static isParamType(e){return e&&e[to]===VI}};P2=new WeakSet,qy=function(t,e,r,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const s=this.arrayChildren,o=e.slice();o.forEach((a,l)=>{var u;Le(u=s,P2,qy).call(u,t,a,r,d=>{o[l]=d})}),n(o);return}if(this.isTuple()){const s=this.components;let o;if(Array.isArray(e))o=e.slice();else{if(e==null||typeof e!="object")throw new Error("invalid tuple value");o=s.map(a=>{if(!a.name)throw new Error("cannot use object value with unnamed components");if(!(a.name in e))throw new Error(`missing value for component ${a.name}`);return e[a.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((a,l)=>{var u;Le(u=s[l],P2,qy).call(u,t,a,r,d=>{o[l]=d})}),n(o);return}const i=r(this.type,e);i.then?t.push((async function(){n(await i)})()):n(i)};let rs=AQ,P0=class HT{constructor(e,r,n){de(this,"type"),de(this,"inputs"),wc(e,qn,"Fragment"),n=Object.freeze(n.slice()),Ft(this,{type:r,inputs:n})}static from(e){if(typeof e=="string"){try{HT.from(JSON.parse(e))}catch{}return HT.from(Iu(e))}if(e instanceof Al)switch(e.peekKeyword(OI)){case"constructor":return Pa.from(e);case"error":return Ss.from(e);case"event":return Ko.from(e);case"fallback":case"receive":return Ma.from(e);case"function":return Xo.from(e);case"struct":return B2.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Pa.from(e);case"error":return Ss.from(e);case"event":return Ko.from(e);case"fallback":case"receive":return Ma.from(e);case"function":return Xo.from(e);case"struct":return B2.from(e)}ot(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}De(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Pa.isFragment(e)}static isError(e){return Ss.isFragment(e)}static isEvent(e){return Ko.isFragment(e)}static isFunction(e){return Xo.isFragment(e)}static isStruct(e){return B2.isFragment(e)}};class M0 extends P0{constructor(e,r,n,i){super(e,r,i),de(this,"name"),De(typeof n=="string"&&n.match(PI),"invalid identifier","name",n),i=Object.freeze(i.slice()),Ft(this,{name:n})}}function M2(t,e){return"("+e.map(r=>r.format(t)).join(t==="full"?", ":",")+")"}class Ss extends M0{constructor(e,r,n){super(e,"error",r,n),Object.defineProperty(this,to,{value:HI})}get selector(){return xa(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("error"),r.push(this.name+M2(e,this.inputs)),r.join(" ")}static from(e){if(Ss.isFragment(e))return e;if(typeof e=="string")return Ss.from(Iu(e));if(e instanceof Al){const r=Xy("error",e),n=Tl(e);return id(e),new Ss(qn,r,n)}return new Ss(qn,e.name,e.inputs?e.inputs.map(rs.from):[])}static isFragment(e){return e&&e[to]===HI}}class Ko extends M0{constructor(e,r,n,i){super(e,"event",r,n),de(this,"anonymous"),Object.defineProperty(this,to,{value:WI}),Ft(this,{anonymous:i})}get topicHash(){return xa(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("event"),r.push(this.name+M2(e,this.inputs)),e!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(e,r){return r=(r||[]).map(n=>rs.from(n)),new Ko(qn,e,r,!1).topicHash}static from(e){if(Ko.isFragment(e))return e;if(typeof e=="string")try{return Ko.from(Iu(e))}catch{De(!1,"invalid event fragment","obj",e)}else if(e instanceof Al){const r=Xy("event",e),n=Tl(e,!0),i=!!El(e,Ps(["anonymous"])).has("anonymous");return id(e),new Ko(qn,r,n,i)}return new Ko(qn,e.name,e.inputs?e.inputs.map(r=>rs.from(r,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[to]===WI}}class Pa extends P0{constructor(e,r,n,i,s){super(e,r,n),de(this,"payable"),de(this,"gas"),Object.defineProperty(this,to,{value:jI}),Ft(this,{payable:i,gas:s})}format(e){if(ot(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});const r=[`constructor${M2(e,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(e){if(Pa.isFragment(e))return e;if(typeof e=="string")try{return Pa.from(Iu(e))}catch{De(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Al){El(e,Ps(["constructor"]));const r=Tl(e),n=!!El(e,uQ).has("payable"),i=FI(e);return id(e),new Pa(qn,"constructor",r,n,i)}return new Pa(qn,"constructor",e.inputs?e.inputs.map(rs.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[to]===jI}}class Ma extends P0{constructor(e,r,n){super(e,"fallback",r),de(this,"payable"),Object.defineProperty(this,to,{value:GI}),Ft(this,{payable:n})}format(e){const r=this.inputs.length===0?"receive":"fallback";if(e==="json"){const n=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:n})}return`${r}()${this.payable?" payable":""}`}static from(e){if(Ma.isFragment(e))return e;if(typeof e=="string")try{return Ma.from(Iu(e))}catch{De(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Al){const r=e.toString(),n=e.peekKeyword(Ps(["fallback","receive"]));if(De(n,"type must be fallback or receive","obj",r),e.popKeyword(Ps(["fallback","receive"]))==="receive"){const o=Tl(e);return De(o.length===0,"receive cannot have arguments","obj.inputs",o),El(e,Ps(["payable"])),id(e),new Ma(qn,[],!0)}let i=Tl(e);i.length?De(i.length===1&&i[0].type==="bytes","invalid fallback inputs","obj.inputs",i.map(o=>o.format("minimal")).join(", ")):i=[rs.from("bytes")];const s=DI(e);if(De(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),El(e,Ps(["returns"])).has("returns")){const o=Tl(e);De(o.length===1&&o[0].type==="bytes","invalid fallback outputs","obj.outputs",o.map(a=>a.format("minimal")).join(", "))}return id(e),new Ma(qn,i,s==="payable")}if(e.type==="receive")return new Ma(qn,[],!0);if(e.type==="fallback"){const r=[rs.from("bytes")],n=e.stateMutability==="payable";return new Ma(qn,r,n)}De(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[to]===GI}}class Xo extends M0{constructor(e,r,n,i,s,o){super(e,"function",r,i),de(this,"constant"),de(this,"outputs"),de(this,"stateMutability"),de(this,"payable"),de(this,"gas"),Object.defineProperty(this,to,{value:zI}),s=Object.freeze(s.slice()),Ft(this,{constant:n==="view"||n==="pure",gas:o,outputs:s,payable:n==="payable",stateMutability:n})}get selector(){return xa(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});const r=[];return e!=="sighash"&&r.push("function"),r.push(this.name+M2(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(M2(e,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(e,r){return r=(r||[]).map(n=>rs.from(n)),new Xo(qn,e,"view",r,[],null).selector}static from(e){if(Xo.isFragment(e))return e;if(typeof e=="string")try{return Xo.from(Iu(e))}catch{De(!1,"invalid function fragment","obj",e)}else if(e instanceof Al){const n=Xy("function",e),i=Tl(e),s=DI(e);let o=[];El(e,Ps(["returns"])).has("returns")&&(o=Tl(e));const a=FI(e);return id(e),new Xo(qn,n,s,i,o,a)}let r=e.stateMutability;return r==null&&(r="payable",typeof e.constant=="boolean"?(r="view",e.constant||(r="payable",typeof e.payable=="boolean"&&!e.payable&&(r="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(r="nonpayable")),new Xo(qn,e.name,r,e.inputs?e.inputs.map(rs.from):[],e.outputs?e.outputs.map(rs.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[to]===zI}}let B2=class Gw extends M0{constructor(e,r,n){super(e,"struct",r,n),Object.defineProperty(this,to,{value:ZI})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Gw.from(Iu(e))}catch{De(!1,"invalid struct fragment","obj",e)}else if(e instanceof Al){const r=Xy("struct",e),n=Tl(e);return id(e),new Gw(qn,r,n)}return new Gw(qn,e.name,e.inputs?e.inputs.map(rs.from):[])}static isFragment(e){return e&&e[to]===ZI}};const Ba=new Map;Ba.set(0,"GENERIC_PANIC"),Ba.set(1,"ASSERT_FALSE"),Ba.set(17,"OVERFLOW"),Ba.set(18,"DIVIDE_BY_ZERO"),Ba.set(33,"ENUM_RANGE_ERROR"),Ba.set(34,"BAD_STORAGE_DATA"),Ba.set(49,"STACK_UNDERFLOW"),Ba.set(50,"ARRAY_RANGE_ERROR"),Ba.set(65,"OUT_OF_MEMORY"),Ba.set(81,"UNINITIALIZED_FUNCTION_CALL");const EQ=new RegExp(/^bytes([0-9]*)$/),TQ=new RegExp(/^(u?int)([0-9]*)$/);let Yv=null,$I=1024;function SQ(t,e,r,n){let i="missing revert data",s=null;const o=null;let a=null;if(r){i="execution reverted";const u=Ot(r);if(r=At(r),u.length===0)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(u.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(At(u.slice(0,4))==="0x08c379a0")try{s=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(At(u.slice(0,4))==="0x4e487b71")try{const d=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[d]},s=`Panic due to ${Ba.get(d)||"UNKNOWN"}(${d})`,i+=`: ${s}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?Or(e.to):null,data:e.data||"0x"};return e.from&&(l.from=Or(e.from)),Nn(i,"CALL_EXCEPTION",{action:t,data:r,reason:s,transaction:l,invocation:o,revert:a})}var sd,B0;const CQ=class WT{constructor(){Ee(this,sd)}getDefaultValue(e){const r=e.map(n=>Le(this,sd,B0).call(this,rs.from(n)));return new Dy(r,"_").defaultValue()}encode(e,r){ay(r.length,e.length,"types/values length mismatch");const n=e.map(o=>Le(this,sd,B0).call(this,rs.from(o))),i=new Dy(n,"_"),s=new iv;return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(s=>Le(this,sd,B0).call(this,rs.from(s)));return new Dy(i,"_").decode(new XG(r,n,$I))}static _setDefaultMaxInflation(e){De(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),$I=e}static defaultAbiCoder(){return Yv==null&&(Yv=new WT),Yv}static getBuiltinCallException(e,r,n){return SQ(e,r,n,WT.defaultAbiCoder())}};sd=new WeakSet,B0=function(t){if(t.isArray())return new zZ(Le(this,sd,B0).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new Dy(t.components.map(r=>Le(this,sd,B0).call(this,r)),t.name);switch(t.baseType){case"address":return new jZ(t.name);case"bool":return new ZZ(t.name);case"string":return new t$(t.name);case"bytes":return new $Z(t.name);case"":return new YZ(t.name)}let e=t.type.match(TQ);if(e){let r=parseInt(e[2]||"256");return De(r!==0&&r<=256&&r%8===0,"invalid "+e[1]+" bit length","param",t),new e$(r/8,e[1]==="int",t.name)}if(e=t.type.match(EQ),e){let r=parseInt(e[1]);return De(r!==0&&r<=32,"invalid bytes length","param",t),new QZ(r,t.name)}De(!1,"invalid type","type",t.type)};let U0=CQ;function QI(t){const e=Ti(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Wp(e,32)}function JI(t){const e=Ot(t,"bytes");if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return ll(e.slice(0,r))}class Kv{constructor(e,r,n){de(this,"fragment"),de(this,"name"),de(this,"signature"),de(this,"topic"),de(this,"args");const i=e.name,s=e.format();Ft(this,{fragment:e,name:i,signature:s,topic:r,args:n})}}class Xv{constructor(e,r,n,i){de(this,"fragment"),de(this,"name"),de(this,"args"),de(this,"signature"),de(this,"selector"),de(this,"value");const s=e.name,o=e.format();Ft(this,{fragment:e,name:s,args:n,signature:o,selector:r,value:i})}}class qv{constructor(e,r,n){de(this,"fragment"),de(this,"name"),de(this,"args"),de(this,"signature"),de(this,"selector");const i=e.name,s=e.format();Ft(this,{fragment:e,name:i,args:n,signature:s,selector:r})}}class e4{constructor(e){de(this,"hash"),de(this,"_isIndexed"),Ft(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const YI={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},KI={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&YI[t.toString()]&&(e=YI[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Sl,Cl,kl,Ms,Ru,t4,r4;const kQ=class Sp{constructor(e){Ee(this,Ru),de(this,"fragments"),de(this,"deploy"),de(this,"fallback"),de(this,"receive"),Ee(this,Sl),Ee(this,Cl),Ee(this,kl),Ee(this,Ms);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ne(this,kl,new Map),ne(this,Sl,new Map),ne(this,Cl,new Map);const n=[];for(const o of r)try{n.push(P0.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}Ft(this,{fragments:Object.freeze(n)});let i=null,s=!1;ne(this,Ms,this.getAbiCoder()),this.fragments.forEach((o,a)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ft(this,{deploy:o});return;case"fallback":o.inputs.length===0?s=!0:(De(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,o),i=o,s=i.payable);return;case"function":l=M(this,kl);break;case"event":l=M(this,Cl);break;case"error":l=M(this,Sl);break;default:return}const u=o.format();l.has(u)||l.set(u,o)}),this.deploy||Ft(this,{deploy:Pa.from("constructor()")}),Ft(this,{fallback:i,receive:s})}format(e){const r=e?"minimal":"full";return this.fragments.map(n=>n.format(r))}formatJson(){const e=this.fragments.map(r=>r.format("json"));return JSON.stringify(e.map(r=>JSON.parse(r)))}getAbiCoder(){return U0.defaultAbiCoder()}getFunctionName(e){const r=Le(this,Ru,t4).call(this,e,null,!1);return De(r,"no matching function","key",e),r.name}hasFunction(e){return!!Le(this,Ru,t4).call(this,e,null,!1)}getFunction(e,r){return Le(this,Ru,t4).call(this,e,r||null,!0)}forEachFunction(e){const r=Array.from(M(this,kl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(M(this,kl).get(i),n)}}getEventName(e){const r=Le(this,Ru,r4).call(this,e,null,!1);return De(r,"no matching event","key",e),r.name}hasEvent(e){return!!Le(this,Ru,r4).call(this,e,null,!1)}getEvent(e,r){return Le(this,Ru,r4).call(this,e,r||null,!0)}forEachEvent(e){const r=Array.from(M(this,Cl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(M(this,Cl).get(i),n)}}getError(e,r){if(wn(e)){const i=e.toLowerCase();if(KI[i])return Ss.from(KI[i].signature);for(const s of M(this,Sl).values())if(i===s.selector)return s;return null}if(e.indexOf("(")===-1){const i=[];for(const[s,o]of M(this,Sl))s.split("(")[0]===e&&i.push(o);if(i.length===0)return e==="Error"?Ss.from("error Error(string)"):e==="Panic"?Ss.from("error Panic(uint256)"):null;if(i.length>1){const s=i.map(o=>JSON.stringify(o.format())).join(", ");De(!1,`ambiguous error description (i.e. ${s})`,"name",e)}return i[0]}return e=Ss.from(e).format(),e==="Error(string)"?Ss.from("error Error(string)"):e==="Panic(uint256)"?Ss.from("error Panic(uint256)"):M(this,Sl).get(e)||null}forEachError(e){const r=Array.from(M(this,Sl).keys());r.sort((n,i)=>n.localeCompare(i));for(let n=0;n<r.length;n++){const i=r[n];e(M(this,Sl).get(i),n)}}_decodeParams(e,r){return M(this,Ms).decode(e,r)}_encodeParams(e,r){return M(this,Ms).encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);De(n,"unknown error","fragment",e),e=n}return De(vn(r,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",r),this._decodeParams(e.inputs,vn(r,4))}encodeErrorResult(e,r){if(typeof e=="string"){const n=this.getError(e);De(n,"unknown error","fragment",e),e=n}return Qr([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);De(n,"unknown function","fragment",e),e=n}return De(vn(r,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",r),this._decodeParams(e.inputs,vn(r,4))}encodeFunctionData(e,r){if(typeof e=="string"){const n=this.getFunction(e);De(n,"unknown function","fragment",e),e=n}return Qr([e.selector,this._encodeParams(e.inputs,r||[])])}decodeFunctionResult(e,r){if(typeof e=="string"){const s=this.getFunction(e);De(s,"unknown function","fragment",e),e=s}let n="invalid length for result data";const i=Di(r);if(i.length%32===0)try{return M(this,Ms).decode(e.outputs,i)}catch{n="could not decode result data"}ot(!1,n,"BAD_DATA",{value:At(i),info:{method:e.name,signature:e.format()}})}makeError(e,r){const n=Ot(e,"data"),i=U0.getBuiltinCallException("call",r,n);if(i.message.startsWith("execution reverted (unknown custom error)")){const o=At(n.slice(0,4)),a=this.getError(o);if(a)try{const l=M(this,Ms).decode(a.inputs,n.slice(4));i.revert={name:a.name,signature:a.format(),args:l},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch{i.message="execution reverted (coult not decode custom error)"}}const s=this.parseTransaction(r);return s&&(i.invocation={method:s.name,signature:s.signature,args:s.args}),i}encodeFunctionResult(e,r){if(typeof e=="string"){const n=this.getFunction(e);De(n,"unknown function","fragment",e),e=n}return At(M(this,Ms).encode(e.outputs,r||[]))}encodeFilterTopics(e,r){if(typeof e=="string"){const s=this.getEvent(e);De(s,"unknown event","eventFragment",e),e=s}ot(r.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:r.length,expectedCount:e.inputs.length});const n=[];e.anonymous||n.push(e.topicHash);const i=(s,o)=>s.type==="string"?xa(o):s.type==="bytes"?bn(At(o)):(s.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":s.type.match(/^u?int/)?o=Zo(o):s.type.match(/^bytes/)?o=Wp(o,32):s.type==="address"&&M(this,Ms).encode(["address"],[o]),zo(At(o),32));for(r.forEach((s,o)=>{const a=e.inputs[o];if(!a.indexed){De(s==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?De(!1,"filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){if(typeof e=="string"){const o=this.getEvent(e);De(o,"unknown event","eventFragment",e),e=o}const n=[],i=[],s=[];return e.anonymous||n.push(e.topicHash),De(r.length===e.inputs.length,"event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(xa(l));else if(o.type==="bytes")n.push(bn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(M(this,Ms).encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:M(this,Ms).encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"){const m=this.getEvent(e);De(m,"unknown event","eventFragment",e),e=m}if(n!=null&&!e.anonymous){const m=e.topicHash;De(wn(n[0],32)&&n[0].toLowerCase()===m,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const i=[],s=[],o=[];e.inputs.forEach((m,v)=>{m.indexed?m.type==="string"||m.type==="bytes"||m.baseType==="tuple"||m.baseType==="array"?(i.push(rs.from({type:"bytes32",name:m.name})),o.push(!0)):(i.push(m),o.push(!1)):(s.push(m),o.push(!1))});const a=n!=null?M(this,Ms).decode(i,Qr(n)):null,l=M(this,Ms).decode(s,r,!0),u=[],d=[];let f=0,g=0;return e.inputs.forEach((m,v)=>{let A=null;if(m.indexed)if(a==null)A=new e4(null);else if(o[v])A=new e4(a[g++]);else try{A=a[g++]}catch(E){A=E}else try{A=l[f++]}catch(E){A=E}u.push(A),d.push(m.name||null)}),g0.fromItems(u,d)}parseTransaction(e){const r=Ot(e.data,"tx.data"),n=Yt(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(At(r.slice(0,4)));if(!i)return null;const s=M(this,Ms).decode(i.inputs,r.slice(4));return new Xv(i,i.selector,s,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new Kv(r,r.topicHash,this.decodeEventLog(r,e.data,e.topics))}parseError(e){const r=At(e),n=this.getError(vn(r,0,4));if(!n)return null;const i=M(this,Ms).decode(n.inputs,vn(r,4));return new qv(n,n.selector,i)}static from(e){return e instanceof Sp?e:typeof e=="string"?new Sp(JSON.parse(e)):typeof e.formatJson=="function"?new Sp(e.formatJson()):typeof e.format=="function"?new Sp(e.format("json")):new Sp(e)}};Sl=new WeakMap,Cl=new WeakMap,kl=new WeakMap,Ms=new WeakMap,Ru=new WeakSet,t4=function(t,e,r){if(wn(t)){const i=t.toLowerCase();for(const s of M(this,kl).values())if(i===s.selector)return s;return null}if(t.indexOf("(")===-1){const i=[];for(const[s,o]of M(this,kl))s.split("(")[0]===t&&i.push(o);if(e){const s=e.length>0?e[e.length-1]:null;let o=e.length,a=!0;Es.isTyped(s)&&s.type==="overrides"&&(a=!1,o--);for(let l=i.length-1;l>=0;l--){const u=i[l].inputs.length;u!==o&&(!a||u!==o-1)&&i.splice(l,1)}for(let l=i.length-1;l>=0;l--){const u=i[l].inputs;for(let d=0;d<e.length;d++)if(Es.isTyped(e[d])){if(d>=u.length){if(e[d].type==="overrides")continue;i.splice(l,1);break}if(e[d].type!==u[d].baseType){i.splice(l,1);break}}}}if(i.length===1&&e&&e.length!==i[0].inputs.length){const s=e[e.length-1];(s==null||Array.isArray(s)||typeof s!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&r){const s=i.map(o=>JSON.stringify(o.format())).join(", ");De(!1,`ambiguous function description (i.e. matches ${s})`,"key",t)}return i[0]}return M(this,kl).get(Xo.from(t).format())||null},r4=function(t,e,r){if(wn(t)){const i=t.toLowerCase();for(const s of M(this,Cl).values())if(i===s.topicHash)return s;return null}if(t.indexOf("(")===-1){const i=[];for(const[s,o]of M(this,Cl))s.split("(")[0]===t&&i.push(o);if(e){for(let s=i.length-1;s>=0;s--)i[s].inputs.length<e.length&&i.splice(s,1);for(let s=i.length-1;s>=0;s--){const o=i[s].inputs;for(let a=0;a<e.length;a++)if(Es.isTyped(e[a])&&e[a].type!==o[a].baseType){i.splice(s,1);break}}}if(i.length===0)return null;if(i.length>1&&r){const s=i.map(o=>JSON.stringify(o.format())).join(", ");De(!1,`ambiguous event description (i.e. matches ${s})`,"key",t)}return i[0]}return M(this,Cl).get(Ko.from(t).format())||null};let n4=kQ;const XI=BigInt(0);function D0(t){return t??null}function fi(t){return t==null?null:t.toString()}class i4{constructor(e,r,n){de(this,"gasPrice"),de(this,"maxFeePerGas"),de(this,"maxPriorityFeePerGas"),Ft(this,{gasPrice:D0(e),maxFeePerGas:D0(r),maxPriorityFeePerGas:D0(n)})}toJSON(){const{gasPrice:e,maxFeePerGas:r,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:fi(e),maxFeePerGas:fi(r),maxPriorityFeePerGas:fi(n)}}}function od(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=At(t.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Yt(t[i],`request.${i}`));const n="type,nonce".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=ir(t[i],`request.${i}`));return t.accessList&&(e.accessList=Sc(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>t0(i)?At(i):Object.assign({},i))),e}var Nu;class eb{constructor(e,r){de(this,"provider"),de(this,"number"),de(this,"hash"),de(this,"timestamp"),de(this,"parentHash"),de(this,"parentBeaconBlockRoot"),de(this,"nonce"),de(this,"difficulty"),de(this,"gasLimit"),de(this,"gasUsed"),de(this,"stateRoot"),de(this,"receiptsRoot"),de(this,"blobGasUsed"),de(this,"excessBlobGas"),de(this,"miner"),de(this,"prevRandao"),de(this,"extraData"),de(this,"baseFeePerGas"),Ee(this,Nu),ne(this,Nu,e.transactions.map(n=>typeof n!="string"?new U2(n,r):n)),Ft(this,{provider:r,hash:D0(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:D0(e.prevRandao),extraData:e.extraData,baseFeePerGas:D0(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return M(this,Nu).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=M(this,Nu).slice();return e.length===0?[]:(ot(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:r,extraData:n,gasLimit:i,gasUsed:s,hash:o,miner:a,prevRandao:l,nonce:u,number:d,parentHash:f,parentBeaconBlockRoot:g,stateRoot:m,receiptsRoot:v,timestamp:A,transactions:E}=this;return{_type:"Block",baseFeePerGas:fi(e),difficulty:fi(r),extraData:n,gasLimit:fi(i),gasUsed:fi(s),blobGasUsed:fi(this.blobGasUsed),excessBlobGas:fi(this.excessBlobGas),hash:o,miner:a,prevRandao:l,nonce:u,number:d,parentHash:f,timestamp:A,parentBeaconBlockRoot:g,stateRoot:m,receiptsRoot:v,transactions:E}}[Symbol.iterator](){let e=0;const r=this.transactions;return{next:()=>e<this.length?{value:r[e++],done:!1}:{value:void 0,done:!0}}}get length(){return M(this,Nu).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let r;if(typeof e=="number")r=M(this,Nu)[e];else{const n=e.toLowerCase();for(const i of M(this,Nu))if(typeof i=="string"){if(i!==n)continue;r=i;break}else{if(i.hash!==n)continue;r=i;break}}if(r==null)throw new Error("no such tx");return typeof r=="string"?await this.provider.getTransaction(r):r}getPrefetchedTransaction(e){const r=this.prefetchedTransactions;if(typeof e=="number")return r[e];e=e.toLowerCase();for(const n of r)if(n.hash===e)return n;De(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return IQ(this)}}Nu=new WeakMap;class ad{constructor(e,r){de(this,"provider"),de(this,"transactionHash"),de(this,"blockHash"),de(this,"blockNumber"),de(this,"removed"),de(this,"address"),de(this,"data"),de(this,"topics"),de(this,"index"),de(this,"transactionIndex"),this.provider=r;const n=Object.freeze(e.topics.slice());Ft(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:r,blockNumber:n,data:i,index:s,removed:o,topics:a,transactionHash:l,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:r,blockNumber:n,data:i,index:s,removed:o,topics:a,transactionHash:l,transactionIndex:u}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return ot(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return ot(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return ot(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return RQ(this)}}var s4;class o4{constructor(e,r){de(this,"provider"),de(this,"to"),de(this,"from"),de(this,"contractAddress"),de(this,"hash"),de(this,"index"),de(this,"blockHash"),de(this,"blockNumber"),de(this,"logsBloom"),de(this,"gasUsed"),de(this,"blobGasUsed"),de(this,"cumulativeGasUsed"),de(this,"gasPrice"),de(this,"blobGasPrice"),de(this,"type"),de(this,"status"),de(this,"root"),Ee(this,s4),ne(this,s4,Object.freeze(e.logs.map(i=>new ad(i,r))));let n=XI;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),Ft(this,{provider:r,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return M(this,s4)}toJSON(){const{to:e,from:r,contractAddress:n,hash:i,index:s,blockHash:o,blockNumber:a,logsBloom:l,logs:u,status:d,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:fi(this.cumulativeGasUsed),from:r,gasPrice:fi(this.gasPrice),blobGasUsed:fi(this.blobGasUsed),blobGasPrice:fi(this.blobGasPrice),gasUsed:fi(this.gasUsed),hash:i,index:s,logs:u,logsBloom:l,root:f,status:d,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return eR(this)}reorderedEvent(e){return ot(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),qI(this,e)}}s4=new WeakMap;var cd;const _Q=class DW{constructor(e,r){de(this,"provider"),de(this,"blockNumber"),de(this,"blockHash"),de(this,"index"),de(this,"hash"),de(this,"type"),de(this,"to"),de(this,"from"),de(this,"nonce"),de(this,"gasLimit"),de(this,"gasPrice"),de(this,"maxPriorityFeePerGas"),de(this,"maxFeePerGas"),de(this,"maxFeePerBlobGas"),de(this,"data"),de(this,"value"),de(this,"chainId"),de(this,"signature"),de(this,"accessList"),de(this,"blobVersionedHashes"),Ee(this,cd),this.provider=r,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,ne(this,cd,-1)}toJSON(){const{blockNumber:e,blockHash:r,index:n,hash:i,type:s,to:o,from:a,nonce:l,data:u,signature:d,accessList:f,blobVersionedHashes:g}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:e,blockHash:r,blobVersionedHashes:g,chainId:fi(this.chainId),data:u,from:a,gasLimit:fi(this.gasLimit),gasPrice:fi(this.gasPrice),hash:i,maxFeePerGas:fi(this.maxFeePerGas),maxPriorityFeePerGas:fi(this.maxPriorityFeePerGas),maxFeePerBlobGas:fi(this.maxFeePerBlobGas),nonce:l,signature:d,to:o,index:n,type:s,value:fi(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;const r=this.provider.getBlock(e);if(r==null)throw new Error("TODO");return r}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:e,blockNumber:r}=await Ui({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return e==null||e.blockNumber==null?0:r-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,r){const n=e??1,i=r??0;let s=M(this,cd),o=-1,a=s===-1;const l=async()=>{if(a)return null;const{blockNumber:f,nonce:g}=await Ui({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g<this.nonce){s=f;return}if(a)return null;const m=await this.getTransaction();if(!(m&&m.blockNumber!=null))for(o===-1&&(o=s-3,o<M(this,cd)&&(o=M(this,cd)));o<=f;){if(a)return null;const v=await this.provider.getBlock(o,!0);if(v==null)return;for(const A of v)if(A===this.hash)return;for(let A=0;A<v.length;A++){const E=await v.getTransaction(A);if(E.from===this.from&&E.nonce===this.nonce){if(a)return null;const C=await this.provider.getTransactionReceipt(E.hash);if(C==null||f-C.blockNumber+1<n)return;let k="replaced";E.data===this.data&&E.to===this.to&&E.value===this.value?k="repriced":E.data==="0x"&&E.from===E.to&&E.value===XI&&(k="cancelled"),ot(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:k==="replaced"||k==="cancelled",reason:k,replacement:E.replaceableTransaction(s),hash:E.hash,receipt:C})}}o++}},u=f=>{if(f==null||f.status!==0)return f;ot(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:f.to,from:f.from,data:""},receipt:f})},d=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(d);if(d){if(await d.confirmations()>=n)return u(d)}else if(await l(),n===0)return null;return await new Promise((f,g)=>{const m=[],v=()=>{m.forEach(E=>E())};if(m.push(()=>{a=!0}),i>0){const E=setTimeout(()=>{v(),g(Nn("wait for transaction timeout","TIMEOUT"))},i);m.push(()=>{clearTimeout(E)})}const A=async E=>{if(await E.confirmations()>=n){v();try{f(u(E))}catch(C){g(C)}}};if(m.push(()=>{this.provider.off(this.hash,A)}),this.provider.on(this.hash,A),s>=0){const E=async()=>{try{await l()}catch(C){if(ui(C,"TRANSACTION_REPLACED")){v(),g(C);return}}a||this.provider.once("block",E)};m.push(()=>{this.provider.off("block",E)}),this.provider.once("block",E)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ot(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),eR(this)}reorderedEvent(e){return ot(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ot(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),qI(this,e)}replaceableTransaction(e){De(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const r=new DW(this,this.provider);return ne(r,cd,e),r}};cd=new WeakMap;let U2=_Q;function IQ(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function qI(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function eR(t){return{orphan:"drop-transaction",tx:t}}function RQ(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class D2 extends ad{constructor(e,r,n){super(e,e.provider),de(this,"interface"),de(this,"fragment"),de(this,"args");const i=r.decodeEventLog(n,e.data,e.topics);Ft(this,{args:i,fragment:n,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class a4 extends ad{constructor(e,r){super(e,e.provider),de(this,"error"),Ft(this,{error:r})}}var F2;class tb extends o4{constructor(e,r,n){super(n,r),Ee(this,F2),ne(this,F2,e)}get logs(){return super.logs.map(e=>{const r=e.topics.length?M(this,F2).getEvent(e.topics[0]):null;if(r)try{return new D2(e,M(this,F2),r)}catch(n){return new a4(e,n)}return e})}}F2=new WeakMap;var c4;class L2 extends U2{constructor(e,r,n){super(n,r),Ee(this,c4),ne(this,c4,e)}async wait(e,r){const n=await super.wait(e,r);return n==null?null:new tb(M(this,c4),this.provider,n)}}c4=new WeakMap;class l4 extends fy{constructor(e,r,n,i){super(e,r,n),de(this,"log"),Ft(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class rb extends l4{constructor(e,r,n,i,s){super(e,r,n,new D2(s,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Ft(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const tR=BigInt(0);function rR(t){return t&&typeof t.call=="function"}function nR(t){return t&&typeof t.estimateGas=="function"}function u4(t){return t&&typeof t.resolveName=="function"}function iR(t){return t&&typeof t.sendTransaction=="function"}function sR(t){if(t!=null){if(u4(t))return t;if(t.provider)return t.provider}}var h4;class NQ{constructor(e,r,n){if(Ee(this,h4),de(this,"fragment"),Ft(this,{fragment:r}),r.inputs.length<n.length)throw new Error("too many arguments");const i=ld(e.runner,"resolveName"),s=u4(i)?i:null;ne(this,h4,(async function(){const o=await Promise.all(r.inputs.map((a,l)=>n[l]==null?null:a.walkAsync(n[l],(u,d)=>u==="address"?Array.isArray(d)?Promise.all(d.map(f=>Li(f,s))):Li(d,s):d)));return e.interface.encodeFilterTopics(r,o)})())}getTopicFilter(){return M(this,h4)}}h4=new WeakMap;function ld(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function ud(t){return t==null?null:t.provider||null}async function nb(t,e){const r=Es.dereference(t,"overrides");De(typeof r=="object","invalid overrides parameter","overrides",t);const n=od(r);return De(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),De(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function oR(t,e,r){const n=ld(t,"resolveName"),i=u4(n)?n:null;return await Promise.all(e.map((s,o)=>s.walkAsync(r[o],(a,l)=>(l=Es.dereference(l,a),a==="address"?Li(l,i):l))))}function OQ(t){const e=async function(o){const a=await nb(o,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await Li(a.from,sR(t.runner)));const l=t.interface,u=Yt(a.value||tR,"overrides.value")===tR,d=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!d&&!u&&De(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),De(l.fallback||d,"cannot send data to receive-only contract","overrides.data",a.data);const f=l.receive||l.fallback&&l.fallback.payable;return De(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),De(l.fallback||d,"cannot send data to receive-only contract","overrides.data",a.data),a},r=async function(o){const a=ld(t.runner,"call");ot(rR(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await a.call(l)}catch(u){throw Hp(u)&&u.data?t.interface.makeError(u.data,l):u}},n=async function(o){const a=t.runner;ot(iR(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(o)),u=ud(t.runner);return new L2(t.interface,u,l)},i=async function(o){const a=ld(t.runner,"estimateGas");return ot(nR(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},s=async o=>await n(o);return Ft(s,{_contract:t,estimateGas:i,populateTransaction:e,send:n,staticCall:r}),s}function xQ(t,e){const r=function(...u){const d=t.interface.getFunction(e,u);return ot(d,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),d},n=async function(...u){const d=r(...u);let f={};if(d.inputs.length+1===u.length&&(f=await nb(u.pop()),f.from&&(f.from=await Li(f.from,sR(t.runner)))),d.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const g=await oR(t.runner,d.inputs,u);return Object.assign({},f,await Ui({to:t.getAddress(),data:t.interface.encodeFunctionData(d,g)}))},i=async function(...u){const d=await a(...u);return d.length===1?d[0]:d},s=async function(...u){const d=t.runner;ot(iR(d),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await d.sendTransaction(await n(...u)),g=ud(t.runner);return new L2(t.interface,g,f)},o=async function(...u){const d=ld(t.runner,"estimateGas");return ot(nR(d),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await d.estimateGas(await n(...u))},a=async function(...u){const d=ld(t.runner,"call");ot(rR(d),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await n(...u);let g="0x";try{g=await d.call(f)}catch(v){throw Hp(v)&&v.data?t.interface.makeError(v.data,f):v}const m=r(...u);return t.interface.decodeFunctionResult(m,g)},l=async(...u)=>r(...u).constant?await i(...u):await s(...u);return Ft(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:r,estimateGas:o,populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const u=t.interface.getFunction(e);return ot(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),l}function PQ(t,e){const r=function(...i){const s=t.interface.getEvent(e,i);return ot(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),s},n=function(...i){return new NQ(t,r(...i),i)};return Ft(n,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return ot(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),n}const d4=Symbol.for("_ethersInternal_contract"),aR=new WeakMap;function MQ(t,e){aR.set(t[d4],e)}function mo(t){return aR.get(t[d4])}function BQ(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function ib(t,e){let r,n=null;if(Array.isArray(e)){const s=function(o){if(wn(o,32))return o;const a=t.interface.getEvent(o);return De(a,"unknown fragment","name",o),a.topicHash};r=e.map(o=>o==null?null:Array.isArray(o)?o.map(s):s(o))}else e==="*"?r=[null]:typeof e=="string"?wn(e,32)?r=[e]:(n=t.interface.getEvent(e),De(n,"unknown fragment","event",e),r=[n.topicHash]):BQ(e)?r=await e.getTopicFilter():"fragment"in e?(n=e.fragment,r=[n.topicHash]):De(!1,"unknown event name","event",e);r=r.map(s=>{if(s==null)return null;if(Array.isArray(s)){const o=Array.from(new Set(s.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return s.toLowerCase()});const i=r.map(s=>s==null?"null":Array.isArray(s)?s.join("|"):s).join("&");return{fragment:n,tag:i,topics:r}}async function V2(t,e){const{subs:r}=mo(t);return r.get((await ib(t,e)).tag)||null}async function cR(t,e,r){const n=ud(t.runner);ot(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:s,topics:o}=await ib(t,r),{addr:a,subs:l}=mo(t);let u=l.get(s);if(!u){const d={address:a||t,topics:o},f=m=>{let v=i;if(v==null)try{v=t.interface.getEvent(m.topics[0])}catch{}if(v){const A=v,E=i?t.interface.decodeEventLog(i,m.data,m.topics):[];ob(t,r,E,C=>new rb(t,C,r,A,m))}else ob(t,r,[],A=>new l4(t,A,r,m))};let g=[];u={tag:s,listeners:[],start:()=>{g.length||g.push(n.on(d,f))},stop:async()=>{if(g.length==0)return;let m=g;g=[],await Promise.all(m),n.off(d,f)}},l.set(s,u)}return u}let sb=Promise.resolve();async function UQ(t,e,r,n){await sb;const i=await V2(t,e);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:a})=>{const l=Array.from(r);n&&l.push(n(a?null:o));try{o.call(t,...l)}catch{}return!a}),i.listeners.length===0&&(i.stop(),mo(t).subs.delete(i.tag)),s>0}async function ob(t,e,r,n){try{await sb}catch{}const i=UQ(t,e,r,n);return sb=i,await i}const f4=["then"];var lR;lR=d4;let H2=class zw{constructor(e,r,n,i){de(this,"target"),de(this,"interface"),de(this,"runner"),de(this,"filters"),de(this,lR),de(this,"fallback"),De(typeof e=="string"||Uy(e),"invalid value for Contract target","target",e),n==null&&(n=null);const s=n4.from(r);Ft(this,{target:e,runner:n,interface:s}),Object.defineProperty(this,d4,{value:{}});let o,a=null,l=null;if(i){const f=ud(n);l=new L2(this.interface,f,i)}let u=new Map;if(typeof e=="string")if(wn(e))a=e,o=Promise.resolve(e);else{const f=ld(n,"resolveName");if(!u4(f))throw Nn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(g=>{if(g==null)throw Nn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return mo(this).addr=g,g})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return mo(this).addr=f,f});MQ(this,{addrPromise:o,addr:a,deployTx:l,subs:u});const d=new Proxy({},{get:(f,g,m)=>{if(typeof g=="symbol"||f4.indexOf(g)>=0)return Reflect.get(f,g,m);try{return this.getEvent(g)}catch(v){if(!ui(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,g)=>f4.indexOf(g)>=0?Reflect.has(f,g):Reflect.has(f,g)||this.interface.hasEvent(String(g))});return Ft(this,{filters:d}),Ft(this,{fallback:s.receive||s.fallback?OQ(this):null}),new Proxy(this,{get:(f,g,m)=>{if(typeof g=="symbol"||g in f||f4.indexOf(g)>=0)return Reflect.get(f,g,m);try{return f.getFunction(g)}catch(v){if(!ui(v,"INVALID_ARGUMENT")||v.argument!=="key")throw v}},has:(f,g)=>typeof g=="symbol"||g in f||f4.indexOf(g)>=0?Reflect.has(f,g):f.interface.hasFunction(g)})}connect(e){return new zw(this.target,this.interface,e)}attach(e){return new zw(e,this.interface,this.runner)}async getAddress(){return await mo(this).addrPromise}async getDeployedCode(){const e=ud(this.runner);ot(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const r=await e.getCode(await this.getAddress());return r==="0x"?null:r}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=ud(this.runner);return ot(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((n,i)=>{const s=async()=>{try{if(await this.getDeployedCode()!=null)return n(this);r.once("block",s)}catch(o){i(o)}};s()})}deploymentTransaction(){return mo(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),xQ(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),PQ(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,r,n){r==null&&(r=0),n==null&&(n="latest");const{addr:i,addrPromise:s}=mo(this),o=i||await s,{fragment:a,topics:l}=await ib(this,e),u={address:o,topics:l,fromBlock:r,toBlock:n},d=ud(this.runner);return ot(d,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await d.getLogs(u)).map(f=>{let g=a;if(g==null)try{g=this.interface.getEvent(f.topics[0])}catch{}if(g)try{return new D2(f,this.interface,g)}catch(m){return new a4(f,m)}return new ad(f,d)})}async on(e,r){const n=await cR(this,"on",e);return n.listeners.push({listener:r,once:!1}),n.start(),this}async once(e,r){const n=await cR(this,"once",e);return n.listeners.push({listener:r,once:!0}),n.start(),this}async emit(e,...r){return await ob(this,e,r,null)}async listenerCount(e){if(e){const i=await V2(this,e);return i?i.listeners.length:0}const{subs:r}=mo(this);let n=0;for(const{listeners:i}of r.values())n+=i.length;return n}async listeners(e){if(e){const i=await V2(this,e);return i?i.listeners.map(({listener:s})=>s):[]}const{subs:r}=mo(this);let n=[];for(const{listeners:i}of r.values())n=n.concat(i.map(({listener:s})=>s));return n}async off(e,r){const n=await V2(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(r==null||n.listeners.length===0)&&(n.stop(),mo(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){const r=await V2(this,e);if(!r)return this;r.stop(),mo(this).subs.delete(r.tag)}else{const{subs:r}=mo(this);for(const{tag:n,stop:i}of r.values())i(),r.delete(n)}return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return await this.off(e,r)}static buildClass(e){class r extends zw{constructor(i,s=null){super(i,e,s)}}return r}static from(e,r,n){return n==null&&(n=null),new this(e,r,n)}};function DQ(){return H2}let Ou=class extends DQ(){};class p4{constructor(e,r,n){de(this,"interface"),de(this,"bytecode"),de(this,"runner");const i=n4.from(e);r instanceof Uint8Array||(typeof r=="object"&&(r=r.object),r.startsWith("0x")||(r="0x"+r)),r=At(Ot(r)),Ft(this,{bytecode:r,interface:i,runner:n||null})}attach(e){return new H2(e,this.interface,this.runner)}async getDeployTransaction(...e){let r={};const n=this.interface.deploy;if(n.inputs.length+1===e.length&&(r=await nb(e.pop())),n.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const i=await oR(this.runner,n.inputs,e),s=Qr([this.bytecode,this.interface.encodeDeploy(i)]);return Object.assign({},r,{data:s})}async deploy(...e){const r=await this.getDeployTransaction(...e);ot(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const n=await this.runner.sendTransaction(r),i=By(n);return new H2(i,this.interface,this.runner,n)}connect(e){return new p4(this.interface,this.bytecode,e)}static fromSolidity(e,r){De(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));const n=e.abi;let i="";return e.bytecode?i=e.bytecode:e.evm&&e.evm.bytecode&&(i=e.evm.bytecode),new this(n,i,r)}}function ab(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):De(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class cb{constructor(e){de(this,"name"),Ft(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,r){throw new Error("unsupported coin")}async decodeAddress(e,r){throw new Error("unsupported coin")}}const uR=new RegExp("^(ipfs)://(.*)$","i"),hR=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),uR,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var hd,F0,dd,L0,lb,dR;const ub=class jT{constructor(e,r,n){Ee(this,dd),de(this,"provider"),de(this,"address"),de(this,"name"),Ee(this,hd),Ee(this,F0),Ft(this,{provider:e,address:r,name:n}),ne(this,hd,null),ne(this,F0,new Ou(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return M(this,hd)==null&&ne(this,hd,(async()=>{try{return await M(this,F0).supportsInterface("0x9061b923")}catch(e){if(ui(e,"CALL_EXCEPTION"))return!1;throw ne(this,hd,null),e}})()),await M(this,hd)}async getAddress(e){if(e==null&&(e=60),e===60)try{const s=await Le(this,dd,L0).call(this,"addr(bytes32)");return s==null||s===Kh?null:s}catch(s){if(ui(s,"CALL_EXCEPTION"))return null;throw s}if(e>=0&&e<2147483648){let s=e+2147483648;const o=await Le(this,dd,L0).call(this,"addr(bytes32,uint)",[s]);if(wn(o,20))return Or(o)}let r=null;for(const s of this.provider.plugins)if(s instanceof cb&&s.supportsCoinType(e)){r=s;break}if(r==null)return null;const n=await Le(this,dd,L0).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;const i=await r.decodeAddress(e,n);if(i!=null)return i;ot(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){const r=await Le(this,dd,L0).call(this,"text(bytes32,string)",[e]);return r==null||r==="0x"?null:r}async getContentHash(){const e=await Le(this,dd,L0).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=r[1]==="e3010170"?"ipfs":"ipns",s=parseInt(r[4],16);if(r[5].length===s*2)return`${i}://${dy("0x"+r[2])}`}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;ot(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const r=await this.getText("avatar");if(r==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:r});for(let n=0;n<hR.length;n++){const i=r.match(hR[n]);if(i==null)continue;const s=i[1].toLowerCase();switch(s){case"https":case"data":return e.push({type:"url",value:r}),{linkage:e,url:r};case"ipfs":{const o=ab(r);return e.push({type:"ipfs",value:r}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{const o=s==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:s,value:r});const a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(i[2]||"").split("/");if(l.length!==2)return e.push({type:`!${s}caip`,value:i[2]||""}),{url:null,linkage:e};const u=l[1],d=new Ou(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(s==="erc721"){const A=await d.ownerOf(u);if(a!==A)return e.push({type:"!owner",value:A}),{url:null,linkage:e};e.push({type:"owner",value:A})}else if(s==="erc1155"){const A=await d.balanceOf(a,u);if(!A)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:A.toString()})}let f=await d[o](u);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),s==="erc1155"&&(f=f.replace("{id}",Zo(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=ab(f)),e.push({type:"metadata-url",value:f});let g={};const m=await new vs(f).send();m.assertOk();try{g=m.bodyJson}catch{try{e.push({type:"!metadata",value:m.bodyText})}catch{const A=m.body;return A&&e.push({type:"!metadata",value:At(A)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!g)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(g)});let v=g.image;if(typeof v!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!v.match(/^(https:\/\/|data:)/i)){if(v.match(uR)==null)return e.push({type:"!imageUrl-ipfs",value:v}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:v}),v=ab(v)}return e.push({type:"url",value:v}),{linkage:e,url:v}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){const r=await e.getNetwork(),n=r.getPlugin("org.ethers.plugins.network.Ens");return ot(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:r}}),n.address}static async fromName(e,r){var n;let i=r;for(;;){if(i===""||i==="."||r!=="eth"&&i==="eth")return null;const s=await Le(n=jT,lb,dR).call(n,e,i);if(s!=null){const o=new jT(e,s,r);return i!==r&&!await o.supportsWildcard()?null:o}i=i.split(".").slice(1).join(".")}}};hd=new WeakMap,F0=new WeakMap,dd=new WeakSet,L0=async function(t,e){e=(e||[]).slice();const r=M(this,F0).interface;e.unshift(y2(this.name));let n=null;await this.supportsWildcard()&&(n=r.getFunction(t),ot(n,"missing fragment","UNKNOWN_ERROR",{info:{funcName:t}}),e=[Vv(this.name,255),r.encodeFunctionData(n,e)],t="resolve(bytes,bytes)"),e.push({enableCcipRead:!0});try{const i=await M(this,F0)[t](...e);return n?r.decodeFunctionResult(n,i)[0]:i}catch(i){if(!ui(i,"CALL_EXCEPTION"))throw i}return null},lb=new WeakSet,dR=async function(t,e){const r=await ub.getEnsAddress(t);try{const n=await new Ou(r,["function resolver(bytes32) view returns (address)"],t).resolver(y2(e),{enableCcipRead:!0});return n===Kh?null:n}catch(n){throw n}return null},Ee(ub,lb);let g4=ub;const fR=BigInt(0);function Jr(t,e){return function(r){return r==null?e:t(r)}}function m4(t,e){return r=>{if(e&&r==null)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(n=>t(n))}}function W2(t,e){return r=>{const n={};for(const i in t){let s=i;if(e&&i in e&&!(s in r)){for(const o of e[i])if(o in r){s=o;break}}try{const o=t[i](r[s]);o!==void 0&&(n[i]=o)}catch(o){const a=o instanceof Error?o.message:"not-an-error";ot(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:r})}}return n}}function FQ(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}De(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function V0(t){return De(wn(t,!0),"invalid data","value",t),t}function ns(t){return De(wn(t,32),"invalid hash","value",t),t}const LQ=W2({address:Or,blockHash:ns,blockNumber:ir,data:V0,index:ir,removed:Jr(FQ,!1),topics:m4(ns),transactionHash:ns,transactionIndex:ir},{index:["logIndex"]});function VQ(t){return LQ(t)}const HQ=W2({hash:Jr(ns),parentHash:ns,parentBeaconBlockRoot:Jr(ns,null),number:ir,timestamp:ir,nonce:Jr(V0),difficulty:Yt,gasLimit:Yt,gasUsed:Yt,stateRoot:Jr(ns,null),receiptsRoot:Jr(ns,null),blobGasUsed:Jr(Yt,null),excessBlobGas:Jr(Yt,null),miner:Jr(Or),prevRandao:Jr(ns,null),extraData:V0,baseFeePerGas:Jr(Yt)},{prevRandao:["mixHash"]});function WQ(t){const e=HQ(t);return e.transactions=t.transactions.map(r=>typeof r=="string"?r:pR(r)),e}const jQ=W2({transactionIndex:ir,blockNumber:ir,transactionHash:ns,address:Or,topics:m4(ns),data:V0,index:ir,blockHash:ns},{index:["logIndex"]});function GQ(t){return jQ(t)}const zQ=W2({to:Jr(Or,null),from:Jr(Or,null),contractAddress:Jr(Or,null),index:ir,root:Jr(At),gasUsed:Yt,blobGasUsed:Jr(Yt,null),logsBloom:Jr(V0),blockHash:ns,hash:ns,logs:m4(GQ),blockNumber:ir,cumulativeGasUsed:Yt,effectiveGasPrice:Jr(Yt),blobGasPrice:Jr(Yt,null),status:Jr(ir),type:Jr(ir,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function ZQ(t){return zQ(t)}function pR(t){t.to&&Yt(t.to)===fR&&(t.to="0x0000000000000000000000000000000000000000");const e=W2({hash:ns,index:Jr(ir,void 0),type:r=>r==="0x"||r==null?0:ir(r),accessList:Jr(Sc,null),blobVersionedHashes:Jr(m4(ns,!0),null),blockHash:Jr(ns,null),blockNumber:Jr(ir,null),transactionIndex:Jr(ir,null),from:Or,gasPrice:Jr(Yt),maxPriorityFeePerGas:Jr(Yt),maxFeePerGas:Jr(Yt),maxFeePerBlobGas:Jr(Yt,null),gasLimit:Yt,to:Jr(Or,null),value:Yt,nonce:ir,data:V0,creates:Jr(Or,null),chainId:Jr(Yt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=By(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Oa.from(t.signature):e.signature=Oa.from(t),e.chainId==null){const r=e.signature.legacyChainId;r!=null&&(e.chainId=r)}return e.blockHash&&Yt(e.blockHash)===fR&&(e.blockHash=null),e}const $Q="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";let fd=class FW{constructor(e){de(this,"name"),Ft(this,{name:e})}clone(){return new FW(this.name)}};class H0 extends fd{constructor(e,r){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`),de(this,"effectiveBlock"),de(this,"txBase"),de(this,"txCreate"),de(this,"txDataZero"),de(this,"txDataNonzero"),de(this,"txAccessListStorageKey"),de(this,"txAccessListAddress");const n={effectiveBlock:e};function i(s,o){let a=(r||{})[s];a==null&&(a=o),De(typeof a=="number",`invalud value for ${s}`,"costs",r),n[s]=a}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Ft(this,n)}clone(){return new H0(this.effectiveBlock,this)}}class W0 extends fd{constructor(e,r){super("org.ethers.plugins.network.Ens"),de(this,"address"),de(this,"targetNetwork"),Ft(this,{address:e||$Q,targetNetwork:r??1})}clone(){return new W0(this.address,this.targetNetwork)}}var j0;const QQ=class LW extends fd{constructor(e){super("org.ethers.plugins.network.FeeData"),Ee(this,j0),ne(this,j0,e)}get feeDataFunc(){return M(this,j0)}async getFeeData(e){return await M(this,j0).call(this,e)}clone(){return new LW(M(this,j0))}};j0=new WeakMap;let gR=QQ;var y4,w4;class hb extends fd{constructor(e,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),Ee(this,y4),Ee(this,w4),ne(this,y4,e),ne(this,w4,r)}get url(){return M(this,y4)}get processFunc(){return M(this,w4)}clone(){return this}}y4=new WeakMap,w4=new WeakMap;const db=new Map;var j2,G2,pd;const JQ=class V3{constructor(e,r){Ee(this,j2),Ee(this,G2),Ee(this,pd),ne(this,j2,e),ne(this,G2,Yt(r)),ne(this,pd,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return M(this,j2)}set name(e){ne(this,j2,e)}get chainId(){return M(this,G2)}set chainId(e){ne(this,G2,Yt(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Yt(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Yt(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Yt(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(M(this,pd).values())}attachPlugin(e){if(M(this,pd).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return M(this,pd).set(e.name,e.clone()),this}getPlugin(e){return M(this,pd).get(e)||null}getPlugins(e){return this.plugins.filter(r=>r.name.split("#")[0]===e)}clone(){const e=new V3(this.name,this.chainId);return this.plugins.forEach(r=>{e.attachPlugin(r.clone())}),e}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new H0;let n=r.txBase;if(e.to==null&&(n+=r.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?n+=r.txDataZero:n+=r.txDataNonzero;if(e.accessList){const i=Sc(e.accessList);for(const s in i)n+=r.txAccessListAddress+r.txAccessListStorageKey*i[s].storageKeys.length}return n}static from(e){if(YQ(),e==null)return V3.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const r=db.get(e);if(r)return r();if(typeof e=="bigint")return new V3("unknown",e);De(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){De(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const r=new V3(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&r.attachPlugin(new W0(e.ensAddress,e.ensNetwork)),r}De(!1,"invalid network","network",e)}static register(e,r){typeof e=="number"&&(e=BigInt(e));const n=db.get(e);n&&De(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),db.set(e,r)}};j2=new WeakMap,G2=new WeakMap,pd=new WeakMap;let Si=JQ;function mR(t,e){const r=String(t);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const n=r.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let i=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||i++,n[1]=i.toString()}return BigInt(n[0]+n[1])}function yR(t){return new hb(t,async(e,r,n)=>{n.setHeader("User-Agent","ethers");let i;try{const[s,o]=await Promise.all([n.send(),e()]);i=s;const a=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:mR(a.maxFee,9),maxPriorityFeePerGas:mR(a.maxPriorityFee,9)}}catch(s){ot(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:i,error:s})}})}let wR=!1;function YQ(){if(wR)return;wR=!0;function t(e,r,n){const i=function(){const s=new Si(e,r);return n.ensNetwork!=null&&s.attachPlugin(new W0(null,n.ensNetwork)),s.attachPlugin(new H0),(n.plugins||[]).forEach(o=>{s.attachPlugin(o)}),s};Si.register(e,i),Si.register(r,i),n.altNames&&n.altNames.forEach(s=>{Si.register(s,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[yR("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[yR("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function fb(t){return JSON.parse(JSON.stringify(t))}var xu,Ua,gd,_l,z2,v4;class KQ{constructor(e){Ee(this,z2),Ee(this,xu),Ee(this,Ua),Ee(this,gd),Ee(this,_l),ne(this,xu,e),ne(this,Ua,null),ne(this,gd,4e3),ne(this,_l,-2)}get pollingInterval(){return M(this,gd)}set pollingInterval(e){ne(this,gd,e)}start(){M(this,Ua)||(ne(this,Ua,M(this,xu)._setTimeout(Le(this,z2,v4).bind(this),M(this,gd))),Le(this,z2,v4).call(this))}stop(){M(this,Ua)&&(M(this,xu)._clearTimeout(M(this,Ua)),ne(this,Ua,null))}pause(e){this.stop(),e&&ne(this,_l,-2)}resume(){this.start()}}xu=new WeakMap,Ua=new WeakMap,gd=new WeakMap,_l=new WeakMap,z2=new WeakSet,v4=async function(){try{const t=await M(this,xu).getBlockNumber();if(M(this,_l)===-2){ne(this,_l,t);return}if(t!==M(this,_l)){for(let e=M(this,_l)+1;e<=t;e++){if(M(this,Ua)==null)return;await M(this,xu).emit("block",e)}ne(this,_l,t)}}catch{}M(this,Ua)!=null&&ne(this,Ua,M(this,xu)._setTimeout(Le(this,z2,v4).bind(this),M(this,gd)))};var G0,z0,md;class pb{constructor(e){Ee(this,G0),Ee(this,z0),Ee(this,md),ne(this,G0,e),ne(this,md,!1),ne(this,z0,r=>{this._poll(r,M(this,G0))})}async _poll(e,r){throw new Error("sub-classes must override this")}start(){M(this,md)||(ne(this,md,!0),M(this,z0).call(this,-2),M(this,G0).on("block",M(this,z0)))}stop(){M(this,md)&&(ne(this,md,!1),M(this,G0).off("block",M(this,z0)))}pause(e){this.stop()}resume(){this.start()}}G0=new WeakMap,z0=new WeakMap,md=new WeakMap;var Z2,Pu;class XQ extends pb{constructor(e,r){super(e),Ee(this,Z2),Ee(this,Pu),ne(this,Z2,r),ne(this,Pu,-2)}pause(e){e&&ne(this,Pu,-2),super.pause(e)}async _poll(e,r){const n=await r.getBlock(M(this,Z2));n!=null&&(M(this,Pu)===-2?ne(this,Pu,n.number):n.number>M(this,Pu)&&(r.emit(M(this,Z2),n.number),ne(this,Pu,n.number)))}}Z2=new WeakMap,Pu=new WeakMap;var gb;class qQ extends pb{constructor(e,r){super(e),Ee(this,gb),ne(this,gb,fb(r))}async _poll(e,r){throw new Error("@TODO")}}gb=new WeakMap;var $2;class eJ extends pb{constructor(e,r){super(e),Ee(this,$2),ne(this,$2,r)}async _poll(e,r){const n=await r.getTransactionReceipt(M(this,$2));n&&r.emit(M(this,$2),n)}}$2=new WeakMap;var Mu,Q2,J2,yd,Da,mb,vR;class yb{constructor(e,r){Ee(this,mb),Ee(this,Mu),Ee(this,Q2),Ee(this,J2),Ee(this,yd),Ee(this,Da),ne(this,Mu,e),ne(this,Q2,fb(r)),ne(this,J2,Le(this,mb,vR).bind(this)),ne(this,yd,!1),ne(this,Da,-2)}start(){M(this,yd)||(ne(this,yd,!0),M(this,Da)===-2&&M(this,Mu).getBlockNumber().then(e=>{ne(this,Da,e)}),M(this,Mu).on("block",M(this,J2)))}stop(){M(this,yd)&&(ne(this,yd,!1),M(this,Mu).off("block",M(this,J2)))}pause(e){this.stop(),e&&ne(this,Da,-2)}resume(){this.start()}}Mu=new WeakMap,Q2=new WeakMap,J2=new WeakMap,yd=new WeakMap,Da=new WeakMap,mb=new WeakSet,vR=async function(t){if(M(this,Da)===-2)return;const e=fb(M(this,Q2));e.fromBlock=M(this,Da)+1,e.toBlock=t;const r=await M(this,Mu).getLogs(e);if(r.length===0){M(this,Da)<t-60&&ne(this,Da,t-60);return}for(const n of r)M(this,Mu).emit(M(this,Q2),n),ne(this,Da,n.blockNumber)};const tJ=BigInt(2),rJ=10;function b4(t){return t&&typeof t.then=="function"}function A4(t,e){return t+":"+JSON.stringify(e,(r,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){const i=Object.keys(n);return i.sort(),i.reduce((s,o)=>(s[o]=n[o],s),{})}return n})}class Z0{constructor(e){de(this,"name"),Ft(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function nJ(t){return JSON.parse(JSON.stringify(t))}function wb(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function vb(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(wn(t,32)){const r=t.toLowerCase();return{type:"transaction",tag:A4("tx",{hash:r}),hash:r}}if(t.orphan){const r=t;return{type:"orphan",tag:A4("orphan",r),filter:nJ(r)}}if(t.address||t.topics){const r=t,n={topics:(r.topics||[]).map(i=>i==null?null:Array.isArray(i)?wb(i.map(s=>s.toLowerCase())):i.toLowerCase())};if(r.address){const i=[],s=[],o=a=>{wn(a)?i.push(a):s.push((async()=>{i.push(await Li(a,e))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),s.length&&await Promise.all(s),n.address=wb(i.map(a=>a.toLowerCase()))}return{filter:n,tag:A4("event",n),type:"event"}}De(!1,"unknown ProviderEvent","event",t)}function bb(){return new Date().getTime()}const iJ={cacheTimeout:250,pollingInterval:4e3};var Bs,wd,Us,Y2,qo,$0,vd,Bu,E4,Fa,K2,X2,un,yo,Ab,Eb,q2,Tb,eg,T4;class Q0{constructor(e,r){if(Ee(this,un),Ee(this,Bs),Ee(this,wd),Ee(this,Us),Ee(this,Y2),Ee(this,qo),Ee(this,$0),Ee(this,vd),Ee(this,Bu),Ee(this,E4),Ee(this,Fa),Ee(this,K2),Ee(this,X2),ne(this,X2,Object.assign({},iJ,r||{})),e==="any")ne(this,$0,!0),ne(this,qo,null);else if(e){const n=Si.from(e);ne(this,$0,!1),ne(this,qo,Promise.resolve(n)),setTimeout(()=>{this.emit("network",n,null)},0)}else ne(this,$0,!1),ne(this,qo,null);ne(this,Bu,-1),ne(this,vd,new Map),ne(this,Bs,new Map),ne(this,wd,new Map),ne(this,Us,null),ne(this,Y2,!1),ne(this,E4,1),ne(this,Fa,new Map),ne(this,K2,!1)}get pollingInterval(){return M(this,X2).pollingInterval}get provider(){return this}get plugins(){return Array.from(M(this,wd).values())}attachPlugin(e){if(M(this,wd).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return M(this,wd).set(e.name,e.connect(this)),this}getPlugin(e){return M(this,wd).get(e)||null}get disableCcipRead(){return M(this,K2)}set disableCcipRead(e){ne(this,K2,!!e)}async ccipReadFetch(e,r,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a<n.length;a++){const l=n[a],u=l.replace("{sender}",i).replace("{data}",s),d=new vs(u);l.indexOf("{data}")===-1&&(d.body={data:s,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:d,index:a,urls:n});let f="unknown error",g;try{g=await d.send()}catch(m){o.push(m.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:{error:m}});continue}try{const m=g.bodyJson;if(m.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:d,result:m}),m.data;m.message&&(f=m.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:d,result:m})}catch{}ot(g.statusCode<400||g.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ot(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,r){return new eb(WQ(e),this)}_wrapLog(e,r){return new ad(VQ(e),this)}_wrapTransactionReceipt(e,r){return new o4(ZQ(e),this)}_wrapTransactionResponse(e,r){return new U2(pR(e),this)}_detectNetwork(){ot(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ot(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=ir(await Le(this,un,yo).call(this,{method:"getBlockNumber"}),"%response");return M(this,Bu)>=0&&ne(this,Bu,e),e}_getAddress(e){return Li(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(wn(e))return wn(e,32)?e:cl(e);if(typeof e=="bigint"&&(e=ir(e,"blockTag")),typeof e=="number")return e>=0?cl(e):M(this,Bu)>=0?cl(M(this,Bu)+e):this.getBlockNumber().then(r=>cl(r+e));De(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const r=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?wb(l.map(u=>u.toLowerCase())):l.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,i=(l,u,d)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(n&&(u!=null||d!=null))throw new Error("invalid filter");const g={};return f&&(g.address=f),r.length&&(g.topics=r),u&&(g.fromBlock=u),d&&(g.toBlock=d),n&&(g.blockHash=n),g};let s=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)s.push(this._getAddress(l));else s.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),s.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(s),o,a]).then(l=>i(l[0],l[1],l[2])):i(s,o,a)}_getTransactionRequest(e){const r=od(e),n=[];if(["to","from"].forEach(i=>{if(r[i]==null)return;const s=Li(r[i],this);b4(s)?n.push((async function(){r[i]=await s})()):r[i]=s}),r.blockTag!=null){const i=this._getBlockTag(r.blockTag);b4(i)?n.push((async function(){r.blockTag=await i})()):r.blockTag=i}return n.length?(async function(){return await Promise.all(n),r})():r}async getNetwork(){if(M(this,qo)==null){const i=(async()=>{try{const s=await this._detectNetwork();return this.emit("network",s,null),s}catch(s){throw M(this,qo)===i&&ne(this,qo,null),s}})();return ne(this,qo,i),(await i).clone()}const e=M(this,qo),[r,n]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==n.chainId&&(M(this,$0)?(this.emit("network",n,r),M(this,qo)===e&&ne(this,qo,Promise.resolve(n))):ot(!1,`network changed: ${r.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:i,gasPrice:s,priorityFee:o}=await Ui({_block:Le(this,un,Tb).call(this,"latest",!1),gasPrice:(async()=>{try{const d=await Le(this,un,yo).call(this,{method:"getGasPrice"});return Yt(d,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const d=await Le(this,un,yo).call(this,{method:"getPriorityFee"});return Yt(d,"%response")}catch{}return null})()});let a=null,l=null;const u=this._wrapBlock(i,e);return u&&u.baseFeePerGas&&(l=o??BigInt("1000000000"),a=u.baseFeePerGas*tJ+l),new i4(s,a,l)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){const i=new vs(n.url),s=await n.processFunc(r,this,i);return new i4(s.gasPrice,s.maxFeePerGas,s.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return b4(r)&&(r=await r),Yt(await Le(this,un,yo).call(this,{method:"estimateGas",transaction:r}),"%response")}async call(e){const{tx:r,blockTag:n}=await Ui({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await Le(this,un,Eb).call(this,Le(this,un,Ab).call(this,r,n,e.enableCcipRead?0:-1))}async getBalance(e,r){return Yt(await Le(this,un,q2).call(this,{method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return ir(await Le(this,un,q2).call(this,{method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return At(await Le(this,un,q2).call(this,{method:"getCode"},e,r))}async getStorage(e,r,n){const i=Yt(r,"position");return At(await Le(this,un,q2).call(this,{method:"getStorage",position:i},e,n))}async broadcastTransaction(e){const{blockNumber:r,hash:n,network:i}=await Ui({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),s=x0.from(e);if(s.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(s,i).replaceableTransaction(r)}async getBlock(e,r){const{network:n,params:i}=await Ui({network:this.getNetwork(),params:Le(this,un,Tb).call(this,e,!!r)});return i==null?null:this._wrapBlock(i,n)}async getTransaction(e){const{network:r,params:n}=await Ui({network:this.getNetwork(),params:Le(this,un,yo).call(this,{method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,r)}async getTransactionReceipt(e){const{network:r,params:n}=await Ui({network:this.getNetwork(),params:Le(this,un,yo).call(this,{method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){const i=await Le(this,un,yo).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(n,r)}async getTransactionResult(e){const{result:r}=await Ui({network:this.getNetwork(),result:Le(this,un,yo).call(this,{method:"getTransactionResult",hash:e})});return r==null?null:At(r)}async getLogs(e){let r=this._getFilter(e);b4(r)&&(r=await r);const{network:n,params:i}=await Ui({network:this.getNetwork(),params:Le(this,un,yo).call(this,{method:"getLogs",filter:r})});return i.map(s=>this._wrapLog(s,n))}_getProvider(e){ot(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await g4.fromName(this,e)}async getAvatar(e){const r=await this.getResolver(e);return r?await r.getAvatar():null}async resolveName(e){const r=await this.getResolver(e);return r?await r.getAddress():null}async lookupAddress(e){e=Or(e);const r=y2(e.substring(2).toLowerCase()+".addr.reverse");try{const n=await g4.getEnsAddress(this),i=await new Ou(n,["function resolver(bytes32) view returns (address)"],this).resolver(r);if(i==null||i===Kh)return null;const s=await new Ou(i,["function name(bytes32) view returns (string)"],this).name(r);return await this.resolveName(s)!==e?null:s}catch(n){if(ui(n,"BAD_DATA")&&n.value==="0x"||ui(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,r,n){const i=r??1;return i===0?this.getTransactionReceipt(e):new Promise(async(s,o)=>{let a=null;const l=async u=>{try{const d=await this.getTransactionReceipt(e);if(d!=null&&u-d.blockNumber+1>=i){s(d),a&&(clearTimeout(a),a=null);return}}catch(d){console.log("EEE",d)}this.once("block",l)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),o(Nn("timeout","TIMEOUT",{reason:"timeout"})))},n)),l(await this.getBlockNumber())})}async waitForBlock(e){ot(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const r=M(this,Fa).get(e);r&&(r.timer&&clearTimeout(r.timer),M(this,Fa).delete(e))}_setTimeout(e,r){r==null&&(r=0);const n=yc(this,E4)._++,i=()=>{M(this,Fa).delete(n),e()};if(this.paused)M(this,Fa).set(n,{timer:null,func:i,time:r});else{const s=setTimeout(i,r);M(this,Fa).set(n,{timer:s,func:i,time:bb()})}return n}_forEachSubscriber(e){for(const r of M(this,Bs).values())e(r.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Z0(e.type);case"block":{const r=new KQ(this);return r.pollingInterval=this.pollingInterval,r}case"safe":case"finalized":return new XQ(this,e.type);case"event":return new yb(this,e.filter);case"transaction":return new eJ(this,e.hash);case"orphan":return new qQ(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,r){for(const n of M(this,Bs).values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=r,n.started&&r.start(),M(this,Us)!=null&&r.pause(M(this,Us));break}}async on(e,r){const n=await Le(this,un,T4).call(this,e);return n.listeners.push({listener:r,once:!1}),n.started||(n.subscriber.start(),n.started=!0,M(this,Us)!=null&&n.subscriber.pause(M(this,Us))),this}async once(e,r){const n=await Le(this,un,T4).call(this,e);return n.listeners.push({listener:r,once:!0}),n.started||(n.subscriber.start(),n.started=!0,M(this,Us)!=null&&n.subscriber.pause(M(this,Us))),this}async emit(e,...r){const n=await Le(this,un,eg).call(this,e,r);if(!n||n.listeners.length===0)return!1;const i=n.listeners.length;return n.listeners=n.listeners.filter(({listener:s,once:o})=>{const a=new fy(this,o?null:s,e);try{s.call(this,...r,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),M(this,Bs).delete(n.tag)),i>0}async listenerCount(e){if(e){const n=await Le(this,un,eg).call(this,e);return n?n.listeners.length:0}let r=0;for(const{listeners:n}of M(this,Bs).values())r+=n.length;return r}async listeners(e){if(e){const n=await Le(this,un,eg).call(this,e);return n?n.listeners.map(({listener:i})=>i):[]}let r=[];for(const{listeners:n}of M(this,Bs).values())r=r.concat(n.map(({listener:i})=>i));return r}async off(e,r){const n=await Le(this,un,eg).call(this,e);if(!n)return this;if(r){const i=n.listeners.map(({listener:s})=>s).indexOf(r);i>=0&&n.listeners.splice(i,1)}return(!r||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),M(this,Bs).delete(n.tag)),this}async removeAllListeners(e){if(e){const{tag:r,started:n,subscriber:i}=await Le(this,un,T4).call(this,e);n&&i.stop(),M(this,Bs).delete(r)}else for(const[r,{started:n,subscriber:i}]of M(this,Bs))n&&i.stop(),M(this,Bs).delete(r);return this}async addListener(e,r){return await this.on(e,r)}async removeListener(e,r){return this.off(e,r)}get destroyed(){return M(this,Y2)}destroy(){this.removeAllListeners();for(const e of M(this,Fa).keys())this._clearTimeout(e);ne(this,Y2,!0)}get paused(){return M(this,Us)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(ne(this,Bu,-1),M(this,Us)!=null){if(M(this,Us)==!!e)return;ot(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(r=>r.pause(e)),ne(this,Us,!!e);for(const r of M(this,Fa).values())r.timer&&clearTimeout(r.timer),r.time=bb()-r.time}resume(){if(M(this,Us)!=null){this._forEachSubscriber(e=>e.resume()),ne(this,Us,null);for(const e of M(this,Fa).values()){let r=e.time;r<0&&(r=0),e.time=bb(),setTimeout(e.func,r)}}}}Bs=new WeakMap,wd=new WeakMap,Us=new WeakMap,Y2=new WeakMap,qo=new WeakMap,$0=new WeakMap,vd=new WeakMap,Bu=new WeakMap,E4=new WeakMap,Fa=new WeakMap,K2=new WeakMap,X2=new WeakMap,un=new WeakSet,yo=async function(t){const e=M(this,X2).cacheTimeout;if(e<0)return await this._perform(t);const r=A4(t.method,t);let n=M(this,vd).get(r);return n||(n=this._perform(t),M(this,vd).set(r,n),setTimeout(()=>{M(this,vd).get(r)===n&&M(this,vd).delete(r)},e)),await n},Ab=async function(t,e,r){ot(r<rJ,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},t,{blockTag:e,enableCcipRead:!0})});const n=od(t);try{return At(await this._perform({method:"call",transaction:n,blockTag:e}))}catch(i){if(!this.disableCcipRead&&Hp(i)&&i.data&&r>=0&&e==="latest"&&n.to!=null&&vn(i.data,0,4)==="0x556f1830"){const s=i.data,o=await Li(n.to,this);let a;try{a=lJ(vn(i.data,4))}catch(d){ot(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:n,info:{data:s}})}ot(a.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:s,reason:"OffchainLookup",transaction:n,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:a.errorArgs}});const l=await this.ccipReadFetch(n,a.calldata,a.urls);ot(l!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:n,info:{data:i.data,errorArgs:a.errorArgs}});const u={to:o,data:Qr([a.selector,cJ([l,a.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const d=await Le(this,un,Ab).call(this,u,e,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:d}),d}}throw i}},Eb=async function(t){const{value:e}=await Ui({network:this.getNetwork(),value:t});return e},q2=async function(t,e,r){let n=this._getAddress(e),i=this._getBlockTag(r);return(typeof n!="string"||typeof i!="string")&&([n,i]=await Promise.all([n,i])),await Le(this,un,Eb).call(this,Le(this,un,yo).call(this,Object.assign(t,{address:n,blockTag:i})))},Tb=async function(t,e){if(wn(t,32))return await Le(this,un,yo).call(this,{method:"getBlock",blockHash:t,includeTransactions:e});let r=this._getBlockTag(t);return typeof r!="string"&&(r=await r),await Le(this,un,yo).call(this,{method:"getBlock",blockTag:r,includeTransactions:e})},eg=async function(t,e){let r=await vb(t,this);return r.type==="event"&&e&&e.length>0&&e[0].removed===!0&&(r=await vb({orphan:"drop-log",log:e[0]},this)),M(this,Bs).get(r.tag)||null},T4=async function(t){const e=await vb(t,this),r=e.tag;let n=M(this,Bs).get(r);return n||(n={subscriber:this._getSubscriber(e),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},M(this,Bs).set(r,n)),n};function sJ(t,e){try{const r=Sb(t,e);if(r)return ll(r)}catch{}return null}function Sb(t,e){if(t==="0x")return null;try{const r=ir(vn(t,e,e+32)),n=ir(vn(t,r,r+32));return vn(t,r+32,r+32+n)}catch{}return null}function bR(t){const e=Fi(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function oJ(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const aJ=new Uint8Array([]);function cJ(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(aJ),r+=32;for(let n=0;n<t.length;n++){const i=Ot(t[n]);e[n]=bR(r),e.push(bR(i.length)),e.push(oJ(i)),r+=32+Math.ceil(i.length/32)*32}return Qr(e)}const AR="0x0000000000000000000000000000000000000000000000000000000000000000";function lJ(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};ot(ol(t)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=vn(t,0,32);ot(vn(r,0,12)===vn(AR,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=vn(r,12);try{const n=[],i=ir(vn(t,32,64)),s=ir(vn(t,i,i+32)),o=vn(t,i+32);for(let a=0;a<s;a++){const l=sJ(o,a*32);if(l==null)throw new Error("abort");n.push(l)}e.urls=n}catch{ot(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const n=Sb(t,64);if(n==null)throw new Error("abort");e.calldata=n}catch{ot(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}ot(vn(t,100,128)===vn(AR,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=vn(t,96,100);try{const n=Sb(t,128);if(n==null)throw new Error("abort");e.extraData=n}catch{ot(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}function J0(t,e){if(t.provider)return t.provider;ot(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function ER(t,e){let r=od(e);if(r.to!=null&&(r.to=Li(r.to,t)),r.from!=null){const n=r.from;r.from=Promise.all([t.getAddress(),Li(n,t)]).then(([i,s])=>(De(i.toLowerCase()===s.toLowerCase(),"transaction from mismatch","tx.from",s),i))}else r.from=t.getAddress();return await Ui(r)}class Y0{constructor(e){de(this,"provider"),Ft(this,{provider:e||null})}async getNonce(e){return J0(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await ER(this,e)}async populateTransaction(e){const r=J0(this,"populateTransaction"),n=await ER(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));const i=await this.provider.getNetwork();if(n.chainId!=null){const o=Yt(n.chainId);De(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=i.chainId;const s=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||s)?De(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&s&&De(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){const o=await r.getFeeData();ot(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{const o=await r.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){const a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ot(!s,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):ot(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await Ui(n)}async estimateGas(e){return J0(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return J0(this,"call").call(await this.populateCall(e))}async resolveName(e){return await J0(this,"resolveName").resolveName(e)}async sendTransaction(e){const r=J0(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;const i=x0.from(n);return await r.broadcastTransaction(await this.signTransaction(i))}}var tg,S4;const uJ=class VW extends Y0{constructor(e,r){super(r),Ee(this,tg),de(this,"address"),Ft(this,{address:e})}async getAddress(){return this.address}connect(e){return new VW(this.address,e)}async signTransaction(e){Le(this,tg,S4).call(this,"transactions","signTransaction")}async signMessage(e){Le(this,tg,S4).call(this,"messages","signMessage")}async signTypedData(e,r,n){Le(this,tg,S4).call(this,"typed-data","signTypedData")}};tg=new WeakSet,S4=function(t,e){ot(!1,`VoidSigner cannot sign ${t}`,"UNSUPPORTED_OPERATION",{operation:e})};let C4=uJ;const TR=new Set;function Il(t){TR.has(t)||(TR.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}function hJ(t){return JSON.parse(JSON.stringify(t))}var ro,Rl,K0,bd,X0,rg,q0,Cb,kb;class SR{constructor(e){Ee(this,q0),Ee(this,ro),Ee(this,Rl),Ee(this,K0),Ee(this,bd),Ee(this,X0),Ee(this,rg),ne(this,ro,e),ne(this,Rl,null),ne(this,K0,Le(this,q0,Cb).bind(this)),ne(this,bd,!1),ne(this,X0,null),ne(this,rg,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,r){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){M(this,bd)||(ne(this,bd,!0),Le(this,q0,Cb).call(this,-2))}stop(){M(this,bd)&&(ne(this,bd,!1),ne(this,rg,!0),Le(this,q0,kb).call(this),M(this,ro).off("block",M(this,K0)))}pause(e){e&&Le(this,q0,kb).call(this),M(this,ro).off("block",M(this,K0))}resume(){this.start()}}ro=new WeakMap,Rl=new WeakMap,K0=new WeakMap,bd=new WeakMap,X0=new WeakMap,rg=new WeakMap,q0=new WeakSet,Cb=async function(t){try{M(this,Rl)==null&&ne(this,Rl,this._subscribe(M(this,ro)));let e=null;try{e=await M(this,Rl)}catch(i){if(!ui(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(e==null){ne(this,Rl,null),M(this,ro)._recoverSubscriber(this,this._recover(M(this,ro)));return}const r=await M(this,ro).getNetwork();if(M(this,X0)||ne(this,X0,r),M(this,X0).chainId!==r.chainId)throw new Error("chaid changed");if(M(this,rg))return;const n=await M(this,ro).send("eth_getFilterChanges",[e]);await this._emitResults(M(this,ro),n)}catch(e){console.log("@TODO",e)}M(this,ro).once("block",M(this,K0))},kb=function(){const t=M(this,Rl);t&&(ne(this,Rl,null),t.then(e=>{M(this,ro).destroyed||M(this,ro).send("eth_uninstallFilter",[e])}))};var e1;class dJ extends SR{constructor(e,r){super(e),Ee(this,e1),ne(this,e1,hJ(r))}_recover(e){return new yb(e,M(this,e1))}async _subscribe(e){return await e.send("eth_newFilter",[M(this,e1)])}async _emitResults(e,r){for(const n of r)e.emit(M(this,e1),e._wrapLog(n,e._network))}}e1=new WeakMap;class fJ extends SR{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,r){for(const n of r)e.emit("pending",n)}}const pJ="bigint,boolean,function,number,string,symbol".split(/,/g);function k4(t){if(t==null||pJ.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(k4);if(typeof t=="object")return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function gJ(t){return new Promise(e=>{setTimeout(e,t)})}function t1(t){return t&&t.toLowerCase()}function CR(t){return t&&typeof t.pollingInterval=="number"}const kR={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class ng extends Y0{constructor(e,r){super(e),de(this,"address"),r=Or(r),Ft(this,{address:r})}connect(e){ot(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const r=k4(e),n=[];if(r.from){const s=r.from;n.push((async()=>{const o=await Li(s,this.provider);De(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),r.from=o})())}else r.from=this.address;if(r.gasLimit==null&&n.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const s=r.to;n.push((async()=>{r.to=await Li(s,this.provider)})())}n.length&&await Promise.all(n);const i=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(e){const r=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((i,s)=>{const o=[1e3,100];let a=0;const l=async()=>{try{const u=await this.provider.getTransaction(n);if(u!=null){i(u.replaceableTransaction(r));return}}catch(u){if(ui(u,"CANCELLED")||ui(u,"BAD_DATA")||ui(u,"NETWORK_ERROR")||ui(u,"UNSUPPORTED_OPERATION")){u.info==null&&(u.info={}),u.info.sendTransactionHash=n,s(u);return}if(ui(u,"INVALID_ARGUMENT")&&(a++,u.info==null&&(u.info={}),u.info.sendTransactionHash=n,a>10)){s(u);return}this.provider.emit("error",Nn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{l()},o.pop()||4e3)};l()})}async signTransaction(e){const r=k4(e);if(r.from){const i=await Li(r.from,this.provider);De(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),r.from=i}else r.from=this.address;const n=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){const r=typeof e=="string"?Ti(e):e;return await this.provider.send("personal_sign",[At(r),this.address.toLowerCase()])}async signTypedData(e,r,n){const i=k4(n),s=await nd.resolveNames(e,r,i,async o=>{const a=await Li(o);return De(a!=null,"TypedData does not support null address","value",o),a});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(nd.getPayload(s.domain,r,s.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const r=typeof e=="string"?Ti(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),At(r)])}}var r1,ig,Uu,Nl,kc,La,wo,_4,_b;class I4 extends Q0{constructor(e,r){super(e,r),Ee(this,_4),Ee(this,r1),Ee(this,ig),Ee(this,Uu),Ee(this,Nl),Ee(this,kc),Ee(this,La),Ee(this,wo),ne(this,ig,1),ne(this,r1,Object.assign({},kR,r||{})),ne(this,Uu,[]),ne(this,Nl,null),ne(this,La,null),ne(this,wo,null);{let i=null;const s=new Promise(o=>{i=o});ne(this,kc,{promise:s,resolve:i})}const n=this._getOption("staticNetwork");typeof n=="boolean"?(De(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",r),n&&e!=null&&ne(this,La,Si.from(e))):n&&(De(e==null||n.matches(e),"staticNetwork MUST match network object","options",r),ne(this,La,n))}_getOption(e){return M(this,r1)[e]}get _network(){return ot(M(this,La),"network is not available yet","NETWORK_ERROR"),M(this,La)}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&Yt(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}const r=this.getRpcRequest(e);return r!=null?await this.send(r.method,r.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)if(e===!0){if(M(this,La))return M(this,La)}else return e;return M(this,wo)?await M(this,wo):this.ready?(ne(this,wo,(async()=>{try{const r=Si.from(Yt(await this.send("eth_chainId",[])));return ne(this,wo,null),r}catch(r){throw ne(this,wo,null),r}})()),await M(this,wo)):(ne(this,wo,(async()=>{const r={id:yc(this,ig)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let n;try{n=(await this._send(r))[0],ne(this,wo,null)}catch(i){throw ne(this,wo,null),this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Si.from(Yt(n.result));throw this.getRpcError(r,n)})()),await M(this,wo))}_start(){M(this,kc)==null||M(this,kc).resolve==null||(M(this,kc).resolve(),ne(this,kc,null),(async()=>{for(;M(this,La)==null&&!this.destroyed;)try{ne(this,La,await this._detectNetwork())}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Nn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await gJ(1e3)}Le(this,_4,_b).call(this)})())}async _waitUntilReady(){if(M(this,kc)!=null)return await M(this,kc).promise}_getSubscriber(e){return e.type==="pending"?new fJ(this):e.type==="event"?this._getOption("polling")?new yb(this,e.filter):new dJ(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new Z0("orphan"):super._getSubscriber(e)}get ready(){return M(this,kc)==null}getRpcTransaction(e){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let i=n;n==="gasLimit"&&(i="gas"),r[i]=cl(Yt(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(r[n]=At(e[n]))}),e.accessList&&(r.accessList=Sc(e.accessList)),e.blobVersionedHashes&&(r.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),r}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[t1(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[t1(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[t1(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[t1(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(t1):e.filter.address=t1(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,r){const{method:n}=e,{error:i}=r;if(n==="eth_estimateGas"&&i.message){const a=i.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return Nn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:i}})}if(n==="eth_call"||n==="eth_estimateGas"){const a=Ib(i),l=U0.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],a?a.data:null);return l.info={error:i,payload:e},l}const s=JSON.stringify(mJ(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return Nn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[n]||"unknown",reason:"rejected",info:{payload:e,error:i}});if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){const a=e.params[0];if(s.match(/insufficient funds|base fee exceeds gas limit/i))return Nn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:i}});if(s.match(/nonce/i)&&s.match(/too low/i))return Nn("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:i}});if(s.match(/replacement transaction/i)&&s.match(/underpriced/i))return Nn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:i}});if(s.match(/only replay-protected/i))return Nn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:a,info:{error:i}}})}let o=!!s.match(/the method .* does not exist/i);return o||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(o=!0),o?Nn("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:i,payload:e}}):Nn("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:e})}send(e,r){if(this.destroyed)return Promise.reject(Nn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const n=yc(this,ig)._++,i=new Promise((s,o)=>{M(this,Uu).push({resolve:s,reject:o,payload:{method:e,params:r,id:n,jsonrpc:"2.0"}})});return Le(this,_4,_b).call(this),i}async getSigner(e){e==null&&(e=0);const r=this.send("eth_accounts",[]);if(typeof e=="number"){const i=await r;if(e>=i.length)throw new Error("no such account");return new ng(this,i[e])}const{accounts:n}=await Ui({network:this.getNetwork(),accounts:r});e=Or(e);for(const i of n)if(Or(i)===e)return new ng(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(e=>new ng(this,e))}destroy(){M(this,Nl)&&(clearTimeout(M(this,Nl)),ne(this,Nl,null));for(const{payload:e,reject:r}of M(this,Uu))r(Nn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));ne(this,Uu,[]),super.destroy()}}r1=new WeakMap,ig=new WeakMap,Uu=new WeakMap,Nl=new WeakMap,kc=new WeakMap,La=new WeakMap,wo=new WeakMap,_4=new WeakSet,_b=function(){if(M(this,Nl))return;const t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");ne(this,Nl,setTimeout(()=>{ne(this,Nl,null);const e=M(this,Uu);for(ne(this,Uu,[]);e.length;){const r=[e.shift()];for(;e.length&&r.length!==M(this,r1).batchMaxCount;)if(r.push(e.shift()),JSON.stringify(r.map(n=>n.payload)).length>M(this,r1).batchMaxSize){e.unshift(r.pop());break}(async()=>{const n=r.length===1?r[0].payload:r.map(i=>i.payload);this.emit("debug",{action:"sendRpcPayload",payload:n});try{const i=await this._send(n);this.emit("debug",{action:"receiveRpcResult",result:i});for(const{resolve:s,reject:o,payload:a}of r){if(this.destroyed){o(Nn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:a.method}));continue}const l=i.filter(u=>u.id===a.id)[0];if(l==null){const u=Nn("missing response for request","BAD_DATA",{value:i,info:{payload:a}});this.emit("error",u),o(u);continue}if("error"in l){o(this.getRpcError(a,l));continue}s(l.result)}}catch(i){this.emit("debug",{action:"receiveRpcError",error:i});for(const{reject:s}of r)s(i)}})()}},t))};var Ad;class _R extends I4{constructor(e,r){super(e,r),Ee(this,Ad);let n=this._getOption("pollingInterval");n==null&&(n=kR.pollingInterval),ne(this,Ad,n)}_getSubscriber(e){const r=super._getSubscriber(e);return CR(r)&&(r.pollingInterval=M(this,Ad)),r}get pollingInterval(){return M(this,Ad)}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");ne(this,Ad,e),this._forEachSubscriber(r=>{CR(r)&&(r.pollingInterval=M(this,Ad))})}}Ad=new WeakMap;var sg;let vo=class extends _R{constructor(e,r,n){e==null&&(e="http://localhost:8545"),super(r,n),Ee(this,sg),typeof e=="string"?ne(this,sg,new vs(e)):ne(this,sg,e.clone())}_getConnection(){return M(this,sg).clone()}async send(e,r){return await this._start(),await super.send(e,r)}async _send(e){const r=this._getConnection();r.body=JSON.stringify(e),r.setHeader("content-type","application/json");const n=await r.send();n.assertOk();let i=n.bodyJson;return Array.isArray(i)||(i=[i]),i}};sg=new WeakMap;function Ib(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&wn(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const r=Ib(t[e]);if(r)return r}return null}if(typeof t=="string")try{return Ib(JSON.parse(t))}catch{}return null}function Rb(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const r in t)Rb(t[r],e);if(typeof t=="string")try{return Rb(JSON.parse(t),e)}catch{}}}function mJ(t){const e=[];return Rb(t,e),e}const R4="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function yJ(t){switch(t){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}De(!1,"unsupported network","network",t)}class n1 extends vo{constructor(e,r){e==null&&(e="mainnet");const n=Si.from(e);r==null&&(r=R4);const i={polling:!0,staticNetwork:n},s=n1.getRequest(n,r);super(s,n,i),de(this,"apiKey"),Ft(this,{apiKey:r})}_getProvider(e){try{return new n1(e,this.apiKey)}catch{}return super._getProvider(e)}static getRequest(e,r){r==null&&(r=R4);const n=new vs(`https://${yJ(e.name)}/${r}`);return n.allowGzip=!0,r===R4&&(n.retryFunc=async(i,s,o)=>(Il("AnkrProvider"),!0)),n}getRpcError(e,r){return e.method==="eth_sendRawTransaction"&&r&&r.error&&r.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(r.error.message="replacement transaction underpriced"),super.getRpcError(e,r)}isCommunityResource(){return this.apiKey===R4}}const N4="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function wJ(t){switch(t){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}De(!1,"unsupported network","network",t)}class i1 extends vo{constructor(e,r){e==null&&(e="mainnet");const n=Si.from(e);r==null&&(r=N4);const i=i1.getRequest(n,r);super(i,n,{staticNetwork:n}),de(this,"apiKey"),Ft(this,{apiKey:r})}_getProvider(e){try{return new i1(e,this.apiKey)}catch{}return super._getProvider(e)}async _perform(e){if(e.method==="getTransactionResult"){const{trace:r,tx:n}=await Ui({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(r==null||n==null)return null;let i,s=!1;try{i=r[0].result.output,s=r[0].error==="Reverted"}catch{}if(i)return ot(!s,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:n,invocation:null,revert:null}),i;ot(!1,"could not parse trace result","BAD_DATA",{value:r})}return await super._perform(e)}isCommunityResource(){return this.apiKey===N4}static getRequest(e,r){r==null&&(r=N4);const n=new vs(`https://${wJ(e.name)}/v2/${r}`);return n.allowGzip=!0,r===N4&&(n.retryFunc=async(i,s,o)=>(Il("alchemy"),!0)),n}}function O4(t){switch(t){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}De(!1,"unsupported network","network",t)}function vJ(t){switch(t){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}De(!1,"unsupported network","network",t)}class s1 extends vo{constructor(e,r){e==null&&(e="mainnet");const n=Si.from(e);r==null&&(r=O4(n.name));const i=s1.getRequest(n,r);super(i,n,{staticNetwork:n}),de(this,"apiKey"),Ft(this,{apiKey:r})}_getProvider(e){try{return new s1(e,this.apiKey)}catch{}return super._getProvider(e)}isCommunityResource(){return this.apiKey===O4(this._network.name)}static getRequest(e,r){r==null&&(r=O4(e.name));const n=new vs(`https://${vJ(e.name)}/${r}`);return n.allowGzip=!0,r===O4(e.name)&&(n.retryFunc=async(i,s,o)=>(Il("ChainstackProvider"),!0)),n}}class Nb extends vo{constructor(e){e==null&&(e="mainnet");const r=Si.from(e);De(r.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",r,{staticNetwork:r})}}const IR=2e3;function bJ(t){return t&&typeof t.then=="function"}const RR="org.ethers.plugins.provider.Etherscan";class x4 extends fd{constructor(e){super(RR),de(this,"baseUrl"),Ft(this,{baseUrl:e})}clone(){return new x4(this.baseUrl)}}const AJ=["enableCcipRead"];let EJ=1;var og;class Ob extends Q0{constructor(e,r){const n=r??null;super(),de(this,"network"),de(this,"apiKey"),Ee(this,og);const i=Si.from(e);ne(this,og,i.getPlugin(RR)),Ft(this,{apiKey:n,network:i}),this.getBaseUrl()}getBaseUrl(){if(M(this,og))return M(this,og).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}De(!1,"unsupported network","network",this.network)}getUrl(e,r){const n=Object.keys(r).reduce((s,o)=>{const a=r[o];return a!=null&&(s+=`&${o}=${a}`),s},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${e}${n}${i}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}async detectNetwork(){return this.network}async fetch(e,r,n){const i=EJ++,s=n?this.getPostUrl():this.getUrl(e,r),o=n?this.getPostData(e,r):null;this.emit("debug",{action:"sendRequest",id:i,url:s,payload:o});const a=new vs(s);a.setThrottleParams({slotInterval:1e3}),a.retryFunc=(d,f,g)=>(this.isCommunityResource()&&Il("Etherscan"),Promise.resolve(!0)),a.processFunc=async(d,f)=>{const g=f.hasBody()?JSON.parse(ll(f.body)):{},m=(typeof g.result=="string"?g.result:"").toLowerCase().indexOf("rate limit")>=0;return e==="proxy"?g&&g.status==0&&g.message=="NOTOK"&&m&&(this.emit("debug",{action:"receiveError",id:i,reason:"proxy-NOTOK",error:g}),f.throwThrottleError(g.result,IR)):m&&(this.emit("debug",{action:"receiveError",id:i,reason:"null result",error:g.result}),f.throwThrottleError(g.result,IR)),f},o&&(a.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.body=Object.keys(o).map(d=>`${d}=${o[d]}`).join("&"));const l=await a.send();try{l.assertOk()}catch(d){this.emit("debug",{action:"receiveError",id:i,error:d,reason:"assertOk"}),ot(!1,"response error","SERVER_ERROR",{request:a,response:l})}l.hasBody()||(this.emit("debug",{action:"receiveError",id:i,error:"missing body",reason:"null body"}),ot(!1,"missing response","SERVER_ERROR",{request:a,response:l}));const u=JSON.parse(ll(l.body));return e==="proxy"?(u.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:i,result:u,reason:"invalid JSON-RPC"}),ot(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:a,response:l,info:{result:u}})),u.error&&(this.emit("debug",{action:"receiveError",id:i,result:u,reason:"JSON-RPC error"}),ot(!1,"error response","SERVER_ERROR",{request:a,response:l,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:i,result:u}),u.result):u.status==0&&(u.message==="No records found"||u.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:i,result:u}),u.result):((u.status!=1||typeof u.message=="string"&&!u.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:i,result:u}),ot(!1,"error response","SERVER_ERROR",{request:a,response:l,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:i,result:u}),u.result)}_getTransactionPostData(e){const r={};for(let n in e){if(AJ.indexOf(n)>=0||e[n]==null)continue;let i=e[n];if(!(n==="type"&&i===0)&&!(n==="blockTag"&&i==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n])i=cl(i);else if(n==="accessList")i="["+Sc(i).map(s=>`{address:"${s.address}",storageKeys:["${s.storageKeys.join('","')}"]}`).join(",")+"]";else if(n==="blobVersionedHashes"){if(i.length===0)continue;ot(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:e}})}else i=At(i);r[n]=i}}return r}_checkError(e,r,n){let i="";if(ui(r,"SERVER_ERROR")){try{i=r.info.result.error.message}catch{}if(!i)try{i=r.info.message}catch{}}if(e.method==="estimateGas"&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&ot(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),(e.method==="call"||e.method==="estimateGas")&&i.match(/execution reverted/i)){let s="";try{s=r.info.result.error.data}catch{}const o=U0.getBuiltinCallException(e.method,e.transaction,s);throw o.info={request:e,error:r},o}if(i&&e.method==="broadcastTransaction"){const s=x0.from(e.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&ot(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:s}),i.match(/insufficient funds/)&&ot(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:s}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ot(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:s})}throw r}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(r=>this._checkError(e,r,e.signedTransaction));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});ot(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if(e.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const r=this._getTransactionPostData(e.transaction);r.module="proxy",r.action="eth_call";try{return await this.fetch("proxy",r,!0)}catch(n){return this._checkError(e,n,e.transaction)}}case"estimateGas":{const r=this._getTransactionPostData(e.transaction);r.module="proxy",r.action="eth_estimateGas";try{return await this.fetch("proxy",r,!0)}catch(n){return this._checkError(e,n,e.transaction)}}}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let r=this._getAddress(e);bJ(r)&&(r=await r);try{const n=await this.fetch("contract",{action:"getabi",address:r}),i=JSON.parse(n);return new Ou(r,i,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}}og=new WeakMap;function TJ(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}const SJ=TJ().WebSocket;var Ol,P4,Ed,o1,Td;class ag{constructor(e,r){Ee(this,Ol),Ee(this,P4),Ee(this,Ed),Ee(this,o1),Ee(this,Td),ne(this,Ol,e),ne(this,P4,JSON.stringify(r)),ne(this,Ed,null),ne(this,o1,null),ne(this,Td,null)}get filter(){return JSON.parse(M(this,P4))}start(){ne(this,Ed,M(this,Ol).send("eth_subscribe",this.filter).then(e=>(M(this,Ol)._register(e,this),e)))}stop(){M(this,Ed).then(e=>{M(this,Ol).destroyed||M(this,Ol).send("eth_unsubscribe",[e])}),ne(this,Ed,null)}pause(e){ot(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),ne(this,o1,!!e)}resume(){ne(this,o1,null)}_handleMessage(e){if(M(this,Ed)!=null&&M(this,o1)===null){let r=M(this,Td);r==null?r=this._emit(M(this,Ol),e):r=r.then(async()=>{await this._emit(M(this,Ol),e)}),ne(this,Td,r.then(()=>{M(this,Td)===r&&ne(this,Td,null)}))}}async _emit(e,r){throw new Error("sub-classes must implemente this; _emit")}}Ol=new WeakMap,P4=new WeakMap,Ed=new WeakMap,o1=new WeakMap,Td=new WeakMap;class xb extends ag{constructor(e){super(e,["newHeads"])}async _emit(e,r){e.emit("block",parseInt(r.number))}}class Pb extends ag{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,r){e.emit("pending",r)}}var M4;class Mb extends ag{constructor(e,r){super(e,["logs",r]),Ee(this,M4),ne(this,M4,JSON.stringify(r))}get logFilter(){return JSON.parse(M(this,M4))}async _emit(e,r){e.emit(this.logFilter,e._wrapLog(r,e._network))}}M4=new WeakMap;var a1,cg,Sd;class Bb extends I4{constructor(e,r){const n=Object.assign({},r??{});De(n.batchMaxCount==null||n.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",r),n.batchMaxCount=1,n.staticNetwork==null&&(n.staticNetwork=!0),super(e,n),Ee(this,a1),Ee(this,cg),Ee(this,Sd),ne(this,a1,new Map),ne(this,cg,new Map),ne(this,Sd,new Map)}_getSubscriber(e){switch(e.type){case"close":return new Z0("close");case"block":return new xb(this);case"pending":return new Pb(this);case"event":return new Mb(this,e.filter);case"orphan":if(e.filter.orphan==="drop-log")return new Z0("drop-log")}return super._getSubscriber(e)}_register(e,r){M(this,cg).set(e,r);const n=M(this,Sd).get(e);if(n){for(const i of n)r._handleMessage(i);M(this,Sd).delete(e)}}async _send(e){De(!Array.isArray(e),"WebSocket does not support batch send","payload",e);const r=new Promise((n,i)=>{M(this,a1).set(e.id,{payload:e,resolve:n,reject:i})});return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await r]}async _processMessage(e){const r=JSON.parse(e);if(r&&typeof r=="object"&&"id"in r){const n=M(this,a1).get(r.id);if(n==null){this.emit("error",Nn("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:r}));return}M(this,a1).delete(r.id),n.resolve(r)}else if(r&&r.method==="eth_subscription"){const n=r.params.subscription,i=M(this,cg).get(n);if(i)i._handleMessage(r.params.result);else{let s=M(this,Sd).get(n);s==null&&(s=[],M(this,Sd).set(n,s)),s.push(r.params.result)}}else{this.emit("error",Nn("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:r}));return}}async _write(e){throw new Error("sub-classes must override this")}}a1=new WeakMap,cg=new WeakMap,Sd=new WeakMap;var c1,_c;class B4 extends Bb{constructor(e,r,n){super(r,n),Ee(this,c1),Ee(this,_c),typeof e=="string"?(ne(this,c1,()=>new SJ(e)),ne(this,_c,M(this,c1).call(this))):typeof e=="function"?(ne(this,c1,e),ne(this,_c,e())):(ne(this,c1,null),ne(this,_c,e)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(i){console.log("failed to start WebsocketProvider",i)}},this.websocket.onmessage=i=>{this._processMessage(i.data)}}get websocket(){if(M(this,_c)==null)throw new Error("websocket closed");return M(this,_c)}async _write(e){this.websocket.send(e)}async destroy(){M(this,_c)!=null&&(M(this,_c).close(),ne(this,_c,null)),super.destroy()}}c1=new WeakMap,_c=new WeakMap;const lg="84842078b09946638c03157f83405213";function CJ(t){switch(t){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}De(!1,"unsupported network","network",t)}class Ub extends B4{constructor(e,r){const n=new Cd(e,r),i=n._getConnection();ot(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const s=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(s,n._network),de(this,"projectId"),de(this,"projectSecret"),Ft(this,{projectId:n.projectId,projectSecret:n.projectSecret})}isCommunityResource(){return this.projectId===lg}}class Cd extends vo{constructor(e,r,n){e==null&&(e="mainnet");const i=Si.from(e);r==null&&(r=lg),n==null&&(n=null);const s=Cd.getRequest(i,r,n);super(s,i,{staticNetwork:i}),de(this,"projectId"),de(this,"projectSecret"),Ft(this,{projectId:r,projectSecret:n})}_getProvider(e){try{return new Cd(e,this.projectId,this.projectSecret)}catch{}return super._getProvider(e)}isCommunityResource(){return this.projectId===lg}static getWebSocketProvider(e,r){return new Ub(e,r)}static getRequest(e,r,n){r==null&&(r=lg),n==null&&(n=null);const i=new vs(`https://${CJ(e.name)}/v3/${r}`);return i.allowGzip=!0,n&&i.setCredentials("",n),r===lg&&(i.retryFunc=async(s,o,a)=>(Il("InfuraProvider"),!0)),i}}const U4="919b412a057b5e9c9b6dce193c5a60242d6efadb";function kJ(t){switch(t){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}De(!1,"unsupported network","network",t)}class l1 extends vo{constructor(e,r){e==null&&(e="mainnet");const n=Si.from(e);r==null&&(r=U4);const i=l1.getRequest(n,r);super(i,n,{staticNetwork:n}),de(this,"token"),Ft(this,{token:r})}_getProvider(e){try{return new l1(e,this.token)}catch{}return super._getProvider(e)}isCommunityResource(){return this.token===U4}static getRequest(e,r){r==null&&(r=U4);const n=new vs(`https://${kJ(e.name)}/${r}`);return n.allowGzip=!0,r===U4&&(n.retryFunc=async(i,s,o)=>(Il("QuickNodeProvider"),!0)),n}}const _J=BigInt("1"),IJ=BigInt("2");function RJ(t){for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}}function NJ(t){return new Promise(e=>{setTimeout(e,t)})}function Db(){return new Date().getTime()}function Fb(t){return JSON.stringify(t,(e,r)=>typeof r=="bigint"?{type:"bigint",value:r.toString()}:r)}const NR={stallTimeout:400,priority:1,weight:1},OR={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function OJ(t,e){for(;(t.blockNumber<0||t.blockNumber<e)&&(t._updateNumber||(t._updateNumber=(async()=>{try{const r=await t.provider.getBlockNumber();r>t.blockNumber&&(t.blockNumber=r)}catch(r){t.blockNumber=-2,t._lastFatalError=r,t._lastFatalErrorTimestamp=Db()}t._updateNumber=null})()),await t._updateNumber,t.outOfSync++,!t._lastFatalError););}function ug(t){if(t==null)return"null";if(Array.isArray(t))return"["+t.map(ug).join(",")+"]";if(typeof t=="object"&&typeof t.toJSON=="function")return ug(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":case"number":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{"+e.map(r=>`${JSON.stringify(r)}:${ug(t[r])}`).join(",")+"}"}}throw console.log("Could not serialize",t),new Error("Hmm...")}function Lb(t){if("error"in t){const r=t.error;return{tag:ug(r),value:r}}const e=t.result;return{tag:ug(e),value:e}}function D4(t,e){const r=new Map;for(const{value:i,tag:s,weight:o}of e){const a=r.get(s)||{value:i,weight:0};a.weight+=o,r.set(s,a)}let n=null;for(const i of r.values())i.weight>=t&&(!n||i.weight>n.weight)&&(n=i);if(n)return n.value}function Vb(t,e){let r=0;const n=new Map;let i=null;const s=[];for(const{value:a,tag:l,weight:u}of e)if(a instanceof Error){const d=n.get(l)||{value:a,weight:0};d.weight+=u,n.set(l,d),(i==null||d.weight>i.weight)&&(i=d)}else s.push(BigInt(a)),r+=u;if(r<t)return i&&i.weight>=t?i.value:void 0;s.sort((a,l)=>a<l?-1:l>a?1:0);const o=Math.floor(s.length/2);return s.length%2?s[o]:(s[o-1]+s[o]+_J)/IJ}function Hb(t,e){const r=D4(t,e);if(r!==void 0)return r;for(const n of e)if(n.value)return n.value}function xJ(t,e){if(t===1)return ir(Vb(t,e),"%internal");const r=new Map,n=(o,a)=>{const l=r.get(o)||{result:o,weight:0};l.weight+=a,r.set(o,l)};for(const{weight:o,value:a}of e){const l=ir(a);n(l-1,o),n(l,o),n(l+1,o)}let i=0,s;for(const{weight:o,result:a}of r.values())o>=t&&(o>i||s!=null&&o===i&&a>s)&&(i=o,s=a);return s}var bo,Du,hg,xl,xR,Wb,PR,MR,jb;class Gb extends Q0{constructor(e,r,n){super(r,n),Ee(this,xl),de(this,"quorum"),de(this,"eventQuorum"),de(this,"eventWorkers"),Ee(this,bo),Ee(this,Du),Ee(this,hg),ne(this,bo,e.map(i=>i instanceof Q0?Object.assign({provider:i},NR,OR):Object.assign({},NR,i,OR))),ne(this,Du,-2),ne(this,hg,null),n&&n.quorum!=null?this.quorum=n.quorum:this.quorum=Math.ceil(M(this,bo).reduce((i,s)=>(i+=s.weight,i),0)/2),this.eventQuorum=1,this.eventWorkers=1,De(this.quorum<=M(this,bo).reduce((i,s)=>i+s.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return M(this,bo).map(e=>{const r=Object.assign({},e);for(const n in r)n[0]==="_"&&delete r[n];return r})}async _detectNetwork(){return Si.from(Yt(await this._perform({method:"chainId"})))}async _translatePerform(e,r){switch(r.method){case"broadcastTransaction":return await e.broadcastTransaction(r.signedTransaction);case"call":return await e.call(Object.assign({},r.transaction,{blockTag:r.blockTag}));case"chainId":return(await e.getNetwork()).chainId;case"estimateGas":return await e.estimateGas(r.transaction);case"getBalance":return await e.getBalance(r.address,r.blockTag);case"getBlock":{const n="blockHash"in r?r.blockHash:r.blockTag;return await e.getBlock(n,r.includeTransactions)}case"getBlockNumber":return await e.getBlockNumber();case"getCode":return await e.getCode(r.address,r.blockTag);case"getGasPrice":return(await e.getFeeData()).gasPrice;case"getPriorityFee":return(await e.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await e.getLogs(r.filter);case"getStorage":return await e.getStorage(r.address,r.position,r.blockTag);case"getTransaction":return await e.getTransaction(r.hash);case"getTransactionCount":return await e.getTransactionCount(r.address,r.blockTag);case"getTransactionReceipt":return await e.getTransactionReceipt(r.hash);case"getTransactionResult":return await e.getTransactionResult(r.hash)}}async _perform(e){if(e.method==="broadcastTransaction"){const s=M(this,bo).map(l=>null),o=M(this,bo).map(async({provider:l,weight:u},d)=>{try{const f=await l._perform(e);s[d]=Object.assign(Lb({result:f}),{weight:u})}catch(f){s[d]=Object.assign(Lb({error:f}),{weight:u})}});for(;;){const l=s.filter(f=>f!=null);for(const{value:f}of l)if(!(f instanceof Error))return f;const u=D4(this.quorum,s.filter(f=>f!=null));if(ui(u,"INSUFFICIENT_FUNDS"))throw u;const d=o.filter((f,g)=>s[g]==null);if(d.length===0)break;await Promise.race(d)}const a=Hb(this.quorum,s);if(ot(a!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:s.map(Fb)}}),a instanceof Error)throw a;return a}await Le(this,xl,PR).call(this);const r=new Set;let n=0;for(;;){const s=Le(this,xl,Wb).call(this,r,e);if(s==null||(n+=s.config.weight,n>=this.quorum))break}const i=await Le(this,xl,jb).call(this,r,e);for(const s of r)s.perform&&s.result==null&&s.config.lateResponses++;return i}async destroy(){for(const{provider:e}of M(this,bo))e.destroy();super.destroy()}}bo=new WeakMap,Du=new WeakMap,hg=new WeakMap,xl=new WeakSet,xR=function(t){const e=Array.from(t).map(n=>n.config),r=M(this,bo).slice();RJ(r),r.sort((n,i)=>n.priority-i.priority);for(const n of r)if(!n._lastFatalError&&e.indexOf(n)===-1)return n;return null},Wb=function(t,e){const r=Le(this,xl,xR).call(this,t);if(r==null)return null;const n={config:r,result:null,didBump:!1,perform:null,staller:null},i=Db();return n.perform=(async()=>{try{r.requests++;const o=await this._translatePerform(r.provider,e);n.result={result:o}}catch(o){r.errorResponses++,n.result={error:o}}const s=Db()-i;r._totalTime+=s,r.rollingDuration=.95*r.rollingDuration+.05*s,n.perform=null})(),n.staller=(async()=>{await NJ(r.stallTimeout),n.staller=null})(),t.add(n),n},PR=async function(){let t=M(this,hg);if(!t){const e=[];M(this,bo).forEach(r=>{e.push((async()=>{await OJ(r,0),r._lastFatalError||(r._network=await r.provider.getNetwork())})())}),ne(this,hg,t=(async()=>{await Promise.all(e);let r=null;for(const n of M(this,bo)){if(n._lastFatalError)continue;const i=n._network;r==null?r=i.chainId:i.chainId!==r&&ot(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await t},MR=async function(t,e){const r=[];for(const n of t)if(n.result!=null){const{tag:i,value:s}=Lb(n.result);r.push({tag:i,value:s,weight:n.config.weight})}if(!(r.reduce((n,i)=>n+i.weight,0)<this.quorum)){switch(e.method){case"getBlockNumber":{M(this,Du)===-2&&ne(this,Du,Math.ceil(ir(Vb(this.quorum,M(this,bo).filter(i=>!i._lastFatalError).map(i=>({value:i.blockNumber,tag:ir(i.blockNumber).toString(),weight:i.weight}))))));const n=xJ(this.quorum,r);return n===void 0?void 0:(n>M(this,Du)&&ne(this,Du,n),M(this,Du))}case"getGasPrice":case"getPriorityFee":case"estimateGas":return Vb(this.quorum,r);case"getBlock":return"blockTag"in e&&e.blockTag==="pending"?Hb(this.quorum,r):D4(this.quorum,r);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return D4(this.quorum,r);case"broadcastTransaction":return Hb(this.quorum,r)}ot(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${Fb(e.method)})`})}},jb=async function(t,e){if(t.size===0)throw new Error("no runners?!");const r=[];let n=0;for(const s of t){if(s.perform&&r.push(s.perform),s.staller){r.push(s.staller);continue}s.didBump||(s.didBump=!0,n++)}const i=await Le(this,xl,MR).call(this,t,e);if(i!==void 0){if(i instanceof Error)throw i;return i}for(let s=0;s<n;s++)Le(this,xl,Wb).call(this,t,e);return ot(r.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:Array.from(t).map(s=>Fb(s.result))}}),await Promise.race(r),await Le(this,xl,jb).call(this,t,e)};function PJ(t){return t&&typeof t.send=="function"&&typeof t.close=="function"}const MJ="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function BR(t,e){e==null&&(e={});const r=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof t=="string"&&t.match(/^https?:/))return new vo(t);if(typeof t=="string"&&t.match(/^wss?:/)||PJ(t))return new B4(t);let n=null;try{n=Si.from(t)}catch{}const i=[];if(r("publicPolygon")&&n&&(n.name==="matic"?i.push(new vo("https://polygon-rpc.com/",n,{staticNetwork:n})):n.name==="matic-amoy"&&i.push(new vo("https://rpc-amoy.polygon.technology/",n,{staticNetwork:n}))),r("alchemy"))try{i.push(new i1(t,e.alchemy))}catch{}if(r("ankr")&&e.ankr!=null)try{i.push(new n1(t,e.ankr))}catch{}if(r("chainstack"))try{i.push(new s1(t,e.chainstack))}catch{}if(r("cloudflare"))try{i.push(new Nb(t))}catch{}if(r("etherscan"))try{i.push(new Ob(t,e.etherscan))}catch{}if(r("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),i.push(new Cd(t,o,a))}catch{}if(r("quicknode"))try{let o=e.quicknode;i.push(new l1(t,o))}catch{}if(ot(i.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),i.length===1)return i[0];let s=Math.floor(i.length/2);return s>2&&(s=2),n&&MJ.indexOf(n.name)!==-1&&(s=1),e&&e.quorum&&(s=e.quorum),new Gb(i,void 0,{quorum:s})}var kd,u1;const BJ=class HW extends Y0{constructor(e){super(e.provider),de(this,"signer"),Ee(this,kd),Ee(this,u1),Ft(this,{signer:e}),ne(this,kd,null),ne(this,u1,0)}async getAddress(){return this.signer.getAddress()}connect(e){return new HW(this.signer.connect(e))}async getNonce(e){if(e==="pending"){M(this,kd)==null&&ne(this,kd,super.getNonce("pending"));const r=M(this,u1);return await M(this,kd)+r}return super.getNonce(e)}increment(){yc(this,u1)._++}reset(){ne(this,u1,0),ne(this,kd,null)}async sendTransaction(e){const r=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await r,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,r,n){return this.signer.signTypedData(e,r,n)}};kd=new WeakMap,u1=new WeakMap;let UR=BJ;var dg;class zb extends _R{constructor(e,r,n){const i=Object.assign({},n??{},{batchMaxCount:1});De(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(r,i),Ee(this,dg),ne(this,dg,async(s,o)=>{const a={method:s,params:o};this.emit("debug",{action:"sendEip1193Request",payload:a});try{const l=await e.request(a);return this.emit("debug",{action:"receiveEip1193Result",result:l}),l}catch(l){const u=new Error(l.message);throw u.code=l.code,u.data=l.data,u.payload=a,this.emit("debug",{action:"receiveEip1193Error",error:u}),u}})}async send(e,r){return await this._start(),await super.send(e,r)}async _send(e){De(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const r=await M(this,dg).call(this,e.method,e.params||[]);return[{id:e.id,result:r}]}catch(r){return[{id:e.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(e,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(e,r)}async hasSigner(e){e==null&&(e=0);const r=await this.send("eth_accounts",[]);return typeof e=="number"?r.length>e:(e=e.toLowerCase(),r.filter(n=>n.toLowerCase()===e).length!==0)}async getSigner(e){if(e==null&&(e=0),!await this.hasSigner(e))try{await M(this,dg).call(this,"eth_requestAccounts",[])}catch(r){const n=r.payload;throw this.getRpcError(n,{id:n.id,error:r})}return await super.getSigner(e)}}dg=new WeakMap;const F4="62e1ad51b37b8e00394bda3b";function UJ(t){switch(t){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}De(!1,"unsupported network","network",t)}class fg extends vo{constructor(e,r,n){e==null&&(e="mainnet");const i=Si.from(e);r==null&&(r=F4),n==null&&(n=null);const s={staticNetwork:i},o=fg.getRequest(i,r,n);super(o,i,s),de(this,"applicationId"),de(this,"applicationSecret"),Ft(this,{applicationId:r,applicationSecret:n})}_getProvider(e){try{return new fg(e,this.applicationId,this.applicationSecret)}catch{}return super._getProvider(e)}static getRequest(e,r,n){r==null&&(r=F4);const i=new vs(`https://${UJ(e.name)}/v1/lb/${r}`);return i.allowGzip=!0,n&&i.setCredentials("",n),r===F4&&(i.retryFunc=async(s,o,a)=>(Il("PocketProvider"),!0)),i}isCommunityResource(){return this.applicationId===F4}}const DR=void 0;var pg;const DJ=class WW extends Y0{constructor(e,r){super(r),de(this,"address"),Ee(this,pg),De(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),ne(this,pg,e);const n=ed(this.signingKey.publicKey);Ft(this,{address:n})}get signingKey(){return M(this,pg)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new WW(M(this,pg),e)}async signTransaction(e){e=od(e);const{to:r,from:n}=await Ui({to:e.to?Li(e.to,this.provider):void 0,from:e.from?Li(e.from,this.provider):void 0});r!=null&&(e.to=r),n!=null&&(e.from=n),e.from!=null&&(De(Or(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const i=x0.from(e);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign($y(e)).serialized}async signTypedData(e,r,n){const i=await nd.resolveNames(e,r,n,async s=>{ot(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:s}});const o=await this.provider.resolveName(s);return ot(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:s}),o});return this.signingKey.sign(nd.hash(i.domain,r,i.value)).serialized}};pg=new WeakMap;let L4=DJ;const V4=" !#$%&'()*+,-./<=>?@[]^_`{|}~",FJ=/^[a-z]*$/i;function FR(t,e){let r=97;return t.reduce((n,i)=>(i===e?r++:i.match(FJ)?n.push(String.fromCharCode(r)+i):(r=97,n.push(i)),n),[])}function LJ(t,e){for(let i=V4.length-1;i>=0;i--)t=t.split(V4[i]).join(e.substring(2*i,2*i+2));const r=[],n=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(i,s,o,a)=>{if(o)for(let l=parseInt(o);l>=0;l--)r.push(";");else r.push(s.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return FR(FR(r,";"),":")}function LR(t){return De(t[0]==="0","unsupported auwl data","data",t),LJ(t.substring(1+2*V4.length),t.substring(1,1+2*V4.length))}class Zb{constructor(e){de(this,"locale"),Ft(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var gg,H4,h1,W4,$b;class j4 extends Zb{constructor(e,r,n){super(e),Ee(this,W4),Ee(this,gg),Ee(this,H4),Ee(this,h1),ne(this,gg,r),ne(this,H4,n),ne(this,h1,null)}get _data(){return M(this,gg)}_decodeWords(){return LR(M(this,gg))}getWord(e){const r=Le(this,W4,$b).call(this);return De(e>=0&&e<r.length,`invalid word index: ${e}`,"index",e),r[e]}getWordIndex(e){return Le(this,W4,$b).call(this).indexOf(e)}}gg=new WeakMap,H4=new WeakMap,h1=new WeakMap,W4=new WeakSet,$b=function(){if(M(this,h1)==null){const t=this._decodeWords();if(xa(t.join(`
@@ -548,7 +548,7 @@ table.apg-attrs a:hover {
548
548
 
549
549
  `),this.statement!==void 0&&(n+=`
550
550
  `),[n,l].join(`
551
- `)}prepareMessage(){let e;return this.version==="1"?e=this.toMessage():e=this.toMessage(),e}async verify(e,r={suppressExceptions:!1}){return new Promise((n,i)=>{var s,o,a;const l=I=>r.suppressExceptions?n(I):i(I),u=(0,Um.checkInvalidKeys)(e,no.VerifyParamsKeys);u.length>0&&l({success:!1,data:this,error:new Error(`${u.join(", ")} is/are not valid key(s) for VerifyParams.`)});const d=(0,Um.checkInvalidKeys)(r,no.VerifyOptsKeys);d.length>0&&l({success:!1,data:this,error:new Error(`${d.join(", ")} is/are not valid key(s) for VerifyOpts.`)});const{signature:f,scheme:g,domain:m,nonce:v,time:A}=e;g&&g!==this.scheme&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.SCHEME_MISMATCH,g,this.scheme)}),m&&m!==this.domain&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.DOMAIN_MISMATCH,m,this.domain)}),v&&v!==this.nonce&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.NONCE_MISMATCH,v,this.nonce)});const E=new Date(A||new Date);if(this.expirationTime){const I=new Date(this.expirationTime);E.getTime()>=I.getTime()&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.EXPIRED_MESSAGE,`${E.toISOString()} < ${I.toISOString()}`,`${E.toISOString()} >= ${I.toISOString()}`)})}if(this.notBefore){const I=new Date(this.notBefore);E.getTime()<I.getTime()&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.NOT_YET_VALID_MESSAGE,`${E.toISOString()} >= ${I.toISOString()}`,`${E.toISOString()} < ${I.toISOString()}`)})}let C;try{C=this.prepareMessage()}catch(I){l({success:!1,data:this,error:I})}let k;try{k=(0,dq.verifyMessage)(C,f)}catch(I){console.error(I)}if(k===this.address)return n({success:!0,data:this});{const I=(0,Um.checkContractWalletSignature)(this,f,r.provider).then(S=>S?{success:!0,data:this}:{success:!1,data:this,error:new no.SiweError(no.SiweErrorType.INVALID_SIGNATURE,k,`Resolved address to be ${this.address}`)}).catch(S=>({success:!1,data:this,error:S}));Promise.all([I,(a=(o=(s=r?.verificationFallback)===null||s===void 0?void 0:s.call(r,e,r,this,I))===null||o===void 0?void 0:o.then(S=>S))===null||a===void 0?void 0:a.catch(S=>S)]).then(([S,N])=>{if(N){if(N.success)return n(N);l(N)}else{if(S.success)return n(S);l(S)}})}})}}i6.SiweMessage=fq,(function(t){var e=Br&&Br.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=Br&&Br.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(i6,t),r(z9,t),r(Ya,t)})(rN);var YM={exports:{}};(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof F8=="object"&&F8.versions&&F8.versions.node;o?i=Br:s&&(i=self);for(var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),d=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],g=[1,256,65536,16777216],m=[6,1536,393216,100663296],v=[0,8,16,24],A=[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],E=[224,256,384,512],C=[128,256],k=["hex","buffer","arrayBuffer","array","digest"],I={128:168,256:136},S=i.JS_SHA3_NO_NODE_JS||!Array.isArray?function(ee){return Object.prototype.toString.call(ee)==="[object Array]"}:Array.isArray,N=l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)?function(ee){return typeof ee=="object"&&ee.buffer&&ee.buffer.constructor===ArrayBuffer}:ArrayBuffer.isView,W=function(ee){var Se=typeof ee;if(Se==="string")return[ee,!0];if(Se!=="object"||ee===null)throw new Error(e);if(l&&ee.constructor===ArrayBuffer)return[new Uint8Array(ee),!1];if(!S(ee)&&!N(ee))throw new Error(e);return[ee,!1]},G=function(ee){return W(ee)[0].length===0},L=function(ee){for(var Se=[],Oe=0;Oe<ee.length;++Oe)Se[Oe]=ee[Oe];return Se},V=function(ee,Se,Oe){return function(Ae){return new ye(ee,Se,ee).update(Ae)[Oe]()}},$=function(ee,Se,Oe){return function(Ae,fe){return new ye(ee,Se,fe).update(Ae)[Oe]()}},j=function(ee,Se,Oe){return function(Ae,fe,Z,se){return Q["cshake"+ee].update(Ae,fe,Z,se)[Oe]()}},B=function(ee,Se,Oe){return function(Ae,fe,Z,se){return Q["kmac"+ee].update(Ae,fe,Z,se)[Oe]()}},O=function(ee,Se,Oe,Ae){for(var fe=0;fe<k.length;++fe){var Z=k[fe];ee[Z]=Se(Oe,Ae,Z)}return ee},H=function(ee,Se){var Oe=V(ee,Se,"hex");return Oe.create=function(){return new ye(ee,Se,ee)},Oe.update=function(Ae){return Oe.create().update(Ae)},O(Oe,V,ee,Se)},D=function(ee,Se){var Oe=$(ee,Se,"hex");return Oe.create=function(Ae){return new ye(ee,Se,Ae)},Oe.update=function(Ae,fe){return Oe.create(fe).update(Ae)},O(Oe,$,ee,Se)},q=function(ee,Se){var Oe=I[ee],Ae=j(ee,Se,"hex");return Ae.create=function(fe,Z,se){return G(Z)&&G(se)?Q["shake"+ee].create(fe):new ye(ee,Se,fe).bytepad([Z,se],Oe)},Ae.update=function(fe,Z,se,pe){return Ae.create(Z,se,pe).update(fe)},O(Ae,j,ee,Se)},K=function(ee,Se){var Oe=I[ee],Ae=B(ee,Se,"hex");return Ae.create=function(fe,Z,se){return new ve(ee,Se,Z).bytepad(["KMAC",se],Oe).bytepad([fe],Oe)},Ae.update=function(fe,Z,se,pe){return Ae.create(fe,se,pe).update(Z)},O(Ae,B,ee,Se)},te=[{name:"keccak",padding:g,bits:E,createMethod:H},{name:"sha3",padding:m,bits:E,createMethod:H},{name:"shake",padding:d,bits:C,createMethod:D},{name:"cshake",padding:f,bits:C,createMethod:q},{name:"kmac",padding:f,bits:C,createMethod:K}],Q={},X=[],Y=0;Y<te.length;++Y)for(var re=te[Y],ue=re.bits,me=0;me<ue.length;++me){var Re=re.name+"_"+ue[me];if(X.push(Re),Q[Re]=re.createMethod(ue[me],re.padding),re.name!=="sha3"){var Te=re.name+ue[me];X.push(Te),Q[Te]=Q[Re]}}function ye(ee,Se,Oe){this.blocks=[],this.s=[],this.padding=Se,this.outputBits=Oe,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(ee<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Oe>>5,this.extraBytes=(Oe&31)>>3;for(var Ae=0;Ae<50;++Ae)this.s[Ae]=0}ye.prototype.update=function(ee){if(this.finalized)throw new Error(r);var Se=W(ee);ee=Se[0];for(var Oe=Se[1],Ae=this.blocks,fe=this.byteCount,Z=ee.length,se=this.blockCount,pe=0,Ne=this.s,xe,Ge;pe<Z;){if(this.reset)for(this.reset=!1,Ae[0]=this.block,xe=1;xe<se+1;++xe)Ae[xe]=0;if(Oe)for(xe=this.start;pe<Z&&xe<fe;++pe)Ge=ee.charCodeAt(pe),Ge<128?Ae[xe>>2]|=Ge<<v[xe++&3]:Ge<2048?(Ae[xe>>2]|=(192|Ge>>6)<<v[xe++&3],Ae[xe>>2]|=(128|Ge&63)<<v[xe++&3]):Ge<55296||Ge>=57344?(Ae[xe>>2]|=(224|Ge>>12)<<v[xe++&3],Ae[xe>>2]|=(128|Ge>>6&63)<<v[xe++&3],Ae[xe>>2]|=(128|Ge&63)<<v[xe++&3]):(Ge=65536+((Ge&1023)<<10|ee.charCodeAt(++pe)&1023),Ae[xe>>2]|=(240|Ge>>18)<<v[xe++&3],Ae[xe>>2]|=(128|Ge>>12&63)<<v[xe++&3],Ae[xe>>2]|=(128|Ge>>6&63)<<v[xe++&3],Ae[xe>>2]|=(128|Ge&63)<<v[xe++&3]);else for(xe=this.start;pe<Z&&xe<fe;++pe)Ae[xe>>2]|=ee[pe]<<v[xe++&3];if(this.lastByteIndex=xe,xe>=fe){for(this.start=xe-fe,this.block=Ae[se],xe=0;xe<se;++xe)Ne[xe]^=Ae[xe];ke(Ne),this.reset=!0}else this.start=xe}return this},ye.prototype.encode=function(ee,Se){var Oe=ee&255,Ae=1,fe=[Oe];for(ee=ee>>8,Oe=ee&255;Oe>0;)fe.unshift(Oe),ee=ee>>8,Oe=ee&255,++Ae;return Se?fe.push(Ae):fe.unshift(Ae),this.update(fe),fe.length},ye.prototype.encodeString=function(ee){var Se=W(ee);ee=Se[0];var Oe=Se[1],Ae=0,fe=ee.length;if(Oe)for(var Z=0;Z<ee.length;++Z){var se=ee.charCodeAt(Z);se<128?Ae+=1:se<2048?Ae+=2:se<55296||se>=57344?Ae+=3:(se=65536+((se&1023)<<10|ee.charCodeAt(++Z)&1023),Ae+=4)}else Ae=fe;return Ae+=this.encode(Ae*8),this.update(ee),Ae},ye.prototype.bytepad=function(ee,Se){for(var Oe=this.encode(Se),Ae=0;Ae<ee.length;++Ae)Oe+=this.encodeString(ee[Ae]);var fe=(Se-Oe%Se)%Se,Z=[];return Z.length=fe,this.update(Z),this},ye.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var ee=this.blocks,Se=this.lastByteIndex,Oe=this.blockCount,Ae=this.s;if(ee[Se>>2]|=this.padding[Se&3],this.lastByteIndex===this.byteCount)for(ee[0]=ee[Oe],Se=1;Se<Oe+1;++Se)ee[Se]=0;for(ee[Oe-1]|=2147483648,Se=0;Se<Oe;++Se)Ae[Se]^=ee[Se];ke(Ae)}},ye.prototype.toString=ye.prototype.hex=function(){this.finalize();for(var ee=this.blockCount,Se=this.s,Oe=this.outputBlocks,Ae=this.extraBytes,fe=0,Z=0,se="",pe;Z<Oe;){for(fe=0;fe<ee&&Z<Oe;++fe,++Z)pe=Se[fe],se+=u[pe>>4&15]+u[pe&15]+u[pe>>12&15]+u[pe>>8&15]+u[pe>>20&15]+u[pe>>16&15]+u[pe>>28&15]+u[pe>>24&15];Z%ee===0&&(Se=L(Se),ke(Se),fe=0)}return Ae&&(pe=Se[fe],se+=u[pe>>4&15]+u[pe&15],Ae>1&&(se+=u[pe>>12&15]+u[pe>>8&15]),Ae>2&&(se+=u[pe>>20&15]+u[pe>>16&15])),se},ye.prototype.arrayBuffer=function(){this.finalize();var ee=this.blockCount,Se=this.s,Oe=this.outputBlocks,Ae=this.extraBytes,fe=0,Z=0,se=this.outputBits>>3,pe;Ae?pe=new ArrayBuffer(Oe+1<<2):pe=new ArrayBuffer(se);for(var Ne=new Uint32Array(pe);Z<Oe;){for(fe=0;fe<ee&&Z<Oe;++fe,++Z)Ne[Z]=Se[fe];Z%ee===0&&(Se=L(Se),ke(Se))}return Ae&&(Ne[Z]=Se[fe],pe=pe.slice(0,se)),pe},ye.prototype.buffer=ye.prototype.arrayBuffer,ye.prototype.digest=ye.prototype.array=function(){this.finalize();for(var ee=this.blockCount,Se=this.s,Oe=this.outputBlocks,Ae=this.extraBytes,fe=0,Z=0,se=[],pe,Ne;Z<Oe;){for(fe=0;fe<ee&&Z<Oe;++fe,++Z)pe=Z<<2,Ne=Se[fe],se[pe]=Ne&255,se[pe+1]=Ne>>8&255,se[pe+2]=Ne>>16&255,se[pe+3]=Ne>>24&255;Z%ee===0&&(Se=L(Se),ke(Se))}return Ae&&(pe=Z<<2,Ne=Se[fe],se[pe]=Ne&255,Ae>1&&(se[pe+1]=Ne>>8&255),Ae>2&&(se[pe+2]=Ne>>16&255)),se};function ve(ee,Se,Oe){ye.call(this,ee,Se,Oe)}ve.prototype=new ye,ve.prototype.finalize=function(){return this.encode(this.outputBits,!0),ye.prototype.finalize.call(this)};var ke=function(ee){var Se,Oe,Ae,fe,Z,se,pe,Ne,xe,Ge,ie,Be,Qe,ut,Ce,_e,w,_,P,U,x,z,ce,we,Pe,Fe,$e,wt,Ar,Mr,Mt,Yi,ds,nc,Ii,pa,jn,fs,wi,Wi,ic,ps,xo,Sn,vi,oi,xt,Ns,Os,Yn,ai,Po,Mo,ji,zc,sc,bi,Cn,en,je,Ke,at,Ve;for(Ae=0;Ae<48;Ae+=2)fe=ee[0]^ee[10]^ee[20]^ee[30]^ee[40],Z=ee[1]^ee[11]^ee[21]^ee[31]^ee[41],se=ee[2]^ee[12]^ee[22]^ee[32]^ee[42],pe=ee[3]^ee[13]^ee[23]^ee[33]^ee[43],Ne=ee[4]^ee[14]^ee[24]^ee[34]^ee[44],xe=ee[5]^ee[15]^ee[25]^ee[35]^ee[45],Ge=ee[6]^ee[16]^ee[26]^ee[36]^ee[46],ie=ee[7]^ee[17]^ee[27]^ee[37]^ee[47],Be=ee[8]^ee[18]^ee[28]^ee[38]^ee[48],Qe=ee[9]^ee[19]^ee[29]^ee[39]^ee[49],Se=Be^(se<<1|pe>>>31),Oe=Qe^(pe<<1|se>>>31),ee[0]^=Se,ee[1]^=Oe,ee[10]^=Se,ee[11]^=Oe,ee[20]^=Se,ee[21]^=Oe,ee[30]^=Se,ee[31]^=Oe,ee[40]^=Se,ee[41]^=Oe,Se=fe^(Ne<<1|xe>>>31),Oe=Z^(xe<<1|Ne>>>31),ee[2]^=Se,ee[3]^=Oe,ee[12]^=Se,ee[13]^=Oe,ee[22]^=Se,ee[23]^=Oe,ee[32]^=Se,ee[33]^=Oe,ee[42]^=Se,ee[43]^=Oe,Se=se^(Ge<<1|ie>>>31),Oe=pe^(ie<<1|Ge>>>31),ee[4]^=Se,ee[5]^=Oe,ee[14]^=Se,ee[15]^=Oe,ee[24]^=Se,ee[25]^=Oe,ee[34]^=Se,ee[35]^=Oe,ee[44]^=Se,ee[45]^=Oe,Se=Ne^(Be<<1|Qe>>>31),Oe=xe^(Qe<<1|Be>>>31),ee[6]^=Se,ee[7]^=Oe,ee[16]^=Se,ee[17]^=Oe,ee[26]^=Se,ee[27]^=Oe,ee[36]^=Se,ee[37]^=Oe,ee[46]^=Se,ee[47]^=Oe,Se=Ge^(fe<<1|Z>>>31),Oe=ie^(Z<<1|fe>>>31),ee[8]^=Se,ee[9]^=Oe,ee[18]^=Se,ee[19]^=Oe,ee[28]^=Se,ee[29]^=Oe,ee[38]^=Se,ee[39]^=Oe,ee[48]^=Se,ee[49]^=Oe,ut=ee[0],Ce=ee[1],oi=ee[11]<<4|ee[10]>>>28,xt=ee[10]<<4|ee[11]>>>28,wt=ee[20]<<3|ee[21]>>>29,Ar=ee[21]<<3|ee[20]>>>29,je=ee[31]<<9|ee[30]>>>23,Ke=ee[30]<<9|ee[31]>>>23,ps=ee[40]<<18|ee[41]>>>14,xo=ee[41]<<18|ee[40]>>>14,nc=ee[2]<<1|ee[3]>>>31,Ii=ee[3]<<1|ee[2]>>>31,_e=ee[13]<<12|ee[12]>>>20,w=ee[12]<<12|ee[13]>>>20,Ns=ee[22]<<10|ee[23]>>>22,Os=ee[23]<<10|ee[22]>>>22,Mr=ee[33]<<13|ee[32]>>>19,Mt=ee[32]<<13|ee[33]>>>19,at=ee[42]<<2|ee[43]>>>30,Ve=ee[43]<<2|ee[42]>>>30,ji=ee[5]<<30|ee[4]>>>2,zc=ee[4]<<30|ee[5]>>>2,pa=ee[14]<<6|ee[15]>>>26,jn=ee[15]<<6|ee[14]>>>26,_=ee[25]<<11|ee[24]>>>21,P=ee[24]<<11|ee[25]>>>21,Yn=ee[34]<<15|ee[35]>>>17,ai=ee[35]<<15|ee[34]>>>17,Yi=ee[45]<<29|ee[44]>>>3,ds=ee[44]<<29|ee[45]>>>3,we=ee[6]<<28|ee[7]>>>4,Pe=ee[7]<<28|ee[6]>>>4,sc=ee[17]<<23|ee[16]>>>9,bi=ee[16]<<23|ee[17]>>>9,fs=ee[26]<<25|ee[27]>>>7,wi=ee[27]<<25|ee[26]>>>7,U=ee[36]<<21|ee[37]>>>11,x=ee[37]<<21|ee[36]>>>11,Po=ee[47]<<24|ee[46]>>>8,Mo=ee[46]<<24|ee[47]>>>8,Sn=ee[8]<<27|ee[9]>>>5,vi=ee[9]<<27|ee[8]>>>5,Fe=ee[18]<<20|ee[19]>>>12,$e=ee[19]<<20|ee[18]>>>12,Cn=ee[29]<<7|ee[28]>>>25,en=ee[28]<<7|ee[29]>>>25,Wi=ee[38]<<8|ee[39]>>>24,ic=ee[39]<<8|ee[38]>>>24,z=ee[48]<<14|ee[49]>>>18,ce=ee[49]<<14|ee[48]>>>18,ee[0]=ut^~_e&_,ee[1]=Ce^~w&P,ee[10]=we^~Fe&wt,ee[11]=Pe^~$e&Ar,ee[20]=nc^~pa&fs,ee[21]=Ii^~jn&wi,ee[30]=Sn^~oi&Ns,ee[31]=vi^~xt&Os,ee[40]=ji^~sc&Cn,ee[41]=zc^~bi&en,ee[2]=_e^~_&U,ee[3]=w^~P&x,ee[12]=Fe^~wt&Mr,ee[13]=$e^~Ar&Mt,ee[22]=pa^~fs&Wi,ee[23]=jn^~wi&ic,ee[32]=oi^~Ns&Yn,ee[33]=xt^~Os&ai,ee[42]=sc^~Cn&je,ee[43]=bi^~en&Ke,ee[4]=_^~U&z,ee[5]=P^~x&ce,ee[14]=wt^~Mr&Yi,ee[15]=Ar^~Mt&ds,ee[24]=fs^~Wi&ps,ee[25]=wi^~ic&xo,ee[34]=Ns^~Yn&Po,ee[35]=Os^~ai&Mo,ee[44]=Cn^~je&at,ee[45]=en^~Ke&Ve,ee[6]=U^~z&ut,ee[7]=x^~ce&Ce,ee[16]=Mr^~Yi&we,ee[17]=Mt^~ds&Pe,ee[26]=Wi^~ps&nc,ee[27]=ic^~xo&Ii,ee[36]=Yn^~Po&Sn,ee[37]=ai^~Mo&vi,ee[46]=je^~at&ji,ee[47]=Ke^~Ve&zc,ee[8]=z^~ut&_e,ee[9]=ce^~Ce&w,ee[18]=Yi^~we&Fe,ee[19]=ds^~Pe&$e,ee[28]=ps^~nc&pa,ee[29]=xo^~Ii&jn,ee[38]=Po^~Sn&oi,ee[39]=Mo^~vi&xt,ee[48]=at^~ji&sc,ee[49]=Ve^~zc&bi,ee[0]^=A[Ae],ee[1]^=A[Ae+1]};if(a)t.exports=Q;else for(Y=0;Y<X.length;++Y)i[X[Y]]=Q[X[Y]]})()})(YM);var pq=YM.exports;const gq=eZ(pq),mq=t=>{const e=t.toLowerCase().replace(/^0x/,""),r=gq.keccak_256(e);let n="0x";for(let i=0;i<e.length;i++)n+=parseInt(r[i],16)>=8?e[i].toUpperCase():e[i];return n};class KM{constructor(e){if(de(this,"name","evm"),de(this,"sdk"),de(this,"provider"),de(this,"chainConfig"),de(this,"optionsProvider"),de(this,"once",pY),de(this,"on",gY),de(this,"_emit",mY),de(this,"switchChainPromise"),!e.chainConfig.chainId||!e.chainConfig.rpcUrl)throw new Error("chainId and rpcUrl are required fields");if(!e.chainConfig.chainId.includes("0x"))throw new Error("Chain id must be a hex value 0x prefixed");this.chainConfig=e.chainConfig,e.provider&&(this.optionsProvider=e.provider)}async _initialize(e){this.sdk=e,this.sdk.on(yY.LOGOUT,()=>this.provider=void 0)}async _checkIsUserLoggedIn(){if(!this.sdk.isLoggedIn())throw new Error("User is not logged in")}async _buildProvider(){try{switch(this.sdk.getLoginProvider()){case Tg.EVM_PROVIDER:{if(!this.optionsProvider)throw new Error("EVM provider was not provided");return this.optionsProvider}case Tg.OAUTH:return new u9({rpcUrl:this.chainConfig.rpcUrl,accessToken:this.sdk.getAccessToken(),env:this.sdk.env});default:throw new Error("Cannot build evm provider")}}catch(e){throw this._emit("EVM_ERROR",e),e}}async getProvider(){return await this._checkIsUserLoggedIn(),this.provider?this.provider instanceof u9&&this.provider.setAccessToken(this.sdk.getAccessToken()):this.provider=await this._buildProvider(),this.provider}async getEthersProvider(){const e=await this.getProvider();if(!e)throw new Error("Cannot get provider");return this.isEvmProvider()&&await this._switchChainEip(this.chainConfig),new zb(e)}async switchChain(e){try{const r=await this.getProvider();switch(this.sdk.getLoginProvider()){case Tg.EVM_PROVIDER:{await this._switchChainEip(e);break}case Tg.OAUTH:{r.setRpcUrl(e.rpcUrl);break}}this.chainConfig=e,this._emit(d9.EVM_SWITCH_CHAIN,{chainConfig:e})}catch(r){throw this._emit(d9.EVM_ERROR,r),r}}getChainConfig(){return this.chainConfig}isEvmProvider(){return!!this.optionsProvider}async loginWithSignature(){if(!this.isEvmProvider())throw new Error("EVM provider was not provided");await this._switchChainEip(this.sdk.evm.getChainConfig());const[e]=await this.optionsProvider.request({method:"eth_requestAccounts"}),r=await CY(this.sdk,{scope:"openid profile email phone blockchain.evm blockchain.evm.write",responseType:"token"},{is_evm:!0});kY(r,{redirectUrl:"none"});const n=await fetch(r.toString());if(!n.ok)throw new Error(n.statusText);const{sid:i,nonce:s}=await n.json(),o=new rN.SiweMessage({domain:window.location.host,address:mq(e),statement:"Sign in with Credenza3",uri:window.location.origin,version:"1",chainId:+this.sdk.evm.getChainConfig().chainId,nonce:s}),a=o.prepareMessage(),l=await this.optionsProvider.request({method:"personal_sign",params:[a,e]}),u=await fetch(r.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({signature:l,sid:i,message:o})}),{access_token:d}=await u.json();await this.sdk._setAccessToken(d,Tg.EVM_PROVIDER)}_ensureHexChainId(e){return typeof e=="string"?e.startsWith("0x")?e:`0x${parseInt(e,10).toString(16)}`:`0x${e.toString(16)}`}async _addChainEip(e){if(!this.optionsProvider)throw new Error("EVM provider was not provided");const r=this._ensureHexChainId(e.chainId);await this.optionsProvider.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:e.displayName,rpcUrls:[e.rpcUrl],blockExplorerUrls:e.blockExplorer?[e.blockExplorer]:void 0,nativeCurrency:{name:e.nativeCurrency.name,symbol:e.nativeCurrency.symbol,decimals:e.nativeCurrency.decimals??18}}]})}async _switchChainEip(e){if(!this.optionsProvider)throw new Error("EVM provider was not provided");if(this.switchChainPromise)return this.switchChainPromise;const r=this._ensureHexChainId(e.chainId);return this.switchChainPromise=this.optionsProvider.request({method:"eth_chainId"}).then(async n=>{var i,s,o;if(n?.toLowerCase()===r.toLowerCase())throw new Error("SWITCH_CHAIN_NOT_REQUIRED");try{await this.optionsProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})}catch(a){if((a?.code??((s=(i=a?.data)==null?void 0:i.originalError)==null?void 0:s.code))===4902||(o=a?.message)!=null&&o.includes("Unrecognized chain"))await this._addChainEip(e),await this.optionsProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]});else throw a}}).catch(n=>{if(n?.message!=="SWITCH_CHAIN_NOT_REQUIRED")return Promise.reject(n)}).finally(()=>{this.switchChainPromise=void 0}),this.switchChainPromise}}de(KM,"EVM_EVENT",d9);const Ls=ws(),as=ws(null),oa=ws(),C1=ws(),Fn=ws(),K9=ws(),Cr=ws({}),Ur=ws(null),zl=ws(null),X9=ws({loading:!1,active:!1}),q9=ws(),Ro=ws();var k1=(t=>(t.OAUTH="OAUTH",t.EVM="EVM",t))(k1||{}),St=(t=>(t.POLYGON="137",t.POLYGON_AMOY="80002",t.CHILIZ_SPICY="88882",t.CHILIZ="88888",t.AVALANCHE_FUJI="43113",t.AVALANCHE="43114",t.BASE="8453",t.BASE_SEPOLIA="84532",t))(St||{}),of=(t=>(t.TESTNET="testnet",t.MAINNET="mainnet",t))(of||{}),Tt=(t=>(t.PROFILE="profile",t.LOGOUT="logout",t.LOGIN="login",t.PASSPORT_ID="passportId",t.WALLET="wallet",t.UPDATE_PROFILE="updateProfile",t.SEND_TOKENS="sendTokens",t.CONFIRM_ACCOUNT="confirmAccount",t.PAYMENT="payment",t.PAYMENT_RESULT="paymentResult",t.SCANNER="scanner",t.ERROR="error",t.LOADER="loader",t.SIGN="sign",t.RICH_ALERT="richAlert",t.ASSETS="assets",t.NAV_MENU="navMenu",t))(Tt||{}),I6=(t=>(t.CARD="CARD",t.ERC20="ERC20",t))(I6||{}),Mc=(t=>(t.WHITE="WHITE",t.BLACK="BLACK",t))(Mc||{}),af=(t=>(t.TOP="TOP",t.BOTTOM="BOTTOM",t))(af||{}),Zl=(t=>(t.LEFT="LEFT",t.RIGHT="RIGHT",t))(Zl||{}),Wu=(t=>(t.PASSPORT_ID="PASSPORT_ID",t.TOKENS_PURCHASE="TOKENS_PURCHASE",t.AIR_DROP_COIN="AIR_DROP_COIN",t.AIR_DROP_ASSET="AIR_DROP_ASSET",t.REQUEST_LOYALTY_POINTS="REQUEST_LOYALTY_POINTS",t.PASSPORT_ID_PASS="PASSPORT_ID_PASS",t))(Wu||{}),XM=(t=>(t.EMAIL="email",t.PHONE="phone",t))(XM||{}),No=(t=>(t.CREDIT_CARD="CREDIT_CARD",t.CREDENZA_BALANCE="CREDENZA_BALANCE",t))(No||{}),cf=(t=>(t.ACCESS_TOKEN="credenza:passport:accessToken",t.QR_CODE="credenza:passport:qrCode",t))(cf||{}),qM={},R6={};R6.byteLength=vq,R6.toByteArray=Aq,R6.fromByteArray=Sq;for(var Bc=[],aa=[],yq=typeof Uint8Array<"u"?Uint8Array:Array,e7="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_1=0,wq=e7.length;_1<wq;++_1)Bc[_1]=e7[_1],aa[e7.charCodeAt(_1)]=_1;aa[45]=62,aa[95]=63;function eB(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function vq(t){var e=eB(t),r=e[0],n=e[1];return(r+n)*3/4-n}function bq(t,e,r){return(e+r)*3/4-r}function Aq(t){var e,r=eB(t),n=r[0],i=r[1],s=new yq(bq(t,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)e=aa[t.charCodeAt(l)]<<18|aa[t.charCodeAt(l+1)]<<12|aa[t.charCodeAt(l+2)]<<6|aa[t.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=aa[t.charCodeAt(l)]<<2|aa[t.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=aa[t.charCodeAt(l)]<<10|aa[t.charCodeAt(l+1)]<<4|aa[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Eq(t){return Bc[t>>18&63]+Bc[t>>12&63]+Bc[t>>6&63]+Bc[t&63]}function Tq(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(Eq(n));return i.join("")}function Sq(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Tq(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(Bc[e>>2]+Bc[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Bc[e>>10]+Bc[e>>4&63]+Bc[e<<2&63]+"=")),i.join("")}var t7={};t7.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,l=(1<<a)-1,u=l>>1,d=-7,f=r?i-1:0,g=r?-1:1,m=t[e+f];for(f+=g,s=m&(1<<-d)-1,m>>=-d,d+=a;d>0;s=s*256+t[e+f],f+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+f],f+=g,d-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-u}return(m?-1:1)*o*Math.pow(2,s-n)},t7.write=function(t,e,r,n,i,s){var o,a,l,u=s*8-i-1,d=(1<<u)-1,f=d>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:s-1,v=n?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=g/l:e+=g*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*l-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+m]=a&255,m+=v,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[r+m]=o&255,m+=v,o/=256,u-=8);t[r+m-v]|=A*128};(function(t){const e=R6,r=t7,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=N,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:o,SharedArrayBuffer:a}=globalThis;d.TYPED_ARRAY_SUPPORT=l(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const U=new s(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,s.prototype),Object.setPrototypeOf(U,x),U.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function u(U){if(U>i)throw new RangeError('The value "'+U+'" is invalid for option "size"');const x=new s(U);return Object.setPrototypeOf(x,d.prototype),x}function d(U,x,z){if(typeof U=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(U)}return f(U,x,z)}d.poolSize=8192;function f(U,x,z){if(typeof U=="string")return A(U,x);if(o.isView(U))return C(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(Ce(U,o)||U&&Ce(U.buffer,o)||typeof a<"u"&&(Ce(U,a)||U&&Ce(U.buffer,a)))return k(U,x,z);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ce=U.valueOf&&U.valueOf();if(ce!=null&&ce!==U)return d.from(ce,x,z);const we=I(U);if(we)return we;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return d.from(U[Symbol.toPrimitive]("string"),x,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}d.from=function(U,x,z){return f(U,x,z)},Object.setPrototypeOf(d.prototype,s.prototype),Object.setPrototypeOf(d,s);function g(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function m(U,x,z){return g(U),U<=0?u(U):x!==void 0?typeof z=="string"?u(U).fill(x,z):u(U).fill(x):u(U)}d.alloc=function(U,x,z){return m(U,x,z)};function v(U){return g(U),u(U<0?0:S(U)|0)}d.allocUnsafe=function(U){return v(U)},d.allocUnsafeSlow=function(U){return v(U)};function A(U,x){if((typeof x!="string"||x==="")&&(x="utf8"),!d.isEncoding(x))throw new TypeError("Unknown encoding: "+x);const z=W(U,x)|0;let ce=u(z);const we=ce.write(U,x);return we!==z&&(ce=ce.slice(0,we)),ce}function E(U){const x=U.length<0?0:S(U.length)|0,z=u(x);for(let ce=0;ce<x;ce+=1)z[ce]=U[ce]&255;return z}function C(U){if(Ce(U,s)){const x=new s(U);return k(x.buffer,x.byteOffset,x.byteLength)}return E(U)}function k(U,x,z){if(x<0||U.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<x+(z||0))throw new RangeError('"length" is outside of buffer bounds');let ce;return x===void 0&&z===void 0?ce=new s(U):z===void 0?ce=new s(U,x):ce=new s(U,x,z),Object.setPrototypeOf(ce,d.prototype),ce}function I(U){if(d.isBuffer(U)){const x=S(U.length)|0,z=u(x);return z.length===0||U.copy(z,0,0,x),z}if(U.length!==void 0)return typeof U.length!="number"||_e(U.length)?u(0):E(U);if(U.type==="Buffer"&&Array.isArray(U.data))return E(U.data)}function S(U){if(U>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return U|0}function N(U){return+U!=U&&(U=0),d.alloc(+U)}d.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==d.prototype},d.compare=function(x,z){if(Ce(x,s)&&(x=d.from(x,x.offset,x.byteLength)),Ce(z,s)&&(z=d.from(z,z.offset,z.byteLength)),!d.isBuffer(x)||!d.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===z)return 0;let ce=x.length,we=z.length;for(let Pe=0,Fe=Math.min(ce,we);Pe<Fe;++Pe)if(x[Pe]!==z[Pe]){ce=x[Pe],we=z[Pe];break}return ce<we?-1:we<ce?1:0},d.isEncoding=function(x){switch(String(x).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(x,z){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return d.alloc(0);let ce;if(z===void 0)for(z=0,ce=0;ce<x.length;++ce)z+=x[ce].length;const we=d.allocUnsafe(z);let Pe=0;for(ce=0;ce<x.length;++ce){let Fe=x[ce];if(Ce(Fe,s))Pe+Fe.length>we.length?(d.isBuffer(Fe)||(Fe=d.from(Fe)),Fe.copy(we,Pe)):s.prototype.set.call(we,Fe,Pe);else if(d.isBuffer(Fe))Fe.copy(we,Pe);else throw new TypeError('"list" argument must be an Array of Buffers');Pe+=Fe.length}return we};function W(U,x){if(d.isBuffer(U))return U.length;if(o.isView(U)||Ce(U,o))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const z=U.length,ce=arguments.length>2&&arguments[2]===!0;if(!ce&&z===0)return 0;let we=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return Ge(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return Qe(U).length;default:if(we)return ce?-1:Ge(U).length;x=(""+x).toLowerCase(),we=!0}}d.byteLength=W;function G(U,x,z){let ce=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,x>>>=0,z<=x))return"";for(U||(U="utf8");;)switch(U){case"hex":return re(this,x,z);case"utf8":case"utf-8":return K(this,x,z);case"ascii":return X(this,x,z);case"latin1":case"binary":return Y(this,x,z);case"base64":return q(this,x,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,x,z);default:if(ce)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),ce=!0}}d.prototype._isBuffer=!0;function L(U,x,z){const ce=U[x];U[x]=U[z],U[z]=ce}d.prototype.swap16=function(){const x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let z=0;z<x;z+=2)L(this,z,z+1);return this},d.prototype.swap32=function(){const x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let z=0;z<x;z+=4)L(this,z,z+3),L(this,z+1,z+2);return this},d.prototype.swap64=function(){const x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let z=0;z<x;z+=8)L(this,z,z+7),L(this,z+1,z+6),L(this,z+2,z+5),L(this,z+3,z+4);return this},d.prototype.toString=function(){const x=this.length;return x===0?"":arguments.length===0?K(this,0,x):G.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(x){if(!d.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:d.compare(this,x)===0},d.prototype.inspect=function(){let x="";const z=t.INSPECT_MAX_BYTES;return x=this.toString("hex",0,z).replace(/(.{2})/g,"$1 ").trim(),this.length>z&&(x+=" ... "),"<Buffer "+x+">"},n&&(d.prototype[n]=d.prototype.inspect),d.prototype.compare=function(x,z,ce,we,Pe){if(Ce(x,s)&&(x=d.from(x,x.offset,x.byteLength)),!d.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(z===void 0&&(z=0),ce===void 0&&(ce=x?x.length:0),we===void 0&&(we=0),Pe===void 0&&(Pe=this.length),z<0||ce>x.length||we<0||Pe>this.length)throw new RangeError("out of range index");if(we>=Pe&&z>=ce)return 0;if(we>=Pe)return-1;if(z>=ce)return 1;if(z>>>=0,ce>>>=0,we>>>=0,Pe>>>=0,this===x)return 0;let Fe=Pe-we,$e=ce-z;const wt=Math.min(Fe,$e),Ar=this.slice(we,Pe),Mr=x.slice(z,ce);for(let Mt=0;Mt<wt;++Mt)if(Ar[Mt]!==Mr[Mt]){Fe=Ar[Mt],$e=Mr[Mt];break}return Fe<$e?-1:$e<Fe?1:0};function V(U,x,z,ce,we){if(U.length===0)return-1;if(typeof z=="string"?(ce=z,z=0):z>2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,_e(z)&&(z=we?0:U.length-1),z<0&&(z=U.length+z),z>=U.length){if(we)return-1;z=U.length-1}else if(z<0)if(we)z=0;else return-1;if(typeof x=="string"&&(x=d.from(x,ce)),d.isBuffer(x))return x.length===0?-1:$(U,x,z,ce,we);if(typeof x=="number")return x=x&255,typeof s.prototype.indexOf=="function"?we?s.prototype.indexOf.call(U,x,z):s.prototype.lastIndexOf.call(U,x,z):$(U,[x],z,ce,we);throw new TypeError("val must be string, number or Buffer")}function $(U,x,z,ce,we){let Pe=1,Fe=U.length,$e=x.length;if(ce!==void 0&&(ce=String(ce).toLowerCase(),ce==="ucs2"||ce==="ucs-2"||ce==="utf16le"||ce==="utf-16le")){if(U.length<2||x.length<2)return-1;Pe=2,Fe/=2,$e/=2,z/=2}function wt(Mr,Mt){return Pe===1?Mr[Mt]:Mr.readUInt16BE(Mt*Pe)}let Ar;if(we){let Mr=-1;for(Ar=z;Ar<Fe;Ar++)if(wt(U,Ar)===wt(x,Mr===-1?0:Ar-Mr)){if(Mr===-1&&(Mr=Ar),Ar-Mr+1===$e)return Mr*Pe}else Mr!==-1&&(Ar-=Ar-Mr),Mr=-1}else for(z+$e>Fe&&(z=Fe-$e),Ar=z;Ar>=0;Ar--){let Mr=!0;for(let Mt=0;Mt<$e;Mt++)if(wt(U,Ar+Mt)!==wt(x,Mt)){Mr=!1;break}if(Mr)return Ar}return-1}d.prototype.includes=function(x,z,ce){return this.indexOf(x,z,ce)!==-1},d.prototype.indexOf=function(x,z,ce){return V(this,x,z,ce,!0)},d.prototype.lastIndexOf=function(x,z,ce){return V(this,x,z,ce,!1)};function j(U,x,z,ce){z=Number(z)||0;const we=U.length-z;ce?(ce=Number(ce),ce>we&&(ce=we)):ce=we;const Pe=x.length;ce>Pe/2&&(ce=Pe/2);let Fe;for(Fe=0;Fe<ce;++Fe){const $e=parseInt(x.substr(Fe*2,2),16);if(_e($e))return Fe;U[z+Fe]=$e}return Fe}function B(U,x,z,ce){return ut(Ge(x,U.length-z),U,z,ce)}function O(U,x,z,ce){return ut(ie(x),U,z,ce)}function H(U,x,z,ce){return ut(Qe(x),U,z,ce)}function D(U,x,z,ce){return ut(Be(x,U.length-z),U,z,ce)}d.prototype.write=function(x,z,ce,we){if(z===void 0)we="utf8",ce=this.length,z=0;else if(ce===void 0&&typeof z=="string")we=z,ce=this.length,z=0;else if(isFinite(z))z=z>>>0,isFinite(ce)?(ce=ce>>>0,we===void 0&&(we="utf8")):(we=ce,ce=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Pe=this.length-z;if((ce===void 0||ce>Pe)&&(ce=Pe),x.length>0&&(ce<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");we||(we="utf8");let Fe=!1;for(;;)switch(we){case"hex":return j(this,x,z,ce);case"utf8":case"utf-8":return B(this,x,z,ce);case"ascii":case"latin1":case"binary":return O(this,x,z,ce);case"base64":return H(this,x,z,ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,x,z,ce);default:if(Fe)throw new TypeError("Unknown encoding: "+we);we=(""+we).toLowerCase(),Fe=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(U,x,z){return x===0&&z===U.length?e.fromByteArray(U):e.fromByteArray(U.slice(x,z))}function K(U,x,z){z=Math.min(U.length,z);const ce=[];let we=x;for(;we<z;){const Pe=U[we];let Fe=null,$e=Pe>239?4:Pe>223?3:Pe>191?2:1;if(we+$e<=z){let wt,Ar,Mr,Mt;switch($e){case 1:Pe<128&&(Fe=Pe);break;case 2:wt=U[we+1],(wt&192)===128&&(Mt=(Pe&31)<<6|wt&63,Mt>127&&(Fe=Mt));break;case 3:wt=U[we+1],Ar=U[we+2],(wt&192)===128&&(Ar&192)===128&&(Mt=(Pe&15)<<12|(wt&63)<<6|Ar&63,Mt>2047&&(Mt<55296||Mt>57343)&&(Fe=Mt));break;case 4:wt=U[we+1],Ar=U[we+2],Mr=U[we+3],(wt&192)===128&&(Ar&192)===128&&(Mr&192)===128&&(Mt=(Pe&15)<<18|(wt&63)<<12|(Ar&63)<<6|Mr&63,Mt>65535&&Mt<1114112&&(Fe=Mt))}}Fe===null?(Fe=65533,$e=1):Fe>65535&&(Fe-=65536,ce.push(Fe>>>10&1023|55296),Fe=56320|Fe&1023),ce.push(Fe),we+=$e}return Q(ce)}const te=4096;function Q(U){const x=U.length;if(x<=te)return String.fromCharCode.apply(String,U);let z="",ce=0;for(;ce<x;)z+=String.fromCharCode.apply(String,U.slice(ce,ce+=te));return z}function X(U,x,z){let ce="";z=Math.min(U.length,z);for(let we=x;we<z;++we)ce+=String.fromCharCode(U[we]&127);return ce}function Y(U,x,z){let ce="";z=Math.min(U.length,z);for(let we=x;we<z;++we)ce+=String.fromCharCode(U[we]);return ce}function re(U,x,z){const ce=U.length;(!x||x<0)&&(x=0),(!z||z<0||z>ce)&&(z=ce);let we="";for(let Pe=x;Pe<z;++Pe)we+=w[U[Pe]];return we}function ue(U,x,z){const ce=U.slice(x,z);let we="";for(let Pe=0;Pe<ce.length-1;Pe+=2)we+=String.fromCharCode(ce[Pe]+ce[Pe+1]*256);return we}d.prototype.slice=function(x,z){const ce=this.length;x=~~x,z=z===void 0?ce:~~z,x<0?(x+=ce,x<0&&(x=0)):x>ce&&(x=ce),z<0?(z+=ce,z<0&&(z=0)):z>ce&&(z=ce),z<x&&(z=x);const we=this.subarray(x,z);return Object.setPrototypeOf(we,d.prototype),we};function me(U,x,z){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+x>z)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(x,z,ce){x=x>>>0,z=z>>>0,ce||me(x,z,this.length);let we=this[x],Pe=1,Fe=0;for(;++Fe<z&&(Pe*=256);)we+=this[x+Fe]*Pe;return we},d.prototype.readUintBE=d.prototype.readUIntBE=function(x,z,ce){x=x>>>0,z=z>>>0,ce||me(x,z,this.length);let we=this[x+--z],Pe=1;for(;z>0&&(Pe*=256);)we+=this[x+--z]*Pe;return we},d.prototype.readUint8=d.prototype.readUInt8=function(x,z){return x=x>>>0,z||me(x,1,this.length),this[x]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(x,z){return x=x>>>0,z||me(x,2,this.length),this[x]|this[x+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(x,z){return x=x>>>0,z||me(x,2,this.length),this[x]<<8|this[x+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(x,z){return x=x>>>0,z||me(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(x,z){return x=x>>>0,z||me(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])},d.prototype.readBigUInt64LE=_(function(x){x=x>>>0,se(x,"offset");const z=this[x],ce=this[x+7];(z===void 0||ce===void 0)&&pe(x,this.length-8);const we=z+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,Pe=this[++x]+this[++x]*2**8+this[++x]*2**16+ce*2**24;return BigInt(we)+(BigInt(Pe)<<BigInt(32))}),d.prototype.readBigUInt64BE=_(function(x){x=x>>>0,se(x,"offset");const z=this[x],ce=this[x+7];(z===void 0||ce===void 0)&&pe(x,this.length-8);const we=z*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],Pe=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+ce;return(BigInt(we)<<BigInt(32))+BigInt(Pe)}),d.prototype.readIntLE=function(x,z,ce){x=x>>>0,z=z>>>0,ce||me(x,z,this.length);let we=this[x],Pe=1,Fe=0;for(;++Fe<z&&(Pe*=256);)we+=this[x+Fe]*Pe;return Pe*=128,we>=Pe&&(we-=Math.pow(2,8*z)),we},d.prototype.readIntBE=function(x,z,ce){x=x>>>0,z=z>>>0,ce||me(x,z,this.length);let we=z,Pe=1,Fe=this[x+--we];for(;we>0&&(Pe*=256);)Fe+=this[x+--we]*Pe;return Pe*=128,Fe>=Pe&&(Fe-=Math.pow(2,8*z)),Fe},d.prototype.readInt8=function(x,z){return x=x>>>0,z||me(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]},d.prototype.readInt16LE=function(x,z){x=x>>>0,z||me(x,2,this.length);const ce=this[x]|this[x+1]<<8;return ce&32768?ce|4294901760:ce},d.prototype.readInt16BE=function(x,z){x=x>>>0,z||me(x,2,this.length);const ce=this[x+1]|this[x]<<8;return ce&32768?ce|4294901760:ce},d.prototype.readInt32LE=function(x,z){return x=x>>>0,z||me(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24},d.prototype.readInt32BE=function(x,z){return x=x>>>0,z||me(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]},d.prototype.readBigInt64LE=_(function(x){x=x>>>0,se(x,"offset");const z=this[x],ce=this[x+7];(z===void 0||ce===void 0)&&pe(x,this.length-8);const we=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(ce<<24);return(BigInt(we)<<BigInt(32))+BigInt(z+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24)}),d.prototype.readBigInt64BE=_(function(x){x=x>>>0,se(x,"offset");const z=this[x],ce=this[x+7];(z===void 0||ce===void 0)&&pe(x,this.length-8);const we=(z<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(we)<<BigInt(32))+BigInt(this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+ce)}),d.prototype.readFloatLE=function(x,z){return x=x>>>0,z||me(x,4,this.length),r.read(this,x,!0,23,4)},d.prototype.readFloatBE=function(x,z){return x=x>>>0,z||me(x,4,this.length),r.read(this,x,!1,23,4)},d.prototype.readDoubleLE=function(x,z){return x=x>>>0,z||me(x,8,this.length),r.read(this,x,!0,52,8)},d.prototype.readDoubleBE=function(x,z){return x=x>>>0,z||me(x,8,this.length),r.read(this,x,!1,52,8)};function Re(U,x,z,ce,we,Pe){if(!d.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>we||x<Pe)throw new RangeError('"value" argument is out of bounds');if(z+ce>U.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(x,z,ce,we){if(x=+x,z=z>>>0,ce=ce>>>0,!we){const $e=Math.pow(2,8*ce)-1;Re(this,x,z,ce,$e,0)}let Pe=1,Fe=0;for(this[z]=x&255;++Fe<ce&&(Pe*=256);)this[z+Fe]=x/Pe&255;return z+ce},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(x,z,ce,we){if(x=+x,z=z>>>0,ce=ce>>>0,!we){const $e=Math.pow(2,8*ce)-1;Re(this,x,z,ce,$e,0)}let Pe=ce-1,Fe=1;for(this[z+Pe]=x&255;--Pe>=0&&(Fe*=256);)this[z+Pe]=x/Fe&255;return z+ce},d.prototype.writeUint8=d.prototype.writeUInt8=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,1,255,0),this[z]=x&255,z+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,2,65535,0),this[z]=x&255,this[z+1]=x>>>8,z+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,2,65535,0),this[z]=x>>>8,this[z+1]=x&255,z+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,4,4294967295,0),this[z+3]=x>>>24,this[z+2]=x>>>16,this[z+1]=x>>>8,this[z]=x&255,z+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,4,4294967295,0),this[z]=x>>>24,this[z+1]=x>>>16,this[z+2]=x>>>8,this[z+3]=x&255,z+4};function Te(U,x,z,ce,we){Z(x,ce,we,U,z,7);let Pe=Number(x&BigInt(4294967295));U[z++]=Pe,Pe=Pe>>8,U[z++]=Pe,Pe=Pe>>8,U[z++]=Pe,Pe=Pe>>8,U[z++]=Pe;let Fe=Number(x>>BigInt(32)&BigInt(4294967295));return U[z++]=Fe,Fe=Fe>>8,U[z++]=Fe,Fe=Fe>>8,U[z++]=Fe,Fe=Fe>>8,U[z++]=Fe,z}function ye(U,x,z,ce,we){Z(x,ce,we,U,z,7);let Pe=Number(x&BigInt(4294967295));U[z+7]=Pe,Pe=Pe>>8,U[z+6]=Pe,Pe=Pe>>8,U[z+5]=Pe,Pe=Pe>>8,U[z+4]=Pe;let Fe=Number(x>>BigInt(32)&BigInt(4294967295));return U[z+3]=Fe,Fe=Fe>>8,U[z+2]=Fe,Fe=Fe>>8,U[z+1]=Fe,Fe=Fe>>8,U[z]=Fe,z+8}d.prototype.writeBigUInt64LE=_(function(x,z=0){return Te(this,x,z,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=_(function(x,z=0){return ye(this,x,z,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(x,z,ce,we){if(x=+x,z=z>>>0,!we){const wt=Math.pow(2,8*ce-1);Re(this,x,z,ce,wt-1,-wt)}let Pe=0,Fe=1,$e=0;for(this[z]=x&255;++Pe<ce&&(Fe*=256);)x<0&&$e===0&&this[z+Pe-1]!==0&&($e=1),this[z+Pe]=(x/Fe>>0)-$e&255;return z+ce},d.prototype.writeIntBE=function(x,z,ce,we){if(x=+x,z=z>>>0,!we){const wt=Math.pow(2,8*ce-1);Re(this,x,z,ce,wt-1,-wt)}let Pe=ce-1,Fe=1,$e=0;for(this[z+Pe]=x&255;--Pe>=0&&(Fe*=256);)x<0&&$e===0&&this[z+Pe+1]!==0&&($e=1),this[z+Pe]=(x/Fe>>0)-$e&255;return z+ce},d.prototype.writeInt8=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,1,127,-128),x<0&&(x=255+x+1),this[z]=x&255,z+1},d.prototype.writeInt16LE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,2,32767,-32768),this[z]=x&255,this[z+1]=x>>>8,z+2},d.prototype.writeInt16BE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,2,32767,-32768),this[z]=x>>>8,this[z+1]=x&255,z+2},d.prototype.writeInt32LE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,4,2147483647,-2147483648),this[z]=x&255,this[z+1]=x>>>8,this[z+2]=x>>>16,this[z+3]=x>>>24,z+4},d.prototype.writeInt32BE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[z]=x>>>24,this[z+1]=x>>>16,this[z+2]=x>>>8,this[z+3]=x&255,z+4},d.prototype.writeBigInt64LE=_(function(x,z=0){return Te(this,x,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=_(function(x,z=0){return ye(this,x,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ve(U,x,z,ce,we,Pe){if(z+ce>U.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function ke(U,x,z,ce,we){return x=+x,z=z>>>0,we||ve(U,x,z,4),r.write(U,x,z,ce,23,4),z+4}d.prototype.writeFloatLE=function(x,z,ce){return ke(this,x,z,!0,ce)},d.prototype.writeFloatBE=function(x,z,ce){return ke(this,x,z,!1,ce)};function ee(U,x,z,ce,we){return x=+x,z=z>>>0,we||ve(U,x,z,8),r.write(U,x,z,ce,52,8),z+8}d.prototype.writeDoubleLE=function(x,z,ce){return ee(this,x,z,!0,ce)},d.prototype.writeDoubleBE=function(x,z,ce){return ee(this,x,z,!1,ce)},d.prototype.copy=function(x,z,ce,we){if(!d.isBuffer(x))throw new TypeError("argument should be a Buffer");if(ce||(ce=0),!we&&we!==0&&(we=this.length),z>=x.length&&(z=x.length),z||(z=0),we>0&&we<ce&&(we=ce),we===ce||x.length===0||this.length===0)return 0;if(z<0)throw new RangeError("targetStart out of bounds");if(ce<0||ce>=this.length)throw new RangeError("Index out of range");if(we<0)throw new RangeError("sourceEnd out of bounds");we>this.length&&(we=this.length),x.length-z<we-ce&&(we=x.length-z+ce);const Pe=we-ce;return this===x&&typeof s.prototype.copyWithin=="function"?this.copyWithin(z,ce,we):s.prototype.set.call(x,this.subarray(ce,we),z),Pe},d.prototype.fill=function(x,z,ce,we){if(typeof x=="string"){if(typeof z=="string"?(we=z,z=0,ce=this.length):typeof ce=="string"&&(we=ce,ce=this.length),we!==void 0&&typeof we!="string")throw new TypeError("encoding must be a string");if(typeof we=="string"&&!d.isEncoding(we))throw new TypeError("Unknown encoding: "+we);if(x.length===1){const Fe=x.charCodeAt(0);(we==="utf8"&&Fe<128||we==="latin1")&&(x=Fe)}}else typeof x=="number"?x=x&255:typeof x=="boolean"&&(x=Number(x));if(z<0||this.length<z||this.length<ce)throw new RangeError("Out of range index");if(ce<=z)return this;z=z>>>0,ce=ce===void 0?this.length:ce>>>0,x||(x=0);let Pe;if(typeof x=="number")for(Pe=z;Pe<ce;++Pe)this[Pe]=x;else{const Fe=d.isBuffer(x)?x:d.from(x,we),$e=Fe.length;if($e===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(Pe=0;Pe<ce-z;++Pe)this[Pe+z]=Fe[Pe%$e]}return this};const Se={};function Oe(U,x,z){Se[U]=class extends z{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(we){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:we,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}Oe("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Oe("ERR_INVALID_ARG_TYPE",function(U,x){return`The "${U}" argument must be of type number. Received type ${typeof x}`},TypeError),Oe("ERR_OUT_OF_RANGE",function(U,x,z){let ce=`The value of "${U}" is out of range.`,we=z;return Number.isInteger(z)&&Math.abs(z)>2**32?we=Ae(String(z)):typeof z=="bigint"&&(we=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(we=Ae(we)),we+="n"),ce+=` It must be ${x}. Received ${we}`,ce},RangeError);function Ae(U){let x="",z=U.length;const ce=U[0]==="-"?1:0;for(;z>=ce+4;z-=3)x=`_${U.slice(z-3,z)}${x}`;return`${U.slice(0,z)}${x}`}function fe(U,x,z){se(x,"offset"),(U[x]===void 0||U[x+z]===void 0)&&pe(x,U.length-(z+1))}function Z(U,x,z,ce,we,Pe){if(U>z||U<x){const Fe=typeof x=="bigint"?"n":"";let $e;throw x===0||x===BigInt(0)?$e=`>= 0${Fe} and < 2${Fe} ** ${(Pe+1)*8}${Fe}`:$e=`>= -(2${Fe} ** ${(Pe+1)*8-1}${Fe}) and < 2 ** ${(Pe+1)*8-1}${Fe}`,new Se.ERR_OUT_OF_RANGE("value",$e,U)}fe(ce,we,Pe)}function se(U,x){if(typeof U!="number")throw new Se.ERR_INVALID_ARG_TYPE(x,"number",U)}function pe(U,x,z){throw Math.floor(U)!==U?(se(U,z),new Se.ERR_OUT_OF_RANGE("offset","an integer",U)):x<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${x}`,U)}const Ne=/[^+/0-9A-Za-z-_]/g;function xe(U){if(U=U.split("=")[0],U=U.trim().replace(Ne,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Ge(U,x){x=x||1/0;let z;const ce=U.length;let we=null;const Pe=[];for(let Fe=0;Fe<ce;++Fe){if(z=U.charCodeAt(Fe),z>55295&&z<57344){if(!we){if(z>56319){(x-=3)>-1&&Pe.push(239,191,189);continue}else if(Fe+1===ce){(x-=3)>-1&&Pe.push(239,191,189);continue}we=z;continue}if(z<56320){(x-=3)>-1&&Pe.push(239,191,189),we=z;continue}z=(we-55296<<10|z-56320)+65536}else we&&(x-=3)>-1&&Pe.push(239,191,189);if(we=null,z<128){if((x-=1)<0)break;Pe.push(z)}else if(z<2048){if((x-=2)<0)break;Pe.push(z>>6|192,z&63|128)}else if(z<65536){if((x-=3)<0)break;Pe.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if((x-=4)<0)break;Pe.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return Pe}function ie(U){const x=[];for(let z=0;z<U.length;++z)x.push(U.charCodeAt(z)&255);return x}function Be(U,x){let z,ce,we;const Pe=[];for(let Fe=0;Fe<U.length&&!((x-=2)<0);++Fe)z=U.charCodeAt(Fe),ce=z>>8,we=z%256,Pe.push(we),Pe.push(ce);return Pe}function Qe(U){return e.toByteArray(xe(U))}function ut(U,x,z,ce){let we;for(we=0;we<ce&&!(we+z>=x.length||we>=U.length);++we)x[we+z]=U[we];return we}function Ce(U,x){return U instanceof x||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===x.name}function _e(U){return U!==U}const w=(function(){const U="0123456789abcdef",x=new Array(256);for(let z=0;z<16;++z){const ce=z*16;for(let we=0;we<16;++we)x[ce+we]=U[z]+U[we]}return x})();function _(U){return typeof BigInt>"u"?P:U}function P(){throw new Error("BigInt not supported")}})(qM);const ju=qM.Buffer;var N6={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_e8723287-b57e-4f77-a118-799ef9a9a7fa",USER:"runner",npm_config_user_agent:"pnpm/10.2.0 npm/? node/v24.14.1 linux x64",CI:"true",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_e8723287-b57e-4f77-a118-799ef9a9a7fa",RUNNER_ENVIRONMENT:"github-hosted",npm_node_execpath:"/opt/hostedtoolcache/node/24.14.1/x64/bin/node",HOME:"/home/runner",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_REPOSITORY_OWNER:"credenza-web3",npm_package_engines_node:">=20.10.0",GITHUB_RETENTION_DAYS:"90",GITHUB_HEAD_REF:"",GITHUB_REPOSITORY_OWNER_ID:"93208388",npm_config_engine_strict:"true",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",GITHUB_API_URL:"https://api.github.com",RUNNER_OS:"Linux",GITHUB_WORKFLOW:"Publish @credenza3/passport-evm",npm_config_registry:"https://registry.npmjs.org/",GITHUB_RUN_ID:"25501792251",GITHUB_BASE_REF:"",GITHUB_REF_TYPE:"branch",GITHUB_WORKFLOW_SHA:"8d1f6d56cda4d93638024d3115cafff1c9bbd619",GITHUB_ACTION_REPOSITORY:"",GITHUB_WORKFLOW_REF:"credenza-web3/passport/.github/workflows/publish_evm.yml@refs/heads/main",npm_config_node_gyp:"/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/passport/passport/packages/passport-evm/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/24.14.1/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",RUNNER_TRACKING_ID:"github_71f69092-329b-4188-bce9-f01d2d054299",TURBO_HASH:"5d014721aa16f3ba",npm_package_name:"@credenza3/passport-evm",NODE:"/opt/hostedtoolcache/node/24.14.1/x64/bin/node",GITHUB_ACTION:"__run_2",GITHUB_RUN_NUMBER:"38",GITHUB_TRIGGERING_ACTOR:"mikeavvad",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",npm_config_frozen_lockfile:"",LANG:"C.UTF-8",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"credenza-web3/passport",RUNNER_NAME:"GitHub Actions 1000001193",npm_lifecycle_script:"vite build",GITHUB_ACTION_REF:"",GITHUB_ACTIONS:"true",GITHUB_REPOSITORY_ID:"493155814",SHELL:"/bin/bash",NODE_PATH:"/home/runner/work/passport/passport/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.2_jiti@2.4.2_lightningcss@1.29.1_sass@1.99.0_yaml@2.8.3/node_modules/vite/bin/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.2_jiti@2.4.2_lightningcss@1.29.1_sass@1.99.0_yaml@2.8.3/node_modules/vite/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.2_jiti@2.4.2_lightningcss@1.29.1_sass@1.99.0_yaml@2.8.3/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules",npm_package_version:"0.4.21",npm_lifecycle_event:"build",npm_config_verify_deps_before_run:"false",GITHUB_REF_PROTECTED:"false",GITHUB_JOB:"publish-gpr",GITHUB_WORKSPACE:"/home/runner/work/passport/passport",npm_package_engines_pnpm:">=9",GITHUB_RUN_ATTEMPT:"1",GITHUB_SHA:"8d1f6d56cda4d93638024d3115cafff1c9bbd619",GITHUB_ACTOR:"mikeavvad",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR_ID:"87299315",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_e8723287-b57e-4f77-a118-799ef9a9a7fa",PWD:"/home/runner/work/passport/passport/packages/passport-evm",RUNNER_WORKSPACE:"/home/runner/work/passport",npm_execpath:"/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/bin/pnpm.cjs",GITHUB_EVENT_NAME:"push",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_e8723287-b57e-4f77-a118-799ef9a9a7fa",GITHUB_SERVER_URL:"https://github.com",npm_command:"run-script",PNPM_SCRIPT_SRC_DIR:"/home/runner/work/passport/passport/packages/passport-evm",PNPM_HOME:"/home/runner/setup-pnpm/node_modules/.bin",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_e8723287-b57e-4f77-a118-799ef9a9a7fa",INIT_CWD:"/home/runner/work/passport/passport/packages/passport-evm",NODE_ENV:"production"},Bt;if(typeof window>"u"){var tB={hostname:""};Bt={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:tB,referrer:""},screen:{width:0,height:0},location:tB,addEventListener:function(){},removeEventListener:function(){}}}else Bt=window;function rB(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function nB(t,e,r,n,i,s,o){try{var a=t[s](o),l=a.value}catch(u){r(u);return}a.done?e(l):Promise.resolve(l).then(n,i)}function r7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(l){nB(s,n,i,o,a,"next",l)}function a(l){nB(s,n,i,o,a,"throw",l)}o(void 0)})}}function O6(t,e,r){return iB()?O6=Reflect.construct:O6=function(i,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(i,a),u=new l;return o&&Fm(u,o.prototype),u},O6.apply(null,arguments)}function Cq(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,n.key,n)}}function cs(t,e,r){return e&&Cq(t.prototype,e),t}function sn(){return sn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sn.apply(this,arguments)}function n7(t){return n7=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},n7(t)}function Cs(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fm(t,e)}function kr(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function kq(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Dm(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Fm(t,e){return Fm=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Fm(t,e)}function Dr(t){"@swc/helpers - typeof";return t&&typeof Symbol<"u"&&t.constructor===Symbol?"symbol":typeof t}function _q(t,e){if(t){if(typeof t=="string")return rB(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rB(t,e)}}function x6(t){var e=typeof Map=="function"?new Map:void 0;return x6=function(n){if(n===null||!kq(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return O6(n,arguments,n7(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Fm(i,n)},x6(t)}function iB(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iB=function(){return!!t})()}function Kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=_q(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Lm(t,e){var r,n,i,s,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=u[0]&2?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(u[0]===6&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(d){u=[6,d],n=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function sB(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var Iq=Object.defineProperty,Rq=function(t,e,r){return e in t?Iq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Pt=function(t,e,r){return Rq(t,(typeof e>"u"?"undefined":Dr(e))!=="symbol"?e+"":e,r)},oB,Nq=Object.defineProperty,Oq=function(t,e,r){return e in t?Nq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},aB=function(t,e,r){return Oq(t,(typeof e>"u"?"undefined":Dr(e))!=="symbol"?e+"":e,r)},Hi=(function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t})(Hi||{}),cB={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},lB={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},P6={},xq=function(){return!!globalThis.Zone};function i7(t){if(P6[t])return P6[t];var e=globalThis[t],r=e.prototype,n=t in cB?cB[t]:void 0,i=!!(n&&n.every(function(d){var f,g;return!!((g=(f=Object.getOwnPropertyDescriptor(r,d))==null?void 0:f.get)!=null&&g.toString().includes("[native code]"))})),s=t in lB?lB[t]:void 0,o=!!(s&&s.every(function(d){var f;return typeof r[d]=="function"&&((f=r[d])==null?void 0:f.toString().includes("[native code]"))}));if(i&&o&&!xq())return P6[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?P6[t]=u:r}catch{return r}}var s7={};function Gu(t,e,r){var n,i=t+"."+String(r);if(s7[i])return s7[i].call(e);var s=i7(t),o=(n=Object.getOwnPropertyDescriptor(s,r))==null?void 0:n.get;return o?(s7[i]=o,o.call(e)):e[r]}var o7={};function uB(t,e,r){var n=t+"."+String(r);if(o7[n])return o7[n].bind(e);var i=i7(t),s=i[r];return typeof s!="function"?e[r]:(o7[n]=s,s.bind(e))}function Pq(t){return Gu("Node",t,"childNodes")}function Mq(t){return Gu("Node",t,"parentNode")}function Bq(t){return Gu("Node",t,"parentElement")}function Uq(t){return Gu("Node",t,"textContent")}function Dq(t,e){return uB("Node",t,"contains")(e)}function Fq(t){return uB("Node",t,"getRootNode")()}function Lq(t){return!t||!("host"in t)?null:Gu("ShadowRoot",t,"host")}function Vq(t){return t.styleSheets}function Hq(t){return!t||!("shadowRoot"in t)?null:Gu("Element",t,"shadowRoot")}function Wq(t,e){return Gu("Element",t,"querySelector")(e)}function jq(t,e){return Gu("Element",t,"querySelectorAll")(e)}function Gq(){return i7("MutationObserver").constructor}function zq(t,e,r){try{if(!(e in t))return function(){};var n=t[e],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,function(){t[e]=n}}catch{return function(){}}}var ks={childNodes:Pq,parentNode:Mq,parentElement:Bq,textContent:Uq,contains:Dq,getRootNode:Fq,host:Lq,styleSheets:Vq,shadowRoot:Hq,querySelector:Wq,querySelectorAll:jq,mutationObserver:Gq,patch:zq};function hB(t){return t.nodeType===t.ELEMENT_NODE}function Vm(t){var e=t&&"host"in t&&"mode"in t&&ks.host(t)||null;return!!(e&&"shadowRoot"in e&&ks.shadowRoot(e)===t)}function Hm(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function Zq(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function $q(t){var e=t.cssText;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return t.layerName===""?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}function a7(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;!r&&t.ownerNode&&t.ownerNode.ownerDocument&&(r=t.ownerNode.ownerDocument.location.href);var n=Array.from(e,function(i){return dB(i,r)}).join("");return Zq(n)}catch{return null}}function dB(t,e){if(Jq(t)){var r;try{r=a7(t.styleSheet)||$q(t)}catch{r=t.cssText}return t.styleSheet.href?U6(r,t.styleSheet.href):r}else{var n=t.cssText;return Yq(t)&&t.selectorText.includes(":")&&(n=Qq(n)),e?U6(n,e):n}}function Qq(t){var e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function Jq(t){return"styleSheet"in t}function Yq(t){return"selectorText"in t}var fB=(function(){function t(){aB(this,"idNodeMap",new Map),aB(this,"nodeMetaMap",new WeakMap)}var e=t.prototype;return e.getId=function(n){var i;if(!n)return-1;var s=(i=this.getMeta(n))==null?void 0:i.id;return s??-1},e.getNode=function(n){return this.idNodeMap.get(n)||null},e.getIds=function(){return Array.from(this.idNodeMap.keys())},e.getMeta=function(n){return this.nodeMetaMap.get(n)||null},e.removeNodeFromMap=function(n){var i=this,s=this.getId(n);this.idNodeMap.delete(s),n.childNodes&&n.childNodes.forEach(function(o){return i.removeNodeFromMap(o)})},e.has=function(n){return this.idNodeMap.has(n)},e.hasNode=function(n){return this.nodeMetaMap.has(n)},e.add=function(n,i){var s=i.id;this.idNodeMap.set(s,n),this.nodeMetaMap.set(n,i)},e.replace=function(n,i){var s=this.getNode(n);if(s){var o=this.nodeMetaMap.get(s);o&&this.nodeMetaMap.set(i,o)}this.idNodeMap.set(n,i)},e.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t})();function Kq(){return new fB}function M6(t){var e=t.element,r=t.maskInputOptions,n=t.tagName,i=t.type,s=t.value,o=t.maskInputFn,a=s||"",l=i&&lf(i);return(r[n.toLowerCase()]||l&&r[l])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function lf(t){return t.toLowerCase()}var pB="__rrweb_original__";function Xq(t){var e=t.getContext("2d");if(!e)return!0;for(var r=50,n=0;n<t.width;n+=r)for(var i=0;i<t.height;i+=r){var s=e.getImageData,o=pB in s?s[pB]:s,a=new Uint32Array(o.call(e,n,i,Math.min(r,t.width-n),Math.min(r,t.height-i)).data.buffer);if(a.some(function(l){return l!==0}))return!1}return!0}function B6(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?lf(e):null}function gB(t,e){var r;try{r=new URL(t,e??window.location.href)}catch{return null}var n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n),s;return(s=i?.[1])!=null?s:null}function qq(t){var e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var eee=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,tee=/^(?:[a-z+]+:)?\/\//i,ree=/^www\..*/i,nee=/^(data:)([^,]*),(.*)/i;function U6(t,e){return(t||"").replace(eee,function(r,n,i,s,o,a){var l=i||o||a,u=n||s||"";if(!l)return r;if(tee.test(l)||ree.test(l)||nee.test(l))return"url("+u+l+u+")";if(l[0]==="/")return"url("+u+(qq(e)+l)+u+")";var d=e.split("/"),f=l.split("/");d.pop();for(var g=Kt(f),m;!(m=g()).done;){var v=m.value;v!=="."&&(v===".."?d.pop():d.push(v))}return"url("+u+d.join("/")+u+")"})}function D6(t,e){return e===void 0&&(e=!1),e?t.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):t.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function iee(t,e,r){r===void 0&&(r=!1);var n=Array.from(e.childNodes),i=[],s=0;if(n.length>1&&t&&typeof t=="string"){for(var o=D6(t,r),a=o.length/t.length,l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){for(var u=D6(n[l].textContent,r),d=100,f=3;f<u.length&&(u[f].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,f),1)!==-1);f++);for(;f<u.length;f++){var g=u.substring(0,f),m=o.split(g),v=-1;if(m.length===2)v=m[0].length;else if(m.length>2&&m[0]===""&&n[l-1].textContent!=="")v=o.indexOf(g,1);else if(m.length===1){if(g=g.substring(0,g.length-1),m=o.split(g),m.length<=1)return i.push(t),i;f=d+1}else f===u.length-1&&(v=o.indexOf(g));if(m.length>=2&&f>d){var A=n[l-1].textContent;if(A&&typeof A=="string"){var E=D6(A).length;v=o.indexOf(g,E)}v===-1&&(v=m[0].length)}if(v!==-1){for(var C=Math.floor(v/a);C>0&&C<t.length;){if(s+=1,s>50*n.length)return i.push(t),i;var k=D6(t.substring(0,C),r);if(k.length===v){i.push(t.substring(0,C)),t=t.substring(C),o=o.substring(v);break}else k.length<v?C+=Math.max(1,Math.floor((v-k.length)/a)):C-=Math.max(1,Math.floor((k.length-v)*a))}break}}}}return i.push(t),i}function see(t,e){return iee(t,e).join("/* rr_split */")}var oee=1,aee=new RegExp("[^a-z0-9-_:]"),Wm=-2;function mB(){return oee++}function cee(t){if(kr(t,HTMLFormElement))return"form";var e=lf(t.tagName);return aee.test(e)?"div":e}var I1,yB,lee=/^[^ \t\n\r\u000c]+/,uee=/^[, \t\n\r\u000c]+/;function hee(t,e){if(e.trim()==="")return e;var r=0;function n(u){var d,f=u.exec(e.substring(r));return f?(d=f[0],r+=d.length,d):""}for(var i=[];n(uee),!(r>=e.length);){var s=n(lee);if(s.slice(-1)===",")s=R1(t,s.substring(0,s.length-1)),i.push(s);else{var o="";s=R1(t,s);for(var a=!1;;){var l=e.charAt(r);if(l===""){i.push((s+o).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((s+o).trim());break}else l==="("&&(a=!0);o+=l,r+=1}}}return i.join(", ")}var wB=new WeakMap;function R1(t,e){return!e||e.trim()===""?e:c7(t,e)}function dee(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function c7(t,e){var r=wB.get(t);if(r||(r=t.createElement("a"),wB.set(t,r)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return r.setAttribute("href",e),r.href}function vB(t,e,r,n){return n&&(r==="src"||r==="href"&&!(e==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(e==="table"||e==="td"||e==="th")?R1(t,n):r==="srcset"?hee(t,n):r==="style"?U6(n,c7(t)):e==="object"&&r==="data"?R1(t,n):n)}function bB(t,e,r){return(t==="video"||t==="audio")&&e==="autoplay"}function fee(t,e,r){try{if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch{}return!1}function F6(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return r?F6(ks.parentNode(t),e,r):!1;for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return r?F6(ks.parentNode(t),e,r):!1}function AB(t,e,r,n){var i;if(hB(t)){if(i=t,!ks.childNodes(i).length)return!1}else{if(ks.parentElement(t)===null)return!1;i=ks.parentElement(t)}try{if(typeof e=="string"){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(F6(i,e,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function pee(t,e,r){var n=t.contentWindow;if(n){var i=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var o=setTimeout(function(){i||(e(),i=!0)},r);t.addEventListener("load",function(){clearTimeout(o),i=!0,e()});return}var a="about:blank";if(n.location.href!==a||t.src===a||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}}function gee(t,e,r){var n=!1,i;try{i=t.sheet}catch{return}if(!i){var s=setTimeout(function(){n||(e(),n=!0)},r);t.addEventListener("load",function(){clearTimeout(s),n=!0,e()})}}function mee(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,s=e.blockSelector,o=e.needsMask,a=e.inlineStylesheet,l=e.maskInputOptions,u=l===void 0?{}:l,d=e.maskTextFn,f=e.maskInputFn,g=e.dataURLOptions,m=g===void 0?{}:g,v=e.inlineImages,A=e.recordCanvas,E=e.keepIframeSrcFn,C=e.newlyAddedElement,k=C===void 0?!1:C,I=e.cssCaptured,S=I===void 0?!1:I,N=yee(r,n);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Hi.Document,childNodes:[],compatMode:t.compatMode}:{type:Hi.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Hi.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:N};case t.ELEMENT_NODE:return vee(t,{doc:r,blockClass:i,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:f,dataURLOptions:m,inlineImages:v,recordCanvas:A,keepIframeSrcFn:E,newlyAddedElement:k,rootId:N});case t.TEXT_NODE:return wee(t,{doc:r,needsMask:o,maskTextFn:d,rootId:N,cssCaptured:S});case t.CDATA_SECTION_NODE:return{type:Hi.CDATA,textContent:"",rootId:N};case t.COMMENT_NODE:return{type:Hi.Comment,textContent:ks.textContent(t)||"",rootId:N};default:return!1}}function yee(t,e){if(e.hasNode(t)){var r=e.getId(t);return r===1?void 0:r}}function wee(t,e){var r=e.needsMask,n=e.maskTextFn,i=e.rootId,s=e.cssCaptured,o=ks.parentNode(t),a=o&&o.tagName,l="",u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0;return d?l="SCRIPT_PLACEHOLDER":s||(l=ks.textContent(t),u&&l&&(l=U6(l,c7(e.doc)))),!u&&!d&&l&&r&&(l=n?n(l,ks.parentElement(t)):l.replace(/[\S]/g,"*")),{type:Hi.Text,textContent:l||"",rootId:i}}function vee(t,e){for(var r=e.doc,n=e.blockClass,i=e.blockSelector,s=e.inlineStylesheet,o=e.maskInputOptions,a=o===void 0?{}:o,l=e.maskInputFn,u=e.dataURLOptions,d=u===void 0?{}:u,f=e.inlineImages,g=e.recordCanvas,m=e.keepIframeSrcFn,v=e.newlyAddedElement,A=v===void 0?!1:v,E=e.rootId,C=fee(t,n,i),k=cee(t),I={},S=t.attributes.length,N=0;N<S;N++){var W=t.attributes[N];bB(k,W.name,W.value)||(I[W.name]=vB(r,k,lf(W.name),W.value))}if(k==="link"&&s){var G=Array.from(r.styleSheets).find(function(me){return me.href===t.href}),L=null;G&&(L=a7(G)),L&&(delete I.rel,delete I.href,I._cssText=L)}if(k==="style"&&t.sheet){var V=a7(t.sheet);V&&(t.childNodes.length>1&&(V=see(V,t)),I._cssText=V)}if(k==="input"||k==="textarea"||k==="select"){var $=t.value,j=t.checked;I.type!=="radio"&&I.type!=="checkbox"&&I.type!=="submit"&&I.type!=="button"&&$?I.value=M6({element:t,type:B6(t),tagName:k,value:$,maskInputOptions:a,maskInputFn:l}):j&&(I.checked=j)}if(k==="option"&&(t.selected&&!a.select?I.selected=!0:delete I.selected),k==="dialog"&&t.open&&(I.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"),k==="canvas"&&g){if(t.__context==="2d")Xq(t)||(I.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var B=t.toDataURL(d.type,d.quality),O=r.createElement("canvas");O.width=t.width,O.height=t.height;var H=O.toDataURL(d.type,d.quality);B!==H&&(I.rr_dataURL=B)}}if(k==="img"&&f){I1||(I1=r.createElement("canvas"),yB=I1.getContext("2d"));var D=t,q=D.currentSrc||D.getAttribute("src")||"<unknown-src>",K=D.crossOrigin,te=function(){D.removeEventListener("load",te);try{I1.width=D.naturalWidth,I1.height=D.naturalHeight,yB.drawImage(D,0,0),I.rr_dataURL=I1.toDataURL(d.type,d.quality)}catch(me){if(D.crossOrigin!=="anonymous"){D.crossOrigin="anonymous",D.complete&&D.naturalWidth!==0?te():D.addEventListener("load",te);return}else console.warn("Cannot inline img src="+q+"! Error: "+me)}D.crossOrigin==="anonymous"&&(K?I.crossOrigin=K:D.removeAttribute("crossorigin"))};D.complete&&D.naturalWidth!==0?te():D.addEventListener("load",te)}if(k==="audio"||k==="video"){var Q=I;Q.rr_mediaState=t.paused?"paused":"played",Q.rr_mediaCurrentTime=t.currentTime,Q.rr_mediaPlaybackRate=t.playbackRate,Q.rr_mediaMuted=t.muted,Q.rr_mediaLoop=t.loop,Q.rr_mediaVolume=t.volume}if(A||(t.scrollLeft&&(I.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(I.rr_scrollTop=t.scrollTop)),C){var X=t.getBoundingClientRect(),Y=X.width,re=X.height;I={class:I.class,rr_width:""+Y+"px",rr_height:""+re+"px"}}k==="iframe"&&!m(I.src)&&(t.contentDocument||(I.rr_src=I.src),delete I.src);var ue;try{customElements.get(k)&&(ue=!0)}catch{}return{type:Hi.Element,tagName:k,attributes:I,childNodes:[],isSVG:dee(t)||void 0,needBlock:C,rootId:E,isCustom:ue}}function On(t){return t==null?"":t.toLowerCase()}function bee(t,e){if(e.comment&&t.type===Hi.Comment)return!0;if(t.type===Hi.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"&&t.attributes.as==="script"||t.attributes.rel==="modulepreload")||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&gB(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(On(t.attributes.name).match(/^msapplication-tile(image|color)$/)||On(t.attributes.name)==="application-name"||On(t.attributes.rel)==="icon"||On(t.attributes.rel)==="apple-touch-icon"||On(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&On(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(On(t.attributes.property).match(/^(og|twitter|fb):/)||On(t.attributes.name).match(/^(og|twitter):/)||On(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(On(t.attributes.name)==="robots"||On(t.attributes.name)==="googlebot"||On(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(On(t.attributes.name)==="author"||On(t.attributes.name)==="generator"||On(t.attributes.name)==="framework"||On(t.attributes.name)==="publisher"||On(t.attributes.name)==="progid"||On(t.attributes.property).match(/^article:/)||On(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(On(t.attributes.name)==="google-site-verification"||On(t.attributes.name)==="yandex-verification"||On(t.attributes.name)==="csrf-token"||On(t.attributes.name)==="p:domain_verify"||On(t.attributes.name)==="verify-v1"||On(t.attributes.name)==="verification"||On(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function N1(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=l===void 0?!1:l,d=e.inlineStylesheet,f=d===void 0?!0:d,g=e.maskInputOptions,m=g===void 0?{}:g,v=e.maskTextFn,A=e.maskInputFn,E=e.slimDOMOptions,C=e.dataURLOptions,k=C===void 0?{}:C,I=e.inlineImages,S=I===void 0?!1:I,N=e.recordCanvas,W=N===void 0?!1:N,G=e.onSerialize,L=e.onIframeLoad,V=e.iframeLoadTimeout,$=V===void 0?5e3:V,j=e.onStylesheetLoad,B=e.stylesheetLoadTimeout,O=B===void 0?5e3:B,H=e.keepIframeSrcFn,D=H===void 0?function(){return!1}:H,q=e.newlyAddedElement,K=q===void 0?!1:q,te=e.cssCaptured,Q=te===void 0?!1:te,X=e.needsMask,Y=e.preserveWhiteSpace,re=Y===void 0?!0:Y;if(!X){var ue=X===void 0;X=AB(t,o,a,ue)}var me=mee(t,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:X,inlineStylesheet:f,maskInputOptions:m,maskTextFn:v,maskInputFn:A,dataURLOptions:k,inlineImages:S,recordCanvas:W,keepIframeSrcFn:D,newlyAddedElement:K,cssCaptured:Q});if(!me)return console.warn(t,"not serialized"),null;var Re;n.hasNode(t)?Re=n.getId(t):bee(me,E)||!re&&me.type===Hi.Text&&!me.textContent.replace(/^\s+|\s+$/gm,"").length?Re=Wm:Re=mB();var Te=Object.assign(me,{id:Re});if(n.add(t,Te),Re===Wm)return null;G&&G(t);var ye=!u;if(Te.type===Hi.Element){ye=ye&&!Te.needBlock,delete Te.needBlock;var ve=ks.shadowRoot(t);ve&&Hm(ve)&&(Te.isShadowHost=!0)}if((Te.type===Hi.Document||Te.type===Hi.Element)&&ye){E.headWhitespace&&Te.type===Hi.Element&&Te.tagName==="head"&&(re=!1);var ke={doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:X,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:f,maskInputOptions:m,maskTextFn:v,maskInputFn:A,slimDOMOptions:E,dataURLOptions:k,inlineImages:S,recordCanvas:W,preserveWhiteSpace:re,onSerialize:G,onIframeLoad:L,iframeLoadTimeout:$,onStylesheetLoad:j,stylesheetLoadTimeout:O,keepIframeSrcFn:D,cssCaptured:!1};if(!(Te.type===Hi.Element&&Te.tagName==="textarea"&&Te.attributes.value!==void 0)){Te.type===Hi.Element&&Te.attributes._cssText!==void 0&&typeof Te.attributes._cssText=="string"&&(ke.cssCaptured=!0);for(var ee=Kt(Array.from(ks.childNodes(t))),Se;!(Se=ee()).done;){var Oe=Se.value,Ae=N1(Oe,ke);Ae&&Te.childNodes.push(Ae)}}var fe=null;if(hB(t)&&(fe=ks.shadowRoot(t)))for(var Z=Kt(Array.from(ks.childNodes(fe))),se;!(se=Z()).done;){var pe=se.value,Ne=N1(pe,ke);Ne&&(Hm(fe)&&(Ne.isShadow=!0),Te.childNodes.push(Ne))}}var xe=ks.parentNode(t);return xe&&Vm(xe)&&Hm(xe)&&(Te.isShadow=!0),Te.type===Hi.Element&&Te.tagName==="iframe"&&pee(t,function(){var Ge=t.contentDocument;if(Ge&&L){var ie=N1(Ge,{doc:Ge,mirror:n,blockClass:i,blockSelector:s,needsMask:X,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskTextFn:v,maskInputFn:A,slimDOMOptions:E,dataURLOptions:k,inlineImages:S,recordCanvas:W,preserveWhiteSpace:re,onSerialize:G,onIframeLoad:L,iframeLoadTimeout:$,onStylesheetLoad:j,stylesheetLoadTimeout:O,keepIframeSrcFn:D});ie&&L(t,ie)}},$),Te.type===Hi.Element&&Te.tagName==="link"&&typeof Te.attributes.rel=="string"&&(Te.attributes.rel==="stylesheet"||Te.attributes.rel==="preload"&&typeof Te.attributes.href=="string"&&gB(Te.attributes.href)==="css")&&gee(t,function(){if(j){var Ge=N1(t,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:X,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskTextFn:v,maskInputFn:A,slimDOMOptions:E,dataURLOptions:k,inlineImages:S,recordCanvas:W,preserveWhiteSpace:re,onSerialize:G,onIframeLoad:L,iframeLoadTimeout:$,onStylesheetLoad:j,stylesheetLoadTimeout:O,keepIframeSrcFn:D});Ge&&j(t,Ge)}},O),Te}function Aee(t,e){var r=e||{},n=r.mirror,i=n===void 0?new fB:n,s=r.blockClass,o=s===void 0?"rr-block":s,a=r.blockSelector,l=a===void 0?null:a,u=r.maskTextClass,d=u===void 0?"rr-mask":u,f=r.maskTextSelector,g=f===void 0?null:f,m=r.inlineStylesheet,v=m===void 0?!0:m,A=r.inlineImages,E=A===void 0?!1:A,C=r.recordCanvas,k=C===void 0?!1:C,I=r.maskAllInputs,S=I===void 0?!1:I,N=r.maskTextFn,W=r.maskInputFn,G=r.slimDOM,L=G===void 0?!1:G,V=r.dataURLOptions,$=r.preserveWhiteSpace,j=r.onSerialize,B=r.onIframeLoad,O=r.iframeLoadTimeout,H=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,q=r.keepIframeSrcFn,K=q===void 0?function(){return!1}:q,te=S===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:S===!1?{password:!0}:S,Q=L===!0||L==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:L==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:L===!1?{}:L;return N1(t,{doc:t,mirror:i,blockClass:o,blockSelector:l,maskTextClass:d,maskTextSelector:g,skipChild:!1,inlineStylesheet:v,maskInputOptions:te,maskTextFn:N,maskInputFn:W,slimDOMOptions:Q,dataURLOptions:V,inlineImages:E,recordCanvas:k,preserveWhiteSpace:$,onSerialize:j,onIframeLoad:B,iframeLoadTimeout:O,onStylesheetLoad:H,stylesheetLoadTimeout:D,keepIframeSrcFn:K,newlyAddedElement:!1})}function Eee(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tee(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return kr(this,n)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var l7={exports:{}},Ln=String,EB=function(){return{isColorSupported:!1,reset:Ln,bold:Ln,dim:Ln,italic:Ln,underline:Ln,inverse:Ln,hidden:Ln,strikethrough:Ln,black:Ln,red:Ln,green:Ln,yellow:Ln,blue:Ln,magenta:Ln,cyan:Ln,white:Ln,gray:Ln,bgBlack:Ln,bgRed:Ln,bgGreen:Ln,bgYellow:Ln,bgBlue:Ln,bgMagenta:Ln,bgCyan:Ln,bgWhite:Ln}};l7.exports=EB(),l7.exports.createColors=EB;var See=l7.exports,Cee={},kee=Object.freeze(Object.defineProperty({__proto__:null,default:Cee},Symbol.toStringTag,{value:"Module"})),mi=Tee(kee),TB=See,SB=mi,u7=(function(t){Cs(e,t);function e(n,i,s,o,a,l){var u;return u=t.call(this,n)||this,u.name="CssSyntaxError",u.reason=n,a&&(u.file=a),o&&(u.source=o),l&&(u.plugin=l),typeof i<"u"&&typeof s<"u"&&(typeof i=="number"?(u.line=i,u.column=s):(u.line=i.line,u.column=i.column,u.endLine=s.line,u.endColumn=s.column)),u.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(u,e),u}var r=e.prototype;return r.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},r.showSourceCode=function(i){var s=this;if(!this.source)return"";var o=this.source;i==null&&(i=TB.isColorSupported),SB&&i&&(o=SB(o));var a=o.split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,a.length),d=String(u).length,f,g;if(i){var m=TB.createColors(!0),v=m.bold,A=m.gray,E=m.red;f=function(C){return v(E(C))},g=function(C){return A(C)}}else f=g=function(C){return C};return a.slice(l,u).map(function(C,k){var I=l+1+k,S=" "+(" "+I).slice(-d)+" | ";if(I===s.line){var N=g(S.replace(/\d/g," "))+C.slice(0,s.column-1).replace(/[^\t]/g," ");return f(">")+g(S)+C+`
551
+ `)}prepareMessage(){let e;return this.version==="1"?e=this.toMessage():e=this.toMessage(),e}async verify(e,r={suppressExceptions:!1}){return new Promise((n,i)=>{var s,o,a;const l=I=>r.suppressExceptions?n(I):i(I),u=(0,Um.checkInvalidKeys)(e,no.VerifyParamsKeys);u.length>0&&l({success:!1,data:this,error:new Error(`${u.join(", ")} is/are not valid key(s) for VerifyParams.`)});const d=(0,Um.checkInvalidKeys)(r,no.VerifyOptsKeys);d.length>0&&l({success:!1,data:this,error:new Error(`${d.join(", ")} is/are not valid key(s) for VerifyOpts.`)});const{signature:f,scheme:g,domain:m,nonce:v,time:A}=e;g&&g!==this.scheme&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.SCHEME_MISMATCH,g,this.scheme)}),m&&m!==this.domain&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.DOMAIN_MISMATCH,m,this.domain)}),v&&v!==this.nonce&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.NONCE_MISMATCH,v,this.nonce)});const E=new Date(A||new Date);if(this.expirationTime){const I=new Date(this.expirationTime);E.getTime()>=I.getTime()&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.EXPIRED_MESSAGE,`${E.toISOString()} < ${I.toISOString()}`,`${E.toISOString()} >= ${I.toISOString()}`)})}if(this.notBefore){const I=new Date(this.notBefore);E.getTime()<I.getTime()&&l({success:!1,data:this,error:new no.SiweError(no.SiweErrorType.NOT_YET_VALID_MESSAGE,`${E.toISOString()} >= ${I.toISOString()}`,`${E.toISOString()} < ${I.toISOString()}`)})}let C;try{C=this.prepareMessage()}catch(I){l({success:!1,data:this,error:I})}let k;try{k=(0,dq.verifyMessage)(C,f)}catch(I){console.error(I)}if(k===this.address)return n({success:!0,data:this});{const I=(0,Um.checkContractWalletSignature)(this,f,r.provider).then(S=>S?{success:!0,data:this}:{success:!1,data:this,error:new no.SiweError(no.SiweErrorType.INVALID_SIGNATURE,k,`Resolved address to be ${this.address}`)}).catch(S=>({success:!1,data:this,error:S}));Promise.all([I,(a=(o=(s=r?.verificationFallback)===null||s===void 0?void 0:s.call(r,e,r,this,I))===null||o===void 0?void 0:o.then(S=>S))===null||a===void 0?void 0:a.catch(S=>S)]).then(([S,N])=>{if(N){if(N.success)return n(N);l(N)}else{if(S.success)return n(S);l(S)}})}})}}i6.SiweMessage=fq,(function(t){var e=Br&&Br.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=Br&&Br.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(i6,t),r(z9,t),r(Ya,t)})(rN);var YM={exports:{}};(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof F8=="object"&&F8.versions&&F8.versions.node;o?i=Br:s&&(i=self);for(var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),d=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],g=[1,256,65536,16777216],m=[6,1536,393216,100663296],v=[0,8,16,24],A=[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],E=[224,256,384,512],C=[128,256],k=["hex","buffer","arrayBuffer","array","digest"],I={128:168,256:136},S=i.JS_SHA3_NO_NODE_JS||!Array.isArray?function(ee){return Object.prototype.toString.call(ee)==="[object Array]"}:Array.isArray,N=l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)?function(ee){return typeof ee=="object"&&ee.buffer&&ee.buffer.constructor===ArrayBuffer}:ArrayBuffer.isView,W=function(ee){var Se=typeof ee;if(Se==="string")return[ee,!0];if(Se!=="object"||ee===null)throw new Error(e);if(l&&ee.constructor===ArrayBuffer)return[new Uint8Array(ee),!1];if(!S(ee)&&!N(ee))throw new Error(e);return[ee,!1]},G=function(ee){return W(ee)[0].length===0},L=function(ee){for(var Se=[],Oe=0;Oe<ee.length;++Oe)Se[Oe]=ee[Oe];return Se},V=function(ee,Se,Oe){return function(Ae){return new ye(ee,Se,ee).update(Ae)[Oe]()}},$=function(ee,Se,Oe){return function(Ae,fe){return new ye(ee,Se,fe).update(Ae)[Oe]()}},j=function(ee,Se,Oe){return function(Ae,fe,Z,se){return Q["cshake"+ee].update(Ae,fe,Z,se)[Oe]()}},B=function(ee,Se,Oe){return function(Ae,fe,Z,se){return Q["kmac"+ee].update(Ae,fe,Z,se)[Oe]()}},O=function(ee,Se,Oe,Ae){for(var fe=0;fe<k.length;++fe){var Z=k[fe];ee[Z]=Se(Oe,Ae,Z)}return ee},H=function(ee,Se){var Oe=V(ee,Se,"hex");return Oe.create=function(){return new ye(ee,Se,ee)},Oe.update=function(Ae){return Oe.create().update(Ae)},O(Oe,V,ee,Se)},D=function(ee,Se){var Oe=$(ee,Se,"hex");return Oe.create=function(Ae){return new ye(ee,Se,Ae)},Oe.update=function(Ae,fe){return Oe.create(fe).update(Ae)},O(Oe,$,ee,Se)},q=function(ee,Se){var Oe=I[ee],Ae=j(ee,Se,"hex");return Ae.create=function(fe,Z,se){return G(Z)&&G(se)?Q["shake"+ee].create(fe):new ye(ee,Se,fe).bytepad([Z,se],Oe)},Ae.update=function(fe,Z,se,pe){return Ae.create(Z,se,pe).update(fe)},O(Ae,j,ee,Se)},K=function(ee,Se){var Oe=I[ee],Ae=B(ee,Se,"hex");return Ae.create=function(fe,Z,se){return new ve(ee,Se,Z).bytepad(["KMAC",se],Oe).bytepad([fe],Oe)},Ae.update=function(fe,Z,se,pe){return Ae.create(fe,se,pe).update(Z)},O(Ae,B,ee,Se)},te=[{name:"keccak",padding:g,bits:E,createMethod:H},{name:"sha3",padding:m,bits:E,createMethod:H},{name:"shake",padding:d,bits:C,createMethod:D},{name:"cshake",padding:f,bits:C,createMethod:q},{name:"kmac",padding:f,bits:C,createMethod:K}],Q={},X=[],Y=0;Y<te.length;++Y)for(var re=te[Y],ue=re.bits,me=0;me<ue.length;++me){var Re=re.name+"_"+ue[me];if(X.push(Re),Q[Re]=re.createMethod(ue[me],re.padding),re.name!=="sha3"){var Te=re.name+ue[me];X.push(Te),Q[Te]=Q[Re]}}function ye(ee,Se,Oe){this.blocks=[],this.s=[],this.padding=Se,this.outputBits=Oe,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(ee<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Oe>>5,this.extraBytes=(Oe&31)>>3;for(var Ae=0;Ae<50;++Ae)this.s[Ae]=0}ye.prototype.update=function(ee){if(this.finalized)throw new Error(r);var Se=W(ee);ee=Se[0];for(var Oe=Se[1],Ae=this.blocks,fe=this.byteCount,Z=ee.length,se=this.blockCount,pe=0,Ne=this.s,xe,Ge;pe<Z;){if(this.reset)for(this.reset=!1,Ae[0]=this.block,xe=1;xe<se+1;++xe)Ae[xe]=0;if(Oe)for(xe=this.start;pe<Z&&xe<fe;++pe)Ge=ee.charCodeAt(pe),Ge<128?Ae[xe>>2]|=Ge<<v[xe++&3]:Ge<2048?(Ae[xe>>2]|=(192|Ge>>6)<<v[xe++&3],Ae[xe>>2]|=(128|Ge&63)<<v[xe++&3]):Ge<55296||Ge>=57344?(Ae[xe>>2]|=(224|Ge>>12)<<v[xe++&3],Ae[xe>>2]|=(128|Ge>>6&63)<<v[xe++&3],Ae[xe>>2]|=(128|Ge&63)<<v[xe++&3]):(Ge=65536+((Ge&1023)<<10|ee.charCodeAt(++pe)&1023),Ae[xe>>2]|=(240|Ge>>18)<<v[xe++&3],Ae[xe>>2]|=(128|Ge>>12&63)<<v[xe++&3],Ae[xe>>2]|=(128|Ge>>6&63)<<v[xe++&3],Ae[xe>>2]|=(128|Ge&63)<<v[xe++&3]);else for(xe=this.start;pe<Z&&xe<fe;++pe)Ae[xe>>2]|=ee[pe]<<v[xe++&3];if(this.lastByteIndex=xe,xe>=fe){for(this.start=xe-fe,this.block=Ae[se],xe=0;xe<se;++xe)Ne[xe]^=Ae[xe];ke(Ne),this.reset=!0}else this.start=xe}return this},ye.prototype.encode=function(ee,Se){var Oe=ee&255,Ae=1,fe=[Oe];for(ee=ee>>8,Oe=ee&255;Oe>0;)fe.unshift(Oe),ee=ee>>8,Oe=ee&255,++Ae;return Se?fe.push(Ae):fe.unshift(Ae),this.update(fe),fe.length},ye.prototype.encodeString=function(ee){var Se=W(ee);ee=Se[0];var Oe=Se[1],Ae=0,fe=ee.length;if(Oe)for(var Z=0;Z<ee.length;++Z){var se=ee.charCodeAt(Z);se<128?Ae+=1:se<2048?Ae+=2:se<55296||se>=57344?Ae+=3:(se=65536+((se&1023)<<10|ee.charCodeAt(++Z)&1023),Ae+=4)}else Ae=fe;return Ae+=this.encode(Ae*8),this.update(ee),Ae},ye.prototype.bytepad=function(ee,Se){for(var Oe=this.encode(Se),Ae=0;Ae<ee.length;++Ae)Oe+=this.encodeString(ee[Ae]);var fe=(Se-Oe%Se)%Se,Z=[];return Z.length=fe,this.update(Z),this},ye.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var ee=this.blocks,Se=this.lastByteIndex,Oe=this.blockCount,Ae=this.s;if(ee[Se>>2]|=this.padding[Se&3],this.lastByteIndex===this.byteCount)for(ee[0]=ee[Oe],Se=1;Se<Oe+1;++Se)ee[Se]=0;for(ee[Oe-1]|=2147483648,Se=0;Se<Oe;++Se)Ae[Se]^=ee[Se];ke(Ae)}},ye.prototype.toString=ye.prototype.hex=function(){this.finalize();for(var ee=this.blockCount,Se=this.s,Oe=this.outputBlocks,Ae=this.extraBytes,fe=0,Z=0,se="",pe;Z<Oe;){for(fe=0;fe<ee&&Z<Oe;++fe,++Z)pe=Se[fe],se+=u[pe>>4&15]+u[pe&15]+u[pe>>12&15]+u[pe>>8&15]+u[pe>>20&15]+u[pe>>16&15]+u[pe>>28&15]+u[pe>>24&15];Z%ee===0&&(Se=L(Se),ke(Se),fe=0)}return Ae&&(pe=Se[fe],se+=u[pe>>4&15]+u[pe&15],Ae>1&&(se+=u[pe>>12&15]+u[pe>>8&15]),Ae>2&&(se+=u[pe>>20&15]+u[pe>>16&15])),se},ye.prototype.arrayBuffer=function(){this.finalize();var ee=this.blockCount,Se=this.s,Oe=this.outputBlocks,Ae=this.extraBytes,fe=0,Z=0,se=this.outputBits>>3,pe;Ae?pe=new ArrayBuffer(Oe+1<<2):pe=new ArrayBuffer(se);for(var Ne=new Uint32Array(pe);Z<Oe;){for(fe=0;fe<ee&&Z<Oe;++fe,++Z)Ne[Z]=Se[fe];Z%ee===0&&(Se=L(Se),ke(Se))}return Ae&&(Ne[Z]=Se[fe],pe=pe.slice(0,se)),pe},ye.prototype.buffer=ye.prototype.arrayBuffer,ye.prototype.digest=ye.prototype.array=function(){this.finalize();for(var ee=this.blockCount,Se=this.s,Oe=this.outputBlocks,Ae=this.extraBytes,fe=0,Z=0,se=[],pe,Ne;Z<Oe;){for(fe=0;fe<ee&&Z<Oe;++fe,++Z)pe=Z<<2,Ne=Se[fe],se[pe]=Ne&255,se[pe+1]=Ne>>8&255,se[pe+2]=Ne>>16&255,se[pe+3]=Ne>>24&255;Z%ee===0&&(Se=L(Se),ke(Se))}return Ae&&(pe=Z<<2,Ne=Se[fe],se[pe]=Ne&255,Ae>1&&(se[pe+1]=Ne>>8&255),Ae>2&&(se[pe+2]=Ne>>16&255)),se};function ve(ee,Se,Oe){ye.call(this,ee,Se,Oe)}ve.prototype=new ye,ve.prototype.finalize=function(){return this.encode(this.outputBits,!0),ye.prototype.finalize.call(this)};var ke=function(ee){var Se,Oe,Ae,fe,Z,se,pe,Ne,xe,Ge,ie,Be,Qe,ut,Ce,_e,w,_,P,U,x,z,ce,we,Pe,Fe,$e,wt,Ar,Mr,Mt,Yi,ds,nc,Ii,pa,jn,fs,wi,Wi,ic,ps,xo,Sn,vi,oi,xt,Ns,Os,Yn,ai,Po,Mo,ji,zc,sc,bi,Cn,en,je,Ke,at,Ve;for(Ae=0;Ae<48;Ae+=2)fe=ee[0]^ee[10]^ee[20]^ee[30]^ee[40],Z=ee[1]^ee[11]^ee[21]^ee[31]^ee[41],se=ee[2]^ee[12]^ee[22]^ee[32]^ee[42],pe=ee[3]^ee[13]^ee[23]^ee[33]^ee[43],Ne=ee[4]^ee[14]^ee[24]^ee[34]^ee[44],xe=ee[5]^ee[15]^ee[25]^ee[35]^ee[45],Ge=ee[6]^ee[16]^ee[26]^ee[36]^ee[46],ie=ee[7]^ee[17]^ee[27]^ee[37]^ee[47],Be=ee[8]^ee[18]^ee[28]^ee[38]^ee[48],Qe=ee[9]^ee[19]^ee[29]^ee[39]^ee[49],Se=Be^(se<<1|pe>>>31),Oe=Qe^(pe<<1|se>>>31),ee[0]^=Se,ee[1]^=Oe,ee[10]^=Se,ee[11]^=Oe,ee[20]^=Se,ee[21]^=Oe,ee[30]^=Se,ee[31]^=Oe,ee[40]^=Se,ee[41]^=Oe,Se=fe^(Ne<<1|xe>>>31),Oe=Z^(xe<<1|Ne>>>31),ee[2]^=Se,ee[3]^=Oe,ee[12]^=Se,ee[13]^=Oe,ee[22]^=Se,ee[23]^=Oe,ee[32]^=Se,ee[33]^=Oe,ee[42]^=Se,ee[43]^=Oe,Se=se^(Ge<<1|ie>>>31),Oe=pe^(ie<<1|Ge>>>31),ee[4]^=Se,ee[5]^=Oe,ee[14]^=Se,ee[15]^=Oe,ee[24]^=Se,ee[25]^=Oe,ee[34]^=Se,ee[35]^=Oe,ee[44]^=Se,ee[45]^=Oe,Se=Ne^(Be<<1|Qe>>>31),Oe=xe^(Qe<<1|Be>>>31),ee[6]^=Se,ee[7]^=Oe,ee[16]^=Se,ee[17]^=Oe,ee[26]^=Se,ee[27]^=Oe,ee[36]^=Se,ee[37]^=Oe,ee[46]^=Se,ee[47]^=Oe,Se=Ge^(fe<<1|Z>>>31),Oe=ie^(Z<<1|fe>>>31),ee[8]^=Se,ee[9]^=Oe,ee[18]^=Se,ee[19]^=Oe,ee[28]^=Se,ee[29]^=Oe,ee[38]^=Se,ee[39]^=Oe,ee[48]^=Se,ee[49]^=Oe,ut=ee[0],Ce=ee[1],oi=ee[11]<<4|ee[10]>>>28,xt=ee[10]<<4|ee[11]>>>28,wt=ee[20]<<3|ee[21]>>>29,Ar=ee[21]<<3|ee[20]>>>29,je=ee[31]<<9|ee[30]>>>23,Ke=ee[30]<<9|ee[31]>>>23,ps=ee[40]<<18|ee[41]>>>14,xo=ee[41]<<18|ee[40]>>>14,nc=ee[2]<<1|ee[3]>>>31,Ii=ee[3]<<1|ee[2]>>>31,_e=ee[13]<<12|ee[12]>>>20,w=ee[12]<<12|ee[13]>>>20,Ns=ee[22]<<10|ee[23]>>>22,Os=ee[23]<<10|ee[22]>>>22,Mr=ee[33]<<13|ee[32]>>>19,Mt=ee[32]<<13|ee[33]>>>19,at=ee[42]<<2|ee[43]>>>30,Ve=ee[43]<<2|ee[42]>>>30,ji=ee[5]<<30|ee[4]>>>2,zc=ee[4]<<30|ee[5]>>>2,pa=ee[14]<<6|ee[15]>>>26,jn=ee[15]<<6|ee[14]>>>26,_=ee[25]<<11|ee[24]>>>21,P=ee[24]<<11|ee[25]>>>21,Yn=ee[34]<<15|ee[35]>>>17,ai=ee[35]<<15|ee[34]>>>17,Yi=ee[45]<<29|ee[44]>>>3,ds=ee[44]<<29|ee[45]>>>3,we=ee[6]<<28|ee[7]>>>4,Pe=ee[7]<<28|ee[6]>>>4,sc=ee[17]<<23|ee[16]>>>9,bi=ee[16]<<23|ee[17]>>>9,fs=ee[26]<<25|ee[27]>>>7,wi=ee[27]<<25|ee[26]>>>7,U=ee[36]<<21|ee[37]>>>11,x=ee[37]<<21|ee[36]>>>11,Po=ee[47]<<24|ee[46]>>>8,Mo=ee[46]<<24|ee[47]>>>8,Sn=ee[8]<<27|ee[9]>>>5,vi=ee[9]<<27|ee[8]>>>5,Fe=ee[18]<<20|ee[19]>>>12,$e=ee[19]<<20|ee[18]>>>12,Cn=ee[29]<<7|ee[28]>>>25,en=ee[28]<<7|ee[29]>>>25,Wi=ee[38]<<8|ee[39]>>>24,ic=ee[39]<<8|ee[38]>>>24,z=ee[48]<<14|ee[49]>>>18,ce=ee[49]<<14|ee[48]>>>18,ee[0]=ut^~_e&_,ee[1]=Ce^~w&P,ee[10]=we^~Fe&wt,ee[11]=Pe^~$e&Ar,ee[20]=nc^~pa&fs,ee[21]=Ii^~jn&wi,ee[30]=Sn^~oi&Ns,ee[31]=vi^~xt&Os,ee[40]=ji^~sc&Cn,ee[41]=zc^~bi&en,ee[2]=_e^~_&U,ee[3]=w^~P&x,ee[12]=Fe^~wt&Mr,ee[13]=$e^~Ar&Mt,ee[22]=pa^~fs&Wi,ee[23]=jn^~wi&ic,ee[32]=oi^~Ns&Yn,ee[33]=xt^~Os&ai,ee[42]=sc^~Cn&je,ee[43]=bi^~en&Ke,ee[4]=_^~U&z,ee[5]=P^~x&ce,ee[14]=wt^~Mr&Yi,ee[15]=Ar^~Mt&ds,ee[24]=fs^~Wi&ps,ee[25]=wi^~ic&xo,ee[34]=Ns^~Yn&Po,ee[35]=Os^~ai&Mo,ee[44]=Cn^~je&at,ee[45]=en^~Ke&Ve,ee[6]=U^~z&ut,ee[7]=x^~ce&Ce,ee[16]=Mr^~Yi&we,ee[17]=Mt^~ds&Pe,ee[26]=Wi^~ps&nc,ee[27]=ic^~xo&Ii,ee[36]=Yn^~Po&Sn,ee[37]=ai^~Mo&vi,ee[46]=je^~at&ji,ee[47]=Ke^~Ve&zc,ee[8]=z^~ut&_e,ee[9]=ce^~Ce&w,ee[18]=Yi^~we&Fe,ee[19]=ds^~Pe&$e,ee[28]=ps^~nc&pa,ee[29]=xo^~Ii&jn,ee[38]=Po^~Sn&oi,ee[39]=Mo^~vi&xt,ee[48]=at^~ji&sc,ee[49]=Ve^~zc&bi,ee[0]^=A[Ae],ee[1]^=A[Ae+1]};if(a)t.exports=Q;else for(Y=0;Y<X.length;++Y)i[X[Y]]=Q[X[Y]]})()})(YM);var pq=YM.exports;const gq=eZ(pq),mq=t=>{const e=t.toLowerCase().replace(/^0x/,""),r=gq.keccak_256(e);let n="0x";for(let i=0;i<e.length;i++)n+=parseInt(r[i],16)>=8?e[i].toUpperCase():e[i];return n};class KM{constructor(e){if(de(this,"name","evm"),de(this,"sdk"),de(this,"provider"),de(this,"chainConfig"),de(this,"optionsProvider"),de(this,"once",pY),de(this,"on",gY),de(this,"_emit",mY),de(this,"switchChainPromise"),!e.chainConfig.chainId||!e.chainConfig.rpcUrl)throw new Error("chainId and rpcUrl are required fields");if(!e.chainConfig.chainId.includes("0x"))throw new Error("Chain id must be a hex value 0x prefixed");this.chainConfig=e.chainConfig,e.provider&&(this.optionsProvider=e.provider)}async _initialize(e){this.sdk=e,this.sdk.on(yY.LOGOUT,()=>this.provider=void 0)}async _checkIsUserLoggedIn(){if(!this.sdk.isLoggedIn())throw new Error("User is not logged in")}async _buildProvider(){try{switch(this.sdk.getLoginProvider()){case Tg.EVM_PROVIDER:{if(!this.optionsProvider)throw new Error("EVM provider was not provided");return this.optionsProvider}case Tg.OAUTH:return new u9({rpcUrl:this.chainConfig.rpcUrl,accessToken:this.sdk.getAccessToken(),env:this.sdk.env});default:throw new Error("Cannot build evm provider")}}catch(e){throw this._emit("EVM_ERROR",e),e}}async getProvider(){return await this._checkIsUserLoggedIn(),this.provider?this.provider instanceof u9&&this.provider.setAccessToken(this.sdk.getAccessToken()):this.provider=await this._buildProvider(),this.provider}async getEthersProvider(){const e=await this.getProvider();if(!e)throw new Error("Cannot get provider");return this.isEvmProvider()&&await this._switchChainEip(this.chainConfig),new zb(e)}async switchChain(e){try{const r=await this.getProvider();switch(this.sdk.getLoginProvider()){case Tg.EVM_PROVIDER:{await this._switchChainEip(e);break}case Tg.OAUTH:{r.setRpcUrl(e.rpcUrl);break}}this.chainConfig=e,this._emit(d9.EVM_SWITCH_CHAIN,{chainConfig:e})}catch(r){throw this._emit(d9.EVM_ERROR,r),r}}getChainConfig(){return this.chainConfig}isEvmProvider(){return!!this.optionsProvider}async loginWithSignature(){if(!this.isEvmProvider())throw new Error("EVM provider was not provided");await this._switchChainEip(this.sdk.evm.getChainConfig());const[e]=await this.optionsProvider.request({method:"eth_requestAccounts"}),r=await CY(this.sdk,{scope:"openid profile email phone blockchain.evm blockchain.evm.write",responseType:"token"},{is_evm:!0});kY(r,{redirectUrl:"none"});const n=await fetch(r.toString());if(!n.ok)throw new Error(n.statusText);const{sid:i,nonce:s}=await n.json(),o=new rN.SiweMessage({domain:window.location.host,address:mq(e),statement:"Sign in with Credenza3",uri:window.location.origin,version:"1",chainId:+this.sdk.evm.getChainConfig().chainId,nonce:s}),a=o.prepareMessage(),l=await this.optionsProvider.request({method:"personal_sign",params:[a,e]}),u=await fetch(r.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({signature:l,sid:i,message:o})}),{access_token:d}=await u.json();await this.sdk._setAccessToken(d,Tg.EVM_PROVIDER)}_ensureHexChainId(e){return typeof e=="string"?e.startsWith("0x")?e:`0x${parseInt(e,10).toString(16)}`:`0x${e.toString(16)}`}async _addChainEip(e){if(!this.optionsProvider)throw new Error("EVM provider was not provided");const r=this._ensureHexChainId(e.chainId);await this.optionsProvider.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:e.displayName,rpcUrls:[e.rpcUrl],blockExplorerUrls:e.blockExplorer?[e.blockExplorer]:void 0,nativeCurrency:{name:e.nativeCurrency.name,symbol:e.nativeCurrency.symbol,decimals:e.nativeCurrency.decimals??18}}]})}async _switchChainEip(e){if(!this.optionsProvider)throw new Error("EVM provider was not provided");if(this.switchChainPromise)return this.switchChainPromise;const r=this._ensureHexChainId(e.chainId);return this.switchChainPromise=this.optionsProvider.request({method:"eth_chainId"}).then(async n=>{var i,s,o;if(n?.toLowerCase()===r.toLowerCase())throw new Error("SWITCH_CHAIN_NOT_REQUIRED");try{await this.optionsProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})}catch(a){if((a?.code??((s=(i=a?.data)==null?void 0:i.originalError)==null?void 0:s.code))===4902||(o=a?.message)!=null&&o.includes("Unrecognized chain"))await this._addChainEip(e),await this.optionsProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]});else throw a}}).catch(n=>{if(n?.message!=="SWITCH_CHAIN_NOT_REQUIRED")return Promise.reject(n)}).finally(()=>{this.switchChainPromise=void 0}),this.switchChainPromise}}de(KM,"EVM_EVENT",d9);const Ls=ws(),as=ws(null),oa=ws(),C1=ws(),Fn=ws(),K9=ws(),Cr=ws({}),Ur=ws(null),zl=ws(null),X9=ws({loading:!1,active:!1}),q9=ws(),Ro=ws();var k1=(t=>(t.OAUTH="OAUTH",t.EVM="EVM",t))(k1||{}),St=(t=>(t.POLYGON="137",t.POLYGON_AMOY="80002",t.CHILIZ_SPICY="88882",t.CHILIZ="88888",t.AVALANCHE_FUJI="43113",t.AVALANCHE="43114",t.BASE="8453",t.BASE_SEPOLIA="84532",t))(St||{}),of=(t=>(t.TESTNET="testnet",t.MAINNET="mainnet",t))(of||{}),Tt=(t=>(t.PROFILE="profile",t.LOGOUT="logout",t.LOGIN="login",t.PASSPORT_ID="passportId",t.WALLET="wallet",t.UPDATE_PROFILE="updateProfile",t.SEND_TOKENS="sendTokens",t.CONFIRM_ACCOUNT="confirmAccount",t.PAYMENT="payment",t.PAYMENT_RESULT="paymentResult",t.SCANNER="scanner",t.ERROR="error",t.LOADER="loader",t.SIGN="sign",t.RICH_ALERT="richAlert",t.ASSETS="assets",t.NAV_MENU="navMenu",t))(Tt||{}),I6=(t=>(t.CARD="CARD",t.ERC20="ERC20",t))(I6||{}),Mc=(t=>(t.WHITE="WHITE",t.BLACK="BLACK",t))(Mc||{}),af=(t=>(t.TOP="TOP",t.BOTTOM="BOTTOM",t))(af||{}),Zl=(t=>(t.LEFT="LEFT",t.RIGHT="RIGHT",t))(Zl||{}),Wu=(t=>(t.PASSPORT_ID="PASSPORT_ID",t.TOKENS_PURCHASE="TOKENS_PURCHASE",t.AIR_DROP_COIN="AIR_DROP_COIN",t.AIR_DROP_ASSET="AIR_DROP_ASSET",t.REQUEST_LOYALTY_POINTS="REQUEST_LOYALTY_POINTS",t.PASSPORT_ID_PASS="PASSPORT_ID_PASS",t))(Wu||{}),XM=(t=>(t.EMAIL="email",t.PHONE="phone",t))(XM||{}),No=(t=>(t.CREDIT_CARD="CREDIT_CARD",t.CREDENZA_BALANCE="CREDENZA_BALANCE",t))(No||{}),cf=(t=>(t.ACCESS_TOKEN="credenza:passport:accessToken",t.QR_CODE="credenza:passport:qrCode",t))(cf||{}),qM={},R6={};R6.byteLength=vq,R6.toByteArray=Aq,R6.fromByteArray=Sq;for(var Bc=[],aa=[],yq=typeof Uint8Array<"u"?Uint8Array:Array,e7="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_1=0,wq=e7.length;_1<wq;++_1)Bc[_1]=e7[_1],aa[e7.charCodeAt(_1)]=_1;aa[45]=62,aa[95]=63;function eB(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function vq(t){var e=eB(t),r=e[0],n=e[1];return(r+n)*3/4-n}function bq(t,e,r){return(e+r)*3/4-r}function Aq(t){var e,r=eB(t),n=r[0],i=r[1],s=new yq(bq(t,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)e=aa[t.charCodeAt(l)]<<18|aa[t.charCodeAt(l+1)]<<12|aa[t.charCodeAt(l+2)]<<6|aa[t.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=aa[t.charCodeAt(l)]<<2|aa[t.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=aa[t.charCodeAt(l)]<<10|aa[t.charCodeAt(l+1)]<<4|aa[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Eq(t){return Bc[t>>18&63]+Bc[t>>12&63]+Bc[t>>6&63]+Bc[t&63]}function Tq(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(Eq(n));return i.join("")}function Sq(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Tq(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(Bc[e>>2]+Bc[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Bc[e>>10]+Bc[e>>4&63]+Bc[e<<2&63]+"=")),i.join("")}var t7={};t7.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,l=(1<<a)-1,u=l>>1,d=-7,f=r?i-1:0,g=r?-1:1,m=t[e+f];for(f+=g,s=m&(1<<-d)-1,m>>=-d,d+=a;d>0;s=s*256+t[e+f],f+=g,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+f],f+=g,d-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-u}return(m?-1:1)*o*Math.pow(2,s-n)},t7.write=function(t,e,r,n,i,s){var o,a,l,u=s*8-i-1,d=(1<<u)-1,f=d>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:s-1,v=n?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=g/l:e+=g*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=d?(a=0,o=d):o+f>=1?(a=(e*l-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+m]=a&255,m+=v,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;t[r+m]=o&255,m+=v,o/=256,u-=8);t[r+m-v]|=A*128};(function(t){const e=R6,r=t7,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=N,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:o,SharedArrayBuffer:a}=globalThis;d.TYPED_ARRAY_SUPPORT=l(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const U=new s(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,s.prototype),Object.setPrototypeOf(U,x),U.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function u(U){if(U>i)throw new RangeError('The value "'+U+'" is invalid for option "size"');const x=new s(U);return Object.setPrototypeOf(x,d.prototype),x}function d(U,x,z){if(typeof U=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(U)}return f(U,x,z)}d.poolSize=8192;function f(U,x,z){if(typeof U=="string")return A(U,x);if(o.isView(U))return C(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(Ce(U,o)||U&&Ce(U.buffer,o)||typeof a<"u"&&(Ce(U,a)||U&&Ce(U.buffer,a)))return k(U,x,z);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ce=U.valueOf&&U.valueOf();if(ce!=null&&ce!==U)return d.from(ce,x,z);const we=I(U);if(we)return we;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return d.from(U[Symbol.toPrimitive]("string"),x,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}d.from=function(U,x,z){return f(U,x,z)},Object.setPrototypeOf(d.prototype,s.prototype),Object.setPrototypeOf(d,s);function g(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function m(U,x,z){return g(U),U<=0?u(U):x!==void 0?typeof z=="string"?u(U).fill(x,z):u(U).fill(x):u(U)}d.alloc=function(U,x,z){return m(U,x,z)};function v(U){return g(U),u(U<0?0:S(U)|0)}d.allocUnsafe=function(U){return v(U)},d.allocUnsafeSlow=function(U){return v(U)};function A(U,x){if((typeof x!="string"||x==="")&&(x="utf8"),!d.isEncoding(x))throw new TypeError("Unknown encoding: "+x);const z=W(U,x)|0;let ce=u(z);const we=ce.write(U,x);return we!==z&&(ce=ce.slice(0,we)),ce}function E(U){const x=U.length<0?0:S(U.length)|0,z=u(x);for(let ce=0;ce<x;ce+=1)z[ce]=U[ce]&255;return z}function C(U){if(Ce(U,s)){const x=new s(U);return k(x.buffer,x.byteOffset,x.byteLength)}return E(U)}function k(U,x,z){if(x<0||U.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<x+(z||0))throw new RangeError('"length" is outside of buffer bounds');let ce;return x===void 0&&z===void 0?ce=new s(U):z===void 0?ce=new s(U,x):ce=new s(U,x,z),Object.setPrototypeOf(ce,d.prototype),ce}function I(U){if(d.isBuffer(U)){const x=S(U.length)|0,z=u(x);return z.length===0||U.copy(z,0,0,x),z}if(U.length!==void 0)return typeof U.length!="number"||_e(U.length)?u(0):E(U);if(U.type==="Buffer"&&Array.isArray(U.data))return E(U.data)}function S(U){if(U>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return U|0}function N(U){return+U!=U&&(U=0),d.alloc(+U)}d.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==d.prototype},d.compare=function(x,z){if(Ce(x,s)&&(x=d.from(x,x.offset,x.byteLength)),Ce(z,s)&&(z=d.from(z,z.offset,z.byteLength)),!d.isBuffer(x)||!d.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===z)return 0;let ce=x.length,we=z.length;for(let Pe=0,Fe=Math.min(ce,we);Pe<Fe;++Pe)if(x[Pe]!==z[Pe]){ce=x[Pe],we=z[Pe];break}return ce<we?-1:we<ce?1:0},d.isEncoding=function(x){switch(String(x).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(x,z){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return d.alloc(0);let ce;if(z===void 0)for(z=0,ce=0;ce<x.length;++ce)z+=x[ce].length;const we=d.allocUnsafe(z);let Pe=0;for(ce=0;ce<x.length;++ce){let Fe=x[ce];if(Ce(Fe,s))Pe+Fe.length>we.length?(d.isBuffer(Fe)||(Fe=d.from(Fe)),Fe.copy(we,Pe)):s.prototype.set.call(we,Fe,Pe);else if(d.isBuffer(Fe))Fe.copy(we,Pe);else throw new TypeError('"list" argument must be an Array of Buffers');Pe+=Fe.length}return we};function W(U,x){if(d.isBuffer(U))return U.length;if(o.isView(U)||Ce(U,o))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const z=U.length,ce=arguments.length>2&&arguments[2]===!0;if(!ce&&z===0)return 0;let we=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return Ge(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return Qe(U).length;default:if(we)return ce?-1:Ge(U).length;x=(""+x).toLowerCase(),we=!0}}d.byteLength=W;function G(U,x,z){let ce=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,x>>>=0,z<=x))return"";for(U||(U="utf8");;)switch(U){case"hex":return re(this,x,z);case"utf8":case"utf-8":return K(this,x,z);case"ascii":return X(this,x,z);case"latin1":case"binary":return Y(this,x,z);case"base64":return q(this,x,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,x,z);default:if(ce)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),ce=!0}}d.prototype._isBuffer=!0;function L(U,x,z){const ce=U[x];U[x]=U[z],U[z]=ce}d.prototype.swap16=function(){const x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let z=0;z<x;z+=2)L(this,z,z+1);return this},d.prototype.swap32=function(){const x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let z=0;z<x;z+=4)L(this,z,z+3),L(this,z+1,z+2);return this},d.prototype.swap64=function(){const x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let z=0;z<x;z+=8)L(this,z,z+7),L(this,z+1,z+6),L(this,z+2,z+5),L(this,z+3,z+4);return this},d.prototype.toString=function(){const x=this.length;return x===0?"":arguments.length===0?K(this,0,x):G.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(x){if(!d.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:d.compare(this,x)===0},d.prototype.inspect=function(){let x="";const z=t.INSPECT_MAX_BYTES;return x=this.toString("hex",0,z).replace(/(.{2})/g,"$1 ").trim(),this.length>z&&(x+=" ... "),"<Buffer "+x+">"},n&&(d.prototype[n]=d.prototype.inspect),d.prototype.compare=function(x,z,ce,we,Pe){if(Ce(x,s)&&(x=d.from(x,x.offset,x.byteLength)),!d.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(z===void 0&&(z=0),ce===void 0&&(ce=x?x.length:0),we===void 0&&(we=0),Pe===void 0&&(Pe=this.length),z<0||ce>x.length||we<0||Pe>this.length)throw new RangeError("out of range index");if(we>=Pe&&z>=ce)return 0;if(we>=Pe)return-1;if(z>=ce)return 1;if(z>>>=0,ce>>>=0,we>>>=0,Pe>>>=0,this===x)return 0;let Fe=Pe-we,$e=ce-z;const wt=Math.min(Fe,$e),Ar=this.slice(we,Pe),Mr=x.slice(z,ce);for(let Mt=0;Mt<wt;++Mt)if(Ar[Mt]!==Mr[Mt]){Fe=Ar[Mt],$e=Mr[Mt];break}return Fe<$e?-1:$e<Fe?1:0};function V(U,x,z,ce,we){if(U.length===0)return-1;if(typeof z=="string"?(ce=z,z=0):z>2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,_e(z)&&(z=we?0:U.length-1),z<0&&(z=U.length+z),z>=U.length){if(we)return-1;z=U.length-1}else if(z<0)if(we)z=0;else return-1;if(typeof x=="string"&&(x=d.from(x,ce)),d.isBuffer(x))return x.length===0?-1:$(U,x,z,ce,we);if(typeof x=="number")return x=x&255,typeof s.prototype.indexOf=="function"?we?s.prototype.indexOf.call(U,x,z):s.prototype.lastIndexOf.call(U,x,z):$(U,[x],z,ce,we);throw new TypeError("val must be string, number or Buffer")}function $(U,x,z,ce,we){let Pe=1,Fe=U.length,$e=x.length;if(ce!==void 0&&(ce=String(ce).toLowerCase(),ce==="ucs2"||ce==="ucs-2"||ce==="utf16le"||ce==="utf-16le")){if(U.length<2||x.length<2)return-1;Pe=2,Fe/=2,$e/=2,z/=2}function wt(Mr,Mt){return Pe===1?Mr[Mt]:Mr.readUInt16BE(Mt*Pe)}let Ar;if(we){let Mr=-1;for(Ar=z;Ar<Fe;Ar++)if(wt(U,Ar)===wt(x,Mr===-1?0:Ar-Mr)){if(Mr===-1&&(Mr=Ar),Ar-Mr+1===$e)return Mr*Pe}else Mr!==-1&&(Ar-=Ar-Mr),Mr=-1}else for(z+$e>Fe&&(z=Fe-$e),Ar=z;Ar>=0;Ar--){let Mr=!0;for(let Mt=0;Mt<$e;Mt++)if(wt(U,Ar+Mt)!==wt(x,Mt)){Mr=!1;break}if(Mr)return Ar}return-1}d.prototype.includes=function(x,z,ce){return this.indexOf(x,z,ce)!==-1},d.prototype.indexOf=function(x,z,ce){return V(this,x,z,ce,!0)},d.prototype.lastIndexOf=function(x,z,ce){return V(this,x,z,ce,!1)};function j(U,x,z,ce){z=Number(z)||0;const we=U.length-z;ce?(ce=Number(ce),ce>we&&(ce=we)):ce=we;const Pe=x.length;ce>Pe/2&&(ce=Pe/2);let Fe;for(Fe=0;Fe<ce;++Fe){const $e=parseInt(x.substr(Fe*2,2),16);if(_e($e))return Fe;U[z+Fe]=$e}return Fe}function B(U,x,z,ce){return ut(Ge(x,U.length-z),U,z,ce)}function O(U,x,z,ce){return ut(ie(x),U,z,ce)}function H(U,x,z,ce){return ut(Qe(x),U,z,ce)}function D(U,x,z,ce){return ut(Be(x,U.length-z),U,z,ce)}d.prototype.write=function(x,z,ce,we){if(z===void 0)we="utf8",ce=this.length,z=0;else if(ce===void 0&&typeof z=="string")we=z,ce=this.length,z=0;else if(isFinite(z))z=z>>>0,isFinite(ce)?(ce=ce>>>0,we===void 0&&(we="utf8")):(we=ce,ce=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Pe=this.length-z;if((ce===void 0||ce>Pe)&&(ce=Pe),x.length>0&&(ce<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");we||(we="utf8");let Fe=!1;for(;;)switch(we){case"hex":return j(this,x,z,ce);case"utf8":case"utf-8":return B(this,x,z,ce);case"ascii":case"latin1":case"binary":return O(this,x,z,ce);case"base64":return H(this,x,z,ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,x,z,ce);default:if(Fe)throw new TypeError("Unknown encoding: "+we);we=(""+we).toLowerCase(),Fe=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q(U,x,z){return x===0&&z===U.length?e.fromByteArray(U):e.fromByteArray(U.slice(x,z))}function K(U,x,z){z=Math.min(U.length,z);const ce=[];let we=x;for(;we<z;){const Pe=U[we];let Fe=null,$e=Pe>239?4:Pe>223?3:Pe>191?2:1;if(we+$e<=z){let wt,Ar,Mr,Mt;switch($e){case 1:Pe<128&&(Fe=Pe);break;case 2:wt=U[we+1],(wt&192)===128&&(Mt=(Pe&31)<<6|wt&63,Mt>127&&(Fe=Mt));break;case 3:wt=U[we+1],Ar=U[we+2],(wt&192)===128&&(Ar&192)===128&&(Mt=(Pe&15)<<12|(wt&63)<<6|Ar&63,Mt>2047&&(Mt<55296||Mt>57343)&&(Fe=Mt));break;case 4:wt=U[we+1],Ar=U[we+2],Mr=U[we+3],(wt&192)===128&&(Ar&192)===128&&(Mr&192)===128&&(Mt=(Pe&15)<<18|(wt&63)<<12|(Ar&63)<<6|Mr&63,Mt>65535&&Mt<1114112&&(Fe=Mt))}}Fe===null?(Fe=65533,$e=1):Fe>65535&&(Fe-=65536,ce.push(Fe>>>10&1023|55296),Fe=56320|Fe&1023),ce.push(Fe),we+=$e}return Q(ce)}const te=4096;function Q(U){const x=U.length;if(x<=te)return String.fromCharCode.apply(String,U);let z="",ce=0;for(;ce<x;)z+=String.fromCharCode.apply(String,U.slice(ce,ce+=te));return z}function X(U,x,z){let ce="";z=Math.min(U.length,z);for(let we=x;we<z;++we)ce+=String.fromCharCode(U[we]&127);return ce}function Y(U,x,z){let ce="";z=Math.min(U.length,z);for(let we=x;we<z;++we)ce+=String.fromCharCode(U[we]);return ce}function re(U,x,z){const ce=U.length;(!x||x<0)&&(x=0),(!z||z<0||z>ce)&&(z=ce);let we="";for(let Pe=x;Pe<z;++Pe)we+=w[U[Pe]];return we}function ue(U,x,z){const ce=U.slice(x,z);let we="";for(let Pe=0;Pe<ce.length-1;Pe+=2)we+=String.fromCharCode(ce[Pe]+ce[Pe+1]*256);return we}d.prototype.slice=function(x,z){const ce=this.length;x=~~x,z=z===void 0?ce:~~z,x<0?(x+=ce,x<0&&(x=0)):x>ce&&(x=ce),z<0?(z+=ce,z<0&&(z=0)):z>ce&&(z=ce),z<x&&(z=x);const we=this.subarray(x,z);return Object.setPrototypeOf(we,d.prototype),we};function me(U,x,z){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+x>z)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(x,z,ce){x=x>>>0,z=z>>>0,ce||me(x,z,this.length);let we=this[x],Pe=1,Fe=0;for(;++Fe<z&&(Pe*=256);)we+=this[x+Fe]*Pe;return we},d.prototype.readUintBE=d.prototype.readUIntBE=function(x,z,ce){x=x>>>0,z=z>>>0,ce||me(x,z,this.length);let we=this[x+--z],Pe=1;for(;z>0&&(Pe*=256);)we+=this[x+--z]*Pe;return we},d.prototype.readUint8=d.prototype.readUInt8=function(x,z){return x=x>>>0,z||me(x,1,this.length),this[x]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(x,z){return x=x>>>0,z||me(x,2,this.length),this[x]|this[x+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(x,z){return x=x>>>0,z||me(x,2,this.length),this[x]<<8|this[x+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(x,z){return x=x>>>0,z||me(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(x,z){return x=x>>>0,z||me(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])},d.prototype.readBigUInt64LE=_(function(x){x=x>>>0,se(x,"offset");const z=this[x],ce=this[x+7];(z===void 0||ce===void 0)&&pe(x,this.length-8);const we=z+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,Pe=this[++x]+this[++x]*2**8+this[++x]*2**16+ce*2**24;return BigInt(we)+(BigInt(Pe)<<BigInt(32))}),d.prototype.readBigUInt64BE=_(function(x){x=x>>>0,se(x,"offset");const z=this[x],ce=this[x+7];(z===void 0||ce===void 0)&&pe(x,this.length-8);const we=z*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],Pe=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+ce;return(BigInt(we)<<BigInt(32))+BigInt(Pe)}),d.prototype.readIntLE=function(x,z,ce){x=x>>>0,z=z>>>0,ce||me(x,z,this.length);let we=this[x],Pe=1,Fe=0;for(;++Fe<z&&(Pe*=256);)we+=this[x+Fe]*Pe;return Pe*=128,we>=Pe&&(we-=Math.pow(2,8*z)),we},d.prototype.readIntBE=function(x,z,ce){x=x>>>0,z=z>>>0,ce||me(x,z,this.length);let we=z,Pe=1,Fe=this[x+--we];for(;we>0&&(Pe*=256);)Fe+=this[x+--we]*Pe;return Pe*=128,Fe>=Pe&&(Fe-=Math.pow(2,8*z)),Fe},d.prototype.readInt8=function(x,z){return x=x>>>0,z||me(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]},d.prototype.readInt16LE=function(x,z){x=x>>>0,z||me(x,2,this.length);const ce=this[x]|this[x+1]<<8;return ce&32768?ce|4294901760:ce},d.prototype.readInt16BE=function(x,z){x=x>>>0,z||me(x,2,this.length);const ce=this[x+1]|this[x]<<8;return ce&32768?ce|4294901760:ce},d.prototype.readInt32LE=function(x,z){return x=x>>>0,z||me(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24},d.prototype.readInt32BE=function(x,z){return x=x>>>0,z||me(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]},d.prototype.readBigInt64LE=_(function(x){x=x>>>0,se(x,"offset");const z=this[x],ce=this[x+7];(z===void 0||ce===void 0)&&pe(x,this.length-8);const we=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(ce<<24);return(BigInt(we)<<BigInt(32))+BigInt(z+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24)}),d.prototype.readBigInt64BE=_(function(x){x=x>>>0,se(x,"offset");const z=this[x],ce=this[x+7];(z===void 0||ce===void 0)&&pe(x,this.length-8);const we=(z<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(we)<<BigInt(32))+BigInt(this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+ce)}),d.prototype.readFloatLE=function(x,z){return x=x>>>0,z||me(x,4,this.length),r.read(this,x,!0,23,4)},d.prototype.readFloatBE=function(x,z){return x=x>>>0,z||me(x,4,this.length),r.read(this,x,!1,23,4)},d.prototype.readDoubleLE=function(x,z){return x=x>>>0,z||me(x,8,this.length),r.read(this,x,!0,52,8)},d.prototype.readDoubleBE=function(x,z){return x=x>>>0,z||me(x,8,this.length),r.read(this,x,!1,52,8)};function Re(U,x,z,ce,we,Pe){if(!d.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>we||x<Pe)throw new RangeError('"value" argument is out of bounds');if(z+ce>U.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(x,z,ce,we){if(x=+x,z=z>>>0,ce=ce>>>0,!we){const $e=Math.pow(2,8*ce)-1;Re(this,x,z,ce,$e,0)}let Pe=1,Fe=0;for(this[z]=x&255;++Fe<ce&&(Pe*=256);)this[z+Fe]=x/Pe&255;return z+ce},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(x,z,ce,we){if(x=+x,z=z>>>0,ce=ce>>>0,!we){const $e=Math.pow(2,8*ce)-1;Re(this,x,z,ce,$e,0)}let Pe=ce-1,Fe=1;for(this[z+Pe]=x&255;--Pe>=0&&(Fe*=256);)this[z+Pe]=x/Fe&255;return z+ce},d.prototype.writeUint8=d.prototype.writeUInt8=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,1,255,0),this[z]=x&255,z+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,2,65535,0),this[z]=x&255,this[z+1]=x>>>8,z+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,2,65535,0),this[z]=x>>>8,this[z+1]=x&255,z+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,4,4294967295,0),this[z+3]=x>>>24,this[z+2]=x>>>16,this[z+1]=x>>>8,this[z]=x&255,z+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,4,4294967295,0),this[z]=x>>>24,this[z+1]=x>>>16,this[z+2]=x>>>8,this[z+3]=x&255,z+4};function Te(U,x,z,ce,we){Z(x,ce,we,U,z,7);let Pe=Number(x&BigInt(4294967295));U[z++]=Pe,Pe=Pe>>8,U[z++]=Pe,Pe=Pe>>8,U[z++]=Pe,Pe=Pe>>8,U[z++]=Pe;let Fe=Number(x>>BigInt(32)&BigInt(4294967295));return U[z++]=Fe,Fe=Fe>>8,U[z++]=Fe,Fe=Fe>>8,U[z++]=Fe,Fe=Fe>>8,U[z++]=Fe,z}function ye(U,x,z,ce,we){Z(x,ce,we,U,z,7);let Pe=Number(x&BigInt(4294967295));U[z+7]=Pe,Pe=Pe>>8,U[z+6]=Pe,Pe=Pe>>8,U[z+5]=Pe,Pe=Pe>>8,U[z+4]=Pe;let Fe=Number(x>>BigInt(32)&BigInt(4294967295));return U[z+3]=Fe,Fe=Fe>>8,U[z+2]=Fe,Fe=Fe>>8,U[z+1]=Fe,Fe=Fe>>8,U[z]=Fe,z+8}d.prototype.writeBigUInt64LE=_(function(x,z=0){return Te(this,x,z,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=_(function(x,z=0){return ye(this,x,z,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(x,z,ce,we){if(x=+x,z=z>>>0,!we){const wt=Math.pow(2,8*ce-1);Re(this,x,z,ce,wt-1,-wt)}let Pe=0,Fe=1,$e=0;for(this[z]=x&255;++Pe<ce&&(Fe*=256);)x<0&&$e===0&&this[z+Pe-1]!==0&&($e=1),this[z+Pe]=(x/Fe>>0)-$e&255;return z+ce},d.prototype.writeIntBE=function(x,z,ce,we){if(x=+x,z=z>>>0,!we){const wt=Math.pow(2,8*ce-1);Re(this,x,z,ce,wt-1,-wt)}let Pe=ce-1,Fe=1,$e=0;for(this[z+Pe]=x&255;--Pe>=0&&(Fe*=256);)x<0&&$e===0&&this[z+Pe+1]!==0&&($e=1),this[z+Pe]=(x/Fe>>0)-$e&255;return z+ce},d.prototype.writeInt8=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,1,127,-128),x<0&&(x=255+x+1),this[z]=x&255,z+1},d.prototype.writeInt16LE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,2,32767,-32768),this[z]=x&255,this[z+1]=x>>>8,z+2},d.prototype.writeInt16BE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,2,32767,-32768),this[z]=x>>>8,this[z+1]=x&255,z+2},d.prototype.writeInt32LE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,4,2147483647,-2147483648),this[z]=x&255,this[z+1]=x>>>8,this[z+2]=x>>>16,this[z+3]=x>>>24,z+4},d.prototype.writeInt32BE=function(x,z,ce){return x=+x,z=z>>>0,ce||Re(this,x,z,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[z]=x>>>24,this[z+1]=x>>>16,this[z+2]=x>>>8,this[z+3]=x&255,z+4},d.prototype.writeBigInt64LE=_(function(x,z=0){return Te(this,x,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=_(function(x,z=0){return ye(this,x,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ve(U,x,z,ce,we,Pe){if(z+ce>U.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function ke(U,x,z,ce,we){return x=+x,z=z>>>0,we||ve(U,x,z,4),r.write(U,x,z,ce,23,4),z+4}d.prototype.writeFloatLE=function(x,z,ce){return ke(this,x,z,!0,ce)},d.prototype.writeFloatBE=function(x,z,ce){return ke(this,x,z,!1,ce)};function ee(U,x,z,ce,we){return x=+x,z=z>>>0,we||ve(U,x,z,8),r.write(U,x,z,ce,52,8),z+8}d.prototype.writeDoubleLE=function(x,z,ce){return ee(this,x,z,!0,ce)},d.prototype.writeDoubleBE=function(x,z,ce){return ee(this,x,z,!1,ce)},d.prototype.copy=function(x,z,ce,we){if(!d.isBuffer(x))throw new TypeError("argument should be a Buffer");if(ce||(ce=0),!we&&we!==0&&(we=this.length),z>=x.length&&(z=x.length),z||(z=0),we>0&&we<ce&&(we=ce),we===ce||x.length===0||this.length===0)return 0;if(z<0)throw new RangeError("targetStart out of bounds");if(ce<0||ce>=this.length)throw new RangeError("Index out of range");if(we<0)throw new RangeError("sourceEnd out of bounds");we>this.length&&(we=this.length),x.length-z<we-ce&&(we=x.length-z+ce);const Pe=we-ce;return this===x&&typeof s.prototype.copyWithin=="function"?this.copyWithin(z,ce,we):s.prototype.set.call(x,this.subarray(ce,we),z),Pe},d.prototype.fill=function(x,z,ce,we){if(typeof x=="string"){if(typeof z=="string"?(we=z,z=0,ce=this.length):typeof ce=="string"&&(we=ce,ce=this.length),we!==void 0&&typeof we!="string")throw new TypeError("encoding must be a string");if(typeof we=="string"&&!d.isEncoding(we))throw new TypeError("Unknown encoding: "+we);if(x.length===1){const Fe=x.charCodeAt(0);(we==="utf8"&&Fe<128||we==="latin1")&&(x=Fe)}}else typeof x=="number"?x=x&255:typeof x=="boolean"&&(x=Number(x));if(z<0||this.length<z||this.length<ce)throw new RangeError("Out of range index");if(ce<=z)return this;z=z>>>0,ce=ce===void 0?this.length:ce>>>0,x||(x=0);let Pe;if(typeof x=="number")for(Pe=z;Pe<ce;++Pe)this[Pe]=x;else{const Fe=d.isBuffer(x)?x:d.from(x,we),$e=Fe.length;if($e===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(Pe=0;Pe<ce-z;++Pe)this[Pe+z]=Fe[Pe%$e]}return this};const Se={};function Oe(U,x,z){Se[U]=class extends z{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(we){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:we,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}Oe("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Oe("ERR_INVALID_ARG_TYPE",function(U,x){return`The "${U}" argument must be of type number. Received type ${typeof x}`},TypeError),Oe("ERR_OUT_OF_RANGE",function(U,x,z){let ce=`The value of "${U}" is out of range.`,we=z;return Number.isInteger(z)&&Math.abs(z)>2**32?we=Ae(String(z)):typeof z=="bigint"&&(we=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(we=Ae(we)),we+="n"),ce+=` It must be ${x}. Received ${we}`,ce},RangeError);function Ae(U){let x="",z=U.length;const ce=U[0]==="-"?1:0;for(;z>=ce+4;z-=3)x=`_${U.slice(z-3,z)}${x}`;return`${U.slice(0,z)}${x}`}function fe(U,x,z){se(x,"offset"),(U[x]===void 0||U[x+z]===void 0)&&pe(x,U.length-(z+1))}function Z(U,x,z,ce,we,Pe){if(U>z||U<x){const Fe=typeof x=="bigint"?"n":"";let $e;throw x===0||x===BigInt(0)?$e=`>= 0${Fe} and < 2${Fe} ** ${(Pe+1)*8}${Fe}`:$e=`>= -(2${Fe} ** ${(Pe+1)*8-1}${Fe}) and < 2 ** ${(Pe+1)*8-1}${Fe}`,new Se.ERR_OUT_OF_RANGE("value",$e,U)}fe(ce,we,Pe)}function se(U,x){if(typeof U!="number")throw new Se.ERR_INVALID_ARG_TYPE(x,"number",U)}function pe(U,x,z){throw Math.floor(U)!==U?(se(U,z),new Se.ERR_OUT_OF_RANGE("offset","an integer",U)):x<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${x}`,U)}const Ne=/[^+/0-9A-Za-z-_]/g;function xe(U){if(U=U.split("=")[0],U=U.trim().replace(Ne,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Ge(U,x){x=x||1/0;let z;const ce=U.length;let we=null;const Pe=[];for(let Fe=0;Fe<ce;++Fe){if(z=U.charCodeAt(Fe),z>55295&&z<57344){if(!we){if(z>56319){(x-=3)>-1&&Pe.push(239,191,189);continue}else if(Fe+1===ce){(x-=3)>-1&&Pe.push(239,191,189);continue}we=z;continue}if(z<56320){(x-=3)>-1&&Pe.push(239,191,189),we=z;continue}z=(we-55296<<10|z-56320)+65536}else we&&(x-=3)>-1&&Pe.push(239,191,189);if(we=null,z<128){if((x-=1)<0)break;Pe.push(z)}else if(z<2048){if((x-=2)<0)break;Pe.push(z>>6|192,z&63|128)}else if(z<65536){if((x-=3)<0)break;Pe.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if((x-=4)<0)break;Pe.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return Pe}function ie(U){const x=[];for(let z=0;z<U.length;++z)x.push(U.charCodeAt(z)&255);return x}function Be(U,x){let z,ce,we;const Pe=[];for(let Fe=0;Fe<U.length&&!((x-=2)<0);++Fe)z=U.charCodeAt(Fe),ce=z>>8,we=z%256,Pe.push(we),Pe.push(ce);return Pe}function Qe(U){return e.toByteArray(xe(U))}function ut(U,x,z,ce){let we;for(we=0;we<ce&&!(we+z>=x.length||we>=U.length);++we)x[we+z]=U[we];return we}function Ce(U,x){return U instanceof x||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===x.name}function _e(U){return U!==U}const w=(function(){const U="0123456789abcdef",x=new Array(256);for(let z=0;z<16;++z){const ce=z*16;for(let we=0;we<16;++we)x[ce+we]=U[z]+U[we]}return x})();function _(U){return typeof BigInt>"u"?P:U}function P(){throw new Error("BigInt not supported")}})(qM);const ju=qM.Buffer;var N6={GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_f29128d6-fe7a-43e3-a59b-f57b2b0535f8",USER:"runner",npm_config_user_agent:"pnpm/10.2.0 npm/? node/v24.14.1 linux x64",CI:"true",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_f29128d6-fe7a-43e3-a59b-f57b2b0535f8",RUNNER_ENVIRONMENT:"github-hosted",npm_node_execpath:"/opt/hostedtoolcache/node/24.14.1/x64/bin/node",HOME:"/home/runner",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_REPOSITORY_OWNER:"credenza-web3",npm_package_engines_node:">=20.10.0",GITHUB_RETENTION_DAYS:"90",GITHUB_HEAD_REF:"",GITHUB_REPOSITORY_OWNER_ID:"93208388",npm_config_engine_strict:"true",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",GITHUB_API_URL:"https://api.github.com",RUNNER_OS:"Linux",GITHUB_WORKFLOW:"Publish @credenza3/passport-evm",npm_config_registry:"https://registry.npmjs.org/",GITHUB_RUN_ID:"25669167777",GITHUB_BASE_REF:"",GITHUB_REF_TYPE:"branch",GITHUB_WORKFLOW_SHA:"9b0358d8b549f6a31dd18e7b39681f7874187352",GITHUB_ACTION_REPOSITORY:"",GITHUB_WORKFLOW_REF:"credenza-web3/passport/.github/workflows/publish_evm.yml@refs/heads/main",npm_config_node_gyp:"/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/passport/passport/packages/passport-evm/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/passport/passport/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/24.14.1/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",RUNNER_TRACKING_ID:"github_400277e4-1741-4d33-a71f-dfbd0e7f2d99",TURBO_HASH:"fb499e953ba4e8be",npm_package_name:"@credenza3/passport-evm",NODE:"/opt/hostedtoolcache/node/24.14.1/x64/bin/node",GITHUB_ACTION:"__run_2",GITHUB_RUN_NUMBER:"40",GITHUB_TRIGGERING_ACTOR:"fokindmitr",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",npm_config_frozen_lockfile:"",LANG:"C.UTF-8",GITHUB_REF_NAME:"main",GITHUB_REPOSITORY:"credenza-web3/passport",RUNNER_NAME:"GitHub Actions 1000001197",npm_lifecycle_script:"vite build",GITHUB_ACTION_REF:"",GITHUB_ACTIONS:"true",GITHUB_REPOSITORY_ID:"493155814",SHELL:"/bin/bash",NODE_PATH:"/home/runner/work/passport/passport/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.2_jiti@2.4.2_lightningcss@1.29.1_sass@1.99.0_yaml@2.8.3/node_modules/vite/bin/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.2_jiti@2.4.2_lightningcss@1.29.1_sass@1.99.0_yaml@2.8.3/node_modules/vite/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.2_jiti@2.4.2_lightningcss@1.29.1_sass@1.99.0_yaml@2.8.3/node_modules:/home/runner/work/passport/passport/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules",npm_package_version:"0.4.23",npm_lifecycle_event:"build",npm_config_verify_deps_before_run:"false",GITHUB_REF_PROTECTED:"false",GITHUB_JOB:"publish-gpr",GITHUB_WORKSPACE:"/home/runner/work/passport/passport",npm_package_engines_pnpm:">=9",GITHUB_RUN_ATTEMPT:"1",GITHUB_SHA:"9b0358d8b549f6a31dd18e7b39681f7874187352",GITHUB_ACTOR:"fokindmitr",GITHUB_REF:"refs/heads/main",GITHUB_ACTOR_ID:"15443122",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_f29128d6-fe7a-43e3-a59b-f57b2b0535f8",PWD:"/home/runner/work/passport/passport/packages/passport-evm",RUNNER_WORKSPACE:"/home/runner/work/passport",npm_execpath:"/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.2.0/node_modules/pnpm/bin/pnpm.cjs",GITHUB_EVENT_NAME:"push",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_f29128d6-fe7a-43e3-a59b-f57b2b0535f8",GITHUB_SERVER_URL:"https://github.com",npm_command:"run-script",PNPM_SCRIPT_SRC_DIR:"/home/runner/work/passport/passport/packages/passport-evm",PNPM_HOME:"/home/runner/setup-pnpm/node_modules/.bin",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_f29128d6-fe7a-43e3-a59b-f57b2b0535f8",INIT_CWD:"/home/runner/work/passport/passport/packages/passport-evm",NODE_ENV:"production"},Bt;if(typeof window>"u"){var tB={hostname:""};Bt={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:tB,referrer:""},screen:{width:0,height:0},location:tB,addEventListener:function(){},removeEventListener:function(){}}}else Bt=window;function rB(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function nB(t,e,r,n,i,s,o){try{var a=t[s](o),l=a.value}catch(u){r(u);return}a.done?e(l):Promise.resolve(l).then(n,i)}function r7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function o(l){nB(s,n,i,o,a,"next",l)}function a(l){nB(s,n,i,o,a,"throw",l)}o(void 0)})}}function O6(t,e,r){return iB()?O6=Reflect.construct:O6=function(i,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(i,a),u=new l;return o&&Fm(u,o.prototype),u},O6.apply(null,arguments)}function Cq(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,n.key,n)}}function cs(t,e,r){return e&&Cq(t.prototype,e),t}function sn(){return sn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sn.apply(this,arguments)}function n7(t){return n7=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},n7(t)}function Cs(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Fm(t,e)}function kr(t,e){return e!=null&&typeof Symbol<"u"&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function kq(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Dm(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s<n.length;s++)i=n[s],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Fm(t,e){return Fm=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Fm(t,e)}function Dr(t){"@swc/helpers - typeof";return t&&typeof Symbol<"u"&&t.constructor===Symbol?"symbol":typeof t}function _q(t,e){if(t){if(typeof t=="string")return rB(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rB(t,e)}}function x6(t){var e=typeof Map=="function"?new Map:void 0;return x6=function(n){if(n===null||!kq(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return O6(n,arguments,n7(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Fm(i,n)},x6(t)}function iB(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iB=function(){return!!t})()}function Kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=_q(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Lm(t,e){var r,n,i,s,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=u[0]&2?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(u[0]===6&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(d){u=[6,d],n=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function sB(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}var Iq=Object.defineProperty,Rq=function(t,e,r){return e in t?Iq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Pt=function(t,e,r){return Rq(t,(typeof e>"u"?"undefined":Dr(e))!=="symbol"?e+"":e,r)},oB,Nq=Object.defineProperty,Oq=function(t,e,r){return e in t?Nq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},aB=function(t,e,r){return Oq(t,(typeof e>"u"?"undefined":Dr(e))!=="symbol"?e+"":e,r)},Hi=(function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t})(Hi||{}),cB={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},lB={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},P6={},xq=function(){return!!globalThis.Zone};function i7(t){if(P6[t])return P6[t];var e=globalThis[t],r=e.prototype,n=t in cB?cB[t]:void 0,i=!!(n&&n.every(function(d){var f,g;return!!((g=(f=Object.getOwnPropertyDescriptor(r,d))==null?void 0:f.get)!=null&&g.toString().includes("[native code]"))})),s=t in lB?lB[t]:void 0,o=!!(s&&s.every(function(d){var f;return typeof r[d]=="function"&&((f=r[d])==null?void 0:f.toString().includes("[native code]"))}));if(i&&o&&!xq())return P6[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?P6[t]=u:r}catch{return r}}var s7={};function Gu(t,e,r){var n,i=t+"."+String(r);if(s7[i])return s7[i].call(e);var s=i7(t),o=(n=Object.getOwnPropertyDescriptor(s,r))==null?void 0:n.get;return o?(s7[i]=o,o.call(e)):e[r]}var o7={};function uB(t,e,r){var n=t+"."+String(r);if(o7[n])return o7[n].bind(e);var i=i7(t),s=i[r];return typeof s!="function"?e[r]:(o7[n]=s,s.bind(e))}function Pq(t){return Gu("Node",t,"childNodes")}function Mq(t){return Gu("Node",t,"parentNode")}function Bq(t){return Gu("Node",t,"parentElement")}function Uq(t){return Gu("Node",t,"textContent")}function Dq(t,e){return uB("Node",t,"contains")(e)}function Fq(t){return uB("Node",t,"getRootNode")()}function Lq(t){return!t||!("host"in t)?null:Gu("ShadowRoot",t,"host")}function Vq(t){return t.styleSheets}function Hq(t){return!t||!("shadowRoot"in t)?null:Gu("Element",t,"shadowRoot")}function Wq(t,e){return Gu("Element",t,"querySelector")(e)}function jq(t,e){return Gu("Element",t,"querySelectorAll")(e)}function Gq(){return i7("MutationObserver").constructor}function zq(t,e,r){try{if(!(e in t))return function(){};var n=t[e],i=r(n);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,function(){t[e]=n}}catch{return function(){}}}var ks={childNodes:Pq,parentNode:Mq,parentElement:Bq,textContent:Uq,contains:Dq,getRootNode:Fq,host:Lq,styleSheets:Vq,shadowRoot:Hq,querySelector:Wq,querySelectorAll:jq,mutationObserver:Gq,patch:zq};function hB(t){return t.nodeType===t.ELEMENT_NODE}function Vm(t){var e=t&&"host"in t&&"mode"in t&&ks.host(t)||null;return!!(e&&"shadowRoot"in e&&ks.shadowRoot(e)===t)}function Hm(t){return Object.prototype.toString.call(t)==="[object ShadowRoot]"}function Zq(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function $q(t){var e=t.cssText;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return t.layerName===""?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}function a7(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;!r&&t.ownerNode&&t.ownerNode.ownerDocument&&(r=t.ownerNode.ownerDocument.location.href);var n=Array.from(e,function(i){return dB(i,r)}).join("");return Zq(n)}catch{return null}}function dB(t,e){if(Jq(t)){var r;try{r=a7(t.styleSheet)||$q(t)}catch{r=t.cssText}return t.styleSheet.href?U6(r,t.styleSheet.href):r}else{var n=t.cssText;return Yq(t)&&t.selectorText.includes(":")&&(n=Qq(n)),e?U6(n,e):n}}function Qq(t){var e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return t.replace(e,"$1\\$2")}function Jq(t){return"styleSheet"in t}function Yq(t){return"selectorText"in t}var fB=(function(){function t(){aB(this,"idNodeMap",new Map),aB(this,"nodeMetaMap",new WeakMap)}var e=t.prototype;return e.getId=function(n){var i;if(!n)return-1;var s=(i=this.getMeta(n))==null?void 0:i.id;return s??-1},e.getNode=function(n){return this.idNodeMap.get(n)||null},e.getIds=function(){return Array.from(this.idNodeMap.keys())},e.getMeta=function(n){return this.nodeMetaMap.get(n)||null},e.removeNodeFromMap=function(n){var i=this,s=this.getId(n);this.idNodeMap.delete(s),n.childNodes&&n.childNodes.forEach(function(o){return i.removeNodeFromMap(o)})},e.has=function(n){return this.idNodeMap.has(n)},e.hasNode=function(n){return this.nodeMetaMap.has(n)},e.add=function(n,i){var s=i.id;this.idNodeMap.set(s,n),this.nodeMetaMap.set(n,i)},e.replace=function(n,i){var s=this.getNode(n);if(s){var o=this.nodeMetaMap.get(s);o&&this.nodeMetaMap.set(i,o)}this.idNodeMap.set(n,i)},e.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},t})();function Kq(){return new fB}function M6(t){var e=t.element,r=t.maskInputOptions,n=t.tagName,i=t.type,s=t.value,o=t.maskInputFn,a=s||"",l=i&&lf(i);return(r[n.toLowerCase()]||l&&r[l])&&(o?a=o(a,e):a="*".repeat(a.length)),a}function lf(t){return t.toLowerCase()}var pB="__rrweb_original__";function Xq(t){var e=t.getContext("2d");if(!e)return!0;for(var r=50,n=0;n<t.width;n+=r)for(var i=0;i<t.height;i+=r){var s=e.getImageData,o=pB in s?s[pB]:s,a=new Uint32Array(o.call(e,n,i,Math.min(r,t.width-n),Math.min(r,t.height-i)).data.buffer);if(a.some(function(l){return l!==0}))return!1}return!0}function B6(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?lf(e):null}function gB(t,e){var r;try{r=new URL(t,e??window.location.href)}catch{return null}var n=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(n),s;return(s=i?.[1])!=null?s:null}function qq(t){var e="";return t.indexOf("//")>-1?e=t.split("/").slice(0,3).join("/"):e=t.split("/")[0],e=e.split("?")[0],e}var eee=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,tee=/^(?:[a-z+]+:)?\/\//i,ree=/^www\..*/i,nee=/^(data:)([^,]*),(.*)/i;function U6(t,e){return(t||"").replace(eee,function(r,n,i,s,o,a){var l=i||o||a,u=n||s||"";if(!l)return r;if(tee.test(l)||ree.test(l)||nee.test(l))return"url("+u+l+u+")";if(l[0]==="/")return"url("+u+(qq(e)+l)+u+")";var d=e.split("/"),f=l.split("/");d.pop();for(var g=Kt(f),m;!(m=g()).done;){var v=m.value;v!=="."&&(v===".."?d.pop():d.push(v))}return"url("+u+d.join("/")+u+")"})}function D6(t,e){return e===void 0&&(e=!1),e?t.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):t.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function iee(t,e,r){r===void 0&&(r=!1);var n=Array.from(e.childNodes),i=[],s=0;if(n.length>1&&t&&typeof t=="string"){for(var o=D6(t,r),a=o.length/t.length,l=1;l<n.length;l++)if(n[l].textContent&&typeof n[l].textContent=="string"){for(var u=D6(n[l].textContent,r),d=100,f=3;f<u.length&&(u[f].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,f),1)!==-1);f++);for(;f<u.length;f++){var g=u.substring(0,f),m=o.split(g),v=-1;if(m.length===2)v=m[0].length;else if(m.length>2&&m[0]===""&&n[l-1].textContent!=="")v=o.indexOf(g,1);else if(m.length===1){if(g=g.substring(0,g.length-1),m=o.split(g),m.length<=1)return i.push(t),i;f=d+1}else f===u.length-1&&(v=o.indexOf(g));if(m.length>=2&&f>d){var A=n[l-1].textContent;if(A&&typeof A=="string"){var E=D6(A).length;v=o.indexOf(g,E)}v===-1&&(v=m[0].length)}if(v!==-1){for(var C=Math.floor(v/a);C>0&&C<t.length;){if(s+=1,s>50*n.length)return i.push(t),i;var k=D6(t.substring(0,C),r);if(k.length===v){i.push(t.substring(0,C)),t=t.substring(C),o=o.substring(v);break}else k.length<v?C+=Math.max(1,Math.floor((v-k.length)/a)):C-=Math.max(1,Math.floor((k.length-v)*a))}break}}}}return i.push(t),i}function see(t,e){return iee(t,e).join("/* rr_split */")}var oee=1,aee=new RegExp("[^a-z0-9-_:]"),Wm=-2;function mB(){return oee++}function cee(t){if(kr(t,HTMLFormElement))return"form";var e=lf(t.tagName);return aee.test(e)?"div":e}var I1,yB,lee=/^[^ \t\n\r\u000c]+/,uee=/^[, \t\n\r\u000c]+/;function hee(t,e){if(e.trim()==="")return e;var r=0;function n(u){var d,f=u.exec(e.substring(r));return f?(d=f[0],r+=d.length,d):""}for(var i=[];n(uee),!(r>=e.length);){var s=n(lee);if(s.slice(-1)===",")s=R1(t,s.substring(0,s.length-1)),i.push(s);else{var o="";s=R1(t,s);for(var a=!1;;){var l=e.charAt(r);if(l===""){i.push((s+o).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){r+=1,i.push((s+o).trim());break}else l==="("&&(a=!0);o+=l,r+=1}}}return i.join(", ")}var wB=new WeakMap;function R1(t,e){return!e||e.trim()===""?e:c7(t,e)}function dee(t){return!!(t.tagName==="svg"||t.ownerSVGElement)}function c7(t,e){var r=wB.get(t);if(r||(r=t.createElement("a"),wB.set(t,r)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return r.setAttribute("href",e),r.href}function vB(t,e,r,n){return n&&(r==="src"||r==="href"&&!(e==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(e==="table"||e==="td"||e==="th")?R1(t,n):r==="srcset"?hee(t,n):r==="style"?U6(n,c7(t)):e==="object"&&r==="data"?R1(t,n):n)}function bB(t,e,r){return(t==="video"||t==="audio")&&e==="autoplay"}function fee(t,e,r){try{if(typeof e=="string"){if(t.classList.contains(e))return!0}else for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch{}return!1}function F6(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return r?F6(ks.parentNode(t),e,r):!1;for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return r?F6(ks.parentNode(t),e,r):!1}function AB(t,e,r,n){var i;if(hB(t)){if(i=t,!ks.childNodes(i).length)return!1}else{if(ks.parentElement(t)===null)return!1;i=ks.parentElement(t)}try{if(typeof e=="string"){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(F6(i,e,n))return!0;if(r){if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function pee(t,e,r){var n=t.contentWindow;if(n){var i=!1,s;try{s=n.document.readyState}catch{return}if(s!=="complete"){var o=setTimeout(function(){i||(e(),i=!0)},r);t.addEventListener("load",function(){clearTimeout(o),i=!0,e()});return}var a="about:blank";if(n.location.href!==a||t.src===a||t.src==="")return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}}function gee(t,e,r){var n=!1,i;try{i=t.sheet}catch{return}if(!i){var s=setTimeout(function(){n||(e(),n=!0)},r);t.addEventListener("load",function(){clearTimeout(s),n=!0,e()})}}function mee(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,s=e.blockSelector,o=e.needsMask,a=e.inlineStylesheet,l=e.maskInputOptions,u=l===void 0?{}:l,d=e.maskTextFn,f=e.maskInputFn,g=e.dataURLOptions,m=g===void 0?{}:g,v=e.inlineImages,A=e.recordCanvas,E=e.keepIframeSrcFn,C=e.newlyAddedElement,k=C===void 0?!1:C,I=e.cssCaptured,S=I===void 0?!1:I,N=yee(r,n);switch(t.nodeType){case t.DOCUMENT_NODE:return t.compatMode!=="CSS1Compat"?{type:Hi.Document,childNodes:[],compatMode:t.compatMode}:{type:Hi.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Hi.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:N};case t.ELEMENT_NODE:return vee(t,{doc:r,blockClass:i,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:f,dataURLOptions:m,inlineImages:v,recordCanvas:A,keepIframeSrcFn:E,newlyAddedElement:k,rootId:N});case t.TEXT_NODE:return wee(t,{doc:r,needsMask:o,maskTextFn:d,rootId:N,cssCaptured:S});case t.CDATA_SECTION_NODE:return{type:Hi.CDATA,textContent:"",rootId:N};case t.COMMENT_NODE:return{type:Hi.Comment,textContent:ks.textContent(t)||"",rootId:N};default:return!1}}function yee(t,e){if(e.hasNode(t)){var r=e.getId(t);return r===1?void 0:r}}function wee(t,e){var r=e.needsMask,n=e.maskTextFn,i=e.rootId,s=e.cssCaptured,o=ks.parentNode(t),a=o&&o.tagName,l="",u=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0;return d?l="SCRIPT_PLACEHOLDER":s||(l=ks.textContent(t),u&&l&&(l=U6(l,c7(e.doc)))),!u&&!d&&l&&r&&(l=n?n(l,ks.parentElement(t)):l.replace(/[\S]/g,"*")),{type:Hi.Text,textContent:l||"",rootId:i}}function vee(t,e){for(var r=e.doc,n=e.blockClass,i=e.blockSelector,s=e.inlineStylesheet,o=e.maskInputOptions,a=o===void 0?{}:o,l=e.maskInputFn,u=e.dataURLOptions,d=u===void 0?{}:u,f=e.inlineImages,g=e.recordCanvas,m=e.keepIframeSrcFn,v=e.newlyAddedElement,A=v===void 0?!1:v,E=e.rootId,C=fee(t,n,i),k=cee(t),I={},S=t.attributes.length,N=0;N<S;N++){var W=t.attributes[N];bB(k,W.name,W.value)||(I[W.name]=vB(r,k,lf(W.name),W.value))}if(k==="link"&&s){var G=Array.from(r.styleSheets).find(function(me){return me.href===t.href}),L=null;G&&(L=a7(G)),L&&(delete I.rel,delete I.href,I._cssText=L)}if(k==="style"&&t.sheet){var V=a7(t.sheet);V&&(t.childNodes.length>1&&(V=see(V,t)),I._cssText=V)}if(k==="input"||k==="textarea"||k==="select"){var $=t.value,j=t.checked;I.type!=="radio"&&I.type!=="checkbox"&&I.type!=="submit"&&I.type!=="button"&&$?I.value=M6({element:t,type:B6(t),tagName:k,value:$,maskInputOptions:a,maskInputFn:l}):j&&(I.checked=j)}if(k==="option"&&(t.selected&&!a.select?I.selected=!0:delete I.selected),k==="dialog"&&t.open&&(I.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"),k==="canvas"&&g){if(t.__context==="2d")Xq(t)||(I.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var B=t.toDataURL(d.type,d.quality),O=r.createElement("canvas");O.width=t.width,O.height=t.height;var H=O.toDataURL(d.type,d.quality);B!==H&&(I.rr_dataURL=B)}}if(k==="img"&&f){I1||(I1=r.createElement("canvas"),yB=I1.getContext("2d"));var D=t,q=D.currentSrc||D.getAttribute("src")||"<unknown-src>",K=D.crossOrigin,te=function(){D.removeEventListener("load",te);try{I1.width=D.naturalWidth,I1.height=D.naturalHeight,yB.drawImage(D,0,0),I.rr_dataURL=I1.toDataURL(d.type,d.quality)}catch(me){if(D.crossOrigin!=="anonymous"){D.crossOrigin="anonymous",D.complete&&D.naturalWidth!==0?te():D.addEventListener("load",te);return}else console.warn("Cannot inline img src="+q+"! Error: "+me)}D.crossOrigin==="anonymous"&&(K?I.crossOrigin=K:D.removeAttribute("crossorigin"))};D.complete&&D.naturalWidth!==0?te():D.addEventListener("load",te)}if(k==="audio"||k==="video"){var Q=I;Q.rr_mediaState=t.paused?"paused":"played",Q.rr_mediaCurrentTime=t.currentTime,Q.rr_mediaPlaybackRate=t.playbackRate,Q.rr_mediaMuted=t.muted,Q.rr_mediaLoop=t.loop,Q.rr_mediaVolume=t.volume}if(A||(t.scrollLeft&&(I.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(I.rr_scrollTop=t.scrollTop)),C){var X=t.getBoundingClientRect(),Y=X.width,re=X.height;I={class:I.class,rr_width:""+Y+"px",rr_height:""+re+"px"}}k==="iframe"&&!m(I.src)&&(t.contentDocument||(I.rr_src=I.src),delete I.src);var ue;try{customElements.get(k)&&(ue=!0)}catch{}return{type:Hi.Element,tagName:k,attributes:I,childNodes:[],isSVG:dee(t)||void 0,needBlock:C,rootId:E,isCustom:ue}}function On(t){return t==null?"":t.toLowerCase()}function bee(t,e){if(e.comment&&t.type===Hi.Comment)return!0;if(t.type===Hi.Element){if(e.script&&(t.tagName==="script"||t.tagName==="link"&&(t.attributes.rel==="preload"&&t.attributes.as==="script"||t.attributes.rel==="modulepreload")||t.tagName==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&gB(t.attributes.href)==="js"))return!0;if(e.headFavicon&&(t.tagName==="link"&&t.attributes.rel==="shortcut icon"||t.tagName==="meta"&&(On(t.attributes.name).match(/^msapplication-tile(image|color)$/)||On(t.attributes.name)==="application-name"||On(t.attributes.rel)==="icon"||On(t.attributes.rel)==="apple-touch-icon"||On(t.attributes.rel)==="shortcut icon")))return!0;if(t.tagName==="meta"){if(e.headMetaDescKeywords&&On(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(On(t.attributes.property).match(/^(og|twitter|fb):/)||On(t.attributes.name).match(/^(og|twitter):/)||On(t.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(On(t.attributes.name)==="robots"||On(t.attributes.name)==="googlebot"||On(t.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&t.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(On(t.attributes.name)==="author"||On(t.attributes.name)==="generator"||On(t.attributes.name)==="framework"||On(t.attributes.name)==="publisher"||On(t.attributes.name)==="progid"||On(t.attributes.property).match(/^article:/)||On(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(On(t.attributes.name)==="google-site-verification"||On(t.attributes.name)==="yandex-verification"||On(t.attributes.name)==="csrf-token"||On(t.attributes.name)==="p:domain_verify"||On(t.attributes.name)==="verify-v1"||On(t.attributes.name)==="verification"||On(t.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function N1(t,e){var r=e.doc,n=e.mirror,i=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,u=l===void 0?!1:l,d=e.inlineStylesheet,f=d===void 0?!0:d,g=e.maskInputOptions,m=g===void 0?{}:g,v=e.maskTextFn,A=e.maskInputFn,E=e.slimDOMOptions,C=e.dataURLOptions,k=C===void 0?{}:C,I=e.inlineImages,S=I===void 0?!1:I,N=e.recordCanvas,W=N===void 0?!1:N,G=e.onSerialize,L=e.onIframeLoad,V=e.iframeLoadTimeout,$=V===void 0?5e3:V,j=e.onStylesheetLoad,B=e.stylesheetLoadTimeout,O=B===void 0?5e3:B,H=e.keepIframeSrcFn,D=H===void 0?function(){return!1}:H,q=e.newlyAddedElement,K=q===void 0?!1:q,te=e.cssCaptured,Q=te===void 0?!1:te,X=e.needsMask,Y=e.preserveWhiteSpace,re=Y===void 0?!0:Y;if(!X){var ue=X===void 0;X=AB(t,o,a,ue)}var me=mee(t,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:X,inlineStylesheet:f,maskInputOptions:m,maskTextFn:v,maskInputFn:A,dataURLOptions:k,inlineImages:S,recordCanvas:W,keepIframeSrcFn:D,newlyAddedElement:K,cssCaptured:Q});if(!me)return console.warn(t,"not serialized"),null;var Re;n.hasNode(t)?Re=n.getId(t):bee(me,E)||!re&&me.type===Hi.Text&&!me.textContent.replace(/^\s+|\s+$/gm,"").length?Re=Wm:Re=mB();var Te=Object.assign(me,{id:Re});if(n.add(t,Te),Re===Wm)return null;G&&G(t);var ye=!u;if(Te.type===Hi.Element){ye=ye&&!Te.needBlock,delete Te.needBlock;var ve=ks.shadowRoot(t);ve&&Hm(ve)&&(Te.isShadowHost=!0)}if((Te.type===Hi.Document||Te.type===Hi.Element)&&ye){E.headWhitespace&&Te.type===Hi.Element&&Te.tagName==="head"&&(re=!1);var ke={doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:X,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:f,maskInputOptions:m,maskTextFn:v,maskInputFn:A,slimDOMOptions:E,dataURLOptions:k,inlineImages:S,recordCanvas:W,preserveWhiteSpace:re,onSerialize:G,onIframeLoad:L,iframeLoadTimeout:$,onStylesheetLoad:j,stylesheetLoadTimeout:O,keepIframeSrcFn:D,cssCaptured:!1};if(!(Te.type===Hi.Element&&Te.tagName==="textarea"&&Te.attributes.value!==void 0)){Te.type===Hi.Element&&Te.attributes._cssText!==void 0&&typeof Te.attributes._cssText=="string"&&(ke.cssCaptured=!0);for(var ee=Kt(Array.from(ks.childNodes(t))),Se;!(Se=ee()).done;){var Oe=Se.value,Ae=N1(Oe,ke);Ae&&Te.childNodes.push(Ae)}}var fe=null;if(hB(t)&&(fe=ks.shadowRoot(t)))for(var Z=Kt(Array.from(ks.childNodes(fe))),se;!(se=Z()).done;){var pe=se.value,Ne=N1(pe,ke);Ne&&(Hm(fe)&&(Ne.isShadow=!0),Te.childNodes.push(Ne))}}var xe=ks.parentNode(t);return xe&&Vm(xe)&&Hm(xe)&&(Te.isShadow=!0),Te.type===Hi.Element&&Te.tagName==="iframe"&&pee(t,function(){var Ge=t.contentDocument;if(Ge&&L){var ie=N1(Ge,{doc:Ge,mirror:n,blockClass:i,blockSelector:s,needsMask:X,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskTextFn:v,maskInputFn:A,slimDOMOptions:E,dataURLOptions:k,inlineImages:S,recordCanvas:W,preserveWhiteSpace:re,onSerialize:G,onIframeLoad:L,iframeLoadTimeout:$,onStylesheetLoad:j,stylesheetLoadTimeout:O,keepIframeSrcFn:D});ie&&L(t,ie)}},$),Te.type===Hi.Element&&Te.tagName==="link"&&typeof Te.attributes.rel=="string"&&(Te.attributes.rel==="stylesheet"||Te.attributes.rel==="preload"&&typeof Te.attributes.href=="string"&&gB(Te.attributes.href)==="css")&&gee(t,function(){if(j){var Ge=N1(t,{doc:r,mirror:n,blockClass:i,blockSelector:s,needsMask:X,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:f,maskInputOptions:m,maskTextFn:v,maskInputFn:A,slimDOMOptions:E,dataURLOptions:k,inlineImages:S,recordCanvas:W,preserveWhiteSpace:re,onSerialize:G,onIframeLoad:L,iframeLoadTimeout:$,onStylesheetLoad:j,stylesheetLoadTimeout:O,keepIframeSrcFn:D});Ge&&j(t,Ge)}},O),Te}function Aee(t,e){var r=e||{},n=r.mirror,i=n===void 0?new fB:n,s=r.blockClass,o=s===void 0?"rr-block":s,a=r.blockSelector,l=a===void 0?null:a,u=r.maskTextClass,d=u===void 0?"rr-mask":u,f=r.maskTextSelector,g=f===void 0?null:f,m=r.inlineStylesheet,v=m===void 0?!0:m,A=r.inlineImages,E=A===void 0?!1:A,C=r.recordCanvas,k=C===void 0?!1:C,I=r.maskAllInputs,S=I===void 0?!1:I,N=r.maskTextFn,W=r.maskInputFn,G=r.slimDOM,L=G===void 0?!1:G,V=r.dataURLOptions,$=r.preserveWhiteSpace,j=r.onSerialize,B=r.onIframeLoad,O=r.iframeLoadTimeout,H=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,q=r.keepIframeSrcFn,K=q===void 0?function(){return!1}:q,te=S===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:S===!1?{password:!0}:S,Q=L===!0||L==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:L==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:L===!1?{}:L;return N1(t,{doc:t,mirror:i,blockClass:o,blockSelector:l,maskTextClass:d,maskTextSelector:g,skipChild:!1,inlineStylesheet:v,maskInputOptions:te,maskTextFn:N,maskInputFn:W,slimDOMOptions:Q,dataURLOptions:V,inlineImages:E,recordCanvas:k,preserveWhiteSpace:$,onSerialize:j,onIframeLoad:B,iframeLoadTimeout:O,onStylesheetLoad:H,stylesheetLoadTimeout:D,keepIframeSrcFn:K,newlyAddedElement:!1})}function Eee(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tee(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return kr(this,n)?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var l7={exports:{}},Ln=String,EB=function(){return{isColorSupported:!1,reset:Ln,bold:Ln,dim:Ln,italic:Ln,underline:Ln,inverse:Ln,hidden:Ln,strikethrough:Ln,black:Ln,red:Ln,green:Ln,yellow:Ln,blue:Ln,magenta:Ln,cyan:Ln,white:Ln,gray:Ln,bgBlack:Ln,bgRed:Ln,bgGreen:Ln,bgYellow:Ln,bgBlue:Ln,bgMagenta:Ln,bgCyan:Ln,bgWhite:Ln}};l7.exports=EB(),l7.exports.createColors=EB;var See=l7.exports,Cee={},kee=Object.freeze(Object.defineProperty({__proto__:null,default:Cee},Symbol.toStringTag,{value:"Module"})),mi=Tee(kee),TB=See,SB=mi,u7=(function(t){Cs(e,t);function e(n,i,s,o,a,l){var u;return u=t.call(this,n)||this,u.name="CssSyntaxError",u.reason=n,a&&(u.file=a),o&&(u.source=o),l&&(u.plugin=l),typeof i<"u"&&typeof s<"u"&&(typeof i=="number"?(u.line=i,u.column=s):(u.line=i.line,u.column=i.column,u.endLine=s.line,u.endColumn=s.column)),u.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(u,e),u}var r=e.prototype;return r.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},r.showSourceCode=function(i){var s=this;if(!this.source)return"";var o=this.source;i==null&&(i=TB.isColorSupported),SB&&i&&(o=SB(o));var a=o.split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,a.length),d=String(u).length,f,g;if(i){var m=TB.createColors(!0),v=m.bold,A=m.gray,E=m.red;f=function(C){return v(E(C))},g=function(C){return A(C)}}else f=g=function(C){return C};return a.slice(l,u).map(function(C,k){var I=l+1+k,S=" "+(" "+I).slice(-d)+" | ";if(I===s.line){var N=g(S.replace(/\d/g," "))+C.slice(0,s.column-1).replace(/[^\t]/g," ");return f(">")+g(S)+C+`
552
552
  `+N+f("^")}return" "+g(S)+C}).join(`
553
553
  `)},r.toString=function(){var i=this.showSourceCode();return i&&(i=`
554
554
 
@@ -682,7 +682,7 @@ crtw-text-white crtw-mt-[5px] crtw-justify-center crtw-flex"><!></button>`);func
682
682
  `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let be=0;be<oe.length;be++)he[OW][B.getCharCode(oe[be])]=be;const ge=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let be=0;be<ge.length;be++)B.getCharCode(ge[be])>0&&(he[$c][B.getCharCode(ge[be])]=be);return he}const LT=r1e(k.createInt32Array(5,256));class F3{constructor(c){this.text=c}encode(){const c=B.getCharCode(" "),h=B.getCharCode(`
683
683
  `);let p=NW.singletonList(Qc.INITIAL_STATE);for(let y=0;y<this.text.length;y++){let b,T=y+1<this.text.length?this.text[y+1]:0;switch(this.text[y]){case B.getCharCode("\r"):b=T===h?2:0;break;case B.getCharCode("."):b=T===c?3:0;break;case B.getCharCode(","):b=T===c?4:0;break;case B.getCharCode(":"):b=T===c?5:0;break;default:b=0}b>0?(p=F3.updateStateListForPair(p,y,b),y++):p=this.updateStateListForChar(p,y)}return NW.min(p,(y,b)=>y.getBitCount()-b.getBitCount()).toBitArray(this.text)}updateStateListForChar(c,h){const p=[];for(let y of c)this.updateStateForChar(y,h,p);return F3.simplifyStates(p)}updateStateForChar(c,h,p){let y=this.text[h]&255,b=LT[c.getMode()][y]>0,T=null;for(let R=0;R<=$c;R++){let F=LT[R][y];if(F>0){if(T==null&&(T=c.endBinaryShift(h)),!b||R===c.getMode()||R===ma){const J=T.latchAndAppend(R,F);p.push(J)}if(!b&&xW[c.getMode()][R]>=0){const J=T.shiftAndAppend(R,F);p.push(J)}}}if(c.getBinaryShiftByteCount()>0||LT[c.getMode()][y]===0){let R=c.addBinaryShiftChar(h);p.push(R)}}static updateStateListForPair(c,h,p){const y=[];for(let b of c)this.updateStateForPair(b,h,p,y);return this.simplifyStates(y)}static updateStateForPair(c,h,p,y){let b=c.endBinaryShift(h);if(y.push(b.latchAndAppend($c,p)),c.getMode()!==$c&&y.push(b.shiftAndAppend($c,p)),p===3||p===4){let T=b.latchAndAppend(ma,16-p).latchAndAppend(ma,1);y.push(T)}if(c.getBinaryShiftByteCount()>0){let T=c.addBinaryShiftChar(h).addBinaryShiftChar(h+1);y.push(T)}}static simplifyStates(c){let h=[];for(const p of c){let y=!0;for(const b of h){if(b.isBetterThanOrEqualTo(p)){y=!1;break}p.isBetterThanOrEqualTo(b)&&(h=h.filter(T=>T!==b))}y&&h.push(p)}return h}}class on{constructor(){}static encodeBytes(c){return on.encode(c,on.DEFAULT_EC_PERCENT,on.DEFAULT_AZTEC_LAYERS)}static encode(c,h,p){let y=new F3(c).encode(),b=I.truncDivision(y.getSize()*h,100)+11,T=y.getSize()+b,R,F,J,oe,ge;if(p!==on.DEFAULT_AZTEC_LAYERS){if(R=p<0,F=Math.abs(p),F>(R?on.MAX_NB_BITS_COMPACT:on.MAX_NB_BITS))throw new f(B.format("Illegal value %s for layers",p));J=on.totalBitsInLayer(F,R),oe=on.WORD_SIZE[F];let bt=J-J%oe;if(ge=on.stuffBits(y,oe),ge.getSize()+b>bt)throw new f("Data to large for user specified layer");if(R&&ge.getSize()>oe*64)throw new f("Data to large for user specified layer")}else{oe=0,ge=null;for(let bt=0;;bt++){if(bt>on.MAX_NB_BITS)throw new f("Data too large for an Aztec code");if(R=bt<=3,F=R?bt+1:bt,J=on.totalBitsInLayer(F,R),T>J)continue;(ge==null||oe!==on.WORD_SIZE[F])&&(oe=on.WORD_SIZE[F],ge=on.stuffBits(y,oe));let Vr=J-J%oe;if(!(R&&ge.getSize()>oe*64)&&ge.getSize()+b<=Vr)break}}let be=on.generateCheckWords(ge,J,oe),Me=ge.getSize()/oe,He=on.generateModeMessage(R,F,Me),ze=(R?11:14)+F*4,et=new Int32Array(ze),ct;if(R){ct=ze;for(let bt=0;bt<et.length;bt++)et[bt]=bt}else{ct=ze+1+2*I.truncDivision(I.truncDivision(ze,2)-1,15);let bt=I.truncDivision(ze,2),Vr=I.truncDivision(ct,2);for(let Tr=0;Tr<bt;Tr++){let ao=Tr+I.truncDivision(Tr,15);et[bt-Tr-1]=Vr-ao-1,et[bt+Tr]=Vr+ao+1}}let _t=new H(ct);for(let bt=0,Vr=0;bt<F;bt++){let Tr=(F-bt)*4+(R?9:12);for(let ao=0;ao<Tr;ao++){let cc=ao*2;for(let co=0;co<2;co++)be.get(Vr+cc+co)&&_t.set(et[bt*2+co],et[bt*2+ao]),be.get(Vr+Tr*2+cc+co)&&_t.set(et[bt*2+ao],et[ze-1-bt*2-co]),be.get(Vr+Tr*4+cc+co)&&_t.set(et[ze-1-bt*2-co],et[ze-1-bt*2-ao]),be.get(Vr+Tr*6+cc+co)&&_t.set(et[ze-1-bt*2-ao],et[bt*2+co])}Vr+=Tr*8}if(on.drawModeMessage(_t,R,ct,He),R)on.drawBullsEye(_t,I.truncDivision(ct,2),5);else{on.drawBullsEye(_t,I.truncDivision(ct,2),7);for(let bt=0,Vr=0;bt<I.truncDivision(ze,2)-1;bt+=15,Vr+=16)for(let Tr=I.truncDivision(ct,2)&1;Tr<ct;Tr+=2)_t.set(I.truncDivision(ct,2)-Vr,Tr),_t.set(I.truncDivision(ct,2)+Vr,Tr),_t.set(Tr,I.truncDivision(ct,2)-Vr),_t.set(Tr,I.truncDivision(ct,2)+Vr)}let kt=new RW;return kt.setCompact(R),kt.setSize(ct),kt.setLayers(F),kt.setCodeWords(Me),kt.setMatrix(_t),kt}static drawBullsEye(c,h,p){for(let y=0;y<p;y+=2)for(let b=h-y;b<=h+y;b++)c.set(b,h-y),c.set(b,h+y),c.set(h-y,b),c.set(h+y,b);c.set(h-p,h-p),c.set(h-p+1,h-p),c.set(h-p,h-p+1),c.set(h+p,h-p),c.set(h+p,h-p+1),c.set(h+p,h+p-1)}static generateModeMessage(c,h,p){let y=new S;return c?(y.appendBits(h-1,2),y.appendBits(p-1,6),y=on.generateCheckWords(y,28,4)):(y.appendBits(h-1,5),y.appendBits(p-1,11),y=on.generateCheckWords(y,40,4)),y}static drawModeMessage(c,h,p,y){let b=I.truncDivision(p,2);if(h)for(let T=0;T<7;T++){let R=b-3+T;y.get(T)&&c.set(R,b-5),y.get(T+7)&&c.set(b+5,R),y.get(20-T)&&c.set(R,b+5),y.get(27-T)&&c.set(b-5,R)}else for(let T=0;T<10;T++){let R=b-5+T+I.truncDivision(T,5);y.get(T)&&c.set(R,b-7),y.get(T+10)&&c.set(b+7,R),y.get(29-T)&&c.set(R,b+7),y.get(39-T)&&c.set(b-7,R)}}static generateCheckWords(c,h,p){let y=c.getSize()/p,b=new MT(on.getGF(p)),T=I.truncDivision(h,p),R=on.bitsToWords(c,p,T);b.encode(R,T-y);let F=h%p,J=new S;J.appendBits(0,F);for(const oe of Array.from(R))J.appendBits(oe,p);return J}static bitsToWords(c,h,p){let y=new Int32Array(p),b,T;for(b=0,T=c.getSize()/h;b<T;b++){let R=0;for(let F=0;F<h;F++)R|=c.get(b*h+F)?1<<h-F-1:0;y[b]=R}return y}static getGF(c){switch(c){case 4:return Ae.AZTEC_PARAM;case 6:return Ae.AZTEC_DATA_6;case 8:return Ae.AZTEC_DATA_8;case 10:return Ae.AZTEC_DATA_10;case 12:return Ae.AZTEC_DATA_12;default:throw new f("Unsupported word size "+c)}}static stuffBits(c,h){let p=new S,y=c.getSize(),b=(1<<h)-2;for(let T=0;T<y;T+=h){let R=0;for(let F=0;F<h;F++)(T+F>=y||c.get(T+F))&&(R|=1<<h-1-F);(R&b)===b?(p.appendBits(R&b,h),T--):R&b?p.appendBits(R,h):(p.appendBits(R|1,h),T--)}return p}static totalBitsInLayer(c,h){return((h?88:112)+16*c)*c}}on.DEFAULT_EC_PERCENT=33,on.DEFAULT_AZTEC_LAYERS=0,on.MAX_NB_BITS=32,on.MAX_NB_BITS_COMPACT=4,on.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class jw{encode(c,h,p,y){return this.encodeWithHints(c,h,p,y,null)}encodeWithHints(c,h,p,y,b){let T=UT.ISO_8859_1,R=on.DEFAULT_EC_PERCENT,F=on.DEFAULT_AZTEC_LAYERS;return b!=null&&(b.has(zi.CHARACTER_SET)&&(T=IW.forName(b.get(zi.CHARACTER_SET).toString())),b.has(zi.ERROR_CORRECTION)&&(R=I.parseInt(b.get(zi.ERROR_CORRECTION).toString())),b.has(zi.AZTEC_LAYERS)&&(F=I.parseInt(b.get(zi.AZTEC_LAYERS).toString()))),jw.encodeLayers(c,h,p,y,T,R,F)}static encodeLayers(c,h,p,y,b,T,R){if(h!==Te.AZTEC)throw new f("Can only encode AZTEC, but got "+h);let F=on.encode(B.getBytes(c,b),T,R);return jw.renderResult(F,p,y)}static renderResult(c,h,p){let y=c.getMatrix();if(y==null)throw new Z;let b=y.getWidth(),T=y.getHeight(),R=Math.max(h,b),F=Math.max(p,T),J=Math.min(R/b,F/T),oe=(R-b*J)/2,ge=(F-T*J)/2,be=new H(R,F);for(let Me=0,He=ge;Me<T;Me++,He+=J)for(let ze=0,et=oe;ze<b;ze++,et+=J)y.get(ze,Me)&&be.setRegion(et,He,J,J);return be}}r.AbstractExpandedDecoder=Os,r.ArgumentException=d,r.ArithmeticException=Oe,r.AztecCode=RW,r.AztecCodeReader=x,r.AztecCodeWriter=jw,r.AztecDecoder=Ne,r.AztecDetector=U,r.AztecDetectorResult=Qe,r.AztecEncoder=on,r.AztecHighLevelEncoder=F3,r.AztecPoint=P,r.BarcodeFormat=Te,r.Binarizer=v,r.BinaryBitmap=g,r.BitArray=S,r.BitMatrix=H,r.BitSource=yn,r.BrowserAztecCodeReader=z,r.BrowserBarcodeReader=Wt,r.BrowserCodeReader=ue,r.BrowserDatamatrixCodeReader=oc,r.BrowserMultiFormatReader=Z0e,r.BrowserPDF417Reader=$0e,r.BrowserQRCodeReader=Q0e,r.BrowserQRCodeSvgWriter=Uf,r.CharacterSetECI=V,r.ChecksumException=m,r.Code128Reader=we,r.Code39Reader=Pe,r.DataMatrixDecodedBitStreamParser=hn,r.DataMatrixReader=gs,r.DecodeHintType=W,r.DecoderResult=ke,r.DefaultGridSampler=w,r.DetectorResult=Be,r.EAN13Reader=Yi,r.EncodeHintType=zi,r.Exception=u,r.FormatException=G,r.GenericGF=Ae,r.GenericGFPoly=Se,r.GlobalHistogramBinarizer=q,r.GridSampler=Ce,r.GridSamplerInstance=_,r.HTMLCanvasElementLuminanceSource=X,r.HybridBinarizer=K,r.ITFReader=Fe,r.IllegalArgumentException=f,r.IllegalStateException=Z,r.InvertedLuminanceSource=Q,r.LuminanceSource=te,r.MathUtils=xe,r.MultiFormatOneDReader=vt,r.MultiFormatReader=_W,r.MultiFormatWriter=Y0e,r.NotFoundException=D,r.OneDReader=ce,r.PDF417DecodedBitStreamParser=st,r.PDF417DecoderErrorCorrection=U3,r.PDF417Reader=ms,r.PDF417ResultMetadata=fn,r.PerspectiveTransform=_e,r.PlanarYUVLuminanceSource=Zc,r.QRCodeByteMatrix=Hw,r.QRCodeDataMask=Zs,r.QRCodeDecodedBitStreamParser=Gn,r.QRCodeDecoderErrorCorrectionLevel=Rr,r.QRCodeDecoderFormatInformation=xn,r.QRCodeEncoder=zn,r.QRCodeEncoderQRCode=Bf,r.QRCodeMaskUtil=ci,r.QRCodeMatrixUtil=or,r.QRCodeMode=qt,r.QRCodeReader=ga,r.QRCodeVersion=Qt,r.QRCodeWriter=wp,r.RGBLuminanceSource=BT,r.RSS14Reader=ht,r.RSSExpandedReader=Ve,r.ReaderException=Vw,r.ReedSolomonDecoder=se,r.ReedSolomonEncoder=MT,r.ReedSolomonException=fe,r.Result=me,r.ResultMetadataType=ve,r.ResultPoint=ie,r.StringUtils=B,r.UnsupportedOperationException=$,r.VideoInputDevice=Y,r.WhiteRectangleDetector=ut,r.WriterException=_n,r.ZXingArrays=k,r.ZXingCharset=IW,r.ZXingInteger=I,r.ZXingStandardCharsets=UT,r.ZXingStringBuilder=O,r.ZXingStringEncoding=j,r.ZXingSystem=A,r.createAbstractExpandedDecoder=je,Object.defineProperty(r,"__esModule",{value:!0})})})(_T,_T.exports);var Wn=_T.exports;const Hfe=kfe(Wn),Wfe=qde({__proto__:null,default:Hfe},[Wn]);var qH=(function(){function t(e,r,n){if(this.formatMap=new Map([[jt.QR_CODE,Wn.BarcodeFormat.QR_CODE],[jt.AZTEC,Wn.BarcodeFormat.AZTEC],[jt.CODABAR,Wn.BarcodeFormat.CODABAR],[jt.CODE_39,Wn.BarcodeFormat.CODE_39],[jt.CODE_93,Wn.BarcodeFormat.CODE_93],[jt.CODE_128,Wn.BarcodeFormat.CODE_128],[jt.DATA_MATRIX,Wn.BarcodeFormat.DATA_MATRIX],[jt.MAXICODE,Wn.BarcodeFormat.MAXICODE],[jt.ITF,Wn.BarcodeFormat.ITF],[jt.EAN_13,Wn.BarcodeFormat.EAN_13],[jt.EAN_8,Wn.BarcodeFormat.EAN_8],[jt.PDF_417,Wn.BarcodeFormat.PDF_417],[jt.RSS_14,Wn.BarcodeFormat.RSS_14],[jt.RSS_EXPANDED,Wn.BarcodeFormat.RSS_EXPANDED],[jt.UPC_A,Wn.BarcodeFormat.UPC_A],[jt.UPC_E,Wn.BarcodeFormat.UPC_E],[jt.UPC_EAN_EXTENSION,Wn.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!Wfe)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=r,this.logger=n;var i=this.createZXingFormats(e),s=new Map;s.set(Wn.DecodeHintType.POSSIBLE_FORMATS,i),s.set(Wn.DecodeHintType.TRY_HARDER,!1),this.hints=s}return t.prototype.decodeAsync=function(e){var r=this;return new Promise(function(n,i){try{n(r.decode(e))}catch(s){i(s)}})},t.prototype.decode=function(e){var r=new Wn.MultiFormatReader(this.verbose,this.hints),n=new Wn.HTMLCanvasElementLuminanceSource(e),i=new Wn.BinaryBitmap(new Wn.HybridBinarizer(n)),s=r.decode(i);return{text:s.text,format:YH.create(this.toHtml5QrcodeSupportedFormats(s.format)),debugData:this.createDebugData()}},t.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(r,n,i){e.set(r,n)}),e},t.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},t.prototype.createZXingFormats=function(e){for(var r=[],n=0,i=e;n<i.length;n++){var s=i[n];this.formatMap.has(s)?r.push(this.formatMap.get(s)):this.logger.logError("".concat(s," is not supported by")+"ZXingHtml5QrcodeShim")}return r},t.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},t})(),jfe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{u(n.next(d))}catch(f){o(f)}}function l(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((n=n.apply(t,[])).next())})},Gfe=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},eW=(function(){function t(e,r,n){if(this.formatMap=new Map([[jt.QR_CODE,"qr_code"],[jt.AZTEC,"aztec"],[jt.CODABAR,"codabar"],[jt.CODE_39,"code_39"],[jt.CODE_93,"code_93"],[jt.CODE_128,"code_128"],[jt.DATA_MATRIX,"data_matrix"],[jt.ITF,"itf"],[jt.EAN_13,"ean_13"],[jt.EAN_8,"ean_8"],[jt.PDF_417,"pdf417"],[jt.UPC_A,"upc_a"],[jt.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!t.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=r,this.logger=n;var i=this.createBarcodeDetectorFormats(e);if(this.detector=new BarcodeDetector(i),!this.detector)throw"BarcodeDetector detector not supported"}return t.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var e=new BarcodeDetector({formats:["qr_code"]});return typeof e<"u"},t.prototype.decodeAsync=function(e){return jfe(this,void 0,void 0,function(){var r,n;return Gfe(this,function(i){switch(i.label){case 0:return[4,this.detector.detect(e)];case 1:if(r=i.sent(),!r||r.length===0)throw"No barcode or QR code detected.";return n=this.selectLargestBarcode(r),[2,{text:n.rawValue,format:YH.create(this.toHtml5QrcodeSupportedFormats(n.format)),debugData:this.createDebugData()}]}})})},t.prototype.selectLargestBarcode=function(e){for(var r=null,n=0,i=0,s=e;i<s.length;i++){var o=s[i],a=o.boundingBox.width*o.boundingBox.height;a>n&&(n=a,r=o)}if(!r)throw"No largest barcode found";return r},t.prototype.createBarcodeDetectorFormats=function(e){for(var r=[],n=0,i=e;n<i.length;n++){var s=i[n];this.formatMap.has(s)?r.push(this.formatMap.get(s)):this.logger.warn("".concat(s," is not supported by")+"BarcodeDetectorDelegate")}return{formats:r}},t.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},t.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(r,n,i){e.set(r,n)}),e},t.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},t})(),tW=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{u(n.next(d))}catch(f){o(f)}}function l(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((n=n.apply(t,[])).next())})},rW=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},zfe=(function(){function t(e,r,n,i){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=n,r&&eW.isSupported()?(this.primaryDecoder=new eW(e,n,i),this.secondaryDecoder=new qH(e,n,i)):this.primaryDecoder=new qH(e,n,i)}return t.prototype.decodeAsync=function(e){return tW(this,void 0,void 0,function(){var r;return rW(this,function(n){switch(n.label){case 0:r=performance.now(),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(e)];case 2:return[2,n.sent()];case 3:return this.possiblyLogPerformance(r),[7];case 4:return[2]}})})},t.prototype.decodeRobustlyAsync=function(e){return tW(this,void 0,void 0,function(){var r,n;return rW(this,function(i){switch(i.label){case 0:r=performance.now(),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(e)];case 2:return[2,i.sent()];case 3:if(n=i.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(e)];throw n;case 4:return this.possiblyLogPerformance(r),[7];case 5:return[2]}})})},t.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},t.prototype.possiblyLogPerformance=function(e){if(this.verbose){var r=performance.now()-e;this.executionResults.push(r),this.executions++,this.possiblyFlushPerformanceReport()}},t.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var e=0,r=0,n=this.executionResults;r<n.length;r++){var i=n[r];e+=i}var s=e/this.executionResults.length;console.log("".concat(s," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},t})(),IT=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Uw=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{u(n.next(d))}catch(f){o(f)}}function l(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((n=n.apply(t,[])).next())})},Dw=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},nW=(function(){function t(e,r){this.name=e,this.track=r}return t.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},t.prototype.apply=function(e){var r={};r[this.name]=e;var n={advanced:[r]};return this.track.applyConstraints(n)},t.prototype.value=function(){var e=this.track.getSettings();if(this.name in e){var r=e[this.name];return r}return null},t})(),Zfe=(function(t){IT(e,t);function e(r,n){return t.call(this,r,n)||this}return e.prototype.min=function(){return this.getCapabilities().min},e.prototype.max=function(){return this.getCapabilities().max},e.prototype.step=function(){return this.getCapabilities().step},e.prototype.apply=function(r){var n={};n[this.name]=r;var i={advanced:[n]};return this.track.applyConstraints(i)},e.prototype.getCapabilities=function(){this.failIfNotSupported();var r=this.track.getCapabilities(),n=r[this.name];return{min:n.min,max:n.max,step:n.step}},e.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},e})(nW),$fe=(function(t){IT(e,t);function e(r){return t.call(this,"zoom",r)||this}return e})(Zfe),Qfe=(function(t){IT(e,t);function e(r){return t.call(this,"torch",r)||this}return e})(nW),Jfe=(function(){function t(e){this.track=e}return t.prototype.zoomFeature=function(){return new $fe(this.track)},t.prototype.torchFeature=function(){return new Qfe(this.track)},t})(),Yfe=(function(){function t(e,r,n){this.isClosed=!1,this.parentElement=e,this.mediaStream=r,this.callbacks=n,this.surface=this.createVideoElement(this.parentElement.clientWidth),e.append(this.surface)}return t.prototype.createVideoElement=function(e){var r=document.createElement("video");return r.style.width="".concat(e,"px"),r.style.display="block",r.muted=!0,r.setAttribute("muted","true"),r.playsInline=!0,r},t.prototype.setupSurface=function(){var e=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var r=function(){var n=e.surface.clientWidth,i=e.surface.clientHeight;e.callbacks.onRenderSurfaceReady(n,i),e.surface.removeEventListener("playing",r)};this.surface.addEventListener("playing",r),this.surface.srcObject=this.mediaStream,this.surface.play()},t.create=function(e,r,n,i){return Uw(this,void 0,void 0,function(){var s,o;return Dw(this,function(a){switch(a.label){case 0:return s=new t(e,r,i),n.aspectRatio?(o={aspectRatio:n.aspectRatio},[4,s.getFirstTrackOrFail().applyConstraints(o)]):[3,2];case 1:a.sent(),a.label=2;case 2:return s.setupSurface(),[2,s]}})})},t.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},t.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},t.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},t.prototype.resume=function(e){this.failIfClosed();var r=this,n=function(){setTimeout(e,200),r.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.play()},t.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},t.prototype.getSurface=function(){return this.failIfClosed(),this.surface},t.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},t.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},t.prototype.applyVideoConstraints=function(e){return Uw(this,void 0,void 0,function(){return Dw(this,function(r){if("aspectRatio"in e)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(e)]})})},t.prototype.close=function(){if(this.isClosed)return Promise.resolve();var e=this;return new Promise(function(r,n){var i=e.mediaStream.getVideoTracks(),s=i.length,o=0;e.mediaStream.getVideoTracks().forEach(function(a){e.mediaStream.removeTrack(a),a.stop(),++o,o>=s&&(e.isClosed=!0,e.parentElement.removeChild(e.surface),r())})})},t.prototype.getCapabilities=function(){return new Jfe(this.getFirstTrackOrFail())},t})(),Kfe=(function(){function t(e){this.mediaStream=e}return t.prototype.render=function(e,r,n){return Uw(this,void 0,void 0,function(){return Dw(this,function(i){return[2,Yfe.create(e,this.mediaStream,r,n)]})})},t.create=function(e){return Uw(this,void 0,void 0,function(){var r,n;return Dw(this,function(i){switch(i.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return r={audio:!1,video:e},[4,navigator.mediaDevices.getUserMedia(r)];case 1:return n=i.sent(),[2,new t(n)]}})})},t})(),iW=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{u(n.next(d))}catch(f){o(f)}}function l(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((n=n.apply(t,[])).next())})},sW=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Xfe=(function(){function t(){}return t.failIfNotSupported=function(){return iW(this,void 0,void 0,function(){return sW(this,function(e){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new t]})})},t.prototype.create=function(e){return iW(this,void 0,void 0,function(){return sW(this,function(r){return[2,Kfe.create(e)]})})},t})(),qfe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{u(n.next(d))}catch(f){o(f)}}function l(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((n=n.apply(t,[])).next())})},e0e=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},t0e=(function(){function t(){}return t.retrieve=function(){if(navigator.mediaDevices)return t.getCamerasFromMediaDevices();var e=MediaStreamTrack;return MediaStreamTrack&&e.getSources?t.getCamerasFromMediaStreamTrack():t.rejectWithError()},t.rejectWithError=function(){var e=mp.unableToQuerySupportedDevices();return t.isHttpsOrLocalhost()||(e=mp.insecureContextCameraQueryError()),Promise.reject(e)},t.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var e=location.host.split(":")[0];return e==="127.0.0.1"||e==="localhost"},t.getCamerasFromMediaDevices=function(){return qfe(this,void 0,void 0,function(){var e,r,n,i,s,o,a;return e0e(this,function(l){switch(l.label){case 0:return e=function(u){for(var d=u.getVideoTracks(),f=0,g=d;f<g.length;f++){var m=g[f];m.enabled=!1,m.stop(),u.removeTrack(m)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return r=l.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(n=l.sent(),i=[],s=0,o=n;s<o.length;s++)a=o[s],a.kind==="videoinput"&&i.push({id:a.deviceId,label:a.label});return e(r),[2,i]}})})},t.getCamerasFromMediaStreamTrack=function(){return new Promise(function(e,r){var n=function(s){for(var o=[],a=0,l=s;a<l.length;a++){var u=l[a];u.kind==="video"&&o.push({id:u.id,label:u.label})}e(o)},i=MediaStreamTrack;i.getSources(n)})},t})(),si;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.SCANNING=2]="SCANNING",t[t.PAUSED=3]="PAUSED"})(si||(si={}));var r0e=(function(){function t(){this.state=si.NOT_STARTED,this.onGoingTransactionNewState=si.UNKNOWN}return t.prototype.directTransition=function(e){this.failIfTransitionOngoing(),this.validateTransition(e),this.state=e},t.prototype.startTransition=function(e){return this.failIfTransitionOngoing(),this.validateTransition(e),this.onGoingTransactionNewState=e,this},t.prototype.execute=function(){if(this.onGoingTransactionNewState===si.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var e=this.onGoingTransactionNewState;this.onGoingTransactionNewState=si.UNKNOWN,this.directTransition(e)},t.prototype.cancel=function(){if(this.onGoingTransactionNewState===si.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=si.UNKNOWN},t.prototype.getState=function(){return this.state},t.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==si.UNKNOWN)throw"Cannot transition to a new state, already under transition"},t.prototype.validateTransition=function(e){switch(this.state){case si.UNKNOWN:throw"Transition from unknown is not allowed";case si.NOT_STARTED:this.failIfNewStateIs(e,[si.PAUSED]);break;case si.SCANNING:break;case si.PAUSED:break}},t.prototype.failIfNewStateIs=function(e,r){for(var n=0,i=r;n<i.length;n++){var s=i[n];if(e===s)throw"Cannot transition from ".concat(this.state," to ").concat(e)}},t})(),n0e=(function(){function t(e){this.stateManager=e}return t.prototype.startTransition=function(e){return this.stateManager.startTransition(e)},t.prototype.directTransition=function(e){this.stateManager.directTransition(e)},t.prototype.getState=function(){return this.stateManager.getState()},t.prototype.canScanFile=function(){return this.stateManager.getState()===si.NOT_STARTED},t.prototype.isScanning=function(){return this.stateManager.getState()!==si.NOT_STARTED},t.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===si.SCANNING},t.prototype.isPaused=function(){return this.stateManager.getState()===si.PAUSED},t})(),i0e=(function(){function t(){}return t.create=function(){return new n0e(new r0e)},t})(),s0e=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Oo=(function(t){s0e(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.DEFAULT_WIDTH=300,e.DEFAULT_WIDTH_OFFSET=2,e.FILE_SCAN_MIN_HEIGHT=300,e.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,e.MIN_QR_BOX_SIZE=50,e.SHADED_LEFT=1,e.SHADED_RIGHT=2,e.SHADED_TOP=3,e.SHADED_BOTTOM=4,e.SHADED_REGION_ELEMENT_ID="qr-shaded-region",e.VERBOSE=!1,e.BORDER_SHADER_DEFAULT_COLOR="#ffffff",e.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",e})(Ffe),o0e=(function(){function t(e,r){this.logger=r,this.fps=Oo.SCAN_DEFAULT_FPS,e?(e.fps&&(this.fps=e.fps),this.disableFlip=e.disableFlip===!0,this.qrbox=e.qrbox,this.aspectRatio=e.aspectRatio,this.videoConstraints=e.videoConstraints):this.disableFlip=Oo.DEFAULT_DISABLE_FLIP}return t.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?XH.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},t.prototype.isShadedBoxEnabled=function(){return!iu(this.qrbox)},t.create=function(e,r){return new t(e,r)},t})(),a0e=(function(){function t(e,r){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(e))throw"HTML Element with id=".concat(e," not found");this.elementId=e,this.verbose=!1;var n;typeof r=="boolean"?this.verbose=r===!0:r&&(n=r,this.verbose=n.verbose===!0,n.experimentalFeatures),this.logger=new Vfe(this.verbose),this.qrcode=new zfe(this.getSupportedFormats(r),this.getUseBarCodeDetectorIfSupported(n),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=i0e.create()}return t.prototype.start=function(e,r,n,i){var s=this;if(!e)throw"cameraIdOrConfig is required";if(!n||typeof n!="function")throw"qrCodeSuccessCallback is required and should be a function.";var o;i?o=i:o=this.verbose?this.logger.log:function(){};var a=o0e.create(r,this.logger);this.clearElement();var l=!1;a.videoConstraints&&(a.isMediaStreamConstraintsValid()?l=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var u=l,d=document.getElementById(this.elementId);d.clientWidth?d.clientWidth:Oo.DEFAULT_WIDTH,d.style.position="relative",this.shouldScan=!0,this.element=d;var f=this,g=this.stateManagerProxy.startTransition(si.SCANNING);return new Promise(function(m,v){var A=u?a.videoConstraints:f.createVideoConstraints(e);if(!A){g.cancel(),v("videoConstraints should be defined");return}var E={};(!u||a.aspectRatio)&&(E.aspectRatio=a.aspectRatio);var C={onRenderSurfaceReady:function(k,I){f.setupUi(k,I,a),f.isScanning=!0,f.foreverScan(a,n,o)}};Xfe.failIfNotSupported().then(function(k){k.create(A).then(function(I){return I.render(s.element,E,C).then(function(S){f.renderedCamera=S,g.execute(),m(null)}).catch(function(S){g.cancel(),v(S)})}).catch(function(I){g.cancel(),v(mp.errorGettingUserMedia(I))})}).catch(function(k){g.cancel(),v(mp.cameraStreamingNotSupported())})})},t.prototype.pause=function(e){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(si.PAUSED),this.showPausedState(),(iu(e)||e!==!0)&&(e=!1),e&&this.renderedCamera&&this.renderedCamera.pause()},t.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var e=this,r=function(){e.stateManagerProxy.directTransition(si.SCANNING),e.hidePausedState()};if(!this.renderedCamera.isPaused()){r();return}this.renderedCamera.resume(function(){r()})},t.prototype.getState=function(){return this.stateManagerProxy.getState()},t.prototype.stop=function(){var e=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var r=this.stateManagerProxy.startTransition(si.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var n=function(){if(e.element){var s=document.getElementById(Oo.SHADED_REGION_ELEMENT_ID);s&&e.element.removeChild(s)}},i=this;return this.renderedCamera.close().then(function(){return i.renderedCamera=null,i.element&&(i.element.removeChild(i.canvasElement),i.canvasElement=null),n(),i.qrRegion&&(i.qrRegion=null),i.context&&(i.context=null),r.execute(),i.hidePausedState(),i.isScanning=!1,Promise.resolve()})},t.prototype.scanFile=function(e,r){return this.scanFileV2(e,r).then(function(n){return n.decodedText})},t.prototype.scanFileV2=function(e,r){var n=this;if(!e||!(e instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(iu(r)&&(r=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(i,s){n.possiblyCloseLastScanImageFile(),n.clearElement(),n.lastScanImageFile=URL.createObjectURL(e);var o=new Image;o.onload=function(){var a=o.width,l=o.height,u=document.getElementById(n.elementId),d=u.clientWidth?u.clientWidth:Oo.DEFAULT_WIDTH,f=Math.max(u.clientHeight?u.clientHeight:l,Oo.FILE_SCAN_MIN_HEIGHT),g=n.computeCanvasDrawConfig(a,l,d,f);if(r){var m=n.createCanvasElement(d,f,"qr-canvas-visible");m.style.display="inline-block",u.appendChild(m);var v=m.getContext("2d");if(!v)throw"Unable to get 2d context from canvas";v.canvas.width=d,v.canvas.height=f,v.drawImage(o,0,0,a,l,g.x,g.y,g.width,g.height)}var A=Oo.FILE_SCAN_HIDDEN_CANVAS_PADDING,E=Math.max(o.width,g.width),C=Math.max(o.height,g.height),k=E+2*A,I=C+2*A,S=n.createCanvasElement(k,I);u.appendChild(S);var N=S.getContext("2d");if(!N)throw"Unable to get 2d context from canvas";N.canvas.width=k,N.canvas.height=I,N.drawImage(o,0,0,a,l,A,A,E,C);try{n.qrcode.decodeRobustlyAsync(S).then(function(W){i(KH.createFromQrcodeResult(W))}).catch(s)}catch(W){s("QR code parse error, error = ".concat(W))}},o.onerror=s,o.onabort=s,o.onstalled=s,o.onsuspend=s,o.src=URL.createObjectURL(e)})},t.prototype.clear=function(){this.clearElement()},t.getCameras=function(){return t0e.retrieve()},t.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},t.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},t.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},t.prototype.applyVideoConstraints=function(e){if(e){if(!XH.isMediaStreamConstraintsValid(e,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(e)},t.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},t.prototype.getSupportedFormats=function(e){var r=[jt.QR_CODE,jt.AZTEC,jt.CODABAR,jt.CODE_39,jt.CODE_93,jt.CODE_128,jt.DATA_MATRIX,jt.MAXICODE,jt.ITF,jt.EAN_13,jt.EAN_8,jt.PDF_417,jt.RSS_14,jt.RSS_EXPANDED,jt.UPC_A,jt.UPC_E,jt.UPC_EAN_EXTENSION];if(!e||typeof e=="boolean"||!e.formatsToSupport)return r;if(!Array.isArray(e.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(e.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var n=[],i=0,s=e.formatsToSupport;i<s.length;i++){var o=s[i];Dfe(o)?n.push(o):this.logger.warn("Invalid format: ".concat(o," passed in config, ignoring."))}if(n.length===0)throw"None of formatsToSupport match supported values.";return n},t.prototype.getUseBarCodeDetectorIfSupported=function(e){if(iu(e))return!0;if(!iu(e.useBarCodeDetectorIfSupported))return e.useBarCodeDetectorIfSupported!==!1;if(iu(e.experimentalFeatures))return!0;var r=e.experimentalFeatures;return iu(r.useBarCodeDetectorIfSupported)?!0:r.useBarCodeDetectorIfSupported!==!1},t.prototype.validateQrboxSize=function(e,r,n){var i=this,s=n.qrbox;this.validateQrboxConfig(s);var o=this.toQrdimensions(e,r,s),a=function(u){if(u<Oo.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(Oo.MIN_QR_BOX_SIZE,"px.")},l=function(u){return u>e&&(i.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),u=e),u};a(o.width),a(o.height),o.width=l(o.width)},t.prototype.validateQrboxConfig=function(e){if(typeof e!="number"&&typeof e!="function"&&(e.width===void 0||e.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},t.prototype.toQrdimensions=function(e,r,n){if(typeof n=="number")return{width:n,height:n};if(typeof n=="function")try{return n(e,r)}catch(i){throw new Error("qrbox config was passed as a function but it failed with unknown error"+i)}return n},t.prototype.setupUi=function(e,r,n){n.isShadedBoxEnabled()&&this.validateQrboxSize(e,r,n);var i=iu(n.qrbox)?{width:e,height:r}:n.qrbox;this.validateQrboxConfig(i);var s=this.toQrdimensions(e,r,i);s.height>r&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var o=n.isShadedBoxEnabled()&&s.height<=r,a={x:0,y:0,width:e,height:r},l=o?this.getShadedRegionBounds(e,r,s):a,u=this.createCanvasElement(l.width,l.height),d={willReadFrequently:!0},f=u.getContext("2d",d);f.canvas.width=l.width,f.canvas.height=l.height,this.element.append(u),o&&this.possiblyInsertShadingElement(this.element,e,r,s),this.createScannerPausedUiElement(this.element),this.qrRegion=l,this.context=f,this.canvasElement=u},t.prototype.createScannerPausedUiElement=function(e){var r=document.createElement("div");r.innerText=mp.scannerPaused(),r.style.display="none",r.style.position="absolute",r.style.top="0px",r.style.zIndex="1",r.style.background="rgba(9, 9, 9, 0.46)",r.style.color="#FFECEC",r.style.textAlign="center",r.style.width="100%",e.appendChild(r),this.scannerPausedUiElement=r},t.prototype.scanContext=function(e,r){var n=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(i){return e(i.text,KH.createFromQrcodeResult(i)),n.possiblyUpdateShaders(!0),!0}).catch(function(i){n.possiblyUpdateShaders(!1);var s=mp.codeParseError(i);return r(s,Lfe.createFrom(s)),!1})},t.prototype.foreverScan=function(e,r,n){var i=this;if(this.shouldScan&&this.renderedCamera){var s=this.renderedCamera.getSurface(),o=s.videoWidth/s.clientWidth,a=s.videoHeight/s.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var l=this.qrRegion.width*o,u=this.qrRegion.height*a,d=this.qrRegion.x*o,f=this.qrRegion.y*a;this.context.drawImage(s,d,f,l,u,0,0,this.qrRegion.width,this.qrRegion.height);var g=function(){i.foreverScanTimeout=setTimeout(function(){i.foreverScan(e,r,n)},i.getTimeoutFps(e.fps))};this.scanContext(r,n).then(function(m){!m&&e.disableFlip!==!0?(i.context.translate(i.context.canvas.width,0),i.context.scale(-1,1),i.scanContext(r,n).finally(function(){g()})):g()}).catch(function(m){i.logger.logError("Error happend while scanning context",m),g()})}},t.prototype.createVideoConstraints=function(e){if(typeof e=="string")return{deviceId:{exact:e}};if(typeof e=="object"){var r="facingMode",n="deviceId",i={user:!0,environment:!0},s="exact",o=function(v){if(v in i)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(v,"'")},a=Object.keys(e);if(a.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(a.length," keys");var l=Object.keys(e)[0];if(l!==r&&l!==n)throw"Only '".concat(r,"' and '").concat(n,"' ")+" are supported for 'cameraIdOrConfig'";if(l===r){var u=e.facingMode;if(typeof u=="string"){if(o(u))return{facingMode:u}}else if(typeof u=="object")if(s in u){if(o(u["".concat(s)]))return{facingMode:{exact:u["".concat(s)]}}}else throw"'facingMode' should be string or object with"+" ".concat(s," as key.");else{var d=typeof u;throw"Invalid type of 'facingMode' = ".concat(d)}}else{var f=e.deviceId;if(typeof f=="string")return{deviceId:f};if(typeof f=="object"){if(s in f)return{deviceId:{exact:f["".concat(s)]}};throw"'deviceId' should be string or object with"+" ".concat(s," as key.")}else{var g=typeof f;throw"Invalid type of 'deviceId' = ".concat(g)}}}var m=typeof e;throw"Invalid type of 'cameraIdOrConfig' = ".concat(m)},t.prototype.computeCanvasDrawConfig=function(e,r,n,i){if(e<=n&&r<=i){var s=(n-e)/2,o=(i-r)/2;return{x:s,y:o,width:e,height:r}}else{var a=e,l=r;return e>n&&(r=n/e*r,e=n),r>i&&(e=i/r*e,r=i),this.logger.log("Image downsampled from "+"".concat(a,"X").concat(l)+" to ".concat(e,"X").concat(r,".")),this.computeCanvasDrawConfig(e,r,n,i)}},t.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var e=document.getElementById(this.elementId);e&&(e.innerHTML="")},t.prototype.possiblyUpdateShaders=function(e){this.qrMatch!==e&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(r){r.style.backgroundColor=e?Oo.BORDER_SHADER_MATCH_COLOR:Oo.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=e)},t.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},t.prototype.createCanvasElement=function(e,r,n){var i=e,s=r,o=document.createElement("canvas");return o.style.width="".concat(i,"px"),o.style.height="".concat(s,"px"),o.style.display="none",o.id=iu(n)?"qr-canvas":n,o},t.prototype.getShadedRegionBounds=function(e,r,n){if(n.width>e||n.height>r)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(e-n.width)/2,y:(r-n.height)/2,width:n.width,height:n.height}},t.prototype.possiblyInsertShadingElement=function(e,r,n,i){if(!(r-i.width<1||n-i.height<1)){var s=document.createElement("div");s.style.position="absolute";var o=(r-i.width)/2,a=(n-i.height)/2;if(s.style.borderLeft="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),s.style.borderRight="".concat(o,"px solid rgba(0, 0, 0, 0.48)"),s.style.borderTop="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),s.style.borderBottom="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),s.style.boxSizing="border-box",s.style.top="0px",s.style.bottom="0px",s.style.left="0px",s.style.right="0px",s.id="".concat(Oo.SHADED_REGION_ELEMENT_ID),r-i.width<11||n-i.height<11)this.hasBorderShaders=!1;else{var l=5,u=40;this.insertShaderBorders(s,u,l,-l,null,0,!0),this.insertShaderBorders(s,u,l,-l,null,0,!1),this.insertShaderBorders(s,u,l,null,-l,0,!0),this.insertShaderBorders(s,u,l,null,-l,0,!1),this.insertShaderBorders(s,l,u+l,-l,null,-l,!0),this.insertShaderBorders(s,l,u+l,null,-l,-l,!0),this.insertShaderBorders(s,l,u+l,-l,null,-l,!1),this.insertShaderBorders(s,l,u+l,null,-l,-l,!1),this.hasBorderShaders=!0}e.append(s)}},t.prototype.insertShaderBorders=function(e,r,n,i,s,o,a){var l=document.createElement("div");l.style.position="absolute",l.style.backgroundColor=Oo.BORDER_SHADER_DEFAULT_COLOR,l.style.width="".concat(r,"px"),l.style.height="".concat(n,"px"),i!==null&&(l.style.top="".concat(i,"px")),s!==null&&(l.style.bottom="".concat(s,"px")),a?l.style.left="".concat(o,"px"):l.style.right="".concat(o,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(l),e.appendChild(l)},t.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},t.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},t.prototype.getTimeoutFps=function(e){return 1e3/e},t})(),oW;(function(t){t[t.STATUS_DEFAULT=0]="STATUS_DEFAULT",t[t.STATUS_SUCCESS=1]="STATUS_SUCCESS",t[t.STATUS_WARNING=2]="STATUS_WARNING",t[t.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(oW||(oW={}));const aW=class{constructor(e,r,n){this.previousScanText=null,this.rootElement=null,this.html5QrScanner=null,this.events={};const i=document.querySelector(e.target);if(!i)throw new Error(`Target element '${e.target}' is not found`);this.targetElement=i,this.decode=r,this.scannerElements=n}async _initializeScanner(e,r=10){var n,i;try{const s=this.scannerElements.VIDEO;this.html5QrScanner=new a0e(s);const o={fps:r,qrbox:{width:250,height:250},formatsToSupport:[jt.QR_CODE,jt.UPC_A,jt.UPC_E,jt.EAN_13]},a=e||{facingMode:"environment"};await this.html5QrScanner.start(a,o,async l=>{var u,d,f,g;if(this.previousScanText!==l)try{this.previousScanText=l;const m=await this.decode(l);(d=(u=this.events)==null?void 0:u[pp.CAPTURE])==null||d.call(u,m)}catch(m){(g=(f=this.events)==null?void 0:f[pp.ERROR])==null||g.call(f,m)}},()=>{})}catch(s){(i=(n=this.events)==null?void 0:n[pp.ERROR])==null||i.call(n,s),await this.stopAndCleanup()}}async stopAndCleanup(){var e,r;(e=this.html5QrScanner)!=null&&e.isScanning&&await this.html5QrScanner.stop(),(r=this.rootElement)==null||r.remove(),this.previousScanText=null}async close(){var e,r;(r=(e=this.events)==null?void 0:e[pp.CANCEL])==null||r.call(e),await this.stopAndCleanup()}on(e,r){this.events[e]=r}off(e){this.events[e]=void 0}};aW.events=pp;let c0e=aW;class RT extends c0e{constructor(e){super(e,Ufe,Pw)}async scan({deviceId:e,maxScansPerSecond:r=10,isCloseButton:n=!0}={}){await this.stopAndCleanup(),new Cfe({target:this.targetElement,props:{close:this.close.bind(this),isCloseButton:n,scannerElements:Pw}}),this.rootElement=document.getElementById(Pw.ROOT),await this._initializeScanner(e,r)}}typeof window<"u"&&(window.CredenzaScanner=RT);const l0e="cpuiScanner",u0e="cpuiCredScanner",cW=async t=>{const e=new RT({target:`#${t}`}),r=RT.events;return{scanner:e,events:r}},lW=t=>typeof t=="string"?t:t?.message,uW=(t,e,r)=>{const n=t.on.bind(t);r.onCapture&&n(e.CAPTURE,r.onCapture),r.onCancel&&n(e.CANCEL,r.onCancel),r.onError&&n(e.ERROR,r.onError)};function hW(t,e){if(new.target)return Ht({component:hW,...t});Ut(e,!1);const r=()=>wr(lr,"$configStore",s),n=()=>wr(ii,"$providerStore",s),i=()=>wr(Ro,"$clientPublicStore",s),[s,o]=Bi(),a=yt(),l=yt();var u=this&&this.__awaiter||function(te,Q,X,Y){function re(ue){return ue instanceof X?ue:new X(function(me){me(ue)})}return new(X||(X=Promise))(function(ue,me){function Re(ve){try{ye(Y.next(ve))}catch(ke){me(ke)}}function Te(ve){try{ye(Y.throw(ve))}catch(ke){me(ke)}}function ye(ve){ve.done?ue(ve.value):re(ve.value).then(Re,Te)}ye((Y=Y.apply(te,Q||[])).next())})};const d=dt(lr),{sendTokens:f,getCREDContract:g,toastAlert:m}=dt(Fn);let v="",A=yt(""),E=yt(),C=yt(""),k=18,I=yt("-"),S=yt(""),N=18,W=yt("-"),G=yt(""),L=yt(!0),V=yt(!1),$,j,B;const O=()=>u(void 0,void 0,void 0,function*(){const{scanner:te,events:Q}=yield cW(u0e);B=te,TE(_r.UI_CLOSED,B.close),uW(B,Q,{onCapture:X=>u(void 0,[X],void 0,function*({sub:Y}){if(!Y)return m(rL(),"failure"),B.close();const{address:re}=yield DL(Y);Ye(A,re),B.close()}),onCancel:()=>Ye(L,!0),onError:X=>{const Y=lW(X);Y?.includes("Permission")&&alert("In order to scan please allow the current page to access your camera and try again."),Ye(L,!0)}}),Ye(L,!1),yield B.scan()}),H=()=>u(void 0,void 0,void 0,function*(){const te=ae(C)===ae(I);Ye(V,!0);try{const Q=dn.parseUnits(String(ae(E)),te?k:N),X=yield f({address:ae(A),amount:Q,instance:te?$:void 0});m(`<a href="${SL(X.hash)}" target="_blank">Send TX</a> was created`),Ye(A,""),Ye(E,void 0);const[Y,re]=yield Promise.all([$.balanceOf(v),j.provider.getBalance(v)]);Ye(S,dn.formatUnits(Y,k)),Ye(G,parseFloat(dn.formatUnits(re,N)).toFixed(4)),qr(_r.RECHECK_BALANCE,[X.hash])}catch(Q){m(Q?.message||Q||"An error occurred while sending tokens","failure"),qr(_r.ERROR,{error:Q})}Ye(V,!1)}),D=()=>u(void 0,void 0,void 0,function*(){var te,Q,X,Y,re,ue;const me=dt(Cr);Ye(A,me?.to||""),Ye(E,me?.amount||void 0);const{decimals:Re,contract:Te}=yield g();k=Re,$=Te;const ye=dt(ii);if(!ye)return;j=yield ye.getSigner(),v=yield _i();const ve=yield Promise.all([$.symbol(),$.balanceOf(v),ye.getBalance(v),fetch("https://chainid.network/chains.json").then(ke=>ke.json()).then(ke=>ke.find(ee=>String(ee.chainId)===d.chainId))]);Ye(I,ve[0]),Ye(S,dn.formatUnits(ve[1],k)),N=(X=(Q=(te=ve[3])===null||te===void 0?void 0:te.nativeCurrency)===null||Q===void 0?void 0:Q.decimals)!==null&&X!==void 0?X:18,Ye(G,parseFloat(dn.formatUnits(ve[2],N)).toFixed(4)),Ye(W,(ue=(re=(Y=ve[3])===null||Y===void 0?void 0:Y.nativeCurrency)===null||re===void 0?void 0:re.symbol)!==null&&ue!==void 0?ue:"ETH"),Ye(C,ae(I))});tr(()=>(r(),n()),()=>{r().chainId&&n()&&D()}),tr(()=>ae(A),()=>{Ye(a,!!dn.isAddress(ae(A)))}),tr(()=>(ae(V),ae(E),ae(a),ae(C),ae(I),ae(S),ae(W),ae(G)),()=>{Ye(l,ae(V)||!ae(E)||!ae(a)||ae(C)===ae(I)&&ae(E)>+ae(S)||ae(C)===ae(W)&&ae(E)>+ae(G))}),Rn();var q={$set:Vt,$on:(te,Q)=>Lt(e,te,Q)};cr();{let te=nr(()=>(r(),ae(L),ae(S),ae(a),ft(Ur),ft(Tt),ae(C),ae(I),ae(W),ae(E),ae(G),ae(V),ae(l),i(),nt(()=>({title:"Send stored value",isNativeCurrecyTransferAllowed:r().transferTokens?.nativeCurrency!==!1,isScannerHidden:ae(L),balance:ae(S),chainId:d.chainId,isRecipientAddressValid:ae(a),onScannerClicked:O,onSendTokens:H,onBackClicked:()=>Ur.set(Tt.WALLET),onChangeCurrency:()=>ae(C)===ae(I)?Ye(C,ae(W)):Ye(C,ae(I)),onSetMaxAmount:()=>ae(C)===ae(I)?Ye(E,+ae(S)):Ye(E,+ae(G)),isLoading:ae(V),isSubmitDisabled:ae(l),credAlias:i()?.ui_settings.cred_alias,activeCurrency:ae(C),symbol:ae(I),nativeSymbol:ae(W),nativeBalance:ae(G)}))));KV(t,{get options(){return ae(te)},get recipientAddress(){return ae(A)},set recipientAddress(Q){Ye(A,Q)},get amount(){return ae(E)},set amount(Q){Ye(E,Q)},$$legacy:!0})}var K=Dt(q);return o(),K}const h0e=Object.freeze(Object.defineProperty({__proto__:null,default:hW},Symbol.toStringTag,{value:"Module"}));var d0e=lt('<div id="ctui-wallet-pay" class="crtw-w-full crtw-my-4" style="dispay: none;"><div id="ctui-payment-request-button"></div></div>');function dW(t,e){if(new.target)return Ht({component:dW,...t});Ut(e,!1);var r=this&&this.__awaiter||function(d,f,g,m){function v(A){return A instanceof g?A:new g(function(E){E(A)})}return new(g||(g=Promise))(function(A,E){function C(S){try{I(m.next(S))}catch(N){E(N)}}function k(S){try{I(m.throw(S))}catch(N){E(N)}}function I(S){S.done?A(S.value):v(S.value).then(C,k)}I((m=m.apply(d,f||[])).next())})};let n=gt(e,"doPayment",12),i=gt(e,"stripe",12),s=gt(e,"stripeElements",12),o=gt(e,"priceCents",12),a=gt(e,"isLoading",12);Dh(()=>r(void 0,void 0,void 0,function*(){const d=i().paymentRequest({country:"US",currency:"usd",total:{label:"Apple/Google payment",amount:o()},requestPayerName:!0,requestPayerEmail:!0});if(!(yield d.canMakePayment()))return;const g=document.getElementById("ctui-wallet-pay");g&&(g.style.display="crtw-block"),s().create("paymentRequestButton",{paymentRequest:d,style:{paymentRequestButton:{height:"48px"}}}).mount("#ctui-payment-request-button"),d.on("token",v=>r(void 0,void 0,void 0,function*(){a(!0);try{yield n()(v.token.id),yield v.complete("success")}catch(A){yield v.complete("error"),qr(_r.ERROR,{error:A})}a(!1)}))}));var l={get doPayment(){return n()},set doPayment(d){n(d),pt()},get stripe(){return i()},set stripe(d){i(d),pt()},get stripeElements(){return s()},set stripeElements(d){s(d),pt()},get priceCents(){return o()},set priceCents(d){o(d),pt()},get isLoading(){return a()},set isLoading(d){a(d),pt()},$set:Vt,$on:(d,f)=>Lt(e,d,f)};cr();var u=d0e();return We(t,u),Dt(l)}const f0e={base:{color:"#121e2b",fontSize:"12px","::placeholder":{color:"#d9d9d9"}},invalid:{color:"#fa755a"}},p0e=t=>new Promise((e,r)=>{const n=document.createElement("script");n.src=t,document.body.appendChild(n),n.addEventListener("load",()=>e(n)),n.addEventListener("error",()=>r(n))}),g0e=async(t,e,r=5)=>{let n=0;for(;n<r;){const i=await fetch(`${t}/orders/completed/${e}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${dt(Ls)}`},method:"GET"});if(i.status===204){if(n++,n<r)continue;throw new Error("No content received after multiple attempts")}if(!i.ok)throw new Error("Failed to get order details");const s=await i.json();if(s.status==="PAYMENT_ERROR")throw new Error(`Order failed: ${s.status}`);return s}},m0e=(t,e)=>{if(t.every(r=>r===null))throw new Error(`All transactions failed.
684
684
  ${e}`)},y0e=t=>{const e=t.filter(r=>r.error).map(r=>`Name: ${r.metadata?.name||r.directive.resource_id}, reason: ${r.error}`).join(`
685
- `);if(t?.every(r=>r.status==="ERROR"))throw new Error("All transactions failed.}");return e},fW=async({hash:t,stripeChargeId:e,title:r,subtitle:n,amount:i,currency:s})=>{const{credenza:o,receiptTarget:a,clientId:l}=dt(lr),u=a?a.filter(f=>{const g=dt(as);if(g)return g[f]}):[XM.EMAIL];let d=0;for(const f of u){const g=await fetch(`${o.evmApiUrl}/contracts/receipt`,{method:"POST",body:JSON.stringify({...t?{tx:t}:{charge_id:e},...i?{amount:i}:{},...s?{currency:s}:{},target:f,title:r,subtitle:n,source:qE(l).name}),headers:{Authorization:`Bearer ${dt(Ls)}`,"Content-Type":"application/json"}});g.ok?d++:console.warn(`Failed to send receipt to ${f}:`,g.status)}return d>0},w0e=async(t,e,r)=>{const{toastAlert:n}=dt(Fn),i=dt(lr),s=y0e(t.items);(r.tokens?.length||r.memberships?.length)&&m0e(t.chain_txs,s),qr(_r.PAYMENT,{type:I6.CARD,results:{...t,tokens:r.tokens,memberships:r.memberships,licenses:r.licenses}}),n("Your payment was successful"),qr(_r.RECHECK_BALANCE,t.chain_txs);const o=dt(as);o&&Is.track("cp_payment_fiat",{$email:o.email,$phone:o.phone,chain:i.chainId,clientId:i.clientId,address:await _i(),location:window.location.href,tokens:r?.tokens,memberships:r?.memberships,licenses:r?.licenses,total:e/100,description:(r?.title??"")+`(${r?.subtitle??""})`}),await oE(),e===0&&Cr.set({subtitle:"Your claim was successful!",receipt:!1}),s&&Cr.set({title:"Done!",subtitle:"Your payment was partly successful",orders:t.items}),Ur.set(Tt.PAYMENT_RESULT)};var v0e=lt("<!> <!>",1);function pW(t,e){if(new.target)return Ht({component:pW,...t});Ut(e,!1);const r=()=>wr(Cr,"$pageOptsStore",n),[n,i]=Bi(),s=yt(),o=yt();var a=this&&this.__awaiter||function(B,O,H,D){function q(K){return K instanceof H?K:new H(function(te){te(K)})}return new(H||(H=Promise))(function(K,te){function Q(re){try{Y(D.next(re))}catch(ue){te(ue)}}function X(re){try{Y(D.throw(re))}catch(ue){te(ue)}}function Y(re){re.done?K(re.value):q(re.value).then(Q,X)}Y((D=D.apply(B,O||[])).next())})};let l=gt(e,"priceCents",12),u=gt(e,"isLoading",12),d=gt(e,"isPriceLoading",12),f=gt(e,"feeToApply",12,0);const{toastAlert:g}=dt(Fn),m=dt(lr);let v,A=yt(),E=yt(),C,k=yt(),I=yt(!1);Dh(()=>a(void 0,void 0,void 0,function*(){var B;try{if(!v){if(!window.Stripe&&(yield p0e("https://js.stripe.com/v3/"),!window.Stripe))throw{};v=window.Stripe}}catch{return console.log("Please include stripe to use payments.")}if(ae(A))return;const O=qE(m.clientId).name;Ye(A,v((B=m.stripe.pk[O])!==null&&B!==void 0?B:m.stripe.pk.DEFAULT)),Ye(E,ae(A).elements()),C=ae(E).create("card",{style:f0e}),C.mount("#cpui-card-element"),C.on("change",H=>{Ye(k,H.complete&&!H.error)}),C.on("focus",()=>Ye(I,!0)),C.on("blur",()=>Ye(I,!1))}));const S=()=>a(void 0,void 0,void 0,function*(){try{if(!ae(k))return;u(!0);const B=yield ae(A).createToken(C);if(B.error)throw B.error;yield N(B.token.id)}catch(B){qr(_r.ERROR,{error:B})}u(!1)}),N=B=>a(void 0,void 0,void 0,function*(){try{const{processPayment:O}=yield Promise.resolve().then(()=>G0e),H=yield O(B);yield w0e(H,l(),r())}catch(O){g(`Payment error: ${O.message||O}`,"failure"),Cr.set({errorMessage:O.message||O}),Ur.set(Tt.ERROR),qr(_r.ERROR,{error:O})}});tr(()=>ft(l()),()=>{Ye(s,(l()/100).toFixed(2))}),tr(()=>(ae(k),ft(u()),ft(d())),()=>{Ye(o,!ae(k)||u()||d())}),Rn();var W={get priceCents(){return l()},set priceCents(B){l(B),pt()},get isLoading(){return u()},set isLoading(B){u(B),pt()},get isPriceLoading(){return d()},set isPriceLoading(B){d(B),pt()},get feeToApply(){return f()},set feeToApply(B){f(B),pt()},$set:Vt,$on:(B,O)=>Lt(e,B,O)};cr();var G=v0e(),L=It(G);{let B=nr(()=>({isCardFocused:ae(I),onPay:S,feeToApply:f()}));nH(L,{get options(){return ae(B)},get isPaymentDisabled(){return ae(o)},set isPaymentDisabled(O){Ye(o,O)},get isLoading(){return u()},set isLoading(O){u(O)},get totalToPay(){return ae(s)},set totalToPay(O){Ye(s,O)},$$legacy:!0})}var V=tt(L,2);{var $=B=>{dW(B,{doPayment:N,get stripe(){return ae(A)},get stripeElements(){return ae(E)},get priceCents(){return l()},get isLoading(){return u()},set isLoading(O){u(O)},$$legacy:!0})};Rt(V,B=>{ae(A)&&ae(E)&&B($)})}We(t,G);var j=Dt(W);return i(),j}const b0e=JSON.parse('[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priceToken","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"addAvailableCurrencyTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"addOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"contentTokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"buyLicenseWithEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"contentTokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"buyLicenseWithToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"contentTokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"currencyTokenContract","type":"address"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"buyLicenseWithToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_requestedAmount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"buyWithEther","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_requestedAmount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"address","name":"_currencyTokenContract","type":"address"}],"name":"buyWithToken","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_requestedAmount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"buyWithToken","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"clearOwners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contentNftContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableCurrencyTokenContractsList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeneficiaryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultCurrencyTokenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDescription","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceFiat","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currencyContract","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLicenseContentNftId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLicenseExpiresAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLicenseType","outputs":[{"internalType":"enum ContentNftTypes.LicenseType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTrustedForwarder","outputs":[{"internalType":"address","name":"forwarder","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"image","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"isAvailableCurrencyTokenContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"tokenURI","type":"string"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintBatch","outputs":[{"internalType":"uint256[]","name":"arr","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nonceUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"priceToken","type":"uint256"},{"internalType":"uint256","name":"contentNftId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"},{"internalType":"uint256","name":"expiresAt","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"internalType":"struct LicenseNftContract.LicenseNFTVoucher","name":"voucher","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"removeAvailableCurrencyTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"removeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"addr","type":"address"}],"name":"setBeneficiaryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"setContentNftContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenContract","type":"address"}],"name":"setDefaultCurrencyTokenContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"description","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newImage","type":"string"}],"name":"setImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceFiat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currencyContract","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSymbol","type":"string"}],"name":"setSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURIByIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_forwarder","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenURIByIndex","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]');var A0e=lt('<div class="crtw-w-full crtw-justify-items-center crtw-my-5"><!></div>');function gW(t,e){if(new.target)return Ht({component:gW,...t});Ut(e,!1);const r=()=>wr(Cr,"$pageOptsStore",i),n=()=>wr(Ro,"$clientPublicStore",i),[i,s]=Bi();var o=this&&this.__awaiter||function(te,Q,X,Y){function re(ue){return ue instanceof X?ue:new X(function(me){me(ue)})}return new(X||(X=Promise))(function(ue,me){function Re(ve){try{ye(Y.next(ve))}catch(ke){me(ke)}}function Te(ve){try{ye(Y.throw(ve))}catch(ke){me(ke)}}function ye(ve){ve.done?ue(ve.value):re(ve.value).then(Re,Te)}ye((Y=Y.apply(te,Q||[])).next())})};let a=gt(e,"totalPriceToken",12),l=gt(e,"isLoading",12),u=gt(e,"isPriceLoading",12),d=gt(e,"pricesByToken",12);const{getCREDContract:f,toastAlert:g}=dt(Fn),{chainId:m,clientId:v}=dt(lr);let A=yt(!1),E=yt(BigInt(0)),C=yt(),k="",I,S=yt(),N,W,G;const L=(te,Q,X)=>o(void 0,void 0,void 0,function*(){g(`<a href="${SL(Q.hash)}" target="_blank">Purchase TX #${te}</a> was created`),qr(_r.PAYMENT,{type:I6.ERC20,data:Q}),qr(_r.RECHECK_BALANCE),yield fW({hash:Q.hash,title:r().title,subtitle:r().subtitle,currency:"CRED",amount:+dn.formatUnits(X,ae(S))}),qr(_r.RECEIPT,{hash:Q.hash})}),V=(te,Q)=>o(void 0,void 0,void 0,function*(){try{const{credenzaSellableMinAbi:X}=yield Promise.resolve().then(()=>uh),Y=new dn.Contract(te.contractAddress,X,W),re=te.tokenId||te.membershipTokenId||f3,ue=d()[`${te.contractAddress}/${re}`],me=yield I.approve.populateTransaction(yield Y.getAddress(),ue);yield bf(me,I);const Re=yield Y.buyWithToken.populateTransaction(re,te.amount||1,N),Te=yield bf(Re,Y);yield L(Q,Te,ue)}catch(X){g(`Payment error: ${X.message||X}`,"failure"),Cr.set({errorMessage:X.message}),Ur.set(Tt.ERROR),qr(_r.ERROR,{error:X})}}),$=(te,Q)=>o(void 0,void 0,void 0,function*(){if(te.licenseContractAddress)try{const X=new dn.Contract(te.licenseContractAddress,b0e,W),Y=d()[`${te.contractAddress}/${te.contentTokenId}`],re=yield I.approve.populateTransaction(yield X.getAddress(),Y);yield bf(re,I),yield new Promise(Te=>setTimeout(Te,3e3));const ue=X.interface.getFunction("buyLicenseWithToken",["uint","address","uint"]);if(!ue)throw new Error("buyLicenseWithToken function not found");const me=yield X[ue.format()].populateTransaction(te.contentTokenId,N,te.licenseType),Re=yield bf(me,X);yield L(Q,Re,Y)}catch(X){g(`Payment error: ${X.message||X}`,"failure"),Cr.set({errorMessage:X.message}),Ur.set(Tt.ERROR),qr(_r.ERROR,{error:X})}}),j=()=>o(void 0,void 0,void 0,function*(){var te,Q;try{if(BigInt(a())>ae(E))return;l(!0);const X=[...r().tokens||[],...r().memberships||[]].map((ue,me)=>V(ue,me+1)),Y=[...r().licenses||[]].map((ue,me)=>$(ue,me+1));yield Promise.all([...X,...Y]);const re=dt(as);re&&Is.track("cp_payment_stored_value",{$email:re.email,$phone:re.phone,chain:m,clientId:v,address:N,location:window.location.href,tokens:r().tokens,memberships:r().memberships,total:a(),description:((te=r()===null||r()===void 0?void 0:r().title)!==null&&te!==void 0?te:"")+`(${(Q=r()===null||r()===void 0?void 0:r().subtitle)!==null&&Q!==void 0?Q:""})`}),yield oE(),a()===0&&Cr.set({subtitle:"Your claim was successful!",receipt:!1}),Ur.set(Tt.PAYMENT_RESULT)}catch(X){g(`Payment error: ${X.message||X}`,"failure"),Cr.set({errorMessage:X.message}),Ur.set(Tt.ERROR),qr(_r.ERROR,{error:X})}finally{l(!1)}});Dh(()=>o(void 0,void 0,void 0,function*(){try{Ye(A,!0),G=yield f();const te=dt(ii);if(!te)return;W=yield te.getSigner(),I=G.contract,Ye(S,G.decimals),[N,k]=yield Promise.all([_i(),I.symbol()]),Ye(E,yield I.balanceOf(N)),Ye(C,`${dn.formatUnits(BigInt(ae(E))-BigInt(a()),ae(S))}`)}catch(te){console.log(te)}finally{Ye(A,!1)}}));var B={get totalPriceToken(){return a()},set totalPriceToken(te){a(te),pt()},get isLoading(){return l()},set isLoading(te){l(te),pt()},get isPriceLoading(){return u()},set isPriceLoading(te){u(te),pt()},get pricesByToken(){return d()},set pricesByToken(te){d(te),pt()},$set:Vt,$on:(te,Q)=>Lt(e,te,Q)};cr();var O=er(),H=It(O);{var D=te=>{var Q=A0e(),X=Xe(Q);jc(X,{}),Je(Q),We(te,Q)},q=te=>{{let Q=nr(()=>(ae(C),ft(dn),ae(E),ae(S),n(),ft(Ur),ft(Tt),ft(a()),ft(l()),ft(u()),nt(()=>({formattedBalance:ae(C),balance:Number((+dn.formatUnits(BigInt(ae(E)),ae(S))).toFixed(2)),credAlias:n()?.ui_settings.cred_alias,onPay:j,onGetCred:()=>Ur.set(Tt.WALLET),totalToPay:(+dn.formatUnits(a(),ae(S))).toFixed(2),isLoading:l(),isPaymentDisabled:!Number(ae(E))||BigInt(a())>ae(E)||u()}))));iH(te,{get options(){return ae(Q)}})}};Rt(H,te=>{ae(A)?te(D):te(q,!1)})}We(t,O);var K=Dt(B);return s(),K}const E0e=JSON.parse('[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"_platformFee","type":"uint8"},{"internalType":"uint8","name":"_defaultAgencyFee","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priceToken","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"addAvailableCurrencyTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"addOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"buyWithEther","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"currencyTokenContract","type":"address"}],"name":"buyWithToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"buyWithToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"clearOwners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAgencyFee","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableCurrencyTokenContractsList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeneficiaryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultCurrencyTokenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDescription","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"getLicensePriceEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"getLicensePriceFiat","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"getLicensePriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceFiat","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currencyContract","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLicenseInfo","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTrustedForwarder","outputs":[{"internalType":"address","name":"forwarder","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"image","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"isAvailableCurrencyTokenContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"tokenURI","type":"string"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintBatch","outputs":[{"internalType":"uint256[]","name":"arr","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"licenseInfo","type":"string"},{"internalType":"uint256","name":"fullLicensePriceFiat","type":"uint256"},{"internalType":"uint256","name":"fullLicensePriceToken","type":"uint256"},{"internalType":"uint256","name":"fullLicensePriceEther","type":"uint256"},{"internalType":"uint256","name":"timeLicensePriceFiat","type":"uint256"},{"internalType":"uint256","name":"timeLicensePriceToken","type":"uint256"},{"internalType":"uint256","name":"timeLicensePriceEther","type":"uint256"},{"internalType":"uint256","name":"oneTimeLicensePriceFiat","type":"uint256"},{"internalType":"uint256","name":"oneTimeLicensePriceToken","type":"uint256"},{"internalType":"uint256","name":"oneTimeLicensePriceEther","type":"uint256"}],"name":"mintWithPrices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nonceUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publisherAgency","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publisherAgencyFee","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"priceToken","type":"uint256"},{"internalType":"string","name":"licenseInfo","type":"string"},{"internalType":"string","name":"uri","type":"string"}],"internalType":"struct ContentNftContract.ContentNFTVoucher","name":"voucher","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"removeAvailableCurrencyTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"removeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"addr","type":"address"}],"name":"setBeneficiaryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"agencyFee","type":"uint8"}],"name":"setDefaultAgencyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenContract","type":"address"}],"name":"setDefaultCurrencyTokenContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"description","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newImage","type":"string"}],"name":"setImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"},{"internalType":"uint256","name":"priceEther","type":"uint256"}],"name":"setLicensePriceEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"},{"internalType":"uint256","name":"priceFiat","type":"uint256"}],"name":"setLicensePriceFiat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"},{"internalType":"uint256","name":"priceToken","type":"uint256"}],"name":"setLicensePriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setPlatformAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"fee","type":"uint8"}],"name":"setPlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceFiat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currencyContract","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"publisher","type":"address"},{"internalType":"address","name":"agency","type":"address"}],"name":"setPublisherAgency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"publisher","type":"address"},{"internalType":"uint8","name":"agencyFee","type":"uint8"}],"name":"setPublisherAgencyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSymbol","type":"string"}],"name":"setSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"licenseInfo","type":"string"}],"name":"setTokenLicenseInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURIByIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_forwarder","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenURIByIndex","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]');var T0e=lt('<div slot="credit-card"><!></div>'),S0e=lt('<div slot="cred-balance"><!></div>'),C0e=lt("<!> <!>",1);function mW(t,e){if(new.target)return Ht({component:mW,...t});Ut(e,!1);const r=()=>wr(lr,"$configStore",a),n=()=>wr(ii,"$providerStore",a),i=()=>wr(wf,"$contractsStore",a),s=()=>wr(as,"$userStore",a),o=()=>wr(Cr,"$pageOptsStore",a),[a,l]=Bi();var u=this&&this.__awaiter||function(O,H,D,q){function K(te){return te instanceof D?te:new D(function(Q){Q(te)})}return new(D||(D=Promise))(function(te,Q){function X(ue){try{re(q.next(ue))}catch(me){Q(me)}}function Y(ue){try{re(q.throw(ue))}catch(me){Q(me)}}function re(ue){ue.done?te(ue.value):K(ue.value).then(X,Y)}re((q=q.apply(O,H||[])).next())})},d;const{close:f}=dt(Fn),g=dt(lr).chainId;let m=yt(0),v=yt(0),A=yt(!1),E=yt(!1),C=yt(0);const k=(d=dt(Ro).client_payment_configuration)===null||d===void 0?void 0:d.token_fee;let I=yt({});const S=(O,H,D)=>u(void 0,void 0,void 0,function*(){let q=0,K=0;if(D){const X=new dn.Contract(O,E0e,n());return q=yield X.getLicensePriceFiat(String(H),D).then(Y=>Number(Y)),K=yield X.getLicensePriceToken(String(H),D).then(Y=>Number(Y)),[q,K]}const{credenzaSellableMinAbi:te}=yield Promise.resolve().then(()=>uh),Q=new dn.Contract(O,te,n());return q=yield Q.getPriceFiat(H).then(X=>Number(X)),K=0,q===0?[q,K]=yield Promise.all([Q.getPriceFiat(f3).then(X=>Number(X)),Q.getPriceToken(f3).then(X=>Number(X))]):K=yield Q.getPriceToken(H).then(X=>Number(X)),[q,K]}),N=O=>u(void 0,void 0,void 0,function*(){try{Ye(A,!0);for(const H of O)if(H.contractAddress===i().erc20Cred.address)Ye(m,ae(m)+H.amount*100),k&&(Ye(C,k),Ye(m,ae(m)+ae(m)*k));else{const D=H.membershipTokenId||f3,q=H.tokenId||H.contentTokenId||D;let[K,te]=yield S(H.contractAddress,q,H.licenseType);H?.amount&&H?.amount!==0&&(K*=H.amount,te*=H.amount),Ye(m,ae(m)+K),Ye(v,ae(v)+te),Wj(I,ae(I)[`${H.contractAddress}/${q}`]=te)}}catch(H){qr(_r.ERROR,H)}finally{Ye(A,!1)}}),W=Cr.subscribe(O=>u(void 0,void 0,void 0,function*(){var H,D,q;!(!((H=O?.tokens)===null||H===void 0)&&H.length)&&!(!((D=O?.memberships)===null||D===void 0)&&D.length)&&!(!((q=O?.licenses)===null||q===void 0)&&q.length)||(yield N([...O?.tokens||[],...O?.memberships||[],...O?.licenses||[]]))}));Kf(W),tr(()=>r(),()=>{r().chainId!==g&&f()}),Rn();var G={$set:Vt,$on:(O,H)=>Lt(e,O,H)};cr();var L=C0e(),V=It(L);{var $=O=>{var H=er(),D=It(H);Mi(D,()=>Promise.resolve().then(()=>TW),null,(q,K)=>{var te=er(),Q=It(te);Ei(Q,()=>ae(K).default,(X,Y)=>{Y(X,{})}),We(q,te)}),We(O,H)};Rt(V,O=>{ae(E)&&O($)})}var j=tt(V,2);{let O=nr(()=>(s(),o(),ft(Ur),ft(Tt),ae(m),nt(()=>({user:s(),title:o().title||"Order Summary",subtitle:o().subtitle,onBackClick:()=>Ur.set(Tt.WALLET),isCardDisabled:o().payments?.card?.disabled,isCredezaValueDisabled:!ae(m)||o().payments?.credenzaStoredValue?.disabled}))));rH(j,{get options(){return ae(O)},get isLoading(){return ae(E)},set isLoading(H){Ye(E,H)},$$slots:{"credit-card":(H,D)=>{var q=T0e(),K=Xe(q);{var te=X=>{jc(X,{})},Q=X=>{pW(X,{get priceCents(){return ae(m)},get isPriceLoading(){return ae(A)},get feeToApply(){return ae(C)},get isLoading(){return ae(E)},set isLoading(Y){Ye(E,Y)},$$legacy:!0})};Rt(K,X=>{ae(E)||ae(A)?X(te):X(Q,!1)})}Je(q),We(H,q)},"cred-balance":(H,D)=>{var q=S0e(),K=Xe(q);gW(K,{get pricesByToken(){return ae(I)},get totalPriceToken(){return ae(v)},get isPriceLoading(){return ae(A)},get isLoading(){return ae(E)},set isLoading(te){Ye(E,te)},$$legacy:!0}),Je(q),We(H,q)}},$$legacy:!0})}We(t,L);var B=Dt(G);return l(),B}const k0e=Object.freeze(Object.defineProperty({__proto__:null,default:mW},Symbol.toStringTag,{value:"Module"}));function yW(t,e){if(new.target)return Ht({component:yW,...t});Ut(e,!1);const r=()=>wr(Cr,"$pageOptsStore",n),[n,i]=Bi();let s=dt(lr);var o={$set:Vt,$on:(l,u)=>Lt(e,l,u)};cr();{let l=nr(()=>({title:r()?.title||s.content?.paymentResult?.title||"Success!",subtitle:r()?.subtitle||s.content?.paymentResult?.subtitle||"Your payment was successful!",description:r()?.description||s.content?.paymentResult?.description,orders:r()?.orders||[],tokenImage:r()?.tokenImage||""}));QV(t,{get options(){return ae(l)}})}var a=Dt(o);return i(),a}const _0e=Object.freeze(Object.defineProperty({__proto__:null,default:yW},Symbol.toStringTag,{value:"Module"})),I0e=async(t,e)=>{const r=await fetch(`https://api.staging.credenza3.com/keyval/key/${t}?client_id=${e}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${dt(Ls)}`},method:"GET"});if(!r.ok)throw new Error("Failed to get key value");return await r.json()},R0e=async(t,e)=>{const n=(await I0e(t,e)).items[0].val;return[JSON.parse(n).scanType,n]};function wW(t,e){if(new.target)return Ht({component:wW,...t});Ut(e,!1);var r=this&&this.__awaiter||function(l,u,d,f){function g(m){return m instanceof d?m:new d(function(v){v(m)})}return new(d||(d=Promise))(function(m,v){function A(k){try{C(f.next(k))}catch(I){v(I)}}function E(k){try{C(f.throw(k))}catch(I){v(I)}}function C(k){k.done?m(k.value):g(k.value).then(A,E)}C((f=f.apply(l,u||[])).next())})};const{close:n}=dt(Fn);let i,s=yt(!1);const o=l=>r(void 0,[l],void 0,function*({message:u,sub:d,scanType:f}){if(!f)try{const g=dt(lr);[f,u]=yield R0e(u,g.clientId)}catch{return mV(rL(u),"failure"),i.close()}switch(i.close(),f){case Wu.PASSPORT_ID_PASS:case Wu.PASSPORT_ID:{const g=JSON.parse(u),{address:m}=yield DL(d);ece({userAddress:m,amount:g?.amount});break}case Wu.TOKENS_PURCHASE:{BL(JSON.parse(u));break}case Wu.AIR_DROP_ASSET:{yield tce(JSON.parse(u));break}case Wu.REQUEST_LOYALTY_POINTS:{yield rce(JSON.parse(u));break}default:n(),Ur.set(null)}});Dh(()=>r(void 0,void 0,void 0,function*(){const{scanner:l,events:u}=yield cW(l0e);i=l,TE(_r.UI_CLOSED,()=>{i.close(),Ur.set(null)}),uW(i,u,{onCapture:o,onError:d=>{const f=lW(d);f?.includes("Permission")&&alert("In order to scan please allow the current page to access your camera and try again.")}}),Ye(s,!0),yield i.scan({isCloseButton:!1})}));var a={$set:Vt,$on:(l,u)=>Lt(e,l,u)};cr();{let l=nr(()=>({isScannerLoaded:ae(s)}));YV(t,{get options(){return ae(l)}})}return Dt(a)}const N0e=Object.freeze(Object.defineProperty({__proto__:null,default:wW},Symbol.toStringTag,{value:"Module"})),O0e="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2027.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20500%20500'%20style='enable-background:new%200%200%20500%20500;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23010101;}%20%3c/style%3e%3cpath%20class='st0'%20d='M454.1,479.5l-39.2-358c-0.5-7.2-6.7-12.4-13.9-12.4l-67.6,0V88.6c0-45.9-37.7-83.6-83.6-83.6%20s-83.6,37.7-83.6,83.6v20.6H98.2c-7.2,0-12.9,5.2-13.9,12.4L45,479.5c-0.5,4.1,1,7.7,3.6,10.8c2.6,3.1,6.2,4.6,10.3,4.6h381.7%20c4.1,0,7.7-1.5,10.3-4.6C453.6,487.3,454.6,483.6,454.1,479.5L454.1,479.5z%20M204.4,88.6c0-25.3,20.6-45.4,45.4-45.4%20c24.8,0,45.4,20.6,45.4,45.4v20.6l-90.8,0L204.4,88.6z%20M249.8,406.3c-57.3,0-104.2-46.4-104.2-104.2c0-57.3,46.4-104.2,104.2-104.2%20c57.3,0,104.2,46.4,104.2,104.2C354,359.3,307.1,406.3,249.8,406.3z'/%3e%3cpath%20class='st0'%20d='M295.2,256.7c-7.2-7.2-19.6-7.2-26.8,0l-18.6,18.6l-18.6-18.6c-7.2-7.2-19.6-7.2-26.8,0%20c-7.2,7.2-7.2,19.6,0,26.8l18.6,18.6l-18.6,18.6c-7.2,7.2-7.2,19.6,0,26.8c3.6,3.6,8.8,5.7,13.4,5.7c4.6,0,9.8-2.1,13.4-5.7%20l18.6-18.6l18.6,18.6c3.6,3.6,8.8,5.7,13.4,5.7c4.6,0,9.8-2.1,13.4-5.7c7.2-7.2,7.2-19.6,0-26.8l-18.6-18.6l18.6-18.6%20C302.4,276.3,302.4,264.4,295.2,256.7L295.2,256.7z'/%3e%3c/svg%3e",fh={titles:{DEFAULT_ERROR_TITLE:"Something went wrong",TRANSACTION_REVERTED_TITLE:"The transaction is reverted",SOLD_OUT_ERROR_TITLE:"Sold out",INVALID_TOKEN_ERROR_TITLE:"Invalid token ID"},desctiptions:{DEFAULT_ERROR_DESC:"An unexpected error occured and we are unable to complete your order.",SOLD_OUT_ERROR_DESC:"We are unable to complete your order as the item that you are trying to add is currently sold out.",INVALID_TOKEN_ERROR_DESC:"There is no token associated with provided ID.",HAS_MEMBERSHIP_ALREADY_ERROR_DESC:"This membership is already assosiated with your account."}},x0e=t=>{let e={};return(t.includes("SOLD_OUT")||t.includes("Sold out"))&&(e={title:fh.titles.SOLD_OUT_ERROR_TITLE,description:fh.desctiptions.SOLD_OUT_ERROR_DESC,image:O0e}),t.includes("invalid token ID")&&(e={title:fh.titles.INVALID_TOKEN_ERROR_TITLE,description:fh.desctiptions.INVALID_TOKEN_ERROR_DESC}),t.includes("ALREADY_HAS_MEMBERSHIP")&&(e={title:fh.titles.TRANSACTION_REVERTED_TITLE,description:fh.desctiptions.HAS_MEMBERSHIP_ALREADY_ERROR_DESC}),e};function vW(t,e){if(new.target)return Ht({component:vW,...t});Ut(e,!1);const r=()=>dt(Fn).close(),{openUI:n}=dt(Fn);let i=yt();const s=Cr.subscribe(l=>{l.errorMessage?Ye(i,Object.assign(Object.assign({},ae(i)),x0e(l.errorMessage))):l.title&&l.description&&Ye(i,Object.assign(Object.assign({},ae(i)),l))}),o=()=>{const{primaryAction:l}=ae(i);let u={tokens:[{contractAddress:l?.contractAddress,tokenId:l?.tokenId}]},d={memberships:[{contractAddress:l?.contractAddress,membershipTokenId:l?.membershipTokenId||f3}]};n(Tt.PAYMENT,Object.assign({title:l?.text,subtitle:""},l?.tokenId?d:u))};Kf(s);var a={$set:Vt,$on:(l,u)=>Lt(e,l,u)};cr();{let l=nr(()=>({title:ae(i)?.title||fh.titles.DEFAULT_ERROR_TITLE,description:ae(i)?.description||fh.desctiptions.DEFAULT_ERROR_DESC,image:ae(i)?.image,shouldRenderBackButton:ae(i)?.shouldRenderBackButton,onCloseClick:r,secondaryAction:ae(i)?.secondaryAction,primaryActionText:ae(i)?.primaryAction?.text,openPaymentFunction:o}));LV(t,{get options(){return ae(l)}})}return Dt(a)}const P0e=Object.freeze(Object.defineProperty({__proto__:null,default:vW},Symbol.toStringTag,{value:"Module"}));var M0e=lt("<button> </button>"),B0e=lt(`<a class="crtw-flex crtw-justify-center crtw-items-center crtw-w-full crtw-h-[50px] crtw-cursor-pointer
685
+ `);if(t?.every(r=>r.status==="ERROR"))throw new Error("All transactions failed.}");return e},fW=async({hash:t,stripeChargeId:e,title:r,subtitle:n,amount:i,currency:s})=>{const{credenza:o,receiptTarget:a,clientId:l}=dt(lr),u=a?a.filter(f=>{const g=dt(as);if(g)return g[f]}):[XM.EMAIL];let d=0;for(const f of u){const g=await fetch(`${o.evmApiUrl}/contracts/receipt`,{method:"POST",body:JSON.stringify({...t?{tx:t}:{charge_id:e},...i?{amount:i}:{},...s?{currency:s}:{},target:f,title:r,subtitle:n,source:qE(l).name}),headers:{Authorization:`Bearer ${dt(Ls)}`,"Content-Type":"application/json"}});g.ok?d++:console.warn(`Failed to send receipt to ${f}:`,g.status)}return d>0},w0e=async(t,e,r)=>{const{toastAlert:n}=dt(Fn),i=dt(lr),s=y0e(t.items);(r.tokens?.length||r.memberships?.length)&&m0e(t.chain_txs,s),qr(_r.PAYMENT,{type:I6.CARD,results:{...t,tokens:r.tokens,memberships:r.memberships,licenses:r.licenses}}),n("Your payment was successful"),qr(_r.RECHECK_BALANCE,t.chain_txs);const o=dt(as);o&&Is.track("cp_payment_fiat",{$email:o.email,$phone:o.phone,chain:i.chainId,clientId:i.clientId,address:await _i(),location:window.location.href,tokens:r?.tokens,memberships:r?.memberships,licenses:r?.licenses,total:e/100,description:(r?.title??"")+`(${r?.subtitle??""})`}),await oE(),e===0&&Cr.set({subtitle:"Your claim was successful!",receipt:!1}),s&&Cr.set({title:"Done!",subtitle:"Your payment was partly successful",orders:t.items}),Ur.set(Tt.PAYMENT_RESULT)};var v0e=lt("<!> <!>",1);function pW(t,e){if(new.target)return Ht({component:pW,...t});Ut(e,!1);const r=()=>wr(Cr,"$pageOptsStore",n),[n,i]=Bi(),s=yt(),o=yt();var a=this&&this.__awaiter||function(B,O,H,D){function q(K){return K instanceof H?K:new H(function(te){te(K)})}return new(H||(H=Promise))(function(K,te){function Q(re){try{Y(D.next(re))}catch(ue){te(ue)}}function X(re){try{Y(D.throw(re))}catch(ue){te(ue)}}function Y(re){re.done?K(re.value):q(re.value).then(Q,X)}Y((D=D.apply(B,O||[])).next())})};let l=gt(e,"priceCents",12),u=gt(e,"isLoading",12),d=gt(e,"isPriceLoading",12),f=gt(e,"feeToApply",12,0);const{toastAlert:g}=dt(Fn),m=dt(lr);let v,A=yt(),E=yt(),C,k=yt(),I=yt(!1);Dh(()=>a(void 0,void 0,void 0,function*(){var B;try{if(!v){if(!window.Stripe&&(yield p0e("https://js.stripe.com/v3/"),!window.Stripe))throw{};v=window.Stripe}}catch{return console.log("Please include stripe to use payments.")}if(ae(A))return;const O=qE(m.clientId).name;Ye(A,v((B=m.stripe.pk[O])!==null&&B!==void 0?B:m.stripe.pk.DEFAULT)),Ye(E,ae(A).elements()),C=ae(E).create("card",{style:f0e}),C.mount("#cpui-card-element"),C.on("change",H=>{Ye(k,H.complete&&!H.error)}),C.on("focus",()=>Ye(I,!0)),C.on("blur",()=>Ye(I,!1))}));const S=()=>a(void 0,void 0,void 0,function*(){try{if(!ae(k))return;u(!0);const B=yield ae(A).createToken(C);if(B.error)throw B.error;yield N(B.token.id)}catch(B){qr(_r.ERROR,{error:B})}u(!1)}),N=B=>a(void 0,void 0,void 0,function*(){try{const{processPayment:O}=yield Promise.resolve().then(()=>G0e),H=yield O(B);yield w0e(H,l(),r())}catch(O){g(`Payment error: ${O.message||O}`,"failure"),Cr.set({errorMessage:O.message||O}),Ur.set(Tt.ERROR),qr(_r.ERROR,{error:O})}});tr(()=>ft(l()),()=>{Ye(s,(Math.ceil(l())/100).toFixed(2))}),tr(()=>(ae(k),ft(u()),ft(d())),()=>{Ye(o,!ae(k)||u()||d())}),Rn();var W={get priceCents(){return l()},set priceCents(B){l(B),pt()},get isLoading(){return u()},set isLoading(B){u(B),pt()},get isPriceLoading(){return d()},set isPriceLoading(B){d(B),pt()},get feeToApply(){return f()},set feeToApply(B){f(B),pt()},$set:Vt,$on:(B,O)=>Lt(e,B,O)};cr();var G=v0e(),L=It(G);{let B=nr(()=>({isCardFocused:ae(I),onPay:S,feeToApply:f()}));nH(L,{get options(){return ae(B)},get isPaymentDisabled(){return ae(o)},set isPaymentDisabled(O){Ye(o,O)},get isLoading(){return u()},set isLoading(O){u(O)},get totalToPay(){return ae(s)},set totalToPay(O){Ye(s,O)},$$legacy:!0})}var V=tt(L,2);{var $=B=>{dW(B,{doPayment:N,get stripe(){return ae(A)},get stripeElements(){return ae(E)},get priceCents(){return l()},get isLoading(){return u()},set isLoading(O){u(O)},$$legacy:!0})};Rt(V,B=>{ae(A)&&ae(E)&&B($)})}We(t,G);var j=Dt(W);return i(),j}const b0e=JSON.parse('[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priceToken","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"addAvailableCurrencyTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"addOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"contentTokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"buyLicenseWithEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"contentTokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"buyLicenseWithToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"contentTokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"currencyTokenContract","type":"address"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"buyLicenseWithToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_requestedAmount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"buyWithEther","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_requestedAmount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"address","name":"_currencyTokenContract","type":"address"}],"name":"buyWithToken","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_requestedAmount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"buyWithToken","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"clearOwners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contentNftContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableCurrencyTokenContractsList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeneficiaryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultCurrencyTokenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDescription","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceFiat","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currencyContract","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLicenseContentNftId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLicenseExpiresAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLicenseType","outputs":[{"internalType":"enum ContentNftTypes.LicenseType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTrustedForwarder","outputs":[{"internalType":"address","name":"forwarder","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"image","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"isAvailableCurrencyTokenContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"tokenURI","type":"string"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintBatch","outputs":[{"internalType":"uint256[]","name":"arr","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nonceUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"priceToken","type":"uint256"},{"internalType":"uint256","name":"contentNftId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"},{"internalType":"uint256","name":"expiresAt","type":"uint256"},{"internalType":"string","name":"uri","type":"string"}],"internalType":"struct LicenseNftContract.LicenseNFTVoucher","name":"voucher","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"removeAvailableCurrencyTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"removeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"addr","type":"address"}],"name":"setBeneficiaryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"setContentNftContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenContract","type":"address"}],"name":"setDefaultCurrencyTokenContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"description","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newImage","type":"string"}],"name":"setImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceFiat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currencyContract","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSymbol","type":"string"}],"name":"setSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURIByIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_forwarder","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenURIByIndex","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]');var A0e=lt('<div class="crtw-w-full crtw-justify-items-center crtw-my-5"><!></div>');function gW(t,e){if(new.target)return Ht({component:gW,...t});Ut(e,!1);const r=()=>wr(Cr,"$pageOptsStore",i),n=()=>wr(Ro,"$clientPublicStore",i),[i,s]=Bi();var o=this&&this.__awaiter||function(te,Q,X,Y){function re(ue){return ue instanceof X?ue:new X(function(me){me(ue)})}return new(X||(X=Promise))(function(ue,me){function Re(ve){try{ye(Y.next(ve))}catch(ke){me(ke)}}function Te(ve){try{ye(Y.throw(ve))}catch(ke){me(ke)}}function ye(ve){ve.done?ue(ve.value):re(ve.value).then(Re,Te)}ye((Y=Y.apply(te,Q||[])).next())})};let a=gt(e,"totalPriceToken",12),l=gt(e,"isLoading",12),u=gt(e,"isPriceLoading",12),d=gt(e,"pricesByToken",12);const{getCREDContract:f,toastAlert:g}=dt(Fn),{chainId:m,clientId:v}=dt(lr);let A=yt(!1),E=yt(BigInt(0)),C=yt(),k="",I,S=yt(),N,W,G;const L=(te,Q,X)=>o(void 0,void 0,void 0,function*(){g(`<a href="${SL(Q.hash)}" target="_blank">Purchase TX #${te}</a> was created`),qr(_r.PAYMENT,{type:I6.ERC20,data:Q}),qr(_r.RECHECK_BALANCE),yield fW({hash:Q.hash,title:r().title,subtitle:r().subtitle,currency:"CRED",amount:+dn.formatUnits(X,ae(S))}),qr(_r.RECEIPT,{hash:Q.hash})}),V=(te,Q)=>o(void 0,void 0,void 0,function*(){try{const{credenzaSellableMinAbi:X}=yield Promise.resolve().then(()=>uh),Y=new dn.Contract(te.contractAddress,X,W),re=te.tokenId||te.membershipTokenId||f3,ue=d()[`${te.contractAddress}/${re}`],me=yield I.approve.populateTransaction(yield Y.getAddress(),ue);yield bf(me,I);const Re=yield Y.buyWithToken.populateTransaction(re,te.amount||1,N),Te=yield bf(Re,Y);yield L(Q,Te,ue)}catch(X){g(`Payment error: ${X.message||X}`,"failure"),Cr.set({errorMessage:X.message}),Ur.set(Tt.ERROR),qr(_r.ERROR,{error:X})}}),$=(te,Q)=>o(void 0,void 0,void 0,function*(){if(te.licenseContractAddress)try{const X=new dn.Contract(te.licenseContractAddress,b0e,W),Y=d()[`${te.contractAddress}/${te.contentTokenId}`],re=yield I.approve.populateTransaction(yield X.getAddress(),Y);yield bf(re,I),yield new Promise(Te=>setTimeout(Te,3e3));const ue=X.interface.getFunction("buyLicenseWithToken",["uint","address","uint"]);if(!ue)throw new Error("buyLicenseWithToken function not found");const me=yield X[ue.format()].populateTransaction(te.contentTokenId,N,te.licenseType),Re=yield bf(me,X);yield L(Q,Re,Y)}catch(X){g(`Payment error: ${X.message||X}`,"failure"),Cr.set({errorMessage:X.message}),Ur.set(Tt.ERROR),qr(_r.ERROR,{error:X})}}),j=()=>o(void 0,void 0,void 0,function*(){var te,Q;try{if(BigInt(a())>ae(E))return;l(!0);const X=[...r().tokens||[],...r().memberships||[]].map((ue,me)=>V(ue,me+1)),Y=[...r().licenses||[]].map((ue,me)=>$(ue,me+1));yield Promise.all([...X,...Y]);const re=dt(as);re&&Is.track("cp_payment_stored_value",{$email:re.email,$phone:re.phone,chain:m,clientId:v,address:N,location:window.location.href,tokens:r().tokens,memberships:r().memberships,total:a(),description:((te=r()===null||r()===void 0?void 0:r().title)!==null&&te!==void 0?te:"")+`(${(Q=r()===null||r()===void 0?void 0:r().subtitle)!==null&&Q!==void 0?Q:""})`}),yield oE(),a()===0&&Cr.set({subtitle:"Your claim was successful!",receipt:!1}),Ur.set(Tt.PAYMENT_RESULT)}catch(X){g(`Payment error: ${X.message||X}`,"failure"),Cr.set({errorMessage:X.message}),Ur.set(Tt.ERROR),qr(_r.ERROR,{error:X})}finally{l(!1)}});Dh(()=>o(void 0,void 0,void 0,function*(){try{Ye(A,!0),G=yield f();const te=dt(ii);if(!te)return;W=yield te.getSigner(),I=G.contract,Ye(S,G.decimals),[N,k]=yield Promise.all([_i(),I.symbol()]),Ye(E,yield I.balanceOf(N)),Ye(C,`${dn.formatUnits(BigInt(ae(E))-BigInt(a()),ae(S))}`)}catch(te){console.log(te)}finally{Ye(A,!1)}}));var B={get totalPriceToken(){return a()},set totalPriceToken(te){a(te),pt()},get isLoading(){return l()},set isLoading(te){l(te),pt()},get isPriceLoading(){return u()},set isPriceLoading(te){u(te),pt()},get pricesByToken(){return d()},set pricesByToken(te){d(te),pt()},$set:Vt,$on:(te,Q)=>Lt(e,te,Q)};cr();var O=er(),H=It(O);{var D=te=>{var Q=A0e(),X=Xe(Q);jc(X,{}),Je(Q),We(te,Q)},q=te=>{{let Q=nr(()=>(ae(C),ft(dn),ae(E),ae(S),n(),ft(Ur),ft(Tt),ft(a()),ft(l()),ft(u()),nt(()=>({formattedBalance:ae(C),balance:Number((+dn.formatUnits(BigInt(ae(E)),ae(S))).toFixed(2)),credAlias:n()?.ui_settings.cred_alias,onPay:j,onGetCred:()=>Ur.set(Tt.WALLET),totalToPay:(+dn.formatUnits(a(),ae(S))).toFixed(2),isLoading:l(),isPaymentDisabled:!Number(ae(E))||BigInt(a())>ae(E)||u()}))));iH(te,{get options(){return ae(Q)}})}};Rt(H,te=>{ae(A)?te(D):te(q,!1)})}We(t,O);var K=Dt(B);return s(),K}const E0e=JSON.parse('[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"_platformFee","type":"uint8"},{"internalType":"uint8","name":"_defaultAgencyFee","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"priceToken","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"addAvailableCurrencyTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"addOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"buyWithEther","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"currencyTokenContract","type":"address"}],"name":"buyWithToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"buyWithToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"clearOwners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"defaultAgencyFee","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAvailableCurrencyTokenContractsList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBeneficiaryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultCurrencyTokenContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDescription","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"getLicensePriceEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"getLicensePriceFiat","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"}],"name":"getLicensePriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOwners","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceEther","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceFiat","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"currencyContract","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getPriceToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenLicenseInfo","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTrustedForwarder","outputs":[{"internalType":"address","name":"forwarder","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"image","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"isAvailableCurrencyTokenContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"tokenURI","type":"string"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintBatch","outputs":[{"internalType":"uint256[]","name":"arr","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"string","name":"tokenURI","type":"string"},{"internalType":"string","name":"licenseInfo","type":"string"},{"internalType":"uint256","name":"fullLicensePriceFiat","type":"uint256"},{"internalType":"uint256","name":"fullLicensePriceToken","type":"uint256"},{"internalType":"uint256","name":"fullLicensePriceEther","type":"uint256"},{"internalType":"uint256","name":"timeLicensePriceFiat","type":"uint256"},{"internalType":"uint256","name":"timeLicensePriceToken","type":"uint256"},{"internalType":"uint256","name":"timeLicensePriceEther","type":"uint256"},{"internalType":"uint256","name":"oneTimeLicensePriceFiat","type":"uint256"},{"internalType":"uint256","name":"oneTimeLicensePriceToken","type":"uint256"},{"internalType":"uint256","name":"oneTimeLicensePriceEther","type":"uint256"}],"name":"mintWithPrices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nonceUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publisherAgency","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"publisherAgencyFee","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"priceToken","type":"uint256"},{"internalType":"string","name":"licenseInfo","type":"string"},{"internalType":"string","name":"uri","type":"string"}],"internalType":"struct ContentNftContract.ContentNFTVoucher","name":"voucher","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"removeAvailableCurrencyTokenContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"removeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setBaseUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"addr","type":"address"}],"name":"setBeneficiaryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"agencyFee","type":"uint8"}],"name":"setDefaultAgencyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenContract","type":"address"}],"name":"setDefaultCurrencyTokenContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"description","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newImage","type":"string"}],"name":"setImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"},{"internalType":"uint256","name":"priceEther","type":"uint256"}],"name":"setLicensePriceEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"},{"internalType":"uint256","name":"priceFiat","type":"uint256"}],"name":"setLicensePriceFiat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"enum ContentNftTypes.LicenseType","name":"licenseType","type":"uint8"},{"internalType":"uint256","name":"priceToken","type":"uint256"}],"name":"setLicensePriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setPlatformAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"fee","type":"uint8"}],"name":"setPlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceFiat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"currencyContract","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPriceToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"publisher","type":"address"},{"internalType":"address","name":"agency","type":"address"}],"name":"setPublisherAgency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"publisher","type":"address"},{"internalType":"uint8","name":"agencyFee","type":"uint8"}],"name":"setPublisherAgencyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newSymbol","type":"string"}],"name":"setSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"licenseInfo","type":"string"}],"name":"setTokenLicenseInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURIByIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_forwarder","type":"address"}],"name":"setTrustedForwarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenURIByIndex","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]');var T0e=lt('<div slot="credit-card"><!></div>'),S0e=lt('<div slot="cred-balance"><!></div>'),C0e=lt("<!> <!>",1);function mW(t,e){if(new.target)return Ht({component:mW,...t});Ut(e,!1);const r=()=>wr(lr,"$configStore",a),n=()=>wr(ii,"$providerStore",a),i=()=>wr(wf,"$contractsStore",a),s=()=>wr(as,"$userStore",a),o=()=>wr(Cr,"$pageOptsStore",a),[a,l]=Bi();var u=this&&this.__awaiter||function(O,H,D,q){function K(te){return te instanceof D?te:new D(function(Q){Q(te)})}return new(D||(D=Promise))(function(te,Q){function X(ue){try{re(q.next(ue))}catch(me){Q(me)}}function Y(ue){try{re(q.throw(ue))}catch(me){Q(me)}}function re(ue){ue.done?te(ue.value):K(ue.value).then(X,Y)}re((q=q.apply(O,H||[])).next())})},d;const{close:f}=dt(Fn),g=dt(lr).chainId;let m=yt(0),v=yt(0),A=yt(!1),E=yt(!1),C=yt(0);const k=(d=dt(Ro).client_payment_configuration)===null||d===void 0?void 0:d.token_fee;let I=yt({});const S=(O,H,D)=>u(void 0,void 0,void 0,function*(){let q=0,K=0;if(D){const X=new dn.Contract(O,E0e,n());return q=yield X.getLicensePriceFiat(String(H),D).then(Y=>Number(Y)),K=yield X.getLicensePriceToken(String(H),D).then(Y=>Number(Y)),[q,K]}const{credenzaSellableMinAbi:te}=yield Promise.resolve().then(()=>uh),Q=new dn.Contract(O,te,n());return q=yield Q.getPriceFiat(H).then(X=>Number(X)),K=0,q===0?[q,K]=yield Promise.all([Q.getPriceFiat(f3).then(X=>Number(X)),Q.getPriceToken(f3).then(X=>Number(X))]):K=yield Q.getPriceToken(H).then(X=>Number(X)),[q,K]}),N=O=>u(void 0,void 0,void 0,function*(){try{Ye(A,!0);for(const H of O)if(H.contractAddress===i().erc20Cred.address)Ye(m,ae(m)+H.amount*100),k&&(Ye(C,k),Ye(m,ae(m)+ae(m)*k));else{const D=H.membershipTokenId||f3,q=H.tokenId||H.contentTokenId||D;let[K,te]=yield S(H.contractAddress,q,H.licenseType);H?.amount&&H?.amount!==0&&(K*=H.amount,te*=H.amount),Ye(m,ae(m)+K),Ye(v,ae(v)+te),Wj(I,ae(I)[`${H.contractAddress}/${q}`]=te)}}catch(H){qr(_r.ERROR,H)}finally{Ye(A,!1)}}),W=Cr.subscribe(O=>u(void 0,void 0,void 0,function*(){var H,D,q;!(!((H=O?.tokens)===null||H===void 0)&&H.length)&&!(!((D=O?.memberships)===null||D===void 0)&&D.length)&&!(!((q=O?.licenses)===null||q===void 0)&&q.length)||(yield N([...O?.tokens||[],...O?.memberships||[],...O?.licenses||[]]))}));Kf(W),tr(()=>r(),()=>{r().chainId!==g&&f()}),Rn();var G={$set:Vt,$on:(O,H)=>Lt(e,O,H)};cr();var L=C0e(),V=It(L);{var $=O=>{var H=er(),D=It(H);Mi(D,()=>Promise.resolve().then(()=>TW),null,(q,K)=>{var te=er(),Q=It(te);Ei(Q,()=>ae(K).default,(X,Y)=>{Y(X,{})}),We(q,te)}),We(O,H)};Rt(V,O=>{ae(E)&&O($)})}var j=tt(V,2);{let O=nr(()=>(s(),o(),ft(Ur),ft(Tt),ae(m),nt(()=>({user:s(),title:o().title||"Order Summary",subtitle:o().subtitle,onBackClick:()=>Ur.set(Tt.WALLET),isCardDisabled:o().payments?.card?.disabled,isCredezaValueDisabled:!ae(m)||o().payments?.credenzaStoredValue?.disabled}))));rH(j,{get options(){return ae(O)},get isLoading(){return ae(E)},set isLoading(H){Ye(E,H)},$$slots:{"credit-card":(H,D)=>{var q=T0e(),K=Xe(q);{var te=X=>{jc(X,{})},Q=X=>{pW(X,{get priceCents(){return ae(m)},get isPriceLoading(){return ae(A)},get feeToApply(){return ae(C)},get isLoading(){return ae(E)},set isLoading(Y){Ye(E,Y)},$$legacy:!0})};Rt(K,X=>{ae(E)||ae(A)?X(te):X(Q,!1)})}Je(q),We(H,q)},"cred-balance":(H,D)=>{var q=S0e(),K=Xe(q);gW(K,{get pricesByToken(){return ae(I)},get totalPriceToken(){return ae(v)},get isPriceLoading(){return ae(A)},get isLoading(){return ae(E)},set isLoading(te){Ye(E,te)},$$legacy:!0}),Je(q),We(H,q)}},$$legacy:!0})}We(t,L);var B=Dt(G);return l(),B}const k0e=Object.freeze(Object.defineProperty({__proto__:null,default:mW},Symbol.toStringTag,{value:"Module"}));function yW(t,e){if(new.target)return Ht({component:yW,...t});Ut(e,!1);const r=()=>wr(Cr,"$pageOptsStore",n),[n,i]=Bi();let s=dt(lr);var o={$set:Vt,$on:(l,u)=>Lt(e,l,u)};cr();{let l=nr(()=>({title:r()?.title||s.content?.paymentResult?.title||"Success!",subtitle:r()?.subtitle||s.content?.paymentResult?.subtitle||"Your payment was successful!",description:r()?.description||s.content?.paymentResult?.description,orders:r()?.orders||[],tokenImage:r()?.tokenImage||""}));QV(t,{get options(){return ae(l)}})}var a=Dt(o);return i(),a}const _0e=Object.freeze(Object.defineProperty({__proto__:null,default:yW},Symbol.toStringTag,{value:"Module"})),I0e=async(t,e)=>{const r=await fetch(`https://api.staging.credenza3.com/keyval/key/${t}?client_id=${e}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${dt(Ls)}`},method:"GET"});if(!r.ok)throw new Error("Failed to get key value");return await r.json()},R0e=async(t,e)=>{const n=(await I0e(t,e)).items[0].val;return[JSON.parse(n).scanType,n]};function wW(t,e){if(new.target)return Ht({component:wW,...t});Ut(e,!1);var r=this&&this.__awaiter||function(l,u,d,f){function g(m){return m instanceof d?m:new d(function(v){v(m)})}return new(d||(d=Promise))(function(m,v){function A(k){try{C(f.next(k))}catch(I){v(I)}}function E(k){try{C(f.throw(k))}catch(I){v(I)}}function C(k){k.done?m(k.value):g(k.value).then(A,E)}C((f=f.apply(l,u||[])).next())})};const{close:n}=dt(Fn);let i,s=yt(!1);const o=l=>r(void 0,[l],void 0,function*({message:u,sub:d,scanType:f}){if(!f)try{const g=dt(lr);[f,u]=yield R0e(u,g.clientId)}catch{return mV(rL(u),"failure"),i.close()}switch(i.close(),f){case Wu.PASSPORT_ID_PASS:case Wu.PASSPORT_ID:{const g=JSON.parse(u),{address:m}=yield DL(d);ece({userAddress:m,amount:g?.amount});break}case Wu.TOKENS_PURCHASE:{BL(JSON.parse(u));break}case Wu.AIR_DROP_ASSET:{yield tce(JSON.parse(u));break}case Wu.REQUEST_LOYALTY_POINTS:{yield rce(JSON.parse(u));break}default:n(),Ur.set(null)}});Dh(()=>r(void 0,void 0,void 0,function*(){const{scanner:l,events:u}=yield cW(l0e);i=l,TE(_r.UI_CLOSED,()=>{i.close(),Ur.set(null)}),uW(i,u,{onCapture:o,onError:d=>{const f=lW(d);f?.includes("Permission")&&alert("In order to scan please allow the current page to access your camera and try again.")}}),Ye(s,!0),yield i.scan({isCloseButton:!1})}));var a={$set:Vt,$on:(l,u)=>Lt(e,l,u)};cr();{let l=nr(()=>({isScannerLoaded:ae(s)}));YV(t,{get options(){return ae(l)}})}return Dt(a)}const N0e=Object.freeze(Object.defineProperty({__proto__:null,default:wW},Symbol.toStringTag,{value:"Module"})),O0e="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2027.3.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20500%20500'%20style='enable-background:new%200%200%20500%20500;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23010101;}%20%3c/style%3e%3cpath%20class='st0'%20d='M454.1,479.5l-39.2-358c-0.5-7.2-6.7-12.4-13.9-12.4l-67.6,0V88.6c0-45.9-37.7-83.6-83.6-83.6%20s-83.6,37.7-83.6,83.6v20.6H98.2c-7.2,0-12.9,5.2-13.9,12.4L45,479.5c-0.5,4.1,1,7.7,3.6,10.8c2.6,3.1,6.2,4.6,10.3,4.6h381.7%20c4.1,0,7.7-1.5,10.3-4.6C453.6,487.3,454.6,483.6,454.1,479.5L454.1,479.5z%20M204.4,88.6c0-25.3,20.6-45.4,45.4-45.4%20c24.8,0,45.4,20.6,45.4,45.4v20.6l-90.8,0L204.4,88.6z%20M249.8,406.3c-57.3,0-104.2-46.4-104.2-104.2c0-57.3,46.4-104.2,104.2-104.2%20c57.3,0,104.2,46.4,104.2,104.2C354,359.3,307.1,406.3,249.8,406.3z'/%3e%3cpath%20class='st0'%20d='M295.2,256.7c-7.2-7.2-19.6-7.2-26.8,0l-18.6,18.6l-18.6-18.6c-7.2-7.2-19.6-7.2-26.8,0%20c-7.2,7.2-7.2,19.6,0,26.8l18.6,18.6l-18.6,18.6c-7.2,7.2-7.2,19.6,0,26.8c3.6,3.6,8.8,5.7,13.4,5.7c4.6,0,9.8-2.1,13.4-5.7%20l18.6-18.6l18.6,18.6c3.6,3.6,8.8,5.7,13.4,5.7c4.6,0,9.8-2.1,13.4-5.7c7.2-7.2,7.2-19.6,0-26.8l-18.6-18.6l18.6-18.6%20C302.4,276.3,302.4,264.4,295.2,256.7L295.2,256.7z'/%3e%3c/svg%3e",fh={titles:{DEFAULT_ERROR_TITLE:"Something went wrong",TRANSACTION_REVERTED_TITLE:"The transaction is reverted",SOLD_OUT_ERROR_TITLE:"Sold out",INVALID_TOKEN_ERROR_TITLE:"Invalid token ID"},desctiptions:{DEFAULT_ERROR_DESC:"An unexpected error occured and we are unable to complete your order.",SOLD_OUT_ERROR_DESC:"We are unable to complete your order as the item that you are trying to add is currently sold out.",INVALID_TOKEN_ERROR_DESC:"There is no token associated with provided ID.",HAS_MEMBERSHIP_ALREADY_ERROR_DESC:"This membership is already assosiated with your account."}},x0e=t=>{let e={};return(t.includes("SOLD_OUT")||t.includes("Sold out"))&&(e={title:fh.titles.SOLD_OUT_ERROR_TITLE,description:fh.desctiptions.SOLD_OUT_ERROR_DESC,image:O0e}),t.includes("invalid token ID")&&(e={title:fh.titles.INVALID_TOKEN_ERROR_TITLE,description:fh.desctiptions.INVALID_TOKEN_ERROR_DESC}),t.includes("ALREADY_HAS_MEMBERSHIP")&&(e={title:fh.titles.TRANSACTION_REVERTED_TITLE,description:fh.desctiptions.HAS_MEMBERSHIP_ALREADY_ERROR_DESC}),e};function vW(t,e){if(new.target)return Ht({component:vW,...t});Ut(e,!1);const r=()=>dt(Fn).close(),{openUI:n}=dt(Fn);let i=yt();const s=Cr.subscribe(l=>{l.errorMessage?Ye(i,Object.assign(Object.assign({},ae(i)),x0e(l.errorMessage))):l.title&&l.description&&Ye(i,Object.assign(Object.assign({},ae(i)),l))}),o=()=>{const{primaryAction:l}=ae(i);let u={tokens:[{contractAddress:l?.contractAddress,tokenId:l?.tokenId}]},d={memberships:[{contractAddress:l?.contractAddress,membershipTokenId:l?.membershipTokenId||f3}]};n(Tt.PAYMENT,Object.assign({title:l?.text,subtitle:""},l?.tokenId?d:u))};Kf(s);var a={$set:Vt,$on:(l,u)=>Lt(e,l,u)};cr();{let l=nr(()=>({title:ae(i)?.title||fh.titles.DEFAULT_ERROR_TITLE,description:ae(i)?.description||fh.desctiptions.DEFAULT_ERROR_DESC,image:ae(i)?.image,shouldRenderBackButton:ae(i)?.shouldRenderBackButton,onCloseClick:r,secondaryAction:ae(i)?.secondaryAction,primaryActionText:ae(i)?.primaryAction?.text,openPaymentFunction:o}));LV(t,{get options(){return ae(l)}})}return Dt(a)}const P0e=Object.freeze(Object.defineProperty({__proto__:null,default:vW},Symbol.toStringTag,{value:"Module"}));var M0e=lt("<button> </button>"),B0e=lt(`<a class="crtw-flex crtw-justify-center crtw-items-center crtw-w-full crtw-h-[50px] crtw-cursor-pointer
686
686
  crtw-border-2 crtw-border-black crtw-rounded crtw-font-['Poppins'] crtw-text-base crtw-font-medium"> </a>`),U0e=lt(`<div class="crtw-flex crtw-flex-col crtw-justify-start crtw-items-start crtw-w-full crtw-mx-[50px]"><img alt="credenza-logo" class="crtw-w-[200px] crtw-mx-auto"/> <div class="crtw-flex crtw-flex-col crtw-justify-start crtw-items-start crtw-font-['Poppins'] crtw-w-full crtw-mt-[36px]"><span class="crtw-text-[24px] crtw-text-[#313a2c] crtw-font-medium"> </span> <span class="crtw-text-base crtw-text-[#747474] crtw-mb-1"> </span></div> <div class="crtw-flex crtw-flex crtw-gap-[6px] crtw-w-full crtw-items-center crtw-mb-[100px] crtw-mt-[30px]"><!> <button> </button></div></div>`);function bW(t,e){if(new.target)return Ht({component:bW,...t});Ut(e,!1);let r=gt(e,"options",12),n=yt(),i=yt(),s=yt();const{close:o}=dt(Fn),a=`crtw-px-[36px] crtw-flex crtw-justify-center crtw-items-center crtw-bg-black crtw-text-white crtw-h-[50px] crtw-cursor-pointer
687
687
  crtw-border-0 crtw-rounded crtw-font-['Poppins'] crtw-text-sm crtw-font-medium`;tr(()=>(ft(r()),ae(n),ae(i),ae(s)),()=>{r()&&(N=>{Ye(n,N.title),Ye(i,N.description),Ye(s,N.action)})(r())}),Rn();var l={get options(){return r()},set options(N){r(N),pt()},$set:Vt,$on:(N,W)=>Lt(e,N,W)};cr();var u=U0e(),d=Xe(u),f=tt(d,2),g=Xe(f),m=Xe(g,!0);Je(g);var v=tt(g,2),A=Xe(v,!0);Je(v),Je(f);var E=tt(f,2),C=Xe(E);{var k=N=>{var W=er(),G=It(W);{var L=$=>{var j=M0e();ri(j,1,T8(a));var B=Xe(j,!0);Je(j),Et(()=>Zt(B,(ae(s),nt(()=>ae(s).text)))),Ai("click",j,function(...O){ae(s).onClick?.apply(this,O)}),We($,j)},V=$=>{var j=B0e(),B=Xe(j,!0);Je(j),Et(()=>{ar(j,"href",(ae(s),nt(()=>ae(s)?.link))),Zt(B,(ae(s),nt(()=>ae(s)?.text)))}),We($,j)};Rt(G,$=>{ae(s),nt(()=>ae(s)?.onClick)?$(L):(ae(s),nt(()=>ae(s)?.link)&&$(V,1))})}We(N,W)};Rt(C,N=>{ae(s)&&N(k)})}var I=tt(C,2);ri(I,1,T8(a));var S=Xe(I,!0);return Je(I),Je(E),Je(u),Et(()=>{ar(d,"src",MV),Zt(m,ae(n)),Zt(A,ae(i)),Zt(S,(ft(r()),nt(()=>r().closeButtonText||"Close")))}),Ai("click",I,o),We(t,u),Dt(l)}function AW(t,e){if(new.target)return Ht({component:AW,...t});Ut(e,!1);let r=yt();const n=Cr.subscribe(s=>{Ye(r,Object.assign(Object.assign({},ae(r)),s.richAlertData))});Kf(n);var i={$set:Vt,$on:(s,o)=>Lt(e,s,o)};cr();{let s=nr(()=>({title:ae(r).title||"Notification",description:ae(r).description||"Choose your next steps",action:ae(r).action,closeButtonText:ae(r).closeButtonText}));bW(t,{get options(){return ae(s)}})}return Dt(i)}const D0e=Object.freeze(Object.defineProperty({__proto__:null,default:AW},Symbol.toStringTag,{value:"Module"}));function EW(t,e){if(new.target)return Ht({component:EW,...t});Ut(e,!1);const r=()=>wr(Cr,"$pageOptsStore",n),[n,i]=Bi();var s,o,a,l;const u=((s=dt(Cr))===null||s===void 0?void 0:s.loaderText)||tL,d=((o=dt(Cr))===null||o===void 0?void 0:o.progressVideos)||((l=(a=dt(lr))===null||a===void 0?void 0:a.content)===null||l===void 0?void 0:l.progressVideos)||[sE];let f=yt(sE);Dh(()=>{const v=Math.floor(Math.random()*d.length);Ye(f,Whe(d[v].src)?d[v]:sE)});var g={$set:Vt,$on:(v,A)=>Lt(e,v,A)};cr();{let v=nr(()=>({text:u,selected:ae(f),onSetVideoEnded:noe}));DV(t,{get options(){return ae(v)},get isProgressFinished(){return r().isProgressFinished},set isProgressFinished(A){wG(Cr,nt(r).isProgressFinished=A,nt(r))},$$legacy:!0})}var m=Dt(g);return i(),m}const TW=Object.freeze(Object.defineProperty({__proto__:null,default:EW},Symbol.toStringTag,{value:"Module"}));function SW(t,e){if(new.target)return Ht({component:SW,...t});Ut(e,!0);var r=this&&this.__awaiter||function(l,u,d,f){function g(m){return m instanceof d?m:new d(function(v){v(m)})}return new(d||(d=Promise))(function(m,v){function A(k){try{C(f.next(k))}catch(I){v(I)}}function E(k){try{C(f.throw(k))}catch(I){v(I)}}function C(k){k.done?m(k.value):g(k.value).then(A,E)}C((f=f.apply(l,u||[])).next())})};const{getAssets:n}=dt(K9),i=dt(lr).walletAssets;let s=Ta(xh([])),o=Ta(!1);Dh(()=>r(void 0,void 0,void 0,function*(){if(i?.length){Ye(o,!0);try{Ye(s,yield n({assetsConfig:i,opts:{fetchMetadata:!0}}),!0)}catch{}Ye(o,!1)}}));var a={$set:Vt,$on:(l,u)=>Lt(e,l,u)};{let l=X3(()=>({title:"My Assets",description:"",assets:ae(s)}));lH(t,{get options(){return ae(l)},get isLoading(){return ae(o)}})}return Dt(a)}const F0e=Object.freeze(Object.defineProperty({__proto__:null,default:SW},Symbol.toStringTag,{value:"Module"}));function CW(t,e){if(new.target)return Ht({component:CW,...t});Ut(e,!1);var r;const i=!!(!((r=dt(lr).walletAssets)===null||r===void 0)&&r.length),s=a=>{Ur.set(a)};var o={$set:Vt,$on:(a,l)=>Lt(e,a,l)};cr();{let a=nr(()=>({onClick:s,showAssets:i}));xV(t,{get options(){return ae(a)}})}return Dt(o)}const L0e=Object.freeze(Object.defineProperty({__proto__:null,default:CW},Symbol.toStringTag,{value:"Module"})),V0e=t=>{const{chainId:e}=dt(lr);switch(e){case St.POLYGON_AMOY:return{scanName:"Polygonscan",scanIcon:"https://amoy.polygonscan.com/assets/poly/images/svg/logos/polygon-chain.svg?v=23.11.1.0",scanLink:Xr[St.POLYGON_AMOY].scanUrl+"/address/"+t,passportLink:"https://passport.testnets.credenza3.com"};case St.CHILIZ_SPICY:return{scanName:"Explorer",scanIcon:"https://cloudflare-ipfs.com/ipfs/bafkreic5h74pwuf3ony3c5zmqoenps4pxj7l5q5j3o2mdcflfpb7g5tivy",scanLink:Xr[St.CHILIZ_SPICY].scanUrl+"/address/"+t,passportLink:"https://passport.testnets.credenza3.com"};case St.CHILIZ:return{scanName:"Explorer",scanIcon:"https://cloudflare-ipfs.com/ipfs/bafkreic5h74pwuf3ony3c5zmqoenps4pxj7l5q5j3o2mdcflfpb7g5tivy",scanLink:Xr[St.CHILIZ].scanUrl+"/address/"+t,passportLink:"https://passport.credenza3.com"};case St.AVALANCHE_FUJI:return{scanName:"Explorer",scanIcon:"https://cryptologos.cc/logos/avalanche-avax-logo.svg?v=040",scanLink:Xr[St.AVALANCHE_FUJI].scanUrl+"/address/"+t,passportLink:"https://passport.testnets.credenza3.com"};case St.AVALANCHE:return{scanName:"Explorer",scanIcon:"https://cryptologos.cc/logos/avalanche-avax-logo.svg?v=040",scanLink:Xr[St.AVALANCHE].scanUrl+"/address/"+t,passportLink:"https://passport.credenza3.com",nftsIcon:"https://opensea.io/static/images/logos/opensea.svg",nftsLink:"https://opensea.io/"+t};case St.BASE:return{scanName:"Explorer",scanIcon:"https://cdn.brandfetch.io/id6XsSOVVS/theme/dark/logo.svg?c=1dxbfHSJFAPEGdCLU4o5B",scanLink:Xr[St.BASE].scanUrl+"/address/"+t,passportLink:"https://passport.credenza3.com",nftsIcon:"https://opensea.io/static/images/logos/opensea.svg",nftsLink:"https://opensea.io/"+t};case St.BASE_SEPOLIA:return{scanName:"Explorer",scanIcon:"https://cdn.brandfetch.io/id6XsSOVVS/theme/dark/logo.svg?c=1dxbfHSJFAPEGdCLU4o5B",scanLink:Xr[St.BASE_SEPOLIA].scanUrl+"/address/"+t,passportLink:"https://passport.testnets.credenza3.com"};case St.POLYGON:default:return{scanName:"Polygonscan",scanIcon:Xr[St.POLYGON].scanUrl+"/assets/poly/images/svg/logos/polygon-chain.svg?v=23.11.1.0",scanLink:Xr[St.POLYGON].scanUrl+"/address/"+t,nftsIcon:"https://opensea.io/static/images/logos/opensea.svg",nftsLink:"https://opensea.io/"+t,passportLink:"https://passport.credenza3.com"}}};function kW(t,e){if(new.target)return Ht({component:kW,...t});Ut(e,!1);const r=()=>wr(lr,"$configStore",s),n=()=>wr(Ro,"$clientPublicStore",s),i=()=>wr(as,"$userStore",s),[s,o]=Bi();var a=this&&this.__awaiter||function(E,C,k,I){function S(N){return N instanceof k?N:new k(function(W){W(N)})}return new(k||(k=Promise))(function(N,W){function G($){try{V(I.next($))}catch(j){W(j)}}function L($){try{V(I.throw($))}catch(j){W(j)}}function V($){$.done?N($.value):S($.value).then(G,L)}V((I=I.apply(E,C||[])).next())})};const{getCREDContract:l,checkMembership:u}=dt(Fn);let d=yt({}),f=yt(null),g=yt(null);const m=()=>a(void 0,void 0,void 0,function*(){const E=yield _i();Ye(d,V0e(E));try{const{isMember:C}=yield u(E);C&&Ye(g,yield gce())}catch{Ye(g,null)}if(r().buyTokens!==!1)try{const{contract:C,decimals:k,address:I}=yield l(),[S,N]=yield Promise.all([C.balanceOf(E).then(W=>dn.formatUnits(W,k)),C.symbol()]);Ye(f,`${S} ${N}`),Is.track("cp_profile_balance_read",{chain:r().chainId,contract:I,decimals:k,balance:S,symbol:N})}catch{Ye(f,"-")}});tr(()=>r(),()=>{r().chainId&&m()}),Rn();var v={$set:Vt,$on:(E,C)=>Lt(e,E,C)};cr();{let E=nr(()=>(ae(d),ae(g),ft(dt),ft(lr),ft(Ur),ft(Tt),ft(zl),ae(f),n(),i(),ft(_i),nt(()=>({links:ae(d),gitbookToken:ae(g),gitbookUrl:dt(lr).credenza.gitbookUrl,onSignOut:()=>Ur.set(Tt.LOGOUT),onUpdateProfile:()=>zl.set(Tt.UPDATE_PROFILE),balance:ae(f),storedValueAlias:n()?.ui_settings.stored_value_alias,userData:i(),userAddress:_i()}))));JV(t,{get options(){return ae(E)}})}var A=Dt(v);return o(),A}const H0e=Object.freeze(Object.defineProperty({__proto__:null,default:kW},Symbol.toStringTag,{value:"Module"})),W0e=async t=>{const e=dt(Cr),r=e.licenses?.map(({contentTokenId:f,licenseContractAddress:g,licenseType:m})=>({contract_address:g,content_token_id:+f,license_type:+m}))||[],n=dt(wf).erc20Cred.address,i=dt(Ro).client_payment_configuration?.token_fee,s=e.tokens?.map(({contractAddress:f,tokenId:g,amount:m})=>(n===f&&i&&(m=+m+ +m*i),{contract_address:f,token_id:+g,amount:m}))||[],o=e.memberships?.map(({contractAddress:f,membershipTokenId:g})=>({contract_address:f,...g?{token_id:g}:{}}))||[],a={...t,tokens:s,memberships:o,licenses:r},l=dt(lr),u=await fetch(l.credenza.evmApiUrl+"/contracts/buy-assets",{headers:{"Content-Type":"application/json",Authorization:`Bearer ${dt(Ls)}`},method:"POST",body:JSON.stringify(a)});if(!u.ok)throw new Error("Failed to create order");const{_id:d}=await u.json();return d},j0e=async t=>{const e=dt(lr),r=dt(Cr),n=await g0e(e.credenza.generalApiUrl,t);return n.payment_provider_tx&&(await fW({stripeChargeId:n.payment_provider_tx,title:r.title,subtitle:r.subtitle}),qr(_r.RECEIPT,{stripeChargeId:n.payment_provider_tx})),await Yae(n.items),n},G0e=Object.freeze(Object.defineProperty({__proto__:null,processPayment:async t=>{const e=dt(lr),r=dt(Cr),n=dt(as),i=await _i(),s=n?.email||n?.pending?.email,o=n?.phone||n?.pending?.phone,a=`Passport Payment: (${JSON.stringify({...r.tokens,...r.memberships,...r.licenses,userAddress:i,chainId:e.chainId,email:s,phone:o})})`,l=qE(e.clientId).name,d={card_token:(e.stripe.pk[l]??e.stripe.pk.DEFAULT).includes("pk_live")?t:"tok_visa",client:l,description:a,address:i,chain_id:Number(e.chainId),currency:"USD"},f=await W0e(d);return await j0e(f)}},Symbol.toStringTag,{value:"Module"}));Df.Passport=Tw,Object.defineProperty(Df,Symbol.toStringTag,{value:"Module"})}));
688
688
  //# sourceMappingURL=passport.umd.js.map