From b32bb2568c0ed3145e815690a931c2009f6b1016 Mon Sep 17 00:00:00 2001 From: SAHIBAKHATOON <115203203+SAHIBAKHATOON@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:54:12 +0530 Subject: [PATCH] implement USDT function --- css/Asset 1.svg | 3 +- css/bg-art-5.svg | 3 +- css/bg-art1.svg | 3 +- css/bg-art2.svg | 1 + css/bg-art3.svg | 2 +- css/bg-art4.svg | 2 +- css/card-art1.svg | 3 +- css/card-back.svg | 3 +- css/favicon.svg | 3 +- css/main.css | 3652 +++++++++++++++++---------------- css/main.min.css | 3 +- css/main.scss | 3301 ++++++++++++++--------------- css/sign-in-bg.svg | 3 +- css/success-art.svg | 3 +- css/welcome.svg | 3 +- index.html | 1733 +++++++++++++++- scripts/bscOperator.js | 523 +++++ scripts/btcOperator.js | 13 +- scripts/ether.umd.min.js | 2 + scripts/floBlockchainAPI.js | 7 + scripts/floCloudAPI.js | 1 + scripts/floEthereum.js | 57 + scripts/floEthereum.min.js | 2 + scripts/floTokenAPI.js | 58 +- scripts/floTokenAPI.min.js | 3 +- scripts/fn_pay.js | 36 +- scripts/keccak.js | 673 ++++++ scripts/qrcode-scanner.min.js | 3 +- scripts/qrcode.min.js | 3 +- 29 files changed, 6504 insertions(+), 3598 deletions(-) create mode 100644 scripts/bscOperator.js create mode 100644 scripts/ether.umd.min.js create mode 100644 scripts/floEthereum.js create mode 100644 scripts/floEthereum.min.js create mode 100644 scripts/keccak.js diff --git a/css/Asset 1.svg b/css/Asset 1.svg index c3fe1b0..1868391 100644 --- a/css/Asset 1.svg +++ b/css/Asset 1.svg @@ -1 +1,2 @@ -Asset 1 \ No newline at end of file + +Asset 1 diff --git a/css/bg-art-5.svg b/css/bg-art-5.svg index c71d67d..2559a61 100644 --- a/css/bg-art-5.svg +++ b/css/bg-art-5.svg @@ -1 +1,2 @@ - \ No newline at end of file + + diff --git a/css/bg-art1.svg b/css/bg-art1.svg index 496d579..f52e26a 100644 --- a/css/bg-art1.svg +++ b/css/bg-art1.svg @@ -1 +1,2 @@ -bg-art1 \ No newline at end of file + +bg-art1 diff --git a/css/bg-art2.svg b/css/bg-art2.svg index 24a7f74..2867417 100644 --- a/css/bg-art2.svg +++ b/css/bg-art2.svg @@ -1,3 +1,4 @@ + diff --git a/css/bg-art3.svg b/css/bg-art3.svg index 25f63f1..02b3a1b 100644 --- a/css/bg-art3.svg +++ b/css/bg-art3.svg @@ -30,4 +30,4 @@ - + \ No newline at end of file diff --git a/css/bg-art4.svg b/css/bg-art4.svg index fadbb59..9ff9c9f 100644 --- a/css/bg-art4.svg +++ b/css/bg-art4.svg @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/css/card-art1.svg b/css/card-art1.svg index add6995..5442404 100644 --- a/css/card-art1.svg +++ b/css/card-art1.svg @@ -1 +1,2 @@ -card-art1 \ No newline at end of file + +card-art1 diff --git a/css/card-back.svg b/css/card-back.svg index e523bbf..64e7b45 100644 --- a/css/card-back.svg +++ b/css/card-back.svg @@ -1 +1,2 @@ -card-back \ No newline at end of file + +card-back diff --git a/css/favicon.svg b/css/favicon.svg index 1cc2b89..444e4d3 100644 --- a/css/favicon.svg +++ b/css/favicon.svg @@ -1 +1,2 @@ -favicon \ No newline at end of file + +favicon diff --git a/css/main.css b/css/main.css index 89528ca..75b1b83 100644 --- a/css/main.css +++ b/css/main.css @@ -1,1863 +1,1865 @@ * { - padding: 0; - margin: 0; - box-sizing: border-box; - font-family: "Inter", sans-serif; -} -*:focus-visible { - outline: var(--accent-color) solid medium; - outline-offset: 0; - transition: outline-offset 0.3s; -} - -:root { - font-size: clamp(1rem, 1.2vmax, 1.2rem); -} - -html, -body { - height: 100%; -} - -body { - --accent-color: #234ebf; - --accent-color-rgb: 35, 78, 191; - --blue-accent-1: #f5f8ff; - --blue-accent-2: #f2f6ff; - --text-color: 58, 58, 58; - --foreground-color: 255, 255, 255; - --background-color: 243, 245, 250; - --danger-color: #ff6161; - --green: #1cad59; - --yellow: rgb(220, 165, 0); - scrollbar-width: thin; - scrollbar-gutter: stable; - color: rgba(var(--text-color), 1); - background-color: rgba(var(--foreground-color), 1); - transition: background-color 0.3s; - position: relative; - display: flex; - flex-direction: column; -} - -body[data-theme=dark] { - --accent-color: #a0b6ff; - --accent-color-rgb: 160, 182, 255; - --blue-accent-1: #f5f8ff10; - --blue-accent-2: #f2f6ff10; - --text-color: 220, 220, 220; - --foreground-color: 27, 28, 29; - --background-color: 21, 22, 22; - --danger-color: rgb(255, 106, 106); - --green: #00e676; - --yellow: rgb(255, 213, 5); -} - -p, -strong { - font-size: 0.9rem; - max-width: 65ch; - line-height: 1.7; - color: rgba(var(--text-color), 0.9); -} - -.warning { - line-height: normal; - padding: 1rem; - background-color: khaki; - border-radius: 0.5rem; - font-weight: 500; - color: rgba(0, 0, 0, 0.7); -} - -a { - text-decoration: none; - color: var(--accent-color); -} - -.button, -button { - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - position: relative; - display: inline-flex; - border: none; - background-color: transparent; - overflow: hidden; - -webkit-tap-highlight-color: transparent; - align-items: center; - font-size: 0.9rem; - font-weight: 500; - white-space: nowrap; - padding: 0.8rem; - border-radius: 0.5rem; - justify-content: center; - color: inherit; - min-width: -webkit-max-content; - min-width: -moz-max-content; - min-width: max-content; -} -.button:not(:disabled), -button:not(:disabled) { - cursor: pointer; -} - -.button { - color: var(--accent-color); - background-color: var(--blue-accent-1); -} -.button .icon { - fill: var(--accent-color); -} -.button--primary, .button--danger { - color: rgba(var(--background-color), 1) !important; -} -.button--primary .icon, .button--danger .icon { - fill: rgba(var(--background-color), 1); -} -.button--primary { - width: 100%; - background-color: var(--accent-color); -} -.button--danger { - background-color: var(--danger-color); -} -.button--small { - padding: 0.4rem 0.6rem; -} - -.cta { - text-transform: uppercase; - font-size: 0.8rem; - font-weight: 700; - letter-spacing: 0.05em; - padding: 0.8rem 1rem; -} - -.icon { - width: 1.2rem; - height: 1.2rem; - fill: rgba(var(--text-color), 0.8); - flex-shrink: 0; -} - -.icon-only { - padding: 0.5rem; - border-radius: 0.3rem; -} - -button:disabled { - opacity: 0.5; - cursor: not-allowed; -} - -details summary { - display: flex; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - cursor: pointer; - align-items: center; - justify-content: space-between; -} - -details[open] summary { - margin-bottom: 1rem; -} -details[open] > summary .down-arrow { - transform: rotate(180deg); -} - -sm-popup::part(popup) { - background-color: rgba(var(--foreground-color), 1); -} -sm-popup::part(backdrop) { - -webkit-backdrop-filter: blur(0.5rem); - backdrop-filter: blur(0.5rem); -} - -sm-input, -sm-textarea { - --border-radius: 0.5rem; - --background-color: rgba(var(--foreground-color), 1); -} -sm-input button .icon, -sm-textarea button .icon { - fill: var(--accent-color); -} - -sm-copy { - font-size: 0.9rem; -} - -sm-spinner { - --size: 1rem; - --stroke-width: 0.1rem; -} - -sm-form { - --gap: 1rem; -} - -sm-select { - --padding: 0.8rem; - font-size: 0.9rem; -} - -sm-option { - font-size: 0.9rem; -} - -sm-chips { - --gap: 0.3rem; -} - -sm-chip { - position: relative; - font-size: 0.9rem; - --border-radius: 0.5rem; - --padding: 0.5rem 0.8rem; - --background: rgba(var(--text-color), 0.06); - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - font-weight: 500; -} -sm-chip[selected] { - --background: var(--accent-color); - color: rgba(var(--foreground-color), 1); -} - -ul { - list-style: none; -} - -ol { - counter-reset: item; -} -ol li { - position: relative; - display: flex; - align-items: flex-start; - counter-increment: item; -} -ol li:not(:last-of-type) { - padding-bottom: 1.5rem; -} -ol li:not(:last-of-type)::after { - content: ""; - position: absolute; - width: 0.1rem; - height: calc(100% - 2.2rem); - background: var(--accent-color); - margin-left: 0.7rem; - margin-top: 2rem; -} -ol li::before { - content: counter(item); - display: flex; - align-items: center; - justify-content: center; - text-align: center; - font-size: 0.8rem; - font-weight: 500; - margin-top: 0.15rem; - margin-right: 1rem; - line-height: 1; - width: 1.5rem; - height: 1.5rem; - border-radius: 100%; - flex-shrink: 0; - color: rgba(var(--text-color), 0.8); - background: rgba(var(--text-color), 0.1); -} - -.overflow-ellipsis { - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -.wrap-around { - overflow-wrap: break-word; - word-wrap: break-word; - word-break: break-word; -} - -.full-bleed { - grid-column: 1/-1; -} - -.uppercase { - text-transform: uppercase; -} - -.capitalize { - text-transform: capitalize; -} - -.sticky { - position: -webkit-sticky; - position: sticky; -} - -.top-0 { - top: 0; -} - -.flex { - display: flex; -} - -.flex-wrap { - flex-wrap: wrap; -} - -.flex-1 { - flex: 1; -} - -.grid { - display: grid; -} - -.flow-column { - grid-auto-flow: column; -} - -.gap-0-3 { - gap: 0.3rem; -} - -.gap-0-5 { - gap: 0.5rem; -} - -.gap-1 { - gap: 1rem; -} - -.gap-1-5 { - gap: 1.5rem; -} - -.gap-2 { - gap: 2rem; -} - -.gap-3 { - gap: 3rem; -} - -.text-align-right { - text-align: right; -} - -.align-start { - align-content: flex-start; -} - -.align-center { - align-items: center; -} - -.align-end { - align-items: flex-end; -} - -.text-center { - text-align: center; -} - -.justify-start { - justify-items: start; -} - -.justify-center { - justify-content: center; -} - -.justify-items-center { - justify-items: center; -} - -.justify-right { - margin-left: auto; -} - -.align-self-center { - align-self: center; -} - -.align-self-end { - align-self: end; -} - -.justify-self-center { - justify-self: center; -} - -.justify-self-start { - justify-self: start; -} - -.justify-self-end { - justify-self: end; -} - -.flex-direction-column { - flex-direction: column; -} - -.space-between { - justify-content: space-between; -} - -.margin-right-0-3 { - margin-right: 0.3rem; -} - -.margin-right-0-5 { - margin-right: 0.5rem; -} - -.margin-right-auto { - margin-right: auto; -} - -.margin-left-0-5 { - margin-left: 0.5rem; -} - -.margin-left-auto { - margin-left: auto; -} - -.margin-top-1 { - margin-top: 1rem; -} - -.margin-top-1-5 { - margin-top: 1.5rem; -} - -.margin-bottom-0-5 { - margin-bottom: 0.5rem; -} - -.margin-bottom-1 { - margin-bottom: 1rem; -} - -.margin-bottom-1-5 { - margin-bottom: 1.5rem; -} - -.margin-bottom-2 { - margin-bottom: 2rem; -} - -.padding-0-3 { - padding: 0.3rem; -} - -.padding-0-5 { - padding: 0.5rem; -} - -.padding-1 { - padding: 1rem; -} - -.padding-inline-0-5 { - padding-inline: 0.5rem; -} - -.padding-inline-1 { - padding-inline: 1rem; -} - -.padding-block-0-5 { - padding-block: 0.5rem; -} - -.padding-block-1 { - padding-block: 1rem; -} - -.border-radius-0-3 { - border-radius: 0.3rem; -} - -.border-radius-0-5 { - border-radius: 0.5rem; -} - -.font-0-9 { - font-size: 0.9rem; -} - -.w-100 { - width: 100%; -} - -.h-100 { - height: 100%; -} - -.label { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); - font-weight: 500; - margin-bottom: 0.2rem; -} - -.button--primary .ripple, -.button--danger .ripple { - background: radial-gradient(circle, rgba(var(--background-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%); -} - -.ripple { - height: 8rem; - width: 8rem; - position: absolute; - border-radius: 50%; - transform: scale(0); - background: radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%); - pointer-events: none; -} - -.interact { - position: relative; - overflow: hidden; - cursor: pointer; - -webkit-tap-highlight-color: transparent; -} - -.empty-state { - display: grid; - width: 100%; - padding: 1.5rem 0; -} - -.observe-empty-state:empty { - display: none !important; -} - -.observe-empty-state:not(:empty) + .empty-state { - display: none !important; -} - -.bullet-point { - display: flex; - align-items: center; - justify-content: center; - margin: 0 0.8ch; -} -.bullet-point::after { - content: ""; - height: 0.4ch; - width: 0.4ch; - border-radius: 0.5em; - background-color: var(--accent-color); -} - -.icon-button { - padding: 0.6rem; - border-radius: 0.8rem; - background-color: rgba(var(--text-color), 0.1); - height: -webkit-max-content; - height: -moz-max-content; - height: max-content; -} -.icon-button .icon { - fill: var(--accent-color); -} - -.page { - height: 100%; -} -.page__header { - position: -webkit-sticky; - position: sticky; - top: 0; - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 1rem; - margin-bottom: 1.5rem; - background-color: rgba(var(--foreground-color), 1); - z-index: 1; -} - -#confirmation_popup, -#prompt_popup { - flex-direction: column; -} -#confirmation_popup h4, -#prompt_popup h4 { - margin-bottom: 0.5rem; -} -#confirmation_popup .flex, -#prompt_popup .flex { - margin-top: 1rem; -} - -#prompt_message { - margin-bottom: 1.5rem; -} - -.popup__header { - position: relative; - display: grid; - gap: 0.5rem; - width: 100%; - padding: 0 1.5rem 0 0.5rem; - align-items: center; - grid-template-columns: auto 1fr; -} -.popup__header > * { - grid-row: 1; -} -.popup__header h3, -.popup__header h4 { - grid-column: 1/-1; - justify-self: center; - align-self: center; -} -.popup__header__close { - grid-column: 1; -} - -.flo-icon { - margin-right: 0.3rem; - height: 1.5rem; - width: 1.5rem; -} - -#secondary_pages { - display: flex; - flex-direction: column; - width: 100%; -} -#secondary_pages header { - padding: 1.5rem; -} -#secondary_pages .inner-page { - height: 100%; -} - -#landing > section { - justify-content: center; - justify-items: center; - align-items: center; - text-align: center; - padding: 8vw 0; -} -#landing h1 { - font-size: clamp(2rem, 5vw, 5rem); -} - -#sign_in, -#sign_up { - justify-content: center; - align-items: center; -} -#sign_in sm-form, -#sign_up sm-form { - margin: 2rem 0; -} - -#sign_in { - display: grid; - align-content: center; - padding: 0; - justify-items: center; -} -#sign_in .illustration { - height: auto; - background-color: #4d77ff; - border-radius: 1rem; - width: min(24rem, 100%); -} -#sign_in section { - width: min(24rem, 100%); - background-color: rgba(var(--foreground-color), 1); - padding: max(1.5rem, 2vw); - border-radius: 0.5rem; - margin-top: -1.6rem; -} - -#sign_up { - justify-items: center; - align-content: center; -} -#sign_up keys-generator { - width: min(26rem, 100%); - margin-top: -4rem; -} -#sign_up .h2 { - margin-bottom: 0.5rem; -} - -#main_header { - display: grid; - gap: 1rem; - padding: 1rem; - align-items: center; - grid-template-columns: minmax(0, 1fr) auto auto; - min-height: 4rem; - flex-shrink: 0; -} - -#user_profile_button { - background-color: var(--blue-accent-1); - border-radius: 2rem; - font-size: 0.8rem; - padding: 0.6rem 0.8rem; - font-weight: 700; - min-width: 0; -} - -#notifications_wrapper { - position: relative; -} - -#notifications_panel { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 10; - background-color: rgba(var(--foreground-color), 1); - padding: 1rem; -} - -.logged-in-user-id { - background-color: rgba(var(--text-color), 0.06); - max-width: -webkit-fit-content; - max-width: -moz-fit-content; - max-width: fit-content; - padding: 0.4rem 0.8rem 0.4rem 0.5rem; - border-radius: 2rem; - font-weight: 500; -} - -#main_card { - position: relative; - display: flex; - flex-direction: column; - height: 100%; - width: 100%; - transition: background-color 0.3s; -} -#main_card.nav-hidden .inner-page { - grid-area: 2/1/3/-1; -} - -.badge { - display: flex; - align-items: center; - justify-content: center; - content: attr(data-notifications); - position: absolute; - top: 0; - right: 0; - font-size: 0.8rem; - padding: 0.1rem 0.3rem; - background: var(--danger-color); - color: rgba(var(--background-color), 1); - aspect-ratio: 1/1; - font-weight: 700; - border-radius: 0.3rem; -} - -.inner-page { - display: flex; - flex-direction: column; - padding: 0 1rem; - flex: 1; - align-content: start; - overflow-y: auto; -} - -.password-field label { - display: flex; - justify-content: center; -} -.password-field label input:checked ~ .visible { - display: none; -} -.password-field label input:not(:checked) ~ .invisible { - display: none; -} - -.multi-state-button { - display: grid; - text-align: center; - align-items: center; - justify-items: center; -} -.multi-state-button > * { - grid-area: 1/1/2/2; -} -.multi-state-button button { - z-index: 1; -} - -.scrolling-wrapper { - overflow-y: auto; -} - -#home { - position: relative; - display: grid; - padding: 0; - gap: 3rem; - overflow-y: visible; - align-content: initial; - transition: filter 0.3s; -} -#home > * { - align-content: flex-start; -} - -#wallet_section { - position: relative; - display: flex; - flex-direction: column; - height: 100%; - gap: 1.5rem; - background-color: rgba(var(--accent-color-rgb), 0.02); -} -#wallet_section sm-chips { - display: flex; - justify-content: center; -} -#wallet_section sm-chip::part(chip) { - width: 8rem; - justify-content: center; -} -#wallet_section > * { - width: 100%; -} -#wallet_section::before { - content: ""; - position: absolute; - top: -10vmax; - left: 0; - width: 100%; - height: 10vmax; - background-color: inherit; - pointer-events: none; -} - -#user, -#cashier { - position: relative; - padding-bottom: 1rem; - align-content: flex-start; -} - -#cashier { - padding: 1rem 0; -} - -#wallet_cards_wrapper { - display: grid; - grid-template-columns: 6rem 1fr; - background-color: rgba(var(--text-color), 0.06); - border-radius: 0.5rem; - padding: 0 0.2rem; -} -#wallet_cards_wrapper sm-input { - --background: transparent; -} -#wallet_cards_wrapper sm-select { - margin: 0.2rem 0; - --background: rgba(var(--foreground-color), 1); -} -#wallet_cards_wrapper sm-select[open] { - z-index: 10; -} - -.balance-card { - background-color: rgba(var(--accent-color-rgb), 0.06); - border-radius: 0.5rem; - padding: 0.8rem; - font-size: 0.9rem; -} -.balance-card > * { - font-weight: 500; -} - -#rupee_balance span:first-of-type, -#flo_balance span:first-of-type, -#btc_balance span:first-of-type { - font-size: 1.5rem; -} -#rupee_balance span:nth-of-type(2), -#flo_balance span:nth-of-type(2), -#btc_balance span:nth-of-type(2) { - font-size: 1rem; -} - -.actions-wrapper { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr)); - gap: 1rem 0.5rem; -} - -.wallet-action, -.integrated-action-button { - position: relative; - color: inherit; - font-weight: 500; - font-size: 0.9rem; -} -.wallet-action .icon:first-of-type, -.integrated-action-button .icon:first-of-type { - height: 3rem; - width: 3rem; - padding: 0.95rem; - overflow: visible; - fill: var(--accent-color); - border-radius: 2rem; - background-color: var(--blue-accent-2); -} -.wallet-action .badge, -.integrated-action-button .badge { - left: 0; - right: auto; -} - -.wallet-action { - gap: 0.5rem; - flex-direction: column; - align-items: center; - font-size: 0.8rem; - white-space: initial; - border-radius: 0.5rem; - padding: 0; - min-width: 0; -} - -.integrated-action-button { - padding: 0; - justify-content: flex-start; -} -.integrated-action-button .icon:first-of-type { - margin-right: 1rem; -} -.integrated-action-button span:last-of-type { - font-size: 1rem; -} - -.cashier-status { - font-size: 0.9rem; - padding: 1rem 1.2rem; - border-radius: 1rem; - background-color: rgba(240, 230, 140, 0.8); - color: rgba(0, 0, 0, 0.8); -} -.cashier-status .icon { - fill: rgba(0, 0, 0, 0.8); -} - -#topup_wallet__qr_code { - background-color: rgba(var(--text-color), 0.03); - border-radius: 0.5rem; - height: 10rem; - justify-self: flex-start; - width: 10rem; -} -#topup_wallet__qr_code svg { - width: 100%; - height: 100%; - fill: rgba(var(--text-color), 1); -} - -#cashier_status { - font-size: 0.9rem; - padding: 1rem 1.2rem; - border-radius: 1rem; - background-color: rgba(240, 230, 140, 0.8); - color: rgba(0, 0, 0, 0.8); -} -#cashier_status .icon { - fill: rgba(0, 0, 0, 0.8); -} - -.remove-card-wrapper { - min-height: 2rem; -} - -#selected_fee_tip, -#error_section { - font-weight: 500; -} - -.error { - color: var(--danger-color); -} -.error .icon { - fill: var(--danger-color); -} - -#send_fee_wrapper { - display: grid; -} -#send_fee_wrapper > * { - grid-area: 1/1; -} - -#send_fee_loader { - background-color: rgba(var(--foreground-color), 1); - z-index: 1; - width: 100%; -} - -.receiver-card { - display: grid; - gap: 0.5rem; - padding: 0.5rem 0; - border: none; -} -.receiver-card:not(:last-of-type) { - border-bottom: solid thin rgba(var(--text-color), 0.3); -} - -#contacts { - position: relative; - padding-bottom: 6rem; -} - -#recent_contacts { - gap: 0; -} - -#saved_ids_list { - display: grid; - gap: 0.5rem 1rem; - grid-template-columns: minmax(0, 1fr); - margin-bottom: 1.5rem; -} - -.saved-id { - align-items: center; - grid-template-columns: auto 1fr; - gap: 0 1rem; - padding: 0.5rem 0; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; - border-radius: 0.5rem; -} -.saved-id.highlight { - box-shadow: 0 0 0.1rem 0.1rem var(--accent-color) inset; -} -.saved-id .edit-saved { - padding: 0.3rem; - position: relative; -} -.saved-id__initials { - display: flex; - align-items: center; - justify-content: center; - height: 2.5rem; - width: 2.5rem; - font-size: 1.2rem; - text-transform: uppercase; - color: var(--accent-color); - font-weight: 700; - line-height: 1; - background-color: rgba(var(--text-color), 0.03); - border-radius: 2rem; - grid-area: 1/1/3/2; -} -.saved-id__title { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - font-weight: 500; -} -.saved-id__flo-id { - font-size: 0.8rem; -} -.saved-id__copy { - padding: 0.3rem 0.5rem; - border-radius: 0.3rem; - background-color: rgba(var(--text-color), 0.03); -} - -#saved_ids_tip { - background-color: rgba(var(--text-color), 0.03); - border-radius: 2rem; - padding: 0.5rem 0.8rem 0.5rem 0.5rem; -} - -.card { - background-color: rgba(var(--foreground-color), 1); - border-radius: 0.5rem; - padding: 1rem; -} - -#contact { - display: grid; - grid-template-rows: auto 1fr auto; - padding: 0; - height: 100%; -} -#contact > * { - padding: 1rem 1.5rem; -} -#contact > :first-child { - padding-top: 0; -} -#contact > :last-child { - padding: 0.5rem 1.5rem; - border-top: solid thin rgba(var(--text-color), 0.2); -} -#contact > :last-child button { - padding: 0.8rem 2rem; - border-radius: 1rem; - color: var(--accent-color); - background-color: rgba(var(--text-color), 0.03); -} - -#contact__transactions { - position: relative; - display: grid; - gap: 0.5rem; - overflow-y: auto; - flex: 1; - padding: 0 max(1rem, 8vw) 1rem max(1rem, 8vw); - align-content: flex-start; -} -#contact__transactions sm-spinner { - position: absolute; - justify-self: center; - align-self: center; -} - -.transaction-message { - background-color: rgba(var(--text-color), 0.06); - padding: 1rem; - border-radius: 0.5rem; - justify-self: flex-start; - border-radius: 0 1rem 1rem 1rem; - gap: 0.5rem; -} -.transaction-message.received { - background-color: var(--accent-color); - color: rgba(var(--background-color), 1); -} -.transaction-message.received + .transaction-message.received { - border-radius: 1rem; -} -.transaction-message.sent { - margin-left: auto; - justify-self: flex-end; - border-radius: 1rem 1rem 0 1rem; - text-align: right; -} -.transaction-message__amount { - font-size: 1.2rem; -} -.transaction-message__time { - opacity: 0.8; - font-size: 0.8rem; -} - -#history_applied_filters { - padding: 0.2rem 0 0.5rem 0; -} - -.applied-filter { - display: flex; - align-items: center; - padding: 0.5rem 0.6rem 0.5rem 0.8rem; - border-radius: 0.5rem; - border: solid thin rgba(var(--text-color), 0.2); - text-transform: uppercase; - font-size: 0.8rem; - font-weight: 500; - letter-spacing: 0.08em; -} -.applied-filter button { - padding: 0.6rem; -} -.applied-filter .icon { - margin-left: 0.3rem; -} - -fieldset { - border: none; - padding: 0; - margin: 0; -} -fieldset legend { - font-size: 0.8rem; - font-weight: 500; - margin-bottom: 0.5rem; -} - -.category-chip { - display: inline-flex; - align-items: center; - justify-content: center; - padding: 0.3rem 0.5rem; - border-radius: 0.3rem; - font-size: 0.8rem; - border: solid thin rgba(var(--text-color), 0.2); - font-weight: 700; -} -.category-chip input { - display: none; -} -.category-chip span { - transition: transform 0.2s; - transform: translateX(-0.8rem); -} -.category-chip .icon { - opacity: 0; - transition: opacity 0.2s, transform 0.2s; - margin-right: 0.3rem; - fill: var(--accent-color); - transform: translateX(0.5rem); -} -.category-chip input:checked ~ .icon { - opacity: 1; - transform: translateX(0); -} -.category-chip input:checked ~ span { - color: var(--accent-color); - transform: translateX(0); -} - -#wallet_history_wrapper { - margin-top: 1.5rem; - padding-bottom: 3rem; -} - -#payments_history { - display: grid; - gap: 2rem; - margin-top: 1.5rem; - padding-bottom: 6rem; -} - -.transaction { - grid-template-columns: auto 1fr auto; - gap: 0.5rem 1rem; - align-items: flex-start; -} -.transaction .button { - min-width: auto; - white-space: normal; - text-align: start; -} -.transaction.sent .icon--tx-type { - fill: var(--danger-color); -} -.transaction.sent .transaction__amount { - color: var(--danger-color); -} -.transaction.sent .transaction__amount::before { - content: "- "; -} -.transaction.received .icon--tx-type { - fill: var(--green); -} -.transaction.received .transaction__amount { - color: var(--green); -} -.transaction.received .transaction__amount::before { - content: "+ "; -} -.transaction__icon { - position: relative; - display: grid; - align-items: center; - justify-content: center; - width: 2.5rem; - height: 2.5rem; - background-color: rgba(var(--text-color), 0.03); - border-radius: 2rem; -} -.transaction__icon > * { - grid-area: 1/1; -} -.transaction__icon .icon--tx-type { - position: absolute; - background-color: inherit; - right: -0.3rem; - bottom: -0.3rem; - border-radius: 1rem; - padding: 0.2rem; - height: 1.5rem; - width: 1.5rem; - border: solid medium rgba(var(--foreground-color), 1); -} -.transaction__receiver { - font-size: 0.9rem; - font-weight: 500; -} -.transaction__time { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); -} -.transaction__amount { - font-size: 0.9rem; - font-weight: 500; - white-space: nowrap; -} - -.btc-tx { - display: grid; - grid-template-columns: auto minmax(0, 1fr); - gap: 0.5rem 1rem; - align-items: flex-start; -} -.btc-tx .button { - min-width: auto; - white-space: normal; - text-align: start; -} -.btc-tx.out .icon--tx-type { - fill: var(--danger-color); -} -.btc-tx.out .btc-tx__amount { - color: var(--danger-color); -} -.btc-tx.out .btc-tx__amount::before { - content: "- "; -} -.btc-tx.in .icon--tx-type { - fill: var(--green); -} -.btc-tx.in .btc-tx__amount { - color: var(--green); -} -.btc-tx.in .btc-tx__amount::before { - content: "+ "; -} -.btc-tx.unconfirmed-tx .icon { - fill: var(--yellow); -} -.btc-tx__icon { - position: relative; - display: grid; - align-items: center; - justify-content: center; - width: 2.5rem; - height: 2.5rem; - background-color: rgba(var(--text-color), 0.03); - border-radius: 2rem; -} -.btc-tx__icon > * { - grid-area: 1/1; -} -.btc-tx__icon .icon--tx-type { - position: absolute; - background-color: inherit; - right: -0.3rem; - bottom: -0.3rem; - border-radius: 1rem; - padding: 0.2rem; - height: 1.5rem; - width: 1.5rem; - border: solid medium rgba(var(--foreground-color), 1); -} -.btc-tx__receiver { - font-size: 0.9rem; - font-weight: 500; -} -.btc-tx__time { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); -} -.btc-tx__amount { - font-size: 0.9rem; - font-weight: 500; - white-space: nowrap; -} -.btc-tx__id { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); -} -.btc-tx .pending-badge { - font-size: 0.8rem; - padding: 0.2rem 0.5rem; - border-radius: 0.5rem; - background-color: var(--yellow); - color: rgba(var(--foreground-color), 1); - font-weight: 500; - align-self: flex-start; -} - -.fab { - position: absolute; - right: 0; - bottom: 0; - margin: 1.5rem; - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); - z-index: 2; -} - -#scroll_to_top { - border-radius: 3rem; - background-color: rgba(var(--foreground-color), 1); -} - -.user-action-result__icon { - justify-self: center; - height: 4rem; - width: 4rem; - border-radius: 5rem; - margin-bottom: 2rem; - -webkit-animation: popup 1s; - animation: popup 1s; -} -.user-action-result__icon.success { - fill: rgba(var(--background-color), 1); - padding: 1rem; - background-color: #0bbe56; -} -.user-action-result__icon.failed { - background-color: rgba(var(--text-color), 0.03); - fill: var(--danger-color); -} - -@-webkit-keyframes popup { - 0% { - opacity: 0; - transform: scale(0.2) translateY(600%); + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: "Inter", sans-serif; } - 10% { - transform: scale(0.2) translateY(5rem); - opacity: 1; + *:focus-visible { + outline: var(--accent-color) solid medium; + outline-offset: 0; + transition: outline-offset 0.3s; } - 40% { - transform: scale(0.2) translateY(0); + .label{ + padding-bottom: 7px !important; } - 80% { - transform: scale(1.1) translateY(0); + :root { + font-size: clamp(1rem, 1.2vmax, 1.2rem); } - 100% { - transform: scale(1) translateY(0); + + html, + body { + height: 100%; } -} - -@keyframes popup { - 0% { - opacity: 0; - transform: scale(0.2) translateY(600%); + + body { + --accent-color: #234ebf; + --accent-color-rgb: 35, 78, 191; + --blue-accent-1: #f5f8ff; + --blue-accent-2: #f2f6ff; + --text-color: 58, 58, 58; + --foreground-color: 255, 255, 255; + --background-color: 243, 245, 250; + --danger-color: #ff6161; + --green: #1cad59; + --yellow: rgb(220, 165, 0); + scrollbar-width: thin; + scrollbar-gutter: stable; + color: rgba(var(--text-color), 1); + background-color: rgba(var(--foreground-color), 1); + transition: background-color 0.3s; + position: relative; + display: flex; + flex-direction: column; } - 10% { - transform: scale(0.2) translateY(5rem); - opacity: 1; + + body[data-theme=dark] { + --accent-color: #a0b6ff; + --accent-color-rgb: 160, 182, 255; + --blue-accent-1: #f5f8ff10; + --blue-accent-2: #f2f6ff10; + --text-color: 220, 220, 220; + --foreground-color: 27, 28, 29; + --background-color: 21, 22, 22; + --danger-color: rgb(255, 106, 106); + --green: #00e676; + --yellow: rgb(255, 213, 5); } - 40% { - transform: scale(0.2) translateY(0); + + p, + strong { + font-size: 0.9rem; + max-width: 65ch; + line-height: 1.7; + color: rgba(var(--text-color), 0.9); } - 80% { - transform: scale(1.1) translateY(0); + + .warning { + line-height: normal; + padding: 1rem; + background-color: khaki; + border-radius: 0.5rem; + font-weight: 500; + color: rgba(0, 0, 0, 0.7); } - 100% { - transform: scale(1) translateY(0); + + a { + text-decoration: none; + color: var(--accent-color); } -} -.cashier-request, -.payment-request { - display: flex; - gap: 1rem; - align-items: center; - padding: 1rem; - border-radius: 0.3rem; - background-color: rgba(var(--foreground-color), 1); -} -.cashier-request:not(:last-of-type), -.payment-request:not(:last-of-type) { - margin-bottom: 0.5rem; -} -.cashier-request__mode, -.payment-request__mode { - text-align: center; - width: 2rem; - font-size: 0.8rem; -} -.cashier-request__time, -.payment-request__time { - font-size: 0.8rem; -} - -.cashier-request { - display: grid; - gap: 0.5rem 1rem; - padding: 1rem 0; - grid-template-columns: auto 1fr auto; - grid-template-areas: "mode details status" "mode . status"; -} -.cashier-request__mode { - grid-area: mode; -} -.cashier-request__details { - grid-area: details; - font-weight: 700; -} -.cashier-request__status, .cashier-request__requestor { - font-size: 0.8rem; -} -.cashier-request__status { - grid-area: status; - grid-column: 3/4; - grid-row: 1/3; -} - -#payment_request_history { - padding-bottom: 3rem; -} -#payment_request_history .payment-request { - margin: 0 -1rem; -} - -.payment-request { - display: grid; - gap: 0.5rem 1rem; - grid-template-columns: 1fr auto; - color: rgba(var(--text-color), 1); -} -.payment-request__requestor { - font-weight: 500; -} -.payment-request__amount { - font-weight: 700; - text-align: right; -} -.payment-request__status { - display: flex; - align-items: center; - font-size: 0.8rem; - text-transform: capitalize; -} -.payment-request__status .icon { - height: 1rem; - width: 1rem; - margin-left: 0.3rem; -} -.payment-request .icon.paid { - fill: var(--green); -} -.payment-request .icon.declined { - fill: var(--danger-color); -} -.payment-request .button { - background-color: transparent; - padding: 0.6rem 0.8rem; - color: var(--accent-color); - background-color: rgba(var(--foreground-color), 1); -} -.payment-request--pending { - padding: 0; -} - -.wallet-request { - display: grid; - gap: 0.5rem 1rem; - padding: 0.5rem 0; - border-radius: 0.5rem; - grid-template-columns: auto 1fr; -} -.wallet-request:not(.rejected, .pending).withdrawn .wallet-request__amount::before { - content: "- "; -} -.wallet-request:not(.rejected, .pending).added .wallet-request__amount { - color: var(--green); -} -.wallet-request:not(.rejected, .pending).added .wallet-request__amount::before { - content: "+ "; -} -.wallet-request .icon.pending { - fill: var(--yellow); -} -.wallet-request .icon.failed { - fill: var(--danger-color); -} -.wallet-request__icon { - display: flex; - align-items: center; - justify-content: center; - grid-area: 1/1/3/2; - width: 2.5rem; - height: 2.5rem; - border-radius: 2rem; - background-color: rgba(var(--text-color), 0.06); -} -.wallet-request__icon .icon { - fill: var(--accent-color); -} -.wallet-request__details { - font-weight: 500; -} -.wallet-request__details, .wallet-request__amount { - color: rgba(var(--text-color), 1); -} -.wallet-request__amount { - font-weight: 700; -} -.wallet-request__time, .wallet-request__status { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); -} -.wallet-request__status { - text-align: right; -} -.wallet-request__status .icon { - margin-left: 0.3rem; -} - -#transaction__amount { - font-size: 2.5rem; - font-weight: 700; -} - -#transaction__remark, -#transaction__note { - line-height: 1.6; - justify-self: flex-start; - background-color: rgba(var(--text-color), 0.06); - border-radius: 0.5rem; - padding: 0.8rem; -} - -#transaction__note .icon { - fill: var(--danger-color); - margin-right: 0.5rem; -} - -#saved_upi_ids_list { - display: grid; - gap: 0.5rem; - width: min(24rem, 100%); -} - -.saved-upi { - display: flex; - justify-content: space-between; - align-items: center; - padding: 0.4rem 0.4rem 0.4rem 1rem; - border-radius: 0.5rem; - background-color: rgba(var(--text-color), 0.03); -} - -#convert_asset_popup .error-icon { - height: 3rem; - width: 3rem; - fill: var(--danger-color); -} - -#conversion_status { - padding-bottom: 1.5rem; -} - -.amount-option { - display: flex; - gap: 0.5rem; - padding: 0.5rem 0.6rem; - border-radius: 0.3rem; - background-color: rgba(var(--text-color), 0.06); - cursor: pointer; - accent-color: var(--accent-color); - font-size: 0.9rem; - font-weight: 500; -} - -@media screen and (max-width: 40rem) { - #home.is-sub-admin { - align-content: flex-start; + + .button, + button { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + position: relative; + display: inline-flex; + border: none; + background-color: transparent; + overflow: hidden; + -webkit-tap-highlight-color: transparent; + align-items: center; + font-size: 0.9rem; + font-weight: 500; + white-space: nowrap; + padding: 0.8rem; + border-radius: 0.5rem; + justify-content: center; + color: inherit; + min-width: -webkit-max-content; + min-width: -moz-max-content; + min-width: max-content; } - #home:not(.is-sub-admin) { - padding-bottom: 3rem; + .button:not(:disabled), + button:not(:disabled) { + cursor: pointer; } - #home > * { - padding: 0 1rem; + + .button { + color: var(--accent-color); + background-color: var(--blue-accent-1); } - #wallet_section { - padding-bottom: 1.5rem; + .button .icon { + fill: var(--accent-color); } - .integrated-action-button .icon:last-of-type { - margin-left: auto; + .button--primary, .button--danger { + color: rgba(var(--background-color), 1) !important; } - #bottom_nav { - position: fixed; - bottom: 0; - left: 0; - right: 0; - z-index: 5; + .button--primary .icon, .button--danger .icon { + fill: rgba(var(--background-color), 1); + } + .button--primary { + width: 100%; + background-color: var(--accent-color); + } + .button--danger { + background-color: var(--danger-color); + } + .button--small { + padding: 0.4rem 0.6rem; + } + + .cta { + text-transform: uppercase; + font-size: 0.8rem; + font-weight: 700; + letter-spacing: 0.05em; + padding: 0.8rem 1rem; + } + + .icon { + width: 1.2rem; + height: 1.2rem; + fill: rgba(var(--text-color), 0.8); + flex-shrink: 0; + } + + .icon-only { + padding: 0.5rem; + border-radius: 0.3rem; + } + + button:disabled { + opacity: 0.5; + cursor: not-allowed; + } + + details summary { + display: flex; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + cursor: pointer; + align-items: center; + justify-content: space-between; + } + + details[open] summary { + margin-bottom: 1rem; + } + details[open] > summary .down-arrow { + transform: rotate(180deg); + } + + sm-popup::part(popup) { background-color: rgba(var(--foreground-color), 1); } - #bottom_nav ul { + sm-popup::part(backdrop) { + -webkit-backdrop-filter: blur(0.5rem); + backdrop-filter: blur(0.5rem); + } + + sm-input, + sm-textarea { + --border-radius: 0.5rem; + --background-color: rgba(var(--foreground-color), 1); + } + sm-input button .icon, + sm-textarea button .icon { + fill: var(--accent-color); + } + + sm-copy { + font-size: 0.9rem; + } + + sm-spinner { + --size: 1rem; + --stroke-width: 0.1rem; + } + + sm-form { + --gap: 1rem; + } + + sm-select { + --padding: 0.8rem; + font-size: 0.9rem; + } + + sm-option { + font-size: 0.9rem; + } + + sm-chips { + --gap: 0.3rem; + } + + sm-chip { + position: relative; + font-size: 0.9rem; + --border-radius: 0.5rem; + --padding: 0.5rem 0.8rem; + --background: rgba(var(--text-color), 0.06); + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + font-weight: 500; + } + sm-chip[selected] { + --background: var(--accent-color); + color: rgba(var(--foreground-color), 1); + } + + ul { + list-style: none; + } + + ol { + counter-reset: item; + } + ol li { + position: relative; + display: flex; + align-items: flex-start; + counter-increment: item; + } + ol li:not(:last-of-type) { + padding-bottom: 1.5rem; + } + ol li:not(:last-of-type)::after { + content: ""; + position: absolute; + width: 0.1rem; + height: calc(100% - 2.2rem); + background: var(--accent-color); + margin-left: 0.7rem; + margin-top: 2rem; + } + ol li::before { + content: counter(item); + display: flex; + align-items: center; + justify-content: center; + text-align: center; + font-size: 0.8rem; + font-weight: 500; + margin-top: 0.15rem; + margin-right: 1rem; + line-height: 1; + width: 1.5rem; + height: 1.5rem; + border-radius: 100%; + flex-shrink: 0; + color: rgba(var(--text-color), 0.8); + background: rgba(var(--text-color), 0.1); + } + + .overflow-ellipsis { + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + .wrap-around { + overflow-wrap: break-word; + word-wrap: break-word; + word-break: break-word; + } + + .full-bleed { + grid-column: 1/-1; + } + + .uppercase { + text-transform: uppercase; + } + + .capitalize { + text-transform: capitalize; + } + + .sticky { + position: -webkit-sticky; + position: sticky; + } + + .top-0 { + top: 0; + } + + .flex { + display: flex; + } + + .flex-wrap { + flex-wrap: wrap; + } + + .flex-1 { + flex: 1; + } + + .grid { + display: grid; + } + + .flow-column { + grid-auto-flow: column; + } + + .gap-0-3 { + gap: 0.3rem; + } + + .gap-0-5 { + gap: 0.5rem; + } + + .gap-1 { + gap: 1rem; + } + + .gap-1-5 { + gap: 1.5rem; + } + + .gap-2 { + gap: 2rem; + } + + .gap-3 { + gap: 3rem; + } + + .text-align-right { + text-align: right; + } + + .align-start { + align-content: flex-start; + } + + .align-center { + align-items: center; + } + + .align-end { + align-items: flex-end; + } + + .text-center { + text-align: center; + } + + .justify-start { + justify-items: start; + } + + .justify-center { + justify-content: center; + } + + .justify-items-center { + justify-items: center; + } + + .justify-right { + margin-left: auto; + } + + .align-self-center { + align-self: center; + } + + .align-self-end { + align-self: end; + } + + .justify-self-center { + justify-self: center; + } + + .justify-self-start { + justify-self: start; + } + + .justify-self-end { + justify-self: end; + } + + .flex-direction-column { + flex-direction: column; + } + + .space-between { + justify-content: space-between; + } + + .margin-right-0-3 { + margin-right: 0.3rem; + } + + .margin-right-0-5 { + margin-right: 0.5rem; + } + + .margin-right-auto { + margin-right: auto; + } + + .margin-left-0-5 { + margin-left: 0.5rem; + } + + .margin-left-auto { + margin-left: auto; + } + + .margin-top-1 { + margin-top: 1rem; + } + + .margin-top-1-5 { + margin-top: 1.5rem; + } + + .margin-bottom-0-5 { + margin-bottom: 0.5rem; + } + + .margin-bottom-1 { + margin-bottom: 1rem; + } + + .margin-bottom-1-5 { + margin-bottom: 1.5rem; + } + + .margin-bottom-2 { + margin-bottom: 2rem; + } + + .padding-0-3 { + padding: 0.3rem; + } + + .padding-0-5 { + padding: 0.5rem; + } + + .padding-1 { + padding: 1rem; + } + + .padding-inline-0-5 { + padding-inline: 0.5rem; + } + + .padding-inline-1 { + padding-inline: 1rem; + } + + .padding-block-0-5 { + padding-block: 0.5rem; + } + + .padding-block-1 { + padding-block: 1rem; + } + + .border-radius-0-3 { + border-radius: 0.3rem; + } + + .border-radius-0-5 { + border-radius: 0.5rem; + } + + .font-0-9 { + font-size: 0.9rem; + } + + .w-100 { + width: 100%; + } + + .h-100 { + height: 100%; + } + + .label { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + font-weight: 500; + margin-bottom: 0.2rem; + } + + .button--primary .ripple, + .button--danger .ripple { + background: radial-gradient(circle, rgba(var(--background-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%); + } + + .ripple { + height: 8rem; + width: 8rem; + position: absolute; + border-radius: 50%; + transform: scale(0); + background: radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%); + pointer-events: none; + } + + .interact { + position: relative; + overflow: hidden; + cursor: pointer; + -webkit-tap-highlight-color: transparent; + } + + .empty-state { + display: grid; + width: 100%; + padding: 1.5rem 0; + } + + .observe-empty-state:empty { + display: none !important; + } + + .observe-empty-state:not(:empty) + .empty-state { + display: none !important; + } + + .bullet-point { + display: flex; + align-items: center; + justify-content: center; + margin: 0 0.8ch; + } + .bullet-point::after { + content: ""; + height: 0.4ch; + width: 0.4ch; + border-radius: 0.5em; + background-color: var(--accent-color); + } + + .icon-button { + padding: 0.6rem; + border-radius: 0.8rem; + background-color: rgba(var(--text-color), 0.1); + height: -webkit-max-content; + height: -moz-max-content; + height: max-content; + } + .icon-button .icon { + fill: var(--accent-color); + } + + .page { + height: 100%; + } + .page__header { + position: -webkit-sticky; + position: sticky; + top: 0; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 1rem; + margin-bottom: 1.5rem; + background-color: rgba(var(--foreground-color), 1); + z-index: 1; + } + + #confirmation_popup, + #prompt_popup { + flex-direction: column; + } + #confirmation_popup h4, + #prompt_popup h4 { + margin-bottom: 0.5rem; + } + #confirmation_popup .flex, + #prompt_popup .flex { + margin-top: 1rem; + } + + #prompt_message { + margin-bottom: 1.5rem; + } + + .popup__header { + position: relative; + display: grid; + gap: 0.5rem; + width: 100%; + padding: 0 1.5rem 0 0.5rem; + align-items: center; + grid-template-columns: auto 1fr; + } + .popup__header > * { + grid-row: 1; + } + .popup__header h3, + .popup__header h4 { + grid-column: 1/-1; + justify-self: center; + align-self: center; + } + .popup__header__close { + grid-column: 1; + } + + .flo-icon { + margin-right: 0.3rem; + height: 1.5rem; + width: 1.5rem; + } + + #secondary_pages { + display: flex; + flex-direction: column; + width: 100%; + } + #secondary_pages header { + padding: 1.5rem; + } + #secondary_pages .inner-page { + height: 100%; + } + + #landing > section { + justify-content: center; + justify-items: center; + align-items: center; + text-align: center; + padding: 8vw 0; + } + #landing h1 { + font-size: clamp(2rem, 5vw, 5rem); + } + + #sign_in, + #sign_up { + justify-content: center; + align-items: center; + } + #sign_in sm-form, + #sign_up sm-form { + margin: 2rem 0; + } + + #sign_in { + display: grid; + align-content: center; + padding: 0; + justify-items: center; + } + #sign_in .illustration { + height: auto; + background-color: #4d77ff; + border-radius: 1rem; + width: min(24rem, 100%); + } + #sign_in section { + width: min(24rem, 100%); + background-color: rgba(var(--foreground-color), 1); + padding: max(1.5rem, 2vw); + border-radius: 0.5rem; + margin-top: -1.6rem; + } + + #sign_up { + justify-items: center; + align-content: center; + } + #sign_up keys-generator { + width: min(26rem, 100%); + margin-top: -4rem; + } + #sign_up .h2 { + margin-bottom: 0.5rem; + } + + #main_header { + display: grid; + gap: 1rem; + padding: 1rem; + align-items: center; + grid-template-columns: minmax(0, 1fr) auto auto; + min-height: 4rem; + flex-shrink: 0; + } + + #user_profile_button { + background-color: var(--blue-accent-1); + border-radius: 2rem; + font-size: 0.8rem; + padding: 0.6rem 0.8rem; + font-weight: 700; + min-width: 0; + } + + #notifications_wrapper { + position: relative; + } + + #notifications_panel { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + background-color: rgba(var(--foreground-color), 1); + padding: 1rem; + } + + .logged-in-user-id { + background-color: rgba(var(--text-color), 0.06); + max-width: -webkit-fit-content; + max-width: -moz-fit-content; + max-width: fit-content; + padding: 0.4rem 0.8rem 0.4rem 0.5rem; + border-radius: 2rem; + font-weight: 500; + } + + #main_card { + position: relative; + display: flex; + flex-direction: column; + height: 100%; + width: 100%; + transition: background-color 0.3s; + } + #main_card.nav-hidden .inner-page { + grid-area: 2/1/3/-1; + } + + .badge { + display: flex; + align-items: center; + justify-content: center; + content: attr(data-notifications); + position: absolute; + top: 0; + right: 0; + font-size: 0.8rem; + padding: 0.1rem 0.3rem; + background: var(--danger-color); + color: rgba(var(--background-color), 1); + aspect-ratio: 1/1; + font-weight: 700; + border-radius: 0.3rem; + } + + .inner-page { + display: flex; + flex-direction: column; + padding: 0 1rem; + flex: 1; + align-content: start; + overflow-y: auto; + } + + .password-field label { + display: flex; + justify-content: center; + } + .password-field label input:checked ~ .visible { + display: none; + } + .password-field label input:not(:checked) ~ .invisible { + display: none; + } + + .multi-state-button { + display: grid; + text-align: center; + align-items: center; + justify-items: center; + } + .multi-state-button > * { + grid-area: 1/1/2/2; + } + .multi-state-button button { + z-index: 1; + } + + .scrolling-wrapper { + overflow-y: auto; + } + + #home { + position: relative; + display: grid; + padding: 0; + gap: 3rem; + overflow-y: visible; + align-content: initial; + transition: filter 0.3s; + } + #home > * { + align-content: flex-start; + } + + #wallet_section { + position: relative; + display: flex; + flex-direction: column; + height: 100%; + gap: 1.5rem; + background-color: rgba(var(--accent-color-rgb), 0.02); + } + #wallet_section sm-chips { + display: flex; + justify-content: center; + } + #wallet_section sm-chip::part(chip) { + width: 8rem; + justify-content: center; + } + #wallet_section > * { + width: 100%; + } + #wallet_section::before { + content: ""; + position: absolute; + top: -10vmax; + left: 0; + width: 100%; + height: 10vmax; + background-color: inherit; + pointer-events: none; + } + + #user, + #cashier { + position: relative; + padding-bottom: 1rem; + align-content: flex-start; + } + + #cashier { + padding: 1rem 0; + } + + #wallet_cards_wrapper { + display: grid; + grid-template-columns: 6rem 1fr; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.5rem; + padding: 0 0.2rem; + } + #wallet_cards_wrapper sm-input { + --background: transparent; + } + #wallet_cards_wrapper sm-select { + margin: 0.2rem 0; + --background: rgba(var(--foreground-color), 1); + } + #wallet_cards_wrapper sm-select[open] { + z-index: 10; + } + + .balance-card { + background-color: rgba(var(--accent-color-rgb), 0.06); + border-radius: 0.5rem; + padding: 0.8rem; + font-size: 0.9rem; + } + .balance-card > * { + font-weight: 500; + } + + #rupee_balance span:first-of-type, + #flo_balance span:first-of-type, + #btc_balance span:first-of-type { + font-size: 1.5rem; + } + #rupee_balance span:nth-of-type(2), + #flo_balance span:nth-of-type(2), + #btc_balance span:nth-of-type(2) { + font-size: 1rem; + } + + .actions-wrapper { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr)); + gap: 1rem 0.5rem; + } + + .wallet-action, + .integrated-action-button { + position: relative; + color: inherit; + font-weight: 500; + font-size: 0.9rem; + } + .wallet-action .icon:first-of-type, + .integrated-action-button .icon:first-of-type { + height: 3rem; + width: 3rem; + padding: 0.95rem; + overflow: visible; + fill: var(--accent-color); + border-radius: 2rem; + background-color: var(--blue-accent-2); + } + .wallet-action .badge, + .integrated-action-button .badge { + left: 0; + right: auto; + } + + .wallet-action { + gap: 0.5rem; + flex-direction: column; + align-items: center; + font-size: 0.8rem; + white-space: initial; + border-radius: 0.5rem; + padding: 0; + min-width: 0; + } + + .integrated-action-button { + padding: 0; + justify-content: flex-start; + } + .integrated-action-button .icon:first-of-type { + margin-right: 1rem; + } + .integrated-action-button span:last-of-type { + font-size: 1rem; + } + + .cashier-status { + font-size: 0.9rem; + padding: 1rem 1.2rem; + border-radius: 1rem; + background-color: rgba(240, 230, 140, 0.8); + color: rgba(0, 0, 0, 0.8); + } + .cashier-status .icon { + fill: rgba(0, 0, 0, 0.8); + } + + #topup_wallet__qr_code { + background-color: rgba(var(--text-color), 0.03); + border-radius: 0.5rem; + height: 10rem; + justify-self: flex-start; + width: 10rem; + } + #topup_wallet__qr_code svg { + width: 100%; + height: 100%; + fill: rgba(var(--text-color), 1); + } + + #cashier_status { + font-size: 0.9rem; + padding: 1rem 1.2rem; + border-radius: 1rem; + background-color: rgba(240, 230, 140, 0.8); + color: rgba(0, 0, 0, 0.8); + } + #cashier_status .icon { + fill: rgba(0, 0, 0, 0.8); + } + + .remove-card-wrapper { + min-height: 2rem; + } + + #selected_fee_tip, + #error_section { + font-weight: 500; + } + + .error { + color: var(--danger-color); + } + .error .icon { + fill: var(--danger-color); + } + + #send_fee_wrapper { + display: grid; + } + #send_fee_wrapper > * { + grid-area: 1/1; + } + + #send_fee_loader { + background-color: rgba(var(--foreground-color), 1); + z-index: 1; + width: 100%; + } + + .receiver-card { + display: grid; + gap: 0.5rem; + padding: 0.5rem 0; + border: none; + } + .receiver-card:not(:last-of-type) { + border-bottom: solid thin rgba(var(--text-color), 0.3); + } + + #contacts { + position: relative; + padding-bottom: 6rem; + } + + #recent_contacts { + gap: 0; + } + + #saved_ids_list { + display: grid; + gap: 0.5rem 1rem; + grid-template-columns: minmax(0, 1fr); + margin-bottom: 1.5rem; + } + + .saved-id { + align-items: center; + grid-template-columns: auto 1fr; + gap: 0 1rem; + padding: 0.5rem 0; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + border-radius: 0.5rem; + } + .saved-id.highlight { + box-shadow: 0 0 0.1rem 0.1rem var(--accent-color) inset; + } + .saved-id .edit-saved { + padding: 0.3rem; + position: relative; + } + .saved-id__initials { + display: flex; + align-items: center; + justify-content: center; + height: 2.5rem; + width: 2.5rem; + font-size: 1.2rem; + text-transform: uppercase; + color: var(--accent-color); + font-weight: 700; + line-height: 1; + background-color: rgba(var(--text-color), 0.03); + border-radius: 2rem; + grid-area: 1/1/3/2; + } + .saved-id__title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-weight: 500; + } + .saved-id__flo-id { + font-size: 0.8rem; + } + .saved-id__copy { + padding: 0.3rem 0.5rem; + border-radius: 0.3rem; + background-color: rgba(var(--text-color), 0.03); + } + + #saved_ids_tip { + background-color: rgba(var(--text-color), 0.03); + border-radius: 2rem; + padding: 0.5rem 0.8rem 0.5rem 0.5rem; + } + + .card { + background-color: rgba(var(--foreground-color), 1); + border-radius: 0.5rem; + padding: 1rem; + } + + #contact { + display: grid; + grid-template-rows: auto 1fr auto; + padding: 0; + height: 100%; + } + #contact > * { + padding: 1rem 1.5rem; + } + #contact > :first-child { + padding-top: 0; + } + #contact > :last-child { + padding: 0.5rem 1.5rem; + border-top: solid thin rgba(var(--text-color), 0.2); + } + #contact > :last-child button { + padding: 0.8rem 2rem; + border-radius: 1rem; + color: var(--accent-color); + background-color: rgba(var(--text-color), 0.03); + } + + #contact__transactions { + position: relative; + display: grid; + gap: 0.5rem; + overflow-y: auto; + flex: 1; + padding: 0 max(1rem, 8vw) 1rem max(1rem, 8vw); + align-content: flex-start; + } + #contact__transactions sm-spinner { + position: absolute; + justify-self: center; + align-self: center; + } + + .transaction-message { + background-color: rgba(var(--text-color), 0.06); + padding: 1rem; + border-radius: 0.5rem; + justify-self: flex-start; + border-radius: 0 1rem 1rem 1rem; + gap: 0.5rem; + } + .transaction-message.received { + background-color: var(--accent-color); + color: rgba(var(--background-color), 1); + } + .transaction-message.received + .transaction-message.received { + border-radius: 1rem; + } + .transaction-message.sent { + margin-left: auto; + justify-self: flex-end; + border-radius: 1rem 1rem 0 1rem; + text-align: right; + } + .transaction-message__amount { + font-size: 1.2rem; + } + .transaction-message__time { + opacity: 0.8; + font-size: 0.8rem; + } + + #history_applied_filters { + padding: 0.2rem 0 0.5rem 0; + } + + .applied-filter { + display: flex; + align-items: center; + padding: 0.5rem 0.6rem 0.5rem 0.8rem; + border-radius: 0.5rem; + border: solid thin rgba(var(--text-color), 0.2); + text-transform: uppercase; + font-size: 0.8rem; + font-weight: 500; + letter-spacing: 0.08em; + } + .applied-filter button { + padding: 0.6rem; + } + .applied-filter .icon { + margin-left: 0.3rem; + } + + fieldset { + border: none; + padding: 0; + margin: 0; + } + fieldset legend { + font-size: 0.8rem; + font-weight: 500; + margin-bottom: 0.5rem; + } + + .category-chip { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0.3rem 0.5rem; + border-radius: 0.3rem; + font-size: 0.8rem; + border: solid thin rgba(var(--text-color), 0.2); + font-weight: 700; + } + .category-chip input { + display: none; + } + .category-chip span { + transition: transform 0.2s; + transform: translateX(-0.8rem); + } + .category-chip .icon { + opacity: 0; + transition: opacity 0.2s, transform 0.2s; + margin-right: 0.3rem; + fill: var(--accent-color); + transform: translateX(0.5rem); + } + .category-chip input:checked ~ .icon { + opacity: 1; + transform: translateX(0); + } + .category-chip input:checked ~ span { + color: var(--accent-color); + transform: translateX(0); + } + + #wallet_history_wrapper { + margin-top: 1.5rem; + padding-bottom: 3rem; + } + + #payments_history { + display: grid; + gap: 2rem; + margin-top: 1.5rem; + padding-bottom: 6rem; + } + + .transaction { + grid-template-columns: auto 1fr auto; + gap: 0.5rem 1rem; + align-items: flex-start; + } + .transaction .button { + min-width: auto; + white-space: normal; + text-align: start; + } + .transaction.sent .icon--tx-type { + fill: var(--danger-color); + } + .transaction.sent .transaction__amount { + color: var(--danger-color); + } + .transaction.sent .transaction__amount::before { + content: "- "; + } + .transaction.received .icon--tx-type { + fill: var(--green); + } + .transaction.received .transaction__amount { + color: var(--green); + } + .transaction.received .transaction__amount::before { + content: "+ "; + } + .transaction__icon { + position: relative; + display: grid; + align-items: center; + justify-content: center; + width: 2.5rem; + height: 2.5rem; + background-color: rgba(var(--text-color), 0.03); + border-radius: 2rem; + } + .transaction__icon > * { + grid-area: 1/1; + } + .transaction__icon .icon--tx-type { + position: absolute; + background-color: inherit; + right: -0.3rem; + bottom: -0.3rem; + border-radius: 1rem; + padding: 0.2rem; + height: 1.5rem; + width: 1.5rem; + border: solid medium rgba(var(--foreground-color), 1); + } + .transaction__receiver { + font-size: 0.9rem; + font-weight: 500; + } + .transaction__time { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + } + .transaction__amount { + font-size: 0.9rem; + font-weight: 500; + white-space: nowrap; + } + + .btc-tx { + display: grid; + grid-template-columns: auto minmax(0, 1fr); + gap: 0.5rem 1rem; + align-items: flex-start; + } + .btc-tx .button { + min-width: auto; + white-space: normal; + text-align: start; + } + .btc-tx.out .icon--tx-type { + fill: var(--danger-color); + } + .btc-tx.out .btc-tx__amount { + color: var(--danger-color); + } + .btc-tx.out .btc-tx__amount::before { + content: "- "; + } + .btc-tx.in .icon--tx-type { + fill: var(--green); + } + .btc-tx.in .btc-tx__amount { + color: var(--green); + } + .btc-tx.in .btc-tx__amount::before { + content: "+ "; + } + .btc-tx.unconfirmed-tx .icon { + fill: var(--yellow); + } + .btc-tx__icon { + position: relative; + display: grid; + align-items: center; + justify-content: center; + width: 2.5rem; + height: 2.5rem; + background-color: rgba(var(--text-color), 0.03); + border-radius: 2rem; + } + .btc-tx__icon > * { + grid-area: 1/1; + } + .btc-tx__icon .icon--tx-type { + position: absolute; + background-color: inherit; + right: -0.3rem; + bottom: -0.3rem; + border-radius: 1rem; + padding: 0.2rem; + height: 1.5rem; + width: 1.5rem; + border: solid medium rgba(var(--foreground-color), 1); + } + .btc-tx__receiver { + font-size: 0.9rem; + font-weight: 500; + } + .btc-tx__time { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + } + .btc-tx__amount { + font-size: 0.9rem; + font-weight: 500; + white-space: nowrap; + } + .btc-tx__id { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + } + .btc-tx .pending-badge { + font-size: 0.8rem; + padding: 0.2rem 0.5rem; + border-radius: 0.5rem; + background-color: var(--yellow); + color: rgba(var(--foreground-color), 1); + font-weight: 500; + align-self: flex-start; + } + + .fab { + position: absolute; + right: 0; + bottom: 0; + margin: 1.5rem; + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); + z-index: 2; + } + + #scroll_to_top { + border-radius: 3rem; + background-color: rgba(var(--foreground-color), 1); + } + + .user-action-result__icon { + justify-self: center; + height: 4rem; + width: 4rem; + border-radius: 5rem; + margin-bottom: 2rem; + -webkit-animation: popup 1s; + animation: popup 1s; + } + .user-action-result__icon.success { + fill: rgba(var(--background-color), 1); + padding: 1rem; + background-color: #0bbe56; + } + .user-action-result__icon.failed { + background-color: rgba(var(--text-color), 0.03); + fill: var(--danger-color); + } + + @-webkit-keyframes popup { + 0% { + opacity: 0; + transform: scale(0.2) translateY(600%); + } + 10% { + transform: scale(0.2) translateY(5rem); + opacity: 1; + } + 40% { + transform: scale(0.2) translateY(0); + } + 80% { + transform: scale(1.1) translateY(0); + } + 100% { + transform: scale(1) translateY(0); + } + } + + @keyframes popup { + 0% { + opacity: 0; + transform: scale(0.2) translateY(600%); + } + 10% { + transform: scale(0.2) translateY(5rem); + opacity: 1; + } + 40% { + transform: scale(0.2) translateY(0); + } + 80% { + transform: scale(1.1) translateY(0); + } + 100% { + transform: scale(1) translateY(0); + } + } + .cashier-request, + .payment-request { + display: flex; + gap: 1rem; + align-items: center; + padding: 1rem; + border-radius: 0.3rem; + background-color: rgba(var(--foreground-color), 1); + } + .cashier-request:not(:last-of-type), + .payment-request:not(:last-of-type) { + margin-bottom: 0.5rem; + } + .cashier-request__mode, + .payment-request__mode { + text-align: center; + width: 2rem; + font-size: 0.8rem; + } + .cashier-request__time, + .payment-request__time { + font-size: 0.8rem; + } + + .cashier-request { + display: grid; + gap: 0.5rem 1rem; + padding: 1rem 0; + grid-template-columns: auto 1fr auto; + grid-template-areas: "mode details status" "mode . status"; + } + .cashier-request__mode { + grid-area: mode; + } + .cashier-request__details { + grid-area: details; + font-weight: 700; + } + .cashier-request__status, .cashier-request__requestor { + font-size: 0.8rem; + } + .cashier-request__status { + grid-area: status; + grid-column: 3/4; + grid-row: 1/3; + } + + #payment_request_history { + padding-bottom: 3rem; + } + #payment_request_history .payment-request { + margin: 0 -1rem; + } + + .payment-request { + display: grid; + gap: 0.5rem 1rem; + grid-template-columns: 1fr auto; + color: rgba(var(--text-color), 1); + } + .payment-request__requestor { + font-weight: 500; + } + .payment-request__amount { + font-weight: 700; + text-align: right; + } + .payment-request__status { + display: flex; + align-items: center; + font-size: 0.8rem; + text-transform: capitalize; + } + .payment-request__status .icon { + height: 1rem; + width: 1rem; + margin-left: 0.3rem; + } + .payment-request .icon.paid { + fill: var(--green); + } + .payment-request .icon.declined { + fill: var(--danger-color); + } + .payment-request .button { + background-color: transparent; + padding: 0.6rem 0.8rem; + color: var(--accent-color); + background-color: rgba(var(--foreground-color), 1); + } + .payment-request--pending { + padding: 0; + } + + .wallet-request { + display: grid; + gap: 0.5rem 1rem; + padding: 0.5rem 0; + border-radius: 0.5rem; + grid-template-columns: auto 1fr; + } + .wallet-request:not(.rejected, .pending).withdrawn .wallet-request__amount::before { + content: "- "; + } + .wallet-request:not(.rejected, .pending).added .wallet-request__amount { + color: var(--green); + } + .wallet-request:not(.rejected, .pending).added .wallet-request__amount::before { + content: "+ "; + } + .wallet-request .icon.pending { + fill: var(--yellow); + } + .wallet-request .icon.failed { + fill: var(--danger-color); + } + .wallet-request__icon { + display: flex; + align-items: center; + justify-content: center; + grid-area: 1/1/3/2; + width: 2.5rem; + height: 2.5rem; + border-radius: 2rem; + background-color: rgba(var(--text-color), 0.06); + } + .wallet-request__icon .icon { + fill: var(--accent-color); + } + .wallet-request__details { + font-weight: 500; + } + .wallet-request__details, .wallet-request__amount { + color: rgba(var(--text-color), 1); + } + .wallet-request__amount { + font-weight: 700; + } + .wallet-request__time, .wallet-request__status { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + } + .wallet-request__status { + text-align: right; + } + .wallet-request__status .icon { + margin-left: 0.3rem; + } + + #transaction__amount { + font-size: 2.5rem; + font-weight: 700; + } + + #transaction__remark, + #transaction__note { + line-height: 1.6; + justify-self: flex-start; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.5rem; + padding: 0.8rem; + } + + #transaction__note .icon { + fill: var(--danger-color); + margin-right: 0.5rem; + } + + #saved_upi_ids_list { + display: grid; + gap: 0.5rem; + width: min(24rem, 100%); + } + + .saved-upi { display: flex; justify-content: space-between; align-items: center; + padding: 0.4rem 0.4rem 0.4rem 1rem; + border-radius: 0.5rem; + background-color: rgba(var(--text-color), 0.03); } - #bottom_nav ul li { - flex: 1; + + #convert_asset_popup .error-icon { + height: 3rem; + width: 3rem; + fill: var(--danger-color); } - .nav-item { + + #conversion_status { + padding-bottom: 1.5rem; + } + + .amount-option { display: flex; - flex-direction: column; - gap: 0.3rem; - align-items: center; - padding: 0.5rem; - font-size: 0.8rem; - flex: 1; - color: inherit; + gap: 0.5rem; + padding: 0.5rem 0.6rem; + border-radius: 0.3rem; + background-color: rgba(var(--text-color), 0.06); + cursor: pointer; + accent-color: var(--accent-color); + font-size: 0.9rem; font-weight: 500; } - .nav-item--active { - color: var(--accent-color); + + @media screen and (max-width: 40rem) { + #home.is-sub-admin { + align-content: flex-start; + } + #home:not(.is-sub-admin) { + padding-bottom: 3rem; + } + #home > * { + padding: 0 1rem; + } + #wallet_section { + padding-bottom: 1.5rem; + } + .integrated-action-button .icon:last-of-type { + margin-left: auto; + } + #bottom_nav { + position: fixed; + bottom: 0; + left: 0; + right: 0; + z-index: 5; + background-color: rgba(var(--foreground-color), 1); + } + #bottom_nav ul { + display: flex; + justify-content: space-between; + align-items: center; + } + #bottom_nav ul li { + flex: 1; + } + .nav-item { + display: flex; + flex-direction: column; + gap: 0.3rem; + align-items: center; + padding: 0.5rem; + font-size: 0.8rem; + flex: 1; + color: inherit; + font-weight: 500; + } + .nav-item--active { + color: var(--accent-color); + } + .nav-item--active .icon { + fill: var(--accent-color); + } + .integrated-action-button .icon:last-of-type { + margin-left: auto; + } + .hide-on-mobile { + display: none; + } } - .nav-item--active .icon { - fill: var(--accent-color); + @media screen and (min-width: 40rem) { + sm-popup { + --width: 24rem; + } + .popup__header { + padding: 1.5rem 1.5rem 0 0.75rem; + } + body { + align-items: center; + justify-content: center; + } + .inner-page { + padding: 0 14vw; + } + #main_header { + padding: 1.5rem 3vw; + grid-template-columns: 1fr auto auto auto; + } + .card { + padding: 1.5rem; + } + #home { + grid-template-columns: 26rem 1fr; + gap: 4vw; + padding-right: 3vw; + } + #profile_popup { + --width: 32rem; + } + #notifications_panel { + position: absolute; + top: 100%; + left: auto; + bottom: auto; + right: 0; + border-radius: 0.5rem; + z-index: 10; + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1); + border: solid 1px rgba(var(--text-color), 0.1); + background-color: rgba(var(--foreground-color), 1); + width: max(24rem, 100%); + } + #wallet_section { + padding: 0 3vw; + grid-row: 1/3; + } + #contact > * { + padding: 1rem 12vw; + } + #contact > :last-child { + padding: 0.5rem 12vw; + } + #saved_ids_list { + gap: 1.5rem; + grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); + } + .hide-on-desktop { + display: none; + } } - .integrated-action-button .icon:last-of-type { - margin-left: auto; + @media screen and (min-width: 68rem) { + #home:not(.is-sub-admin) { + grid-template-columns: 26rem 1fr 1fr; + } } - .hide-on-mobile { - display: none; + @media (any-hover: hover) { + ::-webkit-scrollbar { + width: 0.5rem; + height: 0.5rem; + } + ::-webkit-scrollbar-thumb { + background: rgba(var(--text-color), 0.3); + border-radius: 1rem; + } + ::-webkit-scrollbar-thumb:hover { + background: rgba(var(--text-color), 0.5); + } + .button--primary:not([disabled]), + .button--danger:not([disabled]) { + transition: filter 0.3s; + } + .button--primary:not([disabled]):hover, + .button--danger:not([disabled]):hover { + filter: brightness(1.3); + } + .interact:not([disabled]), + button:not([disabled], .button--primary, .button--danger), + .button:not([disabled], .button--primary, .button--danger) { + transition: background-color 0.3s; + } + .interact:not([disabled]):hover, + button:not([disabled], .button--primary, .button--danger):hover, + .button:not([disabled], .button--primary, .button--danger):hover { + background-color: rgba(var(--text-color), 0.06); + } } -} -@media screen and (min-width: 40rem) { - sm-popup { - --width: 24rem; + @supports (overflow: overlay) { + body { + overflow: overlay; + } } - .popup__header { - padding: 1.5rem 1.5rem 0 0.75rem; + .hidden { + display: none !important; } - body { + + #adblocker_warning { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(var(--foreground-color), 1); + z-index: 50; + display: flex; + flex-direction: column; align-items: center; justify-content: center; - } - .inner-page { - padding: 0 14vw; - } - #main_header { - padding: 1.5rem 3vw; - grid-template-columns: 1fr auto auto auto; - } - .card { + text-align: center; + gap: 1rem; padding: 1.5rem; } - #home { - grid-template-columns: 26rem 1fr; - gap: 4vw; - padding-right: 3vw; - } - #profile_popup { - --width: 32rem; - } - #notifications_panel { - position: absolute; - top: 100%; - left: auto; - bottom: auto; - right: 0; - border-radius: 0.5rem; - z-index: 10; - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1); - border: solid 1px rgba(var(--text-color), 0.1); - background-color: rgba(var(--foreground-color), 1); - width: max(24rem, 100%); - } - #wallet_section { - padding: 0 3vw; - grid-row: 1/3; - } - #contact > * { - padding: 1rem 12vw; - } - #contact > :last-child { - padding: 0.5rem 12vw; - } - #saved_ids_list { - gap: 1.5rem; - grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); - } - .hide-on-desktop { + #adblocker_warning:empty { display: none; } -} -@media screen and (min-width: 68rem) { - #home:not(.is-sub-admin) { - grid-template-columns: 26rem 1fr 1fr; - } -} -@media (any-hover: hover) { - ::-webkit-scrollbar { - width: 0.5rem; - height: 0.5rem; - } - ::-webkit-scrollbar-thumb { - background: rgba(var(--text-color), 0.3); - border-radius: 1rem; - } - ::-webkit-scrollbar-thumb:hover { - background: rgba(var(--text-color), 0.5); - } - .button--primary:not([disabled]), -.button--danger:not([disabled]) { - transition: filter 0.3s; - } - .button--primary:not([disabled]):hover, -.button--danger:not([disabled]):hover { - filter: brightness(1.3); - } - .interact:not([disabled]), -button:not([disabled], .button--primary, .button--danger), -.button:not([disabled], .button--primary, .button--danger) { - transition: background-color 0.3s; - } - .interact:not([disabled]):hover, -button:not([disabled], .button--primary, .button--danger):hover, -.button:not([disabled], .button--primary, .button--danger):hover { - background-color: rgba(var(--text-color), 0.06); - } -} -@supports (overflow: overlay) { - body { - overflow: overlay; - } -} -.hidden { - display: none !important; -} - -#adblocker_warning { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(var(--foreground-color), 1); - z-index: 50; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - text-align: center; - gap: 1rem; - padding: 1.5rem; -} -#adblocker_warning:empty { - display: none; -} -#adblocker_warning .icon { - height: 4rem; - width: 4rem; - fill: #ffc107; -} \ No newline at end of file + #adblocker_warning .icon { + height: 4rem; + width: 4rem; + fill: #ffc107; + } \ No newline at end of file diff --git a/css/main.min.css b/css/main.min.css index e63597c..91770f2 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1,2 @@ -*{padding:0;margin:0;box-sizing:border-box;font-family:"Inter",sans-serif}*:focus-visible{outline:var(--accent-color) solid medium;outline-offset:0;transition:outline-offset .3s}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #234ebf;--accent-color-rgb: 35, 78, 191;--blue-accent-1: #f5f8ff;--blue-accent-2: #f2f6ff;--text-color: 58, 58, 58;--foreground-color: 255, 255, 255;--background-color: 243, 245, 250;--danger-color: #ff6161;--green: #1cad59;--yellow: rgb(220, 165, 0);scrollbar-width:thin;scrollbar-gutter:stable;color:rgba(var(--text-color), 1);background-color:rgba(var(--foreground-color), 1);transition:background-color .3s;position:relative;display:flex;flex-direction:column}body[data-theme=dark]{--accent-color: #a0b6ff;--accent-color-rgb: 160, 182, 255;--blue-accent-1: #f5f8ff10;--blue-accent-2: #f2f6ff10;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}.warning{line-height:normal;padding:1rem;background-color:khaki;border-radius:.5rem;font-weight:500;color:rgba(0,0,0,.7)}a{text-decoration:none;color:var(--accent-color)}.button,button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.5rem;justify-content:center;color:inherit;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content}.button:not(:disabled),button:not(:disabled){cursor:pointer}.button{color:var(--accent-color);background-color:var(--blue-accent-1)}.button .icon{fill:var(--accent-color)}.button--primary,.button--danger{color:rgba(var(--background-color), 1) !important}.button--primary .icon,.button--danger .icon{fill:rgba(var(--background-color), 1)}.button--primary{width:100%;background-color:var(--accent-color)}.button--danger{background-color:var(--danger-color)}.button--small{padding:.4rem .6rem}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:.8rem 1rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem}button:disabled{opacity:.5;cursor:not-allowed}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between}details[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}sm-popup::part(popup){background-color:rgba(var(--foreground-color), 1)}sm-popup::part(backdrop){-webkit-backdrop-filter:blur(0.5rem);backdrop-filter:blur(0.5rem)}sm-input,sm-textarea{--border-radius: 0.5rem;--background-color: rgba(var(--foreground-color), 1)}sm-input button .icon,sm-textarea button .icon{fill:var(--accent-color)}sm-copy{font-size:.9rem}sm-spinner{--size: 1rem;--stroke-width: 0.1rem}sm-form{--gap: 1rem}sm-select{--padding: 0.8rem;font-size:.9rem}sm-option{font-size:.9rem}sm-chips{--gap: 0.3rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.8rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-weight:500}sm-chip[selected]{--background: var(--accent-color);color:rgba(var(--foreground-color), 1)}ul{list-style:none}ol{counter-reset:item}ol li{position:relative;display:flex;align-items:flex-start;counter-increment:item}ol li:not(:last-of-type){padding-bottom:1.5rem}ol li:not(:last-of-type)::after{content:"";position:absolute;width:.1rem;height:calc(100% - 2.2rem);background:var(--accent-color);margin-left:.7rem;margin-top:2rem}ol li::before{content:counter(item);display:flex;align-items:center;justify-content:center;text-align:center;font-size:.8rem;font-weight:500;margin-top:.15rem;margin-right:1rem;line-height:1;width:1.5rem;height:1.5rem;border-radius:100%;flex-shrink:0;color:rgba(var(--text-color), 0.8);background:rgba(var(--text-color), 0.1)}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word}.full-bleed{grid-column:1/-1}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-content:flex-start}.align-center{align-items:center}.align-end{align-items:flex-end}.text-center{text-align:center}.justify-start{justify-items:start}.justify-center{justify-content:center}.justify-items-center{justify-items:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.align-self-end{align-self:end}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.flex-direction-column{flex-direction:column}.space-between{justify-content:space-between}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-right-auto{margin-right:auto}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-top-1{margin-top:1rem}.margin-top-1-5{margin-top:1.5rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-bottom-1-5{margin-bottom:1.5rem}.margin-bottom-2{margin-bottom:2rem}.padding-0-3{padding:.3rem}.padding-0-5{padding:.5rem}.padding-1{padding:1rem}.padding-inline-0-5{padding-inline:.5rem}.padding-inline-1{padding-inline:1rem}.padding-block-0-5{padding-block:.5rem}.padding-block-1{padding-block:1rem}.border-radius-0-3{border-radius:.3rem}.border-radius-0-5{border-radius:.5rem}.font-0-9{font-size:.9rem}.w-100{width:100%}.h-100{height:100%}.label{font-size:.8rem;color:rgba(var(--text-color), 0.8);font-weight:500;margin-bottom:.2rem}.button--primary .ripple,.button--danger .ripple{background:radial-gradient(circle, rgba(var(--background-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%)}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.empty-state{display:grid;width:100%;padding:1.5rem 0}.observe-empty-state:empty{display:none !important}.observe-empty-state:not(:empty)+.empty-state{display:none !important}.bullet-point{display:flex;align-items:center;justify-content:center;margin:0 .8ch}.bullet-point::after{content:"";height:.4ch;width:.4ch;border-radius:.5em;background-color:var(--accent-color)}.icon-button{padding:.6rem;border-radius:.8rem;background-color:rgba(var(--text-color), 0.1);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}.page{height:100%}.page__header{position:-webkit-sticky;position:sticky;top:0;display:flex;flex-direction:column;align-items:flex-start;gap:1rem;margin-bottom:1.5rem;background-color:rgba(var(--foreground-color), 1);z-index:1}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{margin-bottom:.5rem}#confirmation_popup .flex,#prompt_popup .flex{margin-top:1rem}#prompt_message{margin-bottom:1.5rem}.popup__header{position:relative;display:grid;gap:.5rem;width:100%;padding:0 1.5rem 0 .5rem;align-items:center;grid-template-columns:auto 1fr}.popup__header>*{grid-row:1}.popup__header h3,.popup__header h4{grid-column:1/-1;justify-self:center;align-self:center}.popup__header__close{grid-column:1}.flo-icon{margin-right:.3rem;height:1.5rem;width:1.5rem}#secondary_pages{display:flex;flex-direction:column;width:100%}#secondary_pages header{padding:1.5rem}#secondary_pages .inner-page{height:100%}#landing>section{justify-content:center;justify-items:center;align-items:center;text-align:center;padding:8vw 0}#landing h1{font-size:clamp(2rem,5vw,5rem)}#sign_in,#sign_up{justify-content:center;align-items:center}#sign_in sm-form,#sign_up sm-form{margin:2rem 0}#sign_in{display:grid;align-content:center;padding:0;justify-items:center}#sign_in .illustration{height:auto;background-color:#4d77ff;border-radius:1rem;width:min(24rem,100%)}#sign_in section{width:min(24rem,100%);background-color:rgba(var(--foreground-color), 1);padding:max(1.5rem,2vw);border-radius:.5rem;margin-top:-1.6rem}#sign_up{justify-items:center;align-content:center}#sign_up keys-generator{width:min(26rem,100%);margin-top:-4rem}#sign_up .h2{margin-bottom:.5rem}#main_header{display:grid;gap:1rem;padding:1rem;align-items:center;grid-template-columns:minmax(0, 1fr) auto auto;min-height:4rem;flex-shrink:0}#user_profile_button{background-color:var(--blue-accent-1);border-radius:2rem;font-size:.8rem;padding:.6rem .8rem;font-weight:700;min-width:0}#notifications_wrapper{position:relative}#notifications_panel{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10;background-color:rgba(var(--foreground-color), 1);padding:1rem}.logged-in-user-id{background-color:rgba(var(--text-color), 0.06);max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;padding:.4rem .8rem .4rem .5rem;border-radius:2rem;font-weight:500}#main_card{position:relative;display:flex;flex-direction:column;height:100%;width:100%;transition:background-color .3s}#main_card.nav-hidden .inner-page{grid-area:2/1/3/-1}.badge{display:flex;align-items:center;justify-content:center;content:attr(data-notifications);position:absolute;top:0;right:0;font-size:.8rem;padding:.1rem .3rem;background:var(--danger-color);color:rgba(var(--background-color), 1);aspect-ratio:1/1;font-weight:700;border-radius:.3rem}.inner-page{display:flex;flex-direction:column;padding:0 1rem;flex:1;align-content:start;overflow-y:auto}.password-field label{display:flex;justify-content:center}.password-field label input:checked~.visible{display:none}.password-field label input:not(:checked)~.invisible{display:none}.multi-state-button{display:grid;text-align:center;align-items:center;justify-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1}.scrolling-wrapper{overflow-y:auto}#home{position:relative;display:grid;padding:0;gap:3rem;overflow-y:visible;align-content:initial;transition:filter .3s}#home>*{align-content:flex-start}#wallet_section{position:relative;display:flex;flex-direction:column;height:100%;gap:1.5rem;background-color:rgba(var(--accent-color-rgb), 0.02)}#wallet_section sm-chips{display:flex;justify-content:center}#wallet_section sm-chip::part(chip){width:8rem;justify-content:center}#wallet_section>*{width:100%}#wallet_section::before{content:"";position:absolute;top:-10vmax;left:0;width:100%;height:10vmax;background-color:inherit;pointer-events:none}#user,#cashier{position:relative;padding-bottom:1rem;align-content:flex-start}#cashier{padding:1rem 0}#wallet_cards_wrapper{display:grid;grid-template-columns:6rem 1fr;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;padding:0 .2rem}#wallet_cards_wrapper sm-input{--background: transparent}#wallet_cards_wrapper sm-select{margin:.2rem 0;--background: rgba(var(--foreground-color), 1)}#wallet_cards_wrapper sm-select[open]{z-index:10}.balance-card{background-color:rgba(var(--accent-color-rgb), 0.06);border-radius:.5rem;padding:.8rem;font-size:.9rem}.balance-card>*{font-weight:500}#rupee_balance span:first-of-type,#flo_balance span:first-of-type,#btc_balance span:first-of-type{font-size:1.5rem}#rupee_balance span:nth-of-type(2),#flo_balance span:nth-of-type(2),#btc_balance span:nth-of-type(2){font-size:1rem}.actions-wrapper{display:grid;grid-template-columns:repeat(auto-fill, minmax(4rem, 1fr));gap:1rem .5rem}.wallet-action,.integrated-action-button{position:relative;color:inherit;font-weight:500;font-size:.9rem}.wallet-action .icon:first-of-type,.integrated-action-button .icon:first-of-type{height:3rem;width:3rem;padding:.95rem;overflow:visible;fill:var(--accent-color);border-radius:2rem;background-color:var(--blue-accent-2)}.wallet-action .badge,.integrated-action-button .badge{left:0;right:auto}.wallet-action{gap:.5rem;flex-direction:column;align-items:center;font-size:.8rem;white-space:initial;border-radius:.5rem;padding:0;min-width:0}.integrated-action-button{padding:0;justify-content:flex-start}.integrated-action-button .icon:first-of-type{margin-right:1rem}.integrated-action-button span:last-of-type{font-size:1rem}.cashier-status{font-size:.9rem;padding:1rem 1.2rem;border-radius:1rem;background-color:rgba(240,230,140,.8);color:rgba(0,0,0,.8)}.cashier-status .icon{fill:rgba(0,0,0,.8)}#topup_wallet__qr_code{background-color:rgba(var(--text-color), 0.03);border-radius:.5rem;height:10rem;justify-self:flex-start;width:10rem}#topup_wallet__qr_code svg{width:100%;height:100%;fill:rgba(var(--text-color), 1)}#cashier_status{font-size:.9rem;padding:1rem 1.2rem;border-radius:1rem;background-color:rgba(240,230,140,.8);color:rgba(0,0,0,.8)}#cashier_status .icon{fill:rgba(0,0,0,.8)}.remove-card-wrapper{min-height:2rem}#selected_fee_tip,#error_section{font-weight:500}.error{color:var(--danger-color)}.error .icon{fill:var(--danger-color)}#send_fee_wrapper{display:grid}#send_fee_wrapper>*{grid-area:1/1}#send_fee_loader{background-color:rgba(var(--foreground-color), 1);z-index:1;width:100%}.receiver-card{display:grid;gap:.5rem;padding:.5rem 0;border:none}.receiver-card:not(:last-of-type){border-bottom:solid thin rgba(var(--text-color), 0.3)}#contacts{position:relative;padding-bottom:6rem}#recent_contacts{gap:0}#saved_ids_list{display:grid;gap:.5rem 1rem;grid-template-columns:minmax(0, 1fr);margin-bottom:1.5rem}.saved-id{align-items:center;grid-template-columns:auto 1fr;gap:0 1rem;padding:.5rem 0;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:.5rem}.saved-id.highlight{box-shadow:0 0 .1rem .1rem var(--accent-color) inset}.saved-id .edit-saved{padding:.3rem;position:relative}.saved-id__initials{display:flex;align-items:center;justify-content:center;height:2.5rem;width:2.5rem;font-size:1.2rem;text-transform:uppercase;color:var(--accent-color);font-weight:700;line-height:1;background-color:rgba(var(--text-color), 0.03);border-radius:2rem;grid-area:1/1/3/2}.saved-id__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.saved-id__flo-id{font-size:.8rem}.saved-id__copy{padding:.3rem .5rem;border-radius:.3rem;background-color:rgba(var(--text-color), 0.03)}#saved_ids_tip{background-color:rgba(var(--text-color), 0.03);border-radius:2rem;padding:.5rem .8rem .5rem .5rem}.card{background-color:rgba(var(--foreground-color), 1);border-radius:.5rem;padding:1rem}#contact{display:grid;grid-template-rows:auto 1fr auto;padding:0;height:100%}#contact>*{padding:1rem 1.5rem}#contact>:first-child{padding-top:0}#contact>:last-child{padding:.5rem 1.5rem;border-top:solid thin rgba(var(--text-color), 0.2)}#contact>:last-child button{padding:.8rem 2rem;border-radius:1rem;color:var(--accent-color);background-color:rgba(var(--text-color), 0.03)}#contact__transactions{position:relative;display:grid;gap:.5rem;overflow-y:auto;flex:1;padding:0 max(1rem,8vw) 1rem max(1rem,8vw);align-content:flex-start}#contact__transactions sm-spinner{position:absolute;justify-self:center;align-self:center}.transaction-message{background-color:rgba(var(--text-color), 0.06);padding:1rem;border-radius:.5rem;justify-self:flex-start;border-radius:0 1rem 1rem 1rem;gap:.5rem}.transaction-message.received{background-color:var(--accent-color);color:rgba(var(--background-color), 1)}.transaction-message.received+.transaction-message.received{border-radius:1rem}.transaction-message.sent{margin-left:auto;justify-self:flex-end;border-radius:1rem 1rem 0 1rem;text-align:right}.transaction-message__amount{font-size:1.2rem}.transaction-message__time{opacity:.8;font-size:.8rem}#history_applied_filters{padding:.2rem 0 .5rem 0}.applied-filter{display:flex;align-items:center;padding:.5rem .6rem .5rem .8rem;border-radius:.5rem;border:solid thin rgba(var(--text-color), 0.2);text-transform:uppercase;font-size:.8rem;font-weight:500;letter-spacing:.08em}.applied-filter button{padding:.6rem}.applied-filter .icon{margin-left:.3rem}fieldset{border:none;padding:0;margin:0}fieldset legend{font-size:.8rem;font-weight:500;margin-bottom:.5rem}.category-chip{display:inline-flex;align-items:center;justify-content:center;padding:.3rem .5rem;border-radius:.3rem;font-size:.8rem;border:solid thin rgba(var(--text-color), 0.2);font-weight:700}.category-chip input{display:none}.category-chip span{transition:transform .2s;transform:translateX(-0.8rem)}.category-chip .icon{opacity:0;transition:opacity .2s,transform .2s;margin-right:.3rem;fill:var(--accent-color);transform:translateX(0.5rem)}.category-chip input:checked~.icon{opacity:1;transform:translateX(0)}.category-chip input:checked~span{color:var(--accent-color);transform:translateX(0)}#wallet_history_wrapper{margin-top:1.5rem;padding-bottom:3rem}#payments_history{display:grid;gap:2rem;margin-top:1.5rem;padding-bottom:6rem}.transaction{grid-template-columns:auto 1fr auto;gap:.5rem 1rem;align-items:flex-start}.transaction .button{min-width:auto;white-space:normal;text-align:start}.transaction.sent .icon--tx-type{fill:var(--danger-color)}.transaction.sent .transaction__amount{color:var(--danger-color)}.transaction.sent .transaction__amount::before{content:"- "}.transaction.received .icon--tx-type{fill:var(--green)}.transaction.received .transaction__amount{color:var(--green)}.transaction.received .transaction__amount::before{content:"+ "}.transaction__icon{position:relative;display:grid;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;background-color:rgba(var(--text-color), 0.03);border-radius:2rem}.transaction__icon>*{grid-area:1/1}.transaction__icon .icon--tx-type{position:absolute;background-color:inherit;right:-0.3rem;bottom:-0.3rem;border-radius:1rem;padding:.2rem;height:1.5rem;width:1.5rem;border:solid medium rgba(var(--foreground-color), 1)}.transaction__receiver{font-size:.9rem;font-weight:500}.transaction__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.transaction__amount{font-size:.9rem;font-weight:500;white-space:nowrap}.btc-tx{display:grid;grid-template-columns:auto minmax(0, 1fr);gap:.5rem 1rem;align-items:flex-start}.btc-tx .button{min-width:auto;white-space:normal;text-align:start}.btc-tx.out .icon--tx-type{fill:var(--danger-color)}.btc-tx.out .btc-tx__amount{color:var(--danger-color)}.btc-tx.out .btc-tx__amount::before{content:"- "}.btc-tx.in .icon--tx-type{fill:var(--green)}.btc-tx.in .btc-tx__amount{color:var(--green)}.btc-tx.in .btc-tx__amount::before{content:"+ "}.btc-tx.unconfirmed-tx .icon{fill:var(--yellow)}.btc-tx__icon{position:relative;display:grid;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;background-color:rgba(var(--text-color), 0.03);border-radius:2rem}.btc-tx__icon>*{grid-area:1/1}.btc-tx__icon .icon--tx-type{position:absolute;background-color:inherit;right:-0.3rem;bottom:-0.3rem;border-radius:1rem;padding:.2rem;height:1.5rem;width:1.5rem;border:solid medium rgba(var(--foreground-color), 1)}.btc-tx__receiver{font-size:.9rem;font-weight:500}.btc-tx__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.btc-tx__amount{font-size:.9rem;font-weight:500;white-space:nowrap}.btc-tx__id{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.btc-tx .pending-badge{font-size:.8rem;padding:.2rem .5rem;border-radius:.5rem;background-color:var(--yellow);color:rgba(var(--foreground-color), 1);font-weight:500;align-self:flex-start}.fab{position:absolute;right:0;bottom:0;margin:1.5rem;box-shadow:0 .5rem 1rem rgba(0,0,0,.2);z-index:2}#scroll_to_top{border-radius:3rem;background-color:rgba(var(--foreground-color), 1)}.user-action-result__icon{justify-self:center;height:4rem;width:4rem;border-radius:5rem;margin-bottom:2rem;-webkit-animation:popup 1s;animation:popup 1s}.user-action-result__icon.success{fill:rgba(var(--background-color), 1);padding:1rem;background-color:#0bbe56}.user-action-result__icon.failed{background-color:rgba(var(--text-color), 0.03);fill:var(--danger-color)}@-webkit-keyframes popup{0%{opacity:0;transform:scale(0.2) translateY(600%)}10%{transform:scale(0.2) translateY(5rem);opacity:1}40%{transform:scale(0.2) translateY(0)}80%{transform:scale(1.1) translateY(0)}100%{transform:scale(1) translateY(0)}}@keyframes popup{0%{opacity:0;transform:scale(0.2) translateY(600%)}10%{transform:scale(0.2) translateY(5rem);opacity:1}40%{transform:scale(0.2) translateY(0)}80%{transform:scale(1.1) translateY(0)}100%{transform:scale(1) translateY(0)}}.cashier-request,.payment-request{display:flex;gap:1rem;align-items:center;padding:1rem;border-radius:.3rem;background-color:rgba(var(--foreground-color), 1)}.cashier-request:not(:last-of-type),.payment-request:not(:last-of-type){margin-bottom:.5rem}.cashier-request__mode,.payment-request__mode{text-align:center;width:2rem;font-size:.8rem}.cashier-request__time,.payment-request__time{font-size:.8rem}.cashier-request{display:grid;gap:.5rem 1rem;padding:1rem 0;grid-template-columns:auto 1fr auto;grid-template-areas:"mode details status" "mode . status"}.cashier-request__mode{grid-area:mode}.cashier-request__details{grid-area:details;font-weight:700}.cashier-request__status,.cashier-request__requestor{font-size:.8rem}.cashier-request__status{grid-area:status;grid-column:3/4;grid-row:1/3}#payment_request_history{padding-bottom:3rem}#payment_request_history .payment-request{margin:0 -1rem}.payment-request{display:grid;gap:.5rem 1rem;grid-template-columns:1fr auto;color:rgba(var(--text-color), 1)}.payment-request__requestor{font-weight:500}.payment-request__amount{font-weight:700;text-align:right}.payment-request__status{display:flex;align-items:center;font-size:.8rem;text-transform:capitalize}.payment-request__status .icon{height:1rem;width:1rem;margin-left:.3rem}.payment-request .icon.paid{fill:var(--green)}.payment-request .icon.declined{fill:var(--danger-color)}.payment-request .button{background-color:rgba(0,0,0,0);padding:.6rem .8rem;color:var(--accent-color);background-color:rgba(var(--foreground-color), 1)}.payment-request--pending{padding:0}.wallet-request{display:grid;gap:.5rem 1rem;padding:.5rem 0;border-radius:.5rem;grid-template-columns:auto 1fr}.wallet-request:not(.rejected,.pending).withdrawn .wallet-request__amount::before{content:"- "}.wallet-request:not(.rejected,.pending).added .wallet-request__amount{color:var(--green)}.wallet-request:not(.rejected,.pending).added .wallet-request__amount::before{content:"+ "}.wallet-request .icon.pending{fill:var(--yellow)}.wallet-request .icon.failed{fill:var(--danger-color)}.wallet-request__icon{display:flex;align-items:center;justify-content:center;grid-area:1/1/3/2;width:2.5rem;height:2.5rem;border-radius:2rem;background-color:rgba(var(--text-color), 0.06)}.wallet-request__icon .icon{fill:var(--accent-color)}.wallet-request__details{font-weight:500}.wallet-request__details,.wallet-request__amount{color:rgba(var(--text-color), 1)}.wallet-request__amount{font-weight:700}.wallet-request__time,.wallet-request__status{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.wallet-request__status{text-align:right}.wallet-request__status .icon{margin-left:.3rem}#transaction__amount{font-size:2.5rem;font-weight:700}#transaction__remark,#transaction__note{line-height:1.6;justify-self:flex-start;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;padding:.8rem}#transaction__note .icon{fill:var(--danger-color);margin-right:.5rem}#saved_upi_ids_list{display:grid;gap:.5rem;width:min(24rem,100%)}.saved-upi{display:flex;justify-content:space-between;align-items:center;padding:.4rem .4rem .4rem 1rem;border-radius:.5rem;background-color:rgba(var(--text-color), 0.03)}#convert_asset_popup .error-icon{height:3rem;width:3rem;fill:var(--danger-color)}#conversion_status{padding-bottom:1.5rem}.amount-option{display:flex;gap:.5rem;padding:.5rem .6rem;border-radius:.3rem;background-color:rgba(var(--text-color), 0.06);cursor:pointer;accent-color:var(--accent-color);font-size:.9rem;font-weight:500}@media screen and (max-width: 40rem){#home.is-sub-admin{align-content:flex-start}#home:not(.is-sub-admin){padding-bottom:3rem}#home>*{padding:0 1rem}#wallet_section{padding-bottom:1.5rem}.integrated-action-button .icon:last-of-type{margin-left:auto}#bottom_nav{position:fixed;bottom:0;left:0;right:0;z-index:5;background-color:rgba(var(--foreground-color), 1)}#bottom_nav ul{display:flex;justify-content:space-between;align-items:center}#bottom_nav ul li{flex:1}.nav-item{display:flex;flex-direction:column;gap:.3rem;align-items:center;padding:.5rem;font-size:.8rem;flex:1;color:inherit;font-weight:500}.nav-item--active{color:var(--accent-color)}.nav-item--active .icon{fill:var(--accent-color)}.integrated-action-button .icon:last-of-type{margin-left:auto}.hide-on-mobile{display:none}}@media screen and (min-width: 40rem){sm-popup{--width: 24rem}.popup__header{padding:1.5rem 1.5rem 0 .75rem}body{align-items:center;justify-content:center}.inner-page{padding:0 14vw}#main_header{padding:1.5rem 3vw;grid-template-columns:1fr auto auto auto}.card{padding:1.5rem}#home{grid-template-columns:26rem 1fr;gap:4vw;padding-right:3vw}#profile_popup{--width: 32rem}#notifications_panel{position:absolute;top:100%;left:auto;bottom:auto;right:0;border-radius:.5rem;z-index:10;box-shadow:0 .5rem 1rem rgba(0,0,0,.1);border:solid 1px rgba(var(--text-color), 0.1);background-color:rgba(var(--foreground-color), 1);width:max(24rem,100%)}#wallet_section{padding:0 3vw;grid-row:1/3}#contact>*{padding:1rem 12vw}#contact>:last-child{padding:.5rem 12vw}#saved_ids_list{gap:1.5rem;grid-template-columns:repeat(auto-fill, minmax(16rem, 1fr))}.hide-on-desktop{display:none}}@media screen and (min-width: 68rem){#home:not(.is-sub-admin){grid-template-columns:26rem 1fr 1fr}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.button--primary:not([disabled]),.button--danger:not([disabled]){transition:filter .3s}.button--primary:not([disabled]):hover,.button--danger:not([disabled]):hover{filter:brightness(1.3)}.interact:not([disabled]),button:not([disabled],.button--primary,.button--danger),.button:not([disabled],.button--primary,.button--danger){transition:background-color .3s}.interact:not([disabled]):hover,button:not([disabled],.button--primary,.button--danger):hover,.button:not([disabled],.button--primary,.button--danger):hover{background-color:rgba(var(--text-color), 0.06)}}@supports(overflow: overlay){body{overflow:overlay}}.hidden{display:none !important}#adblocker_warning{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(var(--foreground-color), 1);z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:1rem;padding:1.5rem}#adblocker_warning:empty{display:none}#adblocker_warning .icon{height:4rem;width:4rem;fill:#ffc107} \ No newline at end of file + +*{padding:0;margin:0;box-sizing:border-box;font-family:"Inter",sans-serif}*:focus-visible{outline:var(--accent-color) solid medium;outline-offset:0;transition:outline-offset .3s}:root{font-size:clamp(1rem,1.2vmax,1.2rem)}html,body{height:100%}body{--accent-color: #234ebf;--accent-color-rgb: 35, 78, 191;--blue-accent-1: #f5f8ff;--blue-accent-2: #f2f6ff;--text-color: 58, 58, 58;--foreground-color: 255, 255, 255;--background-color: 243, 245, 250;--danger-color: #ff6161;--green: #1cad59;--yellow: rgb(220, 165, 0);scrollbar-width:thin;scrollbar-gutter:stable;color:rgba(var(--text-color), 1);background-color:rgba(var(--foreground-color), 1);transition:background-color .3s;position:relative;display:flex;flex-direction:column}body[data-theme=dark]{--accent-color: #a0b6ff;--accent-color-rgb: 160, 182, 255;--blue-accent-1: #f5f8ff10;--blue-accent-2: #f2f6ff10;--text-color: 220, 220, 220;--foreground-color: 27, 28, 29;--background-color: 21, 22, 22;--danger-color: rgb(255, 106, 106);--green: #00e676;--yellow: rgb(255, 213, 5)}p,strong{font-size:.9rem;max-width:65ch;line-height:1.7;color:rgba(var(--text-color), 0.9)}.warning{line-height:normal;padding:1rem;background-color:khaki;border-radius:.5rem;font-weight:500;color:rgba(0,0,0,.7)}a{text-decoration:none;color:var(--accent-color)}.button,button{-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;display:inline-flex;border:none;background-color:rgba(0,0,0,0);overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);align-items:center;font-size:.9rem;font-weight:500;white-space:nowrap;padding:.8rem;border-radius:.5rem;justify-content:center;color:inherit;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content}.button:not(:disabled),button:not(:disabled){cursor:pointer}.button{color:var(--accent-color);background-color:var(--blue-accent-1)}.button .icon{fill:var(--accent-color)}.button--primary,.button--danger{color:rgba(var(--background-color), 1) !important}.button--primary .icon,.button--danger .icon{fill:rgba(var(--background-color), 1)}.button--primary{width:100%;background-color:var(--accent-color)}.button--danger{background-color:var(--danger-color)}.button--small{padding:.4rem .6rem}.cta{text-transform:uppercase;font-size:.8rem;font-weight:700;letter-spacing:.05em;padding:.8rem 1rem}.icon{width:1.2rem;height:1.2rem;fill:rgba(var(--text-color), 0.8);flex-shrink:0}.icon-only{padding:.5rem;border-radius:.3rem}button:disabled{opacity:.5;cursor:not-allowed}details summary{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;align-items:center;justify-content:space-between}details[open] summary{margin-bottom:1rem}details[open]>summary .down-arrow{transform:rotate(180deg)}sm-popup::part(popup){background-color:rgba(var(--foreground-color), 1)}sm-popup::part(backdrop){-webkit-backdrop-filter:blur(0.5rem);backdrop-filter:blur(0.5rem)}sm-input,sm-textarea{--border-radius: 0.5rem;--background-color: rgba(var(--foreground-color), 1)}sm-input button .icon,sm-textarea button .icon{fill:var(--accent-color)}sm-copy{font-size:.9rem}sm-spinner{--size: 1rem;--stroke-width: 0.1rem}sm-form{--gap: 1rem}sm-select{--padding: 0.8rem;font-size:.9rem}sm-option{font-size:.9rem}sm-chips{--gap: 0.3rem}sm-chip{position:relative;font-size:.9rem;--border-radius: 0.5rem;--padding: 0.5rem 0.8rem;--background: rgba(var(--text-color), 0.06);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-weight:500}sm-chip[selected]{--background: var(--accent-color);color:rgba(var(--foreground-color), 1)}ul{list-style:none}ol{counter-reset:item}ol li{position:relative;display:flex;align-items:flex-start;counter-increment:item}ol li:not(:last-of-type){padding-bottom:1.5rem}ol li:not(:last-of-type)::after{content:"";position:absolute;width:.1rem;height:calc(100% - 2.2rem);background:var(--accent-color);margin-left:.7rem;margin-top:2rem}ol li::before{content:counter(item);display:flex;align-items:center;justify-content:center;text-align:center;font-size:.8rem;font-weight:500;margin-top:.15rem;margin-right:1rem;line-height:1;width:1.5rem;height:1.5rem;border-radius:100%;flex-shrink:0;color:rgba(var(--text-color), 0.8);background:rgba(var(--text-color), 0.1)}.overflow-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.wrap-around{overflow-wrap:break-word;word-wrap:break-word;word-break:break-word}.full-bleed{grid-column:1/-1}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.sticky{position:-webkit-sticky;position:sticky}.top-0{top:0}.flex{display:flex}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.grid{display:grid}.flow-column{grid-auto-flow:column}.gap-0-3{gap:.3rem}.gap-0-5{gap:.5rem}.gap-1{gap:1rem}.gap-1-5{gap:1.5rem}.gap-2{gap:2rem}.gap-3{gap:3rem}.text-align-right{text-align:right}.align-start{align-content:flex-start}.align-center{align-items:center}.align-end{align-items:flex-end}.text-center{text-align:center}.justify-start{justify-items:start}.justify-center{justify-content:center}.justify-items-center{justify-items:center}.justify-right{margin-left:auto}.align-self-center{align-self:center}.align-self-end{align-self:end}.justify-self-center{justify-self:center}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.flex-direction-column{flex-direction:column}.space-between{justify-content:space-between}.margin-right-0-3{margin-right:.3rem}.margin-right-0-5{margin-right:.5rem}.margin-right-auto{margin-right:auto}.margin-left-0-5{margin-left:.5rem}.margin-left-auto{margin-left:auto}.margin-top-1{margin-top:1rem}.margin-top-1-5{margin-top:1.5rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-bottom-1{margin-bottom:1rem}.margin-bottom-1-5{margin-bottom:1.5rem}.margin-bottom-2{margin-bottom:2rem}.padding-0-3{padding:.3rem}.padding-0-5{padding:.5rem}.padding-1{padding:1rem}.padding-inline-0-5{padding-inline:.5rem}.padding-inline-1{padding-inline:1rem}.padding-block-0-5{padding-block:.5rem}.padding-block-1{padding-block:1rem}.border-radius-0-3{border-radius:.3rem}.border-radius-0-5{border-radius:.5rem}.font-0-9{font-size:.9rem}.w-100{width:100%}.h-100{height:100%}.label{font-size:.8rem;color:rgba(var(--text-color), 0.8);font-weight:500;margin-bottom:.2rem}.button--primary .ripple,.button--danger .ripple{background:radial-gradient(circle, rgba(var(--background-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%)}.ripple{height:8rem;width:8rem;position:absolute;border-radius:50%;transform:scale(0);background:radial-gradient(circle, rgba(var(--text-color), 0.3) 0%, rgba(0, 0, 0, 0) 50%);pointer-events:none}.interact{position:relative;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.empty-state{display:grid;width:100%;padding:1.5rem 0}.observe-empty-state:empty{display:none !important}.observe-empty-state:not(:empty)+.empty-state{display:none !important}.bullet-point{display:flex;align-items:center;justify-content:center;margin:0 .8ch}.bullet-point::after{content:"";height:.4ch;width:.4ch;border-radius:.5em;background-color:var(--accent-color)}.icon-button{padding:.6rem;border-radius:.8rem;background-color:rgba(var(--text-color), 0.1);height:-webkit-max-content;height:-moz-max-content;height:max-content}.icon-button .icon{fill:var(--accent-color)}.page{height:100%}.page__header{position:-webkit-sticky;position:sticky;top:0;display:flex;flex-direction:column;align-items:flex-start;gap:1rem;margin-bottom:1.5rem;background-color:rgba(var(--foreground-color), 1);z-index:1}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{margin-bottom:.5rem}#confirmation_popup .flex,#prompt_popup .flex{margin-top:1rem}#prompt_message{margin-bottom:1.5rem}.popup__header{position:relative;display:grid;gap:.5rem;width:100%;padding:0 1.5rem 0 .5rem;align-items:center;grid-template-columns:auto 1fr}.popup__header>*{grid-row:1}.popup__header h3,.popup__header h4{grid-column:1/-1;justify-self:center;align-self:center}.popup__header__close{grid-column:1}.flo-icon{margin-right:.3rem;height:1.5rem;width:1.5rem}#secondary_pages{display:flex;flex-direction:column;width:100%}#secondary_pages header{padding:1.5rem}#secondary_pages .inner-page{height:100%}#landing>section{justify-content:center;justify-items:center;align-items:center;text-align:center;padding:8vw 0}#landing h1{font-size:clamp(2rem,5vw,5rem)}#sign_in,#sign_up{justify-content:center;align-items:center}#sign_in sm-form,#sign_up sm-form{margin:2rem 0}#sign_in{display:grid;align-content:center;padding:0;justify-items:center}#sign_in .illustration{height:auto;background-color:#4d77ff;border-radius:1rem;width:min(24rem,100%)}#sign_in section{width:min(24rem,100%);background-color:rgba(var(--foreground-color), 1);padding:max(1.5rem,2vw);border-radius:.5rem;margin-top:-1.6rem}#sign_up{justify-items:center;align-content:center}#sign_up keys-generator{width:min(26rem,100%);margin-top:-4rem}#sign_up .h2{margin-bottom:.5rem}#main_header{display:grid;gap:1rem;padding:1rem;align-items:center;grid-template-columns:minmax(0, 1fr) auto auto;min-height:4rem;flex-shrink:0}#user_profile_button{background-color:var(--blue-accent-1);border-radius:2rem;font-size:.8rem;padding:.6rem .8rem;font-weight:700;min-width:0}#notifications_wrapper{position:relative}#notifications_panel{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10;background-color:rgba(var(--foreground-color), 1);padding:1rem}.logged-in-user-id{background-color:rgba(var(--text-color), 0.06);max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;padding:.4rem .8rem .4rem .5rem;border-radius:2rem;font-weight:500}#main_card{position:relative;display:flex;flex-direction:column;height:100%;width:100%;transition:background-color .3s}#main_card.nav-hidden .inner-page{grid-area:2/1/3/-1}.badge{display:flex;align-items:center;justify-content:center;content:attr(data-notifications);position:absolute;top:0;right:0;font-size:.8rem;padding:.1rem .3rem;background:var(--danger-color);color:rgba(var(--background-color), 1);aspect-ratio:1/1;font-weight:700;border-radius:.3rem}.inner-page{display:flex;flex-direction:column;padding:0 1rem;flex:1;align-content:start;overflow-y:auto}.password-field label{display:flex;justify-content:center}.password-field label input:checked~.visible{display:none}.password-field label input:not(:checked)~.invisible{display:none}.multi-state-button{display:grid;text-align:center;align-items:center;justify-items:center}.multi-state-button>*{grid-area:1/1/2/2}.multi-state-button button{z-index:1}.scrolling-wrapper{overflow-y:auto}#home{position:relative;display:grid;padding:0;gap:3rem;overflow-y:visible;align-content:initial;transition:filter .3s}#home>*{align-content:flex-start}#wallet_section{position:relative;display:flex;flex-direction:column;height:100%;gap:1.5rem;background-color:rgba(var(--accent-color-rgb), 0.02)}#wallet_section sm-chips{display:flex;justify-content:center}#wallet_section sm-chip::part(chip){width:6.8rem;justify-content:center}#wallet_section>*{width:100%}#wallet_section::before{content:"";position:absolute;top:-10vmax;left:0;width:100%;height:10vmax;background-color:inherit;pointer-events:none}#user,#cashier{position:relative;padding-bottom:1rem;align-content:flex-start}#cashier{padding:1rem 0}#wallet_cards_wrapper{display:grid;grid-template-columns:6rem 1fr;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;padding:0 .2rem}#wallet_cards_wrapper sm-input{--background: transparent}#wallet_cards_wrapper sm-select{margin:.2rem 0;--background: rgba(var(--foreground-color), 1)}#wallet_cards_wrapper sm-select[open]{z-index:10}.balance-card{background-color:rgba(var(--accent-color-rgb), 0.06);border-radius:.5rem;padding:.8rem;font-size:.9rem}.balance-card>*{font-weight:500}#rupee_balance span:first-of-type,#flo_balance span:first-of-type,#btc_balance span:first-of-type{font-size:1.5rem}#rupee_balance span:nth-of-type(2),#flo_balance span:nth-of-type(2),#btc_balance span:nth-of-type(2){font-size:1rem}.actions-wrapper{display:grid;grid-template-columns:repeat(auto-fill, minmax(4rem, 1fr));gap:1rem .5rem}.wallet-action,.integrated-action-button{position:relative;color:inherit;font-weight:500;font-size:.9rem}.wallet-action .icon:first-of-type,.integrated-action-button .icon:first-of-type{height:3rem;width:3rem;padding:.95rem;overflow:visible;fill:var(--accent-color);border-radius:2rem;background-color:var(--blue-accent-2)}.wallet-action .badge,.integrated-action-button .badge{left:0;right:auto}.wallet-action{gap:.5rem;flex-direction:column;align-items:center;font-size:.8rem;white-space:initial;border-radius:.5rem;padding:0;min-width:0}.integrated-action-button{padding:0;justify-content:flex-start}.integrated-action-button .icon:first-of-type{margin-right:1rem}.integrated-action-button span:last-of-type{font-size:1rem}.cashier-status{font-size:.9rem;padding:1rem 1.2rem;border-radius:1rem;background-color:rgba(240,230,140,.8);color:rgba(0,0,0,.8)}.cashier-status .icon{fill:rgba(0,0,0,.8)}#topup_wallet__qr_code{background-color:rgba(var(--text-color), 0.03);border-radius:.5rem;height:10rem;justify-self:flex-start;width:10rem}#topup_wallet__qr_code svg{width:100%;height:100%;fill:rgba(var(--text-color), 1)}#cashier_status{font-size:.9rem;padding:1rem 1.2rem;border-radius:1rem;background-color:rgba(240,230,140,.8);color:rgba(0,0,0,.8)}#cashier_status .icon{fill:rgba(0,0,0,.8)}.remove-card-wrapper{min-height:2rem}#selected_fee_tip,#error_section{font-weight:500}.error{color:var(--danger-color)}.error .icon{fill:var(--danger-color)}#send_fee_wrapper{display:grid}#send_fee_wrapper>*{grid-area:1/1}#send_fee_loader{background-color:rgba(var(--foreground-color), 1);z-index:1;width:100%}.receiver-card{display:grid;gap:.5rem;padding:.5rem 0;border:none}.receiver-card:not(:last-of-type){border-bottom:solid thin rgba(var(--text-color), 0.3)}#contacts{position:relative;padding-bottom:6rem}#recent_contacts{gap:0}#saved_ids_list{display:grid;gap:.5rem 1rem;grid-template-columns:minmax(0, 1fr);margin-bottom:1.5rem}.saved-id{align-items:center;grid-template-columns:auto 1fr;gap:0 1rem;padding:.5rem 0;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:.5rem}.saved-id.highlight{box-shadow:0 0 .1rem .1rem var(--accent-color) inset}.saved-id .edit-saved{padding:.3rem;position:relative}.saved-id__initials{display:flex;align-items:center;justify-content:center;height:2.5rem;width:2.5rem;font-size:1.2rem;text-transform:uppercase;color:var(--accent-color);font-weight:700;line-height:1;background-color:rgba(var(--text-color), 0.03);border-radius:2rem;grid-area:1/1/3/2}.saved-id__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.saved-id__flo-id{font-size:.8rem}.saved-id__copy{padding:.3rem .5rem;border-radius:.3rem;background-color:rgba(var(--text-color), 0.03)}#saved_ids_tip{background-color:rgba(var(--text-color), 0.03);border-radius:2rem;padding:.5rem .8rem .5rem .5rem}.card{background-color:rgba(var(--foreground-color), 1);border-radius:.5rem;padding:1rem}#contact{display:grid;grid-template-rows:auto 1fr auto;padding:0;height:100%}#contact>*{padding:1rem 1.5rem}#contact>:first-child{padding-top:0}#contact>:last-child{padding:.5rem 1.5rem;border-top:solid thin rgba(var(--text-color), 0.2)}#contact>:last-child button{padding:.8rem 2rem;border-radius:1rem;color:var(--accent-color);background-color:rgba(var(--text-color), 0.03)}#contact__transactions{position:relative;display:grid;gap:.5rem;overflow-y:auto;flex:1;padding:0 max(1rem,8vw) 1rem max(1rem,8vw);align-content:flex-start}#contact__transactions sm-spinner{position:absolute;justify-self:center;align-self:center}.transaction-message{background-color:rgba(var(--text-color), 0.06);padding:1rem;border-radius:.5rem;justify-self:flex-start;border-radius:0 1rem 1rem 1rem;gap:.5rem}.transaction-message.received{background-color:var(--accent-color);color:rgba(var(--background-color), 1)}.transaction-message.received+.transaction-message.received{border-radius:1rem}.transaction-message.sent{margin-left:auto;justify-self:flex-end;border-radius:1rem 1rem 0 1rem;text-align:right}.transaction-message__amount{font-size:1.2rem}.transaction-message__time{opacity:.8;font-size:.8rem}#history_applied_filters{padding:.2rem 0 .5rem 0}.applied-filter{display:flex;align-items:center;padding:.5rem .6rem .5rem .8rem;border-radius:.5rem;border:solid thin rgba(var(--text-color), 0.2);text-transform:uppercase;font-size:.8rem;font-weight:500;letter-spacing:.08em}.applied-filter button{padding:.6rem}.applied-filter .icon{margin-left:.3rem}fieldset{border:none;padding:0;margin:0}fieldset legend{font-size:.8rem;font-weight:500;margin-bottom:.5rem}.category-chip{display:inline-flex;align-items:center;justify-content:center;padding:.3rem .5rem;border-radius:.3rem;font-size:.8rem;border:solid thin rgba(var(--text-color), 0.2);font-weight:700}.category-chip input{display:none}.category-chip span{transition:transform .2s;transform:translateX(-0.8rem)}.category-chip .icon{opacity:0;transition:opacity .2s,transform .2s;margin-right:.3rem;fill:var(--accent-color);transform:translateX(0.5rem)}.category-chip input:checked~.icon{opacity:1;transform:translateX(0)}.category-chip input:checked~span{color:var(--accent-color);transform:translateX(0)}#wallet_history_wrapper{margin-top:1.5rem;padding-bottom:3rem}#payments_history{display:grid;gap:2rem;margin-top:1.5rem;padding-bottom:6rem}.transaction{grid-template-columns:auto 1fr auto;gap:.5rem 1rem;align-items:flex-start}.transaction .button{min-width:auto;white-space:normal;text-align:start}.transaction.sent .icon--tx-type{fill:var(--danger-color)}.transaction.sent .transaction__amount{color:var(--danger-color)}.transaction.sent .transaction__amount::before{content:"- "}.transaction.received .icon--tx-type{fill:var(--green)}.transaction.received .transaction__amount{color:var(--green)}.transaction.received .transaction__amount::before{content:"+ "}.transaction__icon{position:relative;display:grid;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;background-color:rgba(var(--text-color), 0.03);border-radius:2rem}.transaction__icon>*{grid-area:1/1}.transaction__icon .icon--tx-type{position:absolute;background-color:inherit;right:-0.3rem;bottom:-0.3rem;border-radius:1rem;padding:.2rem;height:1.5rem;width:1.5rem;border:solid medium rgba(var(--foreground-color), 1)}.transaction__receiver{font-size:.9rem;font-weight:500}.transaction__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.transaction__amount{font-size:.9rem;font-weight:500;white-space:nowrap}.btc-tx{display:grid;grid-template-columns:auto minmax(0, 1fr);gap:.5rem 1rem;align-items:flex-start}.btc-tx .button{min-width:auto;white-space:normal;text-align:start}.btc-tx.out .icon--tx-type{fill:var(--danger-color)}.btc-tx.out .btc-tx__amount{color:var(--danger-color)}.btc-tx.out .btc-tx__amount::before{content:"- "}.btc-tx.in .icon--tx-type{fill:var(--green)}.btc-tx.in .btc-tx__amount{color:var(--green)}.btc-tx.in .btc-tx__amount::before{content:"+ "}.btc-tx.unconfirmed-tx .icon{fill:var(--yellow)}.btc-tx__icon{position:relative;display:grid;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;background-color:rgba(var(--text-color), 0.03);border-radius:2rem}.btc-tx__icon>*{grid-area:1/1}.btc-tx__icon .icon--tx-type{position:absolute;background-color:inherit;right:-0.3rem;bottom:-0.3rem;border-radius:1rem;padding:.2rem;height:1.5rem;width:1.5rem;border:solid medium rgba(var(--foreground-color), 1)}.btc-tx__receiver{font-size:.9rem;font-weight:500}.btc-tx__time{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.btc-tx__amount{font-size:.9rem;font-weight:500;white-space:nowrap}.btc-tx__id{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.btc-tx .pending-badge{font-size:.8rem;padding:.2rem .5rem;border-radius:.5rem;background-color:var(--yellow);color:rgba(var(--foreground-color), 1);font-weight:500;align-self:flex-start}.fab{position:absolute;right:0;bottom:0;margin:1.5rem;box-shadow:0 .5rem 1rem rgba(0,0,0,.2);z-index:2}#scroll_to_top{border-radius:3rem;background-color:rgba(var(--foreground-color), 1)}.user-action-result__icon{justify-self:center;height:4rem;width:4rem;border-radius:5rem;margin-bottom:2rem;-webkit-animation:popup 1s;animation:popup 1s}.user-action-result__icon.success{fill:rgba(var(--background-color), 1);padding:1rem;background-color:#0bbe56}.user-action-result__icon.failed{background-color:rgba(var(--text-color), 0.03);fill:var(--danger-color)}@-webkit-keyframes popup{0%{opacity:0;transform:scale(0.2) translateY(600%)}10%{transform:scale(0.2) translateY(5rem);opacity:1}40%{transform:scale(0.2) translateY(0)}80%{transform:scale(1.1) translateY(0)}100%{transform:scale(1) translateY(0)}}@keyframes popup{0%{opacity:0;transform:scale(0.2) translateY(600%)}10%{transform:scale(0.2) translateY(5rem);opacity:1}40%{transform:scale(0.2) translateY(0)}80%{transform:scale(1.1) translateY(0)}100%{transform:scale(1) translateY(0)}}.cashier-request,.payment-request{display:flex;gap:1rem;align-items:center;padding:1rem;border-radius:.3rem;background-color:rgba(var(--foreground-color), 1)}.cashier-request:not(:last-of-type),.payment-request:not(:last-of-type){margin-bottom:.5rem}.cashier-request__mode,.payment-request__mode{text-align:center;width:2rem;font-size:.8rem}.cashier-request__time,.payment-request__time{font-size:.8rem}.cashier-request{display:grid;gap:.5rem 1rem;padding:1rem 0;grid-template-columns:auto 1fr auto;grid-template-areas:"mode details status" "mode . status"}.cashier-request__mode{grid-area:mode}.cashier-request__details{grid-area:details;font-weight:700}.cashier-request__status,.cashier-request__requestor{font-size:.8rem}.cashier-request__status{grid-area:status;grid-column:3/4;grid-row:1/3}#payment_request_history{padding-bottom:3rem}#payment_request_history .payment-request{margin:0 -1rem}.payment-request{display:grid;gap:.5rem 1rem;grid-template-columns:1fr auto;color:rgba(var(--text-color), 1)}.payment-request__requestor{font-weight:500}.payment-request__amount{font-weight:700;text-align:right}.payment-request__status{display:flex;align-items:center;font-size:.8rem;text-transform:capitalize}.payment-request__status .icon{height:1rem;width:1rem;margin-left:.3rem}.payment-request .icon.paid{fill:var(--green)}.payment-request .icon.declined{fill:var(--danger-color)}.payment-request .button{background-color:rgba(0,0,0,0);padding:.6rem .8rem;color:var(--accent-color);background-color:rgba(var(--foreground-color), 1)}.payment-request--pending{padding:0}.wallet-request{display:grid;gap:.5rem 1rem;padding:.5rem 0;border-radius:.5rem;grid-template-columns:auto 1fr}.wallet-request:not(.rejected,.pending).withdrawn .wallet-request__amount::before{content:"- "}.wallet-request:not(.rejected,.pending).added .wallet-request__amount{color:var(--green)}.wallet-request:not(.rejected,.pending).added .wallet-request__amount::before{content:"+ "}.wallet-request .icon.pending{fill:var(--yellow)}.wallet-request .icon.failed{fill:var(--danger-color)}.wallet-request__icon{display:flex;align-items:center;justify-content:center;grid-area:1/1/3/2;width:2.5rem;height:2.5rem;border-radius:2rem;background-color:rgba(var(--text-color), 0.06)}.wallet-request__icon .icon{fill:var(--accent-color)}.wallet-request__details{font-weight:500}.wallet-request__details,.wallet-request__amount{color:rgba(var(--text-color), 1)}.wallet-request__amount{font-weight:700}.wallet-request__time,.wallet-request__status{font-size:.8rem;color:rgba(var(--text-color), 0.8)}.wallet-request__status{text-align:right}.wallet-request__status .icon{margin-left:.3rem}#transaction__amount{font-size:2.5rem;font-weight:700}#transaction__remark,#transaction__note{line-height:1.6;justify-self:flex-start;background-color:rgba(var(--text-color), 0.06);border-radius:.5rem;padding:.8rem}#transaction__note .icon{fill:var(--danger-color);margin-right:.5rem}#saved_upi_ids_list{display:grid;gap:.5rem;width:min(24rem,100%)}.saved-upi{display:flex;justify-content:space-between;align-items:center;padding:.4rem .4rem .4rem 1rem;border-radius:.5rem;background-color:rgba(var(--text-color), 0.03)}#convert_asset_popup .error-icon{height:3rem;width:3rem;fill:var(--danger-color)}#conversion_status{padding-bottom:1.5rem}.amount-option{display:flex;gap:.5rem;padding:.5rem .6rem;border-radius:.3rem;background-color:rgba(var(--text-color), 0.06);cursor:pointer;accent-color:var(--accent-color);font-size:.9rem;font-weight:500}@media screen and (max-width: 40rem){#home.is-sub-admin{align-content:flex-start}#home:not(.is-sub-admin){padding-bottom:3rem}#home>*{padding:0 1rem}#wallet_section{padding-bottom:1.5rem}.integrated-action-button .icon:last-of-type{margin-left:auto}#bottom_nav{position:fixed;bottom:0;left:0;right:0;z-index:5;background-color:rgba(var(--foreground-color), 1)}#bottom_nav ul{display:flex;justify-content:space-between;align-items:center}#bottom_nav ul li{flex:1}.nav-item{display:flex;flex-direction:column;gap:.3rem;align-items:center;padding:.5rem;font-size:.8rem;flex:1;color:inherit;font-weight:500}.nav-item--active{color:var(--accent-color)}.nav-item--active .icon{fill:var(--accent-color)}.integrated-action-button .icon:last-of-type{margin-left:auto}.hide-on-mobile{display:none}}@media screen and (min-width: 40rem){sm-popup{--width: 24rem}.popup__header{padding:1.5rem 1.5rem 0 .75rem}body{align-items:center;justify-content:center}.inner-page{padding:0 14vw}#main_header{padding:1.5rem 3vw;grid-template-columns:1fr auto auto auto}.card{padding:1.5rem}#home{grid-template-columns:26rem 1fr;gap:4vw;padding-right:3vw}#profile_popup{--width: 32rem}#notifications_panel{position:absolute;top:100%;left:auto;bottom:auto;right:0;border-radius:.5rem;z-index:10;box-shadow:0 .5rem 1rem rgba(0,0,0,.1);border:solid 1px rgba(var(--text-color), 0.1);background-color:rgba(var(--foreground-color), 1);width:max(24rem,100%)}#wallet_section{padding:0 3vw;grid-row:1/3}#contact>*{padding:1rem 12vw}#contact>:last-child{padding:.5rem 12vw}#saved_ids_list{gap:1.5rem;grid-template-columns:repeat(auto-fill, minmax(16rem, 1fr))}.hide-on-desktop{display:none}}@media screen and (min-width: 68rem){#home:not(.is-sub-admin){grid-template-columns:26rem 1fr 1fr}}@media(any-hover: hover){::-webkit-scrollbar{width:.5rem;height:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color), 0.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color), 0.5)}.button--primary:not([disabled]),.button--danger:not([disabled]){transition:filter .3s}.button--primary:not([disabled]):hover,.button--danger:not([disabled]):hover{filter:brightness(1.3)}.interact:not([disabled]),button:not([disabled],.button--primary,.button--danger),.button:not([disabled],.button--primary,.button--danger){transition:background-color .3s}.interact:not([disabled]):hover,button:not([disabled],.button--primary,.button--danger):hover,.button:not([disabled],.button--primary,.button--danger):hover{background-color:rgba(var(--text-color), 0.06)}}@supports(overflow: overlay){body{overflow:overlay}}.hidden{display:none !important}#adblocker_warning{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(var(--foreground-color), 1);z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:1rem;padding:1.5rem}#adblocker_warning:empty{display:none}#adblocker_warning .icon{height:4rem;width:4rem;fill:#ffc107} diff --git a/css/main.scss b/css/main.scss index 7a96625..f1f1e09 100644 --- a/css/main.scss +++ b/css/main.scss @@ -1,1756 +1,1757 @@ * { - padding: 0; - margin: 0; - box-sizing: border-box; - font-family: "Inter", sans-serif; - &:focus-visible { - outline: var(--accent-color) solid medium; - outline-offset: 0; - transition: outline-offset 0.3s; - } -} -:root { - font-size: clamp(1rem, 1.2vmax, 1.2rem); -} - -html, -body { - height: 100%; -} - -body { - --accent-color: #234ebf; - --accent-color-rgb: 35, 78, 191; - --blue-accent-1: #f5f8ff; - --blue-accent-2: #f2f6ff; - --text-color: 58, 58, 58; - --foreground-color: 255, 255, 255; - --background-color: 243, 245, 250; - --danger-color: #ff6161; - --green: #1cad59; - --yellow: rgb(220, 165, 0); - scrollbar-width: thin; - scrollbar-gutter: stable; - color: rgba(var(--text-color), 1); - background-color: rgba(var(--foreground-color), 1); - transition: background-color 0.3s; - position: relative; - display: flex; - flex-direction: column; -} - -body[data-theme="dark"] { - --accent-color: #a0b6ff; - --accent-color-rgb: 160, 182, 255; - --blue-accent-1: #f5f8ff10; - --blue-accent-2: #f2f6ff10; - --text-color: 220, 220, 220; - --foreground-color: 27, 28, 29; - --background-color: 21, 22, 22; - --danger-color: rgb(255, 106, 106); - --green: #00e676; - --yellow: rgb(255, 213, 5); -} - -p, -strong { - font-size: 0.9rem; - max-width: 65ch; - line-height: 1.7; - color: rgba(var(--text-color), 0.9); -} -.warning { - line-height: normal; - padding: 1rem; - background-color: khaki; - border-radius: 0.5rem; - font-weight: 500; - color: rgba(0, 0, 0, 0.7); -} -a { - text-decoration: none; - color: var(--accent-color); -} -.button, -button { - user-select: none; - position: relative; - display: inline-flex; - border: none; - background-color: transparent; - overflow: hidden; - -webkit-tap-highlight-color: transparent; - align-items: center; - font-size: 0.9rem; - font-weight: 500; - white-space: nowrap; - padding: 0.8rem; - border-radius: 0.5rem; - justify-content: center; - color: inherit; - min-width: max-content; - &:not(:disabled) { - cursor: pointer; - } -} -.button { - color: var(--accent-color); - background-color: var(--blue-accent-1); - .icon { - fill: var(--accent-color); - } - &--primary, - &--danger { - color: rgba(var(--background-color), 1) !important; - .icon { - fill: rgba(var(--background-color), 1); + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: "Inter", sans-serif; + &:focus-visible { + outline: var(--accent-color) solid medium; + outline-offset: 0; + transition: outline-offset 0.3s; } } - &--primary { + :root { + font-size: clamp(1rem, 1.2vmax, 1.2rem); + } + + html, + body { + height: 100%; + } + + body { + --accent-color: #234ebf; + --accent-color-rgb: 35, 78, 191; + --blue-accent-1: #f5f8ff; + --blue-accent-2: #f2f6ff; + --text-color: 58, 58, 58; + --foreground-color: 255, 255, 255; + --background-color: 243, 245, 250; + --danger-color: #ff6161; + --green: #1cad59; + --yellow: rgb(220, 165, 0); + scrollbar-width: thin; + scrollbar-gutter: stable; + color: rgba(var(--text-color), 1); + background-color: rgba(var(--foreground-color), 1); + transition: background-color 0.3s; + position: relative; + display: flex; + flex-direction: column; + } + + body[data-theme="dark"] { + --accent-color: #a0b6ff; + --accent-color-rgb: 160, 182, 255; + --blue-accent-1: #f5f8ff10; + --blue-accent-2: #f2f6ff10; + --text-color: 220, 220, 220; + --foreground-color: 27, 28, 29; + --background-color: 21, 22, 22; + --danger-color: rgb(255, 106, 106); + --green: #00e676; + --yellow: rgb(255, 213, 5); + } + + p, + strong { + font-size: 0.9rem; + max-width: 65ch; + line-height: 1.7; + color: rgba(var(--text-color), 0.9); + } + .warning { + line-height: normal; + padding: 1rem; + background-color: khaki; + border-radius: 0.5rem; + font-weight: 500; + color: rgba(0, 0, 0, 0.7); + } + a { + text-decoration: none; + color: var(--accent-color); + } + .button, + button { + user-select: none; + position: relative; + display: inline-flex; + border: none; + background-color: transparent; + overflow: hidden; + -webkit-tap-highlight-color: transparent; + align-items: center; + font-size: 0.9rem; + font-weight: 500; + white-space: nowrap; + padding: 0.8rem; + border-radius: 0.5rem; + justify-content: center; + color: inherit; + min-width: max-content; + &:not(:disabled) { + cursor: pointer; + } + } + .button { + color: var(--accent-color); + background-color: var(--blue-accent-1); + .icon { + fill: var(--accent-color); + } + &--primary, + &--danger { + color: rgba(var(--background-color), 1) !important; + .icon { + fill: rgba(var(--background-color), 1); + } + } + &--primary { + width: 100%; + background-color: var(--accent-color); + } + &--danger { + background-color: var(--danger-color); + } + &--small { + padding: 0.4rem 0.6rem; + } + } + .cta { + text-transform: uppercase; + font-size: 0.8rem; + font-weight: 700; + letter-spacing: 0.05em; + padding: 0.8rem 1rem; + } + .icon { + width: 1.2rem; + height: 1.2rem; + fill: rgba(var(--text-color), 0.8); + flex-shrink: 0; + } + .icon-only { + padding: 0.5rem; + border-radius: 0.3rem; + } + + button:disabled { + opacity: 0.5; + cursor: not-allowed; + } + + details summary { + display: flex; + user-select: none; + cursor: pointer; + align-items: center; + justify-content: space-between; + } + + details[open] { + & summary { + margin-bottom: 1rem; + } + & > summary .down-arrow { + transform: rotate(180deg); + } + } + sm-popup { + &::part(popup) { + background-color: rgba(var(--foreground-color), 1); + } + &::part(backdrop) { + backdrop-filter: blur(0.5rem); + } + } + + sm-input, + sm-textarea { + --border-radius: 0.5rem; + --background-color: rgba(var(--foreground-color), 1); + button { + .icon { + fill: var(--accent-color); + } + } + } + sm-copy { + font-size: 0.9rem; + } + sm-spinner { + --size: 1rem; + --stroke-width: 0.1rem; + } + sm-form { + --gap: 1rem; + } + sm-select { + --padding: 0.8rem; + font-size: 0.9rem; + } + sm-option { + font-size: 0.9rem; + } + sm-chips { + --gap: 0.3rem; + } + + sm-chip { + position: relative; + font-size: 0.9rem; + --border-radius: 0.5rem; + --padding: 0.5rem 0.8rem; + --background: rgba(var(--text-color), 0.06); + user-select: none; + font-weight: 500; + &[selected] { + --background: var(--accent-color); + color: rgba(var(--foreground-color), 1); + } + } + ul { + list-style: none; + } + ol { + counter-reset: item; + li { + position: relative; + display: flex; + align-items: flex-start; + counter-increment: item; + &:not(:last-of-type) { + padding-bottom: 1.5rem; + &::after { + content: ""; + position: absolute; + width: 0.1rem; + height: calc(100% - 2.2rem); + background: var(--accent-color); + margin-left: 0.7rem; + margin-top: 2rem; + } + } + } + li::before { + content: counter(item); + display: flex; + align-items: center; + justify-content: center; + text-align: center; + font-size: 0.8rem; + font-weight: 500; + margin-top: 0.15rem; + margin-right: 1rem; + line-height: 1; + width: 1.5rem; + height: 1.5rem; + border-radius: 100%; + flex-shrink: 0; + color: rgba(var(--text-color), 0.8); + background: rgba(var(--text-color), 0.1); + } + } + + .overflow-ellipsis { width: 100%; - background-color: var(--accent-color); + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } - &--danger { - background-color: var(--danger-color); + + .wrap-around { + overflow-wrap: break-word; + word-wrap: break-word; + word-break: break-word; } - &--small { - padding: 0.4rem 0.6rem; + + .full-bleed { + grid-column: 1/-1; } -} -.cta { - text-transform: uppercase; - font-size: 0.8rem; - font-weight: 700; - letter-spacing: 0.05em; - padding: 0.8rem 1rem; -} -.icon { - width: 1.2rem; - height: 1.2rem; - fill: rgba(var(--text-color), 0.8); - flex-shrink: 0; -} -.icon-only { - padding: 0.5rem; - border-radius: 0.3rem; -} - -button:disabled { - opacity: 0.5; - cursor: not-allowed; -} - -details summary { - display: flex; - user-select: none; - cursor: pointer; - align-items: center; - justify-content: space-between; -} - -details[open] { - & summary { + .uppercase { + text-transform: uppercase; + } + + .capitalize { + text-transform: capitalize; + } + + .sticky { + position: sticky; + } + .top-0 { + top: 0; + } + + .flex { + display: flex; + } + .flex-wrap { + flex-wrap: wrap; + } + .flex-1 { + flex: 1; + } + + .grid { + display: grid; + } + .flow-column { + grid-auto-flow: column; + } + + .gap-0-3 { + gap: 0.3rem; + } + .gap-0-5 { + gap: 0.5rem; + } + + .gap-1 { + gap: 1rem; + } + + .gap-1-5 { + gap: 1.5rem; + } + + .gap-2 { + gap: 2rem; + } + + .gap-3 { + gap: 3rem; + } + + .text-align-right { + text-align: right; + } + + .align-start { + align-content: flex-start; + } + + .align-center { + align-items: center; + } + .align-end { + align-items: flex-end; + } + + .text-center { + text-align: center; + } + + .justify-start { + justify-items: start; + } + + .justify-center { + justify-content: center; + } + .justify-items-center { + justify-items: center; + } + + .justify-right { + margin-left: auto; + } + + .align-self-center { + align-self: center; + } + .align-self-end { + align-self: end; + } + + .justify-self-center { + justify-self: center; + } + + .justify-self-start { + justify-self: start; + } + + .justify-self-end { + justify-self: end; + } + + .flex-direction-column { + flex-direction: column; + } + + .space-between { + justify-content: space-between; + } + .margin-right-0-3 { + margin-right: 0.3rem; + } + .margin-right-0-5 { + margin-right: 0.5rem; + } + .margin-right-auto { + margin-right: auto; + } + .margin-left-0-5 { + margin-left: 0.5rem; + } + .margin-left-auto { + margin-left: auto; + } + .margin-top-1 { + margin-top: 1rem; + } + .margin-top-1-5 { + margin-top: 1.5rem; + } + .margin-bottom-0-5 { + margin-bottom: 0.5rem; + } + .margin-bottom-1 { margin-bottom: 1rem; } - & > summary .down-arrow { - transform: rotate(180deg); + .margin-bottom-1-5 { + margin-bottom: 1.5rem; } -} -sm-popup { - &::part(popup) { - background-color: rgba(var(--foreground-color), 1); + .margin-bottom-2 { + margin-bottom: 2rem; } - &::part(backdrop) { - backdrop-filter: blur(0.5rem); + .padding-0-3 { + padding: 0.3rem; } -} - -sm-input, -sm-textarea { - --border-radius: 0.5rem; - --background-color: rgba(var(--foreground-color), 1); - button { + .padding-0-5 { + padding: 0.5rem; + } + .padding-1 { + padding: 1rem; + } + .padding-inline-0-5 { + padding-inline: 0.5rem; + } + .padding-inline-1 { + padding-inline: 1rem; + } + .padding-block-0-5 { + padding-block: 0.5rem; + } + .padding-block-1 { + padding-block: 1rem; + } + .border-radius-0-3 { + border-radius: 0.3rem; + } + .border-radius-0-5 { + border-radius: 0.5rem; + } + .font-0-9 { + font-size: 0.9rem; + } + .w-100 { + width: 100%; + } + .h-100 { + height: 100%; + } + .label { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + font-weight: 500; + margin-bottom: 0.2rem; + } + + .button--primary, + .button--danger { + .ripple { + background: radial-gradient( + circle, + rgba(var(--background-color), 0.3) 0%, + rgba(0, 0, 0, 0) 50% + ); + } + } + .ripple { + height: 8rem; + width: 8rem; + position: absolute; + border-radius: 50%; + transform: scale(0); + background: radial-gradient( + circle, + rgba(var(--text-color), 0.3) 0%, + rgba(0, 0, 0, 0) 50% + ); + pointer-events: none; + } + .interact { + position: relative; + overflow: hidden; + cursor: pointer; + -webkit-tap-highlight-color: transparent; + } + .empty-state { + display: grid; + width: 100%; + padding: 1.5rem 0; + } + + .observe-empty-state:empty { + display: none !important; + } + + .observe-empty-state:not(:empty) + .empty-state { + display: none !important; + } + + .bullet-point { + display: flex; + align-items: center; + justify-content: center; + margin: 0 0.8ch; + &::after { + content: ""; + height: 0.4ch; + width: 0.4ch; + border-radius: 0.5em; + background-color: var(--accent-color); + } + } + + .icon-button { + padding: 0.6rem; + border-radius: 0.8rem; + background-color: rgba(var(--text-color), 0.1); + height: max-content; .icon { fill: var(--accent-color); } } -} -sm-copy { - font-size: 0.9rem; -} -sm-spinner { - --size: 1rem; - --stroke-width: 0.1rem; -} -sm-form { - --gap: 1rem; -} -sm-select { - --padding: 0.8rem; - font-size: 0.9rem; -} -sm-option { - font-size: 0.9rem; -} -sm-chips { - --gap: 0.3rem; -} - -sm-chip { - position: relative; - font-size: 0.9rem; - --border-radius: 0.5rem; - --padding: 0.5rem 0.8rem; - --background: rgba(var(--text-color), 0.06); - user-select: none; - font-weight: 500; - &[selected] { - --background: var(--accent-color); - color: rgba(var(--foreground-color), 1); + .page { + height: 100%; + &__header { + position: sticky; + top: 0; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 1rem; + margin-bottom: 1.5rem; + background-color: rgba(var(--foreground-color), 1); + z-index: 1; + } } -} -ul { - list-style: none; -} -ol { - counter-reset: item; - li { + #confirmation_popup, + #prompt_popup { + flex-direction: column; + + h4 { + margin-bottom: 0.5rem; + } + + .flex { + margin-top: 1rem; + } + } + #prompt_message { + margin-bottom: 1.5rem; + } + + .popup__header { + position: relative; + display: grid; + gap: 0.5rem; + width: 100%; + padding: 0 1.5rem 0 0.5rem; + align-items: center; + grid-template-columns: auto 1fr; + & > * { + grid-row: 1; + } + h3, + h4 { + grid-column: 1/-1; + justify-self: center; + align-self: center; + } + &__close { + grid-column: 1; + } + } + .flo-icon { + margin-right: 0.3rem; + height: 1.5rem; + width: 1.5rem; + } + #secondary_pages { + display: flex; + flex-direction: column; + width: 100%; + header { + padding: 1.5rem; + } + .inner-page { + height: 100%; + } + } + #landing { + & > section { + justify-content: center; + justify-items: center; + align-items: center; + text-align: center; + padding: 8vw 0; + } + h1 { + font-size: clamp(2rem, 5vw, 5rem); + } + } + + #sign_in, + #sign_up { + justify-content: center; + align-items: center; + sm-form { + margin: 2rem 0; + } + } + #sign_in { + display: grid; + align-content: center; + padding: 0; + justify-items: center; + .illustration { + height: auto; + background-color: #4d77ff; + border-radius: 1rem; + width: min(24rem, 100%); + } + section { + width: min(24rem, 100%); + background-color: rgba(var(--foreground-color), 1); + padding: max(1.5rem, 2vw); + border-radius: 0.5rem; + margin-top: -1.6rem; + } + } + #sign_up { + justify-items: center; + align-content: center; + keys-generator { + width: min(26rem, 100%); + margin-top: -4rem; + } + .h2 { + margin-bottom: 0.5rem; + } + } + #main_header { + display: grid; + gap: 1rem; + padding: 1rem; + align-items: center; + grid-template-columns: minmax(0, 1fr) auto auto; + min-height: 4rem; + flex-shrink: 0; + } + #user_profile_button { + background-color: var(--blue-accent-1); + border-radius: 2rem; + font-size: 0.8rem; + padding: 0.6rem 0.8rem; + font-weight: 700; + min-width: 0; + } + #notifications_wrapper { + position: relative; + } + #notifications_panel { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + background-color: rgba(var(--foreground-color), 1); + padding: 1rem; + } + .logged-in-user-id { + background-color: rgba(var(--text-color), 0.06); + max-width: fit-content; + padding: 0.4rem 0.8rem 0.4rem 0.5rem; + border-radius: 2rem; + font-weight: 500; + } + #main_card { position: relative; display: flex; - align-items: flex-start; - counter-increment: item; - &:not(:last-of-type) { - padding-bottom: 1.5rem; - &::after { - content: ""; - position: absolute; - width: 0.1rem; - height: calc(100% - 2.2rem); - background: var(--accent-color); - margin-left: 0.7rem; - margin-top: 2rem; + flex-direction: column; + height: 100%; + width: 100%; + transition: background-color 0.3s; + &.nav-hidden { + .inner-page { + grid-area: 2/1/3/-1; } } } - li::before { - content: counter(item); + .badge { display: flex; align-items: center; justify-content: center; - text-align: center; - font-size: 0.8rem; - font-weight: 500; - margin-top: 0.15rem; - margin-right: 1rem; - line-height: 1; - width: 1.5rem; - height: 1.5rem; - border-radius: 100%; - flex-shrink: 0; - color: rgba(var(--text-color), 0.8); - background: rgba(var(--text-color), 0.1); - } -} - -.overflow-ellipsis { - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -.wrap-around { - overflow-wrap: break-word; - word-wrap: break-word; - word-break: break-word; -} - -.full-bleed { - grid-column: 1/-1; -} -.uppercase { - text-transform: uppercase; -} - -.capitalize { - text-transform: capitalize; -} - -.sticky { - position: sticky; -} -.top-0 { - top: 0; -} - -.flex { - display: flex; -} -.flex-wrap { - flex-wrap: wrap; -} -.flex-1 { - flex: 1; -} - -.grid { - display: grid; -} -.flow-column { - grid-auto-flow: column; -} - -.gap-0-3 { - gap: 0.3rem; -} -.gap-0-5 { - gap: 0.5rem; -} - -.gap-1 { - gap: 1rem; -} - -.gap-1-5 { - gap: 1.5rem; -} - -.gap-2 { - gap: 2rem; -} - -.gap-3 { - gap: 3rem; -} - -.text-align-right { - text-align: right; -} - -.align-start { - align-content: flex-start; -} - -.align-center { - align-items: center; -} -.align-end { - align-items: flex-end; -} - -.text-center { - text-align: center; -} - -.justify-start { - justify-items: start; -} - -.justify-center { - justify-content: center; -} -.justify-items-center { - justify-items: center; -} - -.justify-right { - margin-left: auto; -} - -.align-self-center { - align-self: center; -} -.align-self-end { - align-self: end; -} - -.justify-self-center { - justify-self: center; -} - -.justify-self-start { - justify-self: start; -} - -.justify-self-end { - justify-self: end; -} - -.flex-direction-column { - flex-direction: column; -} - -.space-between { - justify-content: space-between; -} -.margin-right-0-3 { - margin-right: 0.3rem; -} -.margin-right-0-5 { - margin-right: 0.5rem; -} -.margin-right-auto { - margin-right: auto; -} -.margin-left-0-5 { - margin-left: 0.5rem; -} -.margin-left-auto { - margin-left: auto; -} -.margin-top-1 { - margin-top: 1rem; -} -.margin-top-1-5 { - margin-top: 1.5rem; -} -.margin-bottom-0-5 { - margin-bottom: 0.5rem; -} -.margin-bottom-1 { - margin-bottom: 1rem; -} -.margin-bottom-1-5 { - margin-bottom: 1.5rem; -} -.margin-bottom-2 { - margin-bottom: 2rem; -} -.padding-0-3 { - padding: 0.3rem; -} -.padding-0-5 { - padding: 0.5rem; -} -.padding-1 { - padding: 1rem; -} -.padding-inline-0-5 { - padding-inline: 0.5rem; -} -.padding-inline-1 { - padding-inline: 1rem; -} -.padding-block-0-5 { - padding-block: 0.5rem; -} -.padding-block-1 { - padding-block: 1rem; -} -.border-radius-0-3 { - border-radius: 0.3rem; -} -.border-radius-0-5 { - border-radius: 0.5rem; -} -.font-0-9 { - font-size: 0.9rem; -} -.w-100 { - width: 100%; -} -.h-100 { - height: 100%; -} -.label { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); - font-weight: 500; - margin-bottom: 0.2rem; -} - -.button--primary, -.button--danger { - .ripple { - background: radial-gradient( - circle, - rgba(var(--background-color), 0.3) 0%, - rgba(0, 0, 0, 0) 50% - ); - } -} -.ripple { - height: 8rem; - width: 8rem; - position: absolute; - border-radius: 50%; - transform: scale(0); - background: radial-gradient( - circle, - rgba(var(--text-color), 0.3) 0%, - rgba(0, 0, 0, 0) 50% - ); - pointer-events: none; -} -.interact { - position: relative; - overflow: hidden; - cursor: pointer; - -webkit-tap-highlight-color: transparent; -} -.empty-state { - display: grid; - width: 100%; - padding: 1.5rem 0; -} - -.observe-empty-state:empty { - display: none !important; -} - -.observe-empty-state:not(:empty) + .empty-state { - display: none !important; -} - -.bullet-point { - display: flex; - align-items: center; - justify-content: center; - margin: 0 0.8ch; - &::after { - content: ""; - height: 0.4ch; - width: 0.4ch; - border-radius: 0.5em; - background-color: var(--accent-color); - } -} - -.icon-button { - padding: 0.6rem; - border-radius: 0.8rem; - background-color: rgba(var(--text-color), 0.1); - height: max-content; - .icon { - fill: var(--accent-color); - } -} -.page { - height: 100%; - &__header { - position: sticky; + content: attr(data-notifications); + position: absolute; top: 0; - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 1rem; - margin-bottom: 1.5rem; - background-color: rgba(var(--foreground-color), 1); - z-index: 1; - } -} -#confirmation_popup, -#prompt_popup { - flex-direction: column; - - h4 { - margin-bottom: 0.5rem; - } - - .flex { - margin-top: 1rem; - } -} -#prompt_message { - margin-bottom: 1.5rem; -} - -.popup__header { - position: relative; - display: grid; - gap: 0.5rem; - width: 100%; - padding: 0 1.5rem 0 0.5rem; - align-items: center; - grid-template-columns: auto 1fr; - & > * { - grid-row: 1; - } - h3, - h4 { - grid-column: 1/-1; - justify-self: center; - align-self: center; - } - &__close { - grid-column: 1; - } -} -.flo-icon { - margin-right: 0.3rem; - height: 1.5rem; - width: 1.5rem; -} -#secondary_pages { - display: flex; - flex-direction: column; - width: 100%; - header { - padding: 1.5rem; + right: 0; + font-size: 0.8rem; + padding: 0.1rem 0.3rem; + background: var(--danger-color); + color: rgba(var(--background-color), 1); + aspect-ratio: 1/1; + font-weight: 700; + border-radius: 0.3rem; } .inner-page { - height: 100%; - } -} -#landing { - & > section { - justify-content: center; - justify-items: center; - align-items: center; - text-align: center; - padding: 8vw 0; - } - h1 { - font-size: clamp(2rem, 5vw, 5rem); - } -} - -#sign_in, -#sign_up { - justify-content: center; - align-items: center; - sm-form { - margin: 2rem 0; - } -} -#sign_in { - display: grid; - align-content: center; - padding: 0; - justify-items: center; - .illustration { - height: auto; - background-color: #4d77ff; - border-radius: 1rem; - width: min(24rem, 100%); - } - section { - width: min(24rem, 100%); - background-color: rgba(var(--foreground-color), 1); - padding: max(1.5rem, 2vw); - border-radius: 0.5rem; - margin-top: -1.6rem; - } -} -#sign_up { - justify-items: center; - align-content: center; - keys-generator { - width: min(26rem, 100%); - margin-top: -4rem; - } - .h2 { - margin-bottom: 0.5rem; - } -} -#main_header { - display: grid; - gap: 1rem; - padding: 1rem; - align-items: center; - grid-template-columns: minmax(0, 1fr) auto auto; - min-height: 4rem; - flex-shrink: 0; -} -#user_profile_button { - background-color: var(--blue-accent-1); - border-radius: 2rem; - font-size: 0.8rem; - padding: 0.6rem 0.8rem; - font-weight: 700; - min-width: 0; -} -#notifications_wrapper { - position: relative; -} -#notifications_panel { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 10; - background-color: rgba(var(--foreground-color), 1); - padding: 1rem; -} -.logged-in-user-id { - background-color: rgba(var(--text-color), 0.06); - max-width: fit-content; - padding: 0.4rem 0.8rem 0.4rem 0.5rem; - border-radius: 2rem; - font-weight: 500; -} -#main_card { - position: relative; - display: flex; - flex-direction: column; - height: 100%; - width: 100%; - transition: background-color 0.3s; - &.nav-hidden { - .inner-page { - grid-area: 2/1/3/-1; - } - } -} -.badge { - display: flex; - align-items: center; - justify-content: center; - content: attr(data-notifications); - position: absolute; - top: 0; - right: 0; - font-size: 0.8rem; - padding: 0.1rem 0.3rem; - background: var(--danger-color); - color: rgba(var(--background-color), 1); - aspect-ratio: 1/1; - font-weight: 700; - border-radius: 0.3rem; -} -.inner-page { - display: flex; - flex-direction: column; - padding: 0 1rem; - flex: 1; - align-content: start; - overflow-y: auto; -} - -.password-field { - label { display: flex; - justify-content: center; - input:checked ~ .visible { - display: none; - } - input:not(:checked) ~ .invisible { - display: none; + flex-direction: column; + padding: 0 1rem; + flex: 1; + align-content: start; + overflow-y: auto; + } + + .password-field { + label { + display: flex; + justify-content: center; + input:checked ~ .visible { + display: none; + } + input:not(:checked) ~ .invisible { + display: none; + } } } -} -.multi-state-button { - display: grid; - text-align: center; - align-items: center; - justify-items: center; - & > * { - grid-area: 1/1/2/2; + .multi-state-button { + display: grid; + text-align: center; + align-items: center; + justify-items: center; + & > * { + grid-area: 1/1/2/2; + } + button { + z-index: 1; + } } - button { - z-index: 1; + .scrolling-wrapper { + overflow-y: auto; } -} -.scrolling-wrapper { - overflow-y: auto; -} -#home { - position: relative; - display: grid; - padding: 0; - gap: 3rem; - overflow-y: visible; - align-content: initial; - transition: filter 0.3s; - & > * { + #home { + position: relative; + display: grid; + padding: 0; + gap: 3rem; + overflow-y: visible; + align-content: initial; + transition: filter 0.3s; + & > * { + align-content: flex-start; + } + } + #wallet_section { + position: relative; + display: flex; + flex-direction: column; + height: 100%; + gap: 1.5rem; + background-color: rgba(var(--accent-color-rgb), 0.02); + sm-chips { + display: flex; + justify-content: center; + } + sm-chip::part(chip) { + width: 8rem; + justify-content: center; + } + > * { + width: 100%; + + } + &::before { + content: ""; + position: absolute; + top: -10vmax; + left: 0; + width: 100%; + height: 10vmax; + background-color: inherit; + pointer-events: none; + } + } + #user, + #cashier { + position: relative; + padding-bottom: 1rem; align-content: flex-start; } -} -#wallet_section { - position: relative; - display: flex; - flex-direction: column; - height: 100%; - gap: 1.5rem; - background-color: rgba(var(--accent-color-rgb), 0.02); - sm-chips { - display: flex; - justify-content: center; + #cashier { + padding: 1rem 0; } - sm-chip::part(chip) { - width: 8rem; - justify-content: center; - } - > * { - width: 100%; - } - &::before { - content: ""; - position: absolute; - top: -10vmax; - left: 0; - width: 100%; - height: 10vmax; - background-color: inherit; - pointer-events: none; - } -} -#user, -#cashier { - position: relative; - padding-bottom: 1rem; - align-content: flex-start; -} -#cashier { - padding: 1rem 0; -} -#wallet_cards_wrapper { - display: grid; - grid-template-columns: 6rem 1fr; - background-color: rgba(var(--text-color), 0.06); - border-radius: 0.5rem; - padding: 0 0.2rem; - sm-input { - --background: transparent; - } - sm-select { - margin: 0.2rem 0; - --background: rgba(var(--foreground-color), 1); - &[open] { - z-index: 10; + #wallet_cards_wrapper { + display: grid; + grid-template-columns: 6rem 1fr; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.5rem; + padding: 0 0.2rem; + sm-input { + --background: transparent; + } + sm-select { + margin: 0.2rem 0; + --background: rgba(var(--foreground-color), 1); + &[open] { + z-index: 10; + } } } -} -.balance-card { - background-color: rgba(var(--accent-color-rgb), 0.06); - border-radius: 0.5rem; - padding: 0.8rem; - font-size: 0.9rem; - & > * { - font-weight: 500; + .balance-card { + background-color: rgba(var(--accent-color-rgb), 0.06); + border-radius: 0.5rem; + padding: 0.8rem; + font-size: 0.9rem; + & > * { + font-weight: 500; + } } -} -#rupee_balance, -#flo_balance, -#btc_balance { - span:first-of-type { - font-size: 1.5rem; + #rupee_balance, + #flo_balance, + #btc_balance { + span:first-of-type { + font-size: 1.5rem; + } + span:nth-of-type(2) { + font-size: 1rem; + } } - span:nth-of-type(2) { - font-size: 1rem; + .actions-wrapper { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr)); + gap: 1rem 0.5rem; } -} -.actions-wrapper { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr)); - gap: 1rem 0.5rem; -} -.wallet-action, -.integrated-action-button { - position: relative; - color: inherit; - font-weight: 500; - font-size: 0.9rem; - .icon:first-of-type { - height: 3rem; - width: 3rem; - padding: 0.95rem; - overflow: visible; - fill: var(--accent-color); - border-radius: 2rem; - background-color: var(--blue-accent-2); - } - .badge { - left: 0; - right: auto; - } -} -.wallet-action { - gap: 0.5rem; - flex-direction: column; - align-items: center; - font-size: 0.8rem; - white-space: initial; - border-radius: 0.5rem; - padding: 0; - min-width: 0; -} -.integrated-action-button { - padding: 0; - justify-content: flex-start; - .icon:first-of-type { - margin-right: 1rem; - } - span:last-of-type { - font-size: 1rem; - } -} -.cashier-status { - font-size: 0.9rem; - padding: 1rem 1.2rem; - border-radius: 1rem; - background-color: rgb(240, 230, 140, 0.8); - color: rgba(0, 0, 0, 0.8); - .icon { - fill: rgba(0, 0, 0, 0.8); - } -} -#topup_wallet__qr_code { - background-color: rgba(var(--text-color), 0.03); - border-radius: 0.5rem; - height: 10rem; - justify-self: flex-start; - width: 10rem; - svg { - width: 100%; - height: 100%; - fill: rgba(var(--text-color), 1); - } -} -#cashier_status { - font-size: 0.9rem; - padding: 1rem 1.2rem; - border-radius: 1rem; - background-color: rgb(240, 230, 140, 0.8); - color: rgba(0, 0, 0, 0.8); - .icon { - fill: rgba(0, 0, 0, 0.8); - } -} - -.remove-card-wrapper { - min-height: 2rem; -} -#selected_fee_tip, -#error_section { - font-weight: 500; -} -.error { - color: var(--danger-color); - .icon { - fill: var(--danger-color); - } -} -#send_fee_wrapper { - display: grid; - & > * { - grid-area: 1/1; - } -} -#send_fee_loader { - background-color: rgba(var(--foreground-color), 1); - z-index: 1; - width: 100%; -} -.receiver-card { - display: grid; - gap: 0.5rem; - padding: 0.5rem 0; - border: none; - &:not(:last-of-type) { - border-bottom: solid thin rgba(var(--text-color), 0.3); - } -} - -#contacts { - position: relative; - padding-bottom: 6rem; -} -#recent_contacts { - gap: 0; -} -#saved_ids_list { - display: grid; - gap: 0.5rem 1rem; - grid-template-columns: minmax(0, 1fr); - margin-bottom: 1.5rem; -} -.saved-id { - align-items: center; - grid-template-columns: auto 1fr; - gap: 0 1rem; - padding: 0.5rem 0; - user-select: none; - border-radius: 0.5rem; - &.highlight { - box-shadow: 0 0 0.1rem 0.1rem var(--accent-color) inset; - } - .edit-saved { - padding: 0.3rem; + .wallet-action, + .integrated-action-button { position: relative; + color: inherit; + font-weight: 500; + font-size: 0.9rem; + .icon:first-of-type { + height: 3rem; + width: 3rem; + padding: 0.95rem; + overflow: visible; + fill: var(--accent-color); + border-radius: 2rem; + background-color: var(--blue-accent-2); + } + .badge { + left: 0; + right: auto; + } } - &__initials { - display: flex; + .wallet-action { + gap: 0.5rem; + flex-direction: column; align-items: center; - justify-content: center; - height: 2.5rem; - width: 2.5rem; - font-size: 1.2rem; - text-transform: uppercase; - color: var(--accent-color); - font-weight: 700; - line-height: 1; - background-color: rgba(var(--text-color), 0.03); - border-radius: 2rem; - grid-area: 1/1/3/2; + font-size: 0.8rem; + white-space: initial; + border-radius: 0.5rem; + padding: 0; + min-width: 0; } - &__title { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + .integrated-action-button { + padding: 0; + justify-content: flex-start; + .icon:first-of-type { + margin-right: 1rem; + } + span:last-of-type { + font-size: 1rem; + } + } + .cashier-status { + font-size: 0.9rem; + padding: 1rem 1.2rem; + border-radius: 1rem; + background-color: rgb(240, 230, 140, 0.8); + color: rgba(0, 0, 0, 0.8); + .icon { + fill: rgba(0, 0, 0, 0.8); + } + } + #topup_wallet__qr_code { + background-color: rgba(var(--text-color), 0.03); + border-radius: 0.5rem; + height: 10rem; + justify-self: flex-start; + width: 10rem; + svg { + width: 100%; + height: 100%; + fill: rgba(var(--text-color), 1); + } + } + #cashier_status { + font-size: 0.9rem; + padding: 1rem 1.2rem; + border-radius: 1rem; + background-color: rgb(240, 230, 140, 0.8); + color: rgba(0, 0, 0, 0.8); + .icon { + fill: rgba(0, 0, 0, 0.8); + } + } + + .remove-card-wrapper { + min-height: 2rem; + } + #selected_fee_tip, + #error_section { font-weight: 500; } - &__flo-id { - font-size: 0.8rem; + .error { + color: var(--danger-color); + .icon { + fill: var(--danger-color); + } } - &__copy { - padding: 0.3rem 0.5rem; - border-radius: 0.3rem; - background-color: rgba(var(--text-color), 0.03); + #send_fee_wrapper { + display: grid; + & > * { + grid-area: 1/1; + } } -} -#saved_ids_tip { - background-color: rgba(var(--text-color), 0.03); - border-radius: 2rem; - padding: 0.5rem 0.8rem 0.5rem 0.5rem; -} - -.card { - background-color: rgba(var(--foreground-color), 1); - border-radius: 0.5rem; - padding: 1rem; -} -#contact { - display: grid; - grid-template-rows: auto 1fr auto; - padding: 0; - height: 100%; - & > * { - padding: 1rem 1.5rem; + #send_fee_loader { + background-color: rgba(var(--foreground-color), 1); + z-index: 1; + width: 100%; } - & > :first-child { - padding-top: 0; + .receiver-card { + display: grid; + gap: 0.5rem; + padding: 0.5rem 0; + border: none; + &:not(:last-of-type) { + border-bottom: solid thin rgba(var(--text-color), 0.3); + } } - & > :last-child { - padding: 0.5rem 1.5rem; - border-top: solid thin rgba(var(--text-color), 0.2); - button { - padding: 0.8rem 2rem; - border-radius: 1rem; + + #contacts { + position: relative; + padding-bottom: 6rem; + } + #recent_contacts { + gap: 0; + } + #saved_ids_list { + display: grid; + gap: 0.5rem 1rem; + grid-template-columns: minmax(0, 1fr); + margin-bottom: 1.5rem; + } + .saved-id { + align-items: center; + grid-template-columns: auto 1fr; + gap: 0 1rem; + padding: 0.5rem 0; + user-select: none; + border-radius: 0.5rem; + &.highlight { + box-shadow: 0 0 0.1rem 0.1rem var(--accent-color) inset; + } + .edit-saved { + padding: 0.3rem; + position: relative; + } + &__initials { + display: flex; + align-items: center; + justify-content: center; + height: 2.5rem; + width: 2.5rem; + font-size: 1.2rem; + text-transform: uppercase; color: var(--accent-color); + font-weight: 700; + line-height: 1; + background-color: rgba(var(--text-color), 0.03); + border-radius: 2rem; + grid-area: 1/1/3/2; + } + &__title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-weight: 500; + } + &__flo-id { + font-size: 0.8rem; + } + &__copy { + padding: 0.3rem 0.5rem; + border-radius: 0.3rem; background-color: rgba(var(--text-color), 0.03); } } -} -#contact__transactions { - position: relative; - display: grid; - gap: 0.5rem; - overflow-y: auto; - flex: 1; - padding: 0 max(1rem, 8vw) 1rem max(1rem, 8vw); - align-content: flex-start; - sm-spinner { - position: absolute; - justify-self: center; - align-self: center; - } -} -.transaction-message { - background-color: rgba(var(--text-color), 0.06); - padding: 1rem; - border-radius: 0.5rem; - justify-self: flex-start; - border-radius: 0 1rem 1rem 1rem; - gap: 0.5rem; - &.received { - background-color: var(--accent-color); - color: rgba(var(--background-color), 1); - & + & { - border-radius: 1rem; - } - } - &.sent { - margin-left: auto; - justify-self: flex-end; - border-radius: 1rem 1rem 0 1rem; - text-align: right; - } - - &__amount { - font-size: 1.2rem; - } - &__time { - opacity: 0.8; - font-size: 0.8rem; - } -} -#history_applied_filters { - padding: 0.2rem 0 0.5rem 0; -} -.applied-filter { - display: flex; - align-items: center; - padding: 0.5rem 0.6rem 0.5rem 0.8rem; - border-radius: 0.5rem; - border: solid thin rgba(var(--text-color), 0.2); - text-transform: uppercase; - font-size: 0.8rem; - font-weight: 500; - letter-spacing: 0.08em; - button { - padding: 0.6rem; - } - .icon { - margin-left: 0.3rem; - } -} -fieldset { - border: none; - padding: 0; - margin: 0; - legend { - font-size: 0.8rem; - font-weight: 500; - margin-bottom: 0.5rem; - } -} -.category-chip { - display: inline-flex; - align-items: center; - justify-content: center; - padding: 0.3rem 0.5rem; - border-radius: 0.3rem; - font-size: 0.8rem; - border: solid thin rgba(var(--text-color), 0.2); - font-weight: 700; - input { - display: none; - } - span { - transition: transform 0.2s; - transform: translateX(-0.8rem); - } - .icon { - opacity: 0; - transition: opacity 0.2s, transform 0.2s; - margin-right: 0.3rem; - fill: var(--accent-color); - transform: translateX(0.5rem); - } - input:checked ~ .icon { - opacity: 1; - transform: translateX(0); - } - input:checked ~ span { - color: var(--accent-color); - transform: translateX(0); - } -} - -#wallet_history_wrapper { - margin-top: 1.5rem; - padding-bottom: 3rem; -} -#payments_history { - display: grid; - gap: 2rem; - margin-top: 1.5rem; - padding-bottom: 6rem; -} -.transaction { - grid-template-columns: auto 1fr auto; - gap: 0.5rem 1rem; - align-items: flex-start; - .button { - min-width: auto; - white-space: normal; - text-align: start; - } - &.sent { - .icon--tx-type { - fill: var(--danger-color); - } - .transaction__amount { - color: var(--danger-color); - &::before { - content: "- "; - } - } - } - &.received { - .icon--tx-type { - fill: var(--green); - } - .transaction__amount { - color: var(--green); - &::before { - content: "+ "; - } - } - } - &__icon { - position: relative; - display: grid; - align-items: center; - justify-content: center; - width: 2.5rem; - height: 2.5rem; + #saved_ids_tip { background-color: rgba(var(--text-color), 0.03); border-radius: 2rem; - & > * { - grid-area: 1/1; - } - .icon--tx-type { - position: absolute; - background-color: inherit; - right: -0.3rem; - bottom: -0.3rem; - border-radius: 1rem; - padding: 0.2rem; - height: 1.5rem; - width: 1.5rem; - border: solid medium rgba(var(--foreground-color), 1); - } + padding: 0.5rem 0.8rem 0.5rem 0.5rem; } - &__receiver { - font-size: 0.9rem; - font-weight: 500; - } - &__time { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); - } - &__amount { - font-size: 0.9rem; - font-weight: 500; - white-space: nowrap; - } -} -.btc-tx { - display: grid; - grid-template-columns: auto minmax(0, 1fr); - gap: 0.5rem 1rem; - align-items: flex-start; - .button { - min-width: auto; - white-space: normal; - text-align: start; - } - &.out { - .icon--tx-type { - fill: var(--danger-color); - } - .btc-tx__amount { - color: var(--danger-color); - &::before { - content: "- "; - } - } - } - &.in { - .icon--tx-type { - fill: var(--green); - } - .btc-tx__amount { - color: var(--green); - &::before { - content: "+ "; - } - } - } - &.unconfirmed-tx { - .icon { - fill: var(--yellow); - } - } - &__icon { - position: relative; - display: grid; - align-items: center; - justify-content: center; - width: 2.5rem; - height: 2.5rem; - background-color: rgba(var(--text-color), 0.03); - border-radius: 2rem; - & > * { - grid-area: 1/1; - } - .icon--tx-type { - position: absolute; - background-color: inherit; - right: -0.3rem; - bottom: -0.3rem; - border-radius: 1rem; - padding: 0.2rem; - height: 1.5rem; - width: 1.5rem; - border: solid medium rgba(var(--foreground-color), 1); - } - } - &__receiver { - font-size: 0.9rem; - font-weight: 500; - } - &__time { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); - } - &__amount { - font-size: 0.9rem; - font-weight: 500; - white-space: nowrap; - } - &__id { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); - } - .pending-badge { - font-size: 0.8rem; - padding: 0.2rem 0.5rem; + + .card { + background-color: rgba(var(--foreground-color), 1); border-radius: 0.5rem; - background-color: var(--yellow); - color: rgba(var(--foreground-color), 1); - font-weight: 500; - align-self: flex-start; - } -} -.fab { - position: absolute; - right: 0; - bottom: 0; - margin: 1.5rem; - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); - z-index: 2; -} -#scroll_to_top { - border-radius: 3rem; - background-color: rgba(var(--foreground-color), 1); -} -.user-action-result__icon { - justify-self: center; - height: 4rem; - width: 4rem; - border-radius: 5rem; - margin-bottom: 2rem; - animation: popup 1s; - &.success { - fill: rgba(var(--background-color), 1); padding: 1rem; - background-color: #0bbe56; } - &.failed { - background-color: rgba(var(--text-color), 0.03); - fill: var(--danger-color); + #contact { + display: grid; + grid-template-rows: auto 1fr auto; + padding: 0; + height: 100%; + & > * { + padding: 1rem 1.5rem; + } + & > :first-child { + padding-top: 0; + } + & > :last-child { + padding: 0.5rem 1.5rem; + border-top: solid thin rgba(var(--text-color), 0.2); + button { + padding: 0.8rem 2rem; + border-radius: 1rem; + color: var(--accent-color); + background-color: rgba(var(--text-color), 0.03); + } + } } -} -@keyframes popup { - 0% { - opacity: 0; - transform: scale(0.2) translateY(600%); + #contact__transactions { + position: relative; + display: grid; + gap: 0.5rem; + overflow-y: auto; + flex: 1; + padding: 0 max(1rem, 8vw) 1rem max(1rem, 8vw); + align-content: flex-start; + sm-spinner { + position: absolute; + justify-self: center; + align-self: center; + } } - 10% { - transform: scale(0.2) translateY(5rem); - opacity: 1; + .transaction-message { + background-color: rgba(var(--text-color), 0.06); + padding: 1rem; + border-radius: 0.5rem; + justify-self: flex-start; + border-radius: 0 1rem 1rem 1rem; + gap: 0.5rem; + &.received { + background-color: var(--accent-color); + color: rgba(var(--background-color), 1); + & + & { + border-radius: 1rem; + } + } + &.sent { + margin-left: auto; + justify-self: flex-end; + border-radius: 1rem 1rem 0 1rem; + text-align: right; + } + + &__amount { + font-size: 1.2rem; + } + &__time { + opacity: 0.8; + font-size: 0.8rem; + } } - 40% { - transform: scale(0.2) translateY(0); + #history_applied_filters { + padding: 0.2rem 0 0.5rem 0; } - 80% { - transform: scale(1.1) translateY(0); - } - 100% { - transform: scale(1) translateY(0); - } -} - -.cashier-request, -.payment-request { - display: flex; - gap: 1rem; - align-items: center; - padding: 1rem; - border-radius: 0.3rem; - background-color: rgba(var(--foreground-color), 1); - &:not(:last-of-type) { - margin-bottom: 0.5rem; - } - &__mode { - text-align: center; - width: 2rem; - font-size: 0.8rem; - } - &__time { - font-size: 0.8rem; - } -} -.cashier-request { - display: grid; - gap: 0.5rem 1rem; - padding: 1rem 0; - grid-template-columns: auto 1fr auto; - grid-template-areas: "mode details status" "mode . status"; - &__mode { - grid-area: mode; - } - &__details { - grid-area: details; - font-weight: 700; - } - &__status, - &__requestor { - font-size: 0.8rem; - } - &__status { - grid-area: status; - grid-column: 3/4; - grid-row: 1/3; - } -} -#payment_request_history { - padding-bottom: 3rem; - .payment-request { - margin: 0 -1rem; - } -} -.payment-request { - display: grid; - gap: 0.5rem 1rem; - grid-template-columns: 1fr auto; - color: rgba(var(--text-color), 1); - &__requestor { - font-weight: 500; - } - &__amount { - font-weight: 700; - text-align: right; - } - &__status { + .applied-filter { display: flex; align-items: center; + padding: 0.5rem 0.6rem 0.5rem 0.8rem; + border-radius: 0.5rem; + border: solid thin rgba(var(--text-color), 0.2); + text-transform: uppercase; font-size: 0.8rem; - text-transform: capitalize; + font-weight: 500; + letter-spacing: 0.08em; + button { + padding: 0.6rem; + } .icon { - height: 1rem; - width: 1rem; margin-left: 0.3rem; } } - .icon.paid { - fill: var(--green); - } - .icon.declined { - fill: var(--danger-color); - } - .button { - background-color: transparent; - padding: 0.6rem 0.8rem; - color: var(--accent-color); - background-color: rgba(var(--foreground-color), 1); - } - &--pending { + fieldset { + border: none; padding: 0; + margin: 0; + legend { + font-size: 0.8rem; + font-weight: 500; + margin-bottom: 0.5rem; + } } -} -.wallet-request { - display: grid; - gap: 0.5rem 1rem; - padding: 0.5rem 0; - border-radius: 0.5rem; - grid-template-columns: auto 1fr; - &:not(.rejected, .pending) { - &.withdrawn { - .wallet-request__amount { + .category-chip { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0.3rem 0.5rem; + border-radius: 0.3rem; + font-size: 0.8rem; + border: solid thin rgba(var(--text-color), 0.2); + font-weight: 700; + input { + display: none; + } + span { + transition: transform 0.2s; + transform: translateX(-0.8rem); + } + .icon { + opacity: 0; + transition: opacity 0.2s, transform 0.2s; + margin-right: 0.3rem; + fill: var(--accent-color); + transform: translateX(0.5rem); + } + input:checked ~ .icon { + opacity: 1; + transform: translateX(0); + } + input:checked ~ span { + color: var(--accent-color); + transform: translateX(0); + } + } + + #wallet_history_wrapper { + margin-top: 1.5rem; + padding-bottom: 3rem; + } + #payments_history { + display: grid; + gap: 2rem; + margin-top: 1.5rem; + padding-bottom: 6rem; + } + .transaction { + grid-template-columns: auto 1fr auto; + gap: 0.5rem 1rem; + align-items: flex-start; + .button { + min-width: auto; + white-space: normal; + text-align: start; + } + &.sent { + .icon--tx-type { + fill: var(--danger-color); + } + .transaction__amount { + color: var(--danger-color); &::before { content: "- "; } } } - &.added { - .wallet-request__amount { + &.received { + .icon--tx-type { + fill: var(--green); + } + .transaction__amount { color: var(--green); &::before { content: "+ "; } } } - } - .icon.pending { - fill: var(--yellow); - } - .icon.failed { - fill: var(--danger-color); - } - &__icon { - display: flex; - align-items: center; - justify-content: center; - grid-area: 1/1/3/2; - width: 2.5rem; - height: 2.5rem; - border-radius: 2rem; - background-color: rgba(var(--text-color), 0.06); - .icon { - fill: var(--accent-color); - } - } - &__details { - font-weight: 500; - } - &__details, - &__amount { - color: rgba(var(--text-color), 1); - } - &__amount { - font-weight: 700; - } - &__time, - &__status { - font-size: 0.8rem; - color: rgba(var(--text-color), 0.8); - } - &__status { - text-align: right; - .icon { - margin-left: 0.3rem; - } - } -} -#transaction__amount { - font-size: 2.5rem; - font-weight: 700; -} -#transaction__remark, -#transaction__note { - line-height: 1.6; - justify-self: flex-start; - background-color: rgba(var(--text-color), 0.06); - border-radius: 0.5rem; - padding: 0.8rem; -} -#transaction__note { - .icon { - fill: var(--danger-color); - margin-right: 0.5rem; - } -} -#saved_upi_ids_list { - display: grid; - gap: 0.5rem; - width: min(24rem, 100%); -} -.saved-upi { - display: flex; - justify-content: space-between; - align-items: center; - padding: 0.4rem 0.4rem 0.4rem 1rem; - border-radius: 0.5rem; - background-color: rgba(var(--text-color), 0.03); -} - -#convert_asset_popup { - .error-icon { - height: 3rem; - width: 3rem; - fill: var(--danger-color); - } -} -#conversion_status { - padding-bottom: 1.5rem; -} -.amount-option { - display: flex; - gap: 0.5rem; - padding: 0.5rem 0.6rem; - border-radius: 0.3rem; - background-color: rgba(var(--text-color), 0.06); - cursor: pointer; - accent-color: var(--accent-color); - font-size: 0.9rem; - font-weight: 500; -} -@media screen and (max-width: 40rem) { - #home { - &.is-sub-admin { - align-content: flex-start; - } - &:not(.is-sub-admin) { - padding-bottom: 3rem; - } - > * { - padding: 0 1rem; - } - } - #wallet_section { - padding-bottom: 1.5rem; - } - .integrated-action-button { - .icon:last-of-type { - margin-left: auto; - } - } - #bottom_nav { - position: fixed; - bottom: 0; - left: 0; - right: 0; - z-index: 5; - background-color: rgba(var(--foreground-color), 1); - ul { - display: flex; - justify-content: space-between; + &__icon { + position: relative; + display: grid; align-items: center; - li { - flex: 1; + justify-content: center; + width: 2.5rem; + height: 2.5rem; + background-color: rgba(var(--text-color), 0.03); + border-radius: 2rem; + & > * { + grid-area: 1/1; + } + .icon--tx-type { + position: absolute; + background-color: inherit; + right: -0.3rem; + bottom: -0.3rem; + border-radius: 1rem; + padding: 0.2rem; + height: 1.5rem; + width: 1.5rem; + border: solid medium rgba(var(--foreground-color), 1); } } + &__receiver { + font-size: 0.9rem; + font-weight: 500; + } + &__time { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + } + &__amount { + font-size: 0.9rem; + font-weight: 500; + white-space: nowrap; + } } - .nav-item { + .btc-tx { + display: grid; + grid-template-columns: auto minmax(0, 1fr); + gap: 0.5rem 1rem; + align-items: flex-start; + .button { + min-width: auto; + white-space: normal; + text-align: start; + } + &.out { + .icon--tx-type { + fill: var(--danger-color); + } + .btc-tx__amount { + color: var(--danger-color); + &::before { + content: "- "; + } + } + } + &.in { + .icon--tx-type { + fill: var(--green); + } + .btc-tx__amount { + color: var(--green); + &::before { + content: "+ "; + } + } + } + &.unconfirmed-tx { + .icon { + fill: var(--yellow); + } + } + &__icon { + position: relative; + display: grid; + align-items: center; + justify-content: center; + width: 2.5rem; + height: 2.5rem; + background-color: rgba(var(--text-color), 0.03); + border-radius: 2rem; + & > * { + grid-area: 1/1; + } + .icon--tx-type { + position: absolute; + background-color: inherit; + right: -0.3rem; + bottom: -0.3rem; + border-radius: 1rem; + padding: 0.2rem; + height: 1.5rem; + width: 1.5rem; + border: solid medium rgba(var(--foreground-color), 1); + } + } + &__receiver { + font-size: 0.9rem; + font-weight: 500; + } + &__time { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + } + &__amount { + font-size: 0.9rem; + font-weight: 500; + white-space: nowrap; + } + &__id { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + } + .pending-badge { + font-size: 0.8rem; + padding: 0.2rem 0.5rem; + border-radius: 0.5rem; + background-color: var(--yellow); + color: rgba(var(--foreground-color), 1); + font-weight: 500; + align-self: flex-start; + } + } + .fab { + position: absolute; + right: 0; + bottom: 0; + margin: 1.5rem; + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); + z-index: 2; + } + #scroll_to_top { + border-radius: 3rem; + background-color: rgba(var(--foreground-color), 1); + } + .user-action-result__icon { + justify-self: center; + height: 4rem; + width: 4rem; + border-radius: 5rem; + margin-bottom: 2rem; + animation: popup 1s; + &.success { + fill: rgba(var(--background-color), 1); + padding: 1rem; + background-color: #0bbe56; + } + &.failed { + background-color: rgba(var(--text-color), 0.03); + fill: var(--danger-color); + } + } + @keyframes popup { + 0% { + opacity: 0; + transform: scale(0.2) translateY(600%); + } + 10% { + transform: scale(0.2) translateY(5rem); + opacity: 1; + } + 40% { + transform: scale(0.2) translateY(0); + } + 80% { + transform: scale(1.1) translateY(0); + } + 100% { + transform: scale(1) translateY(0); + } + } + + .cashier-request, + .payment-request { display: flex; - flex-direction: column; - gap: 0.3rem; + gap: 1rem; align-items: center; - padding: 0.5rem; - font-size: 0.8rem; - flex: 1; - color: inherit; - font-weight: 500; - &--active { + padding: 1rem; + border-radius: 0.3rem; + background-color: rgba(var(--foreground-color), 1); + &:not(:last-of-type) { + margin-bottom: 0.5rem; + } + &__mode { + text-align: center; + width: 2rem; + font-size: 0.8rem; + } + &__time { + font-size: 0.8rem; + } + } + .cashier-request { + display: grid; + gap: 0.5rem 1rem; + padding: 1rem 0; + grid-template-columns: auto 1fr auto; + grid-template-areas: "mode details status" "mode . status"; + &__mode { + grid-area: mode; + } + &__details { + grid-area: details; + font-weight: 700; + } + &__status, + &__requestor { + font-size: 0.8rem; + } + &__status { + grid-area: status; + grid-column: 3/4; + grid-row: 1/3; + } + } + #payment_request_history { + padding-bottom: 3rem; + .payment-request { + margin: 0 -1rem; + } + } + .payment-request { + display: grid; + gap: 0.5rem 1rem; + grid-template-columns: 1fr auto; + color: rgba(var(--text-color), 1); + &__requestor { + font-weight: 500; + } + &__amount { + font-weight: 700; + text-align: right; + } + &__status { + display: flex; + align-items: center; + font-size: 0.8rem; + text-transform: capitalize; + .icon { + height: 1rem; + width: 1rem; + margin-left: 0.3rem; + } + } + .icon.paid { + fill: var(--green); + } + .icon.declined { + fill: var(--danger-color); + } + .button { + background-color: transparent; + padding: 0.6rem 0.8rem; color: var(--accent-color); + background-color: rgba(var(--foreground-color), 1); + } + &--pending { + padding: 0; + } + } + .wallet-request { + display: grid; + gap: 0.5rem 1rem; + padding: 0.5rem 0; + border-radius: 0.5rem; + grid-template-columns: auto 1fr; + &:not(.rejected, .pending) { + &.withdrawn { + .wallet-request__amount { + &::before { + content: "- "; + } + } + } + &.added { + .wallet-request__amount { + color: var(--green); + &::before { + content: "+ "; + } + } + } + } + .icon.pending { + fill: var(--yellow); + } + .icon.failed { + fill: var(--danger-color); + } + &__icon { + display: flex; + align-items: center; + justify-content: center; + grid-area: 1/1/3/2; + width: 2.5rem; + height: 2.5rem; + border-radius: 2rem; + background-color: rgba(var(--text-color), 0.06); .icon { fill: var(--accent-color); } } - } - .integrated-action-button { - .icon:last-of-type { - margin-left: auto; + &__details { + font-weight: 500; + } + &__details, + &__amount { + color: rgba(var(--text-color), 1); + } + &__amount { + font-weight: 700; + } + &__time, + &__status { + font-size: 0.8rem; + color: rgba(var(--text-color), 0.8); + } + &__status { + text-align: right; + .icon { + margin-left: 0.3rem; + } } } - .hide-on-mobile { - display: none; + #transaction__amount { + font-size: 2.5rem; + font-weight: 700; } -} -@media screen and (min-width: 40rem) { - sm-popup { - --width: 24rem; + #transaction__remark, + #transaction__note { + line-height: 1.6; + justify-self: flex-start; + background-color: rgba(var(--text-color), 0.06); + border-radius: 0.5rem; + padding: 0.8rem; } - .popup__header { - padding: 1.5rem 1.5rem 0 0.75rem; + #transaction__note { + .icon { + fill: var(--danger-color); + margin-right: 0.5rem; + } } - body { + #saved_upi_ids_list { + display: grid; + gap: 0.5rem; + width: min(24rem, 100%); + } + .saved-upi { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0.4rem 0.4rem 0.4rem 1rem; + border-radius: 0.5rem; + background-color: rgba(var(--text-color), 0.03); + } + + #convert_asset_popup { + .error-icon { + height: 3rem; + width: 3rem; + fill: var(--danger-color); + } + } + #conversion_status { + padding-bottom: 1.5rem; + } + .amount-option { + display: flex; + gap: 0.5rem; + padding: 0.5rem 0.6rem; + border-radius: 0.3rem; + background-color: rgba(var(--text-color), 0.06); + cursor: pointer; + accent-color: var(--accent-color); + font-size: 0.9rem; + font-weight: 500; + } + @media screen and (max-width: 40rem) { + #home { + &.is-sub-admin { + align-content: flex-start; + } + &:not(.is-sub-admin) { + padding-bottom: 3rem; + } + > * { + padding: 0 1rem; + } + } + #wallet_section { + padding-bottom: 1.5rem; + } + .integrated-action-button { + .icon:last-of-type { + margin-left: auto; + } + } + #bottom_nav { + position: fixed; + bottom: 0; + left: 0; + right: 0; + z-index: 5; + background-color: rgba(var(--foreground-color), 1); + ul { + display: flex; + justify-content: space-between; + align-items: center; + li { + flex: 1; + } + } + } + .nav-item { + display: flex; + flex-direction: column; + gap: 0.3rem; + align-items: center; + padding: 0.5rem; + font-size: 0.8rem; + flex: 1; + color: inherit; + font-weight: 500; + &--active { + color: var(--accent-color); + .icon { + fill: var(--accent-color); + } + } + } + .integrated-action-button { + .icon:last-of-type { + margin-left: auto; + } + } + .hide-on-mobile { + display: none; + } + } + @media screen and (min-width: 40rem) { + sm-popup { + --width: 24rem; + } + .popup__header { + padding: 1.5rem 1.5rem 0 0.75rem; + } + body { + align-items: center; + justify-content: center; + } + .inner-page { + padding: 0 14vw; + } + #main_header { + padding: 1.5rem 3vw; + grid-template-columns: 1fr auto auto auto; + } + .card { + padding: 1.5rem; + } + #home { + grid-template-columns: 26rem 1fr; + gap: 4vw; + padding-right: 3vw; + } + #profile_popup { + --width: 32rem; + } + #notifications_panel { + position: absolute; + top: 100%; + left: auto; + bottom: auto; + right: 0; + border-radius: 0.5rem; + z-index: 10; + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1); + border: solid 1px rgba(var(--text-color), 0.1); + background-color: rgba(var(--foreground-color), 1); + width: max(24rem, 100%); + } + #wallet_section { + padding: 0 3vw; + grid-row: 1/3; + } + #contact { + & > * { + padding: 1rem 12vw; + } + & > :last-child { + padding: 0.5rem 12vw; + } + } + #saved_ids_list { + gap: 1.5rem; + grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); + } + .hide-on-desktop { + display: none; + } + } + @media screen and (min-width: 68rem) { + #home:not(.is-sub-admin) { + grid-template-columns: 26rem 1fr 1fr; + } + } + @media (any-hover: hover) { + ::-webkit-scrollbar { + width: 0.5rem; + height: 0.5rem; + } + + ::-webkit-scrollbar-thumb { + background: rgba(var(--text-color), 0.3); + border-radius: 1rem; + &:hover { + background: rgba(var(--text-color), 0.5); + } + } + .button--primary:not([disabled]), + .button--danger:not([disabled]) { + transition: filter 0.3s; + &:hover { + filter: brightness(1.3); + } + } + .interact:not([disabled]), + button:not([disabled], .button--primary, .button--danger), + .button:not([disabled], .button--primary, .button--danger) { + transition: background-color 0.3s; + &:hover { + background-color: rgba(var(--text-color), 0.06); + } + } + } + + @supports (overflow: overlay) { + body { + overflow: overlay; + } + } + + .hidden { + display: none !important; + } + + #adblocker_warning { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(var(--foreground-color), 1); + z-index: 50; + display: flex; + flex-direction: column; align-items: center; justify-content: center; - } - .inner-page { - padding: 0 14vw; - } - #main_header { - padding: 1.5rem 3vw; - grid-template-columns: 1fr auto auto auto; - } - .card { + text-align: center; + gap: 1rem; padding: 1.5rem; - } - #home { - grid-template-columns: 26rem 1fr; - gap: 4vw; - padding-right: 3vw; - } - #profile_popup { - --width: 32rem; - } - #notifications_panel { - position: absolute; - top: 100%; - left: auto; - bottom: auto; - right: 0; - border-radius: 0.5rem; - z-index: 10; - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1); - border: solid 1px rgba(var(--text-color), 0.1); - background-color: rgba(var(--foreground-color), 1); - width: max(24rem, 100%); - } - #wallet_section { - padding: 0 3vw; - grid-row: 1/3; - } - #contact { - & > * { - padding: 1rem 12vw; + &:empty { + display: none; } - & > :last-child { - padding: 0.5rem 12vw; + .icon { + height: 4rem; + width: 4rem; + // fill amber + fill: #ffc107; } - } - #saved_ids_list { - gap: 1.5rem; - grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); - } - .hide-on-desktop { - display: none; - } -} -@media screen and (min-width: 68rem) { - #home:not(.is-sub-admin) { - grid-template-columns: 26rem 1fr 1fr; - } -} -@media (any-hover: hover) { - ::-webkit-scrollbar { - width: 0.5rem; - height: 0.5rem; - } - - ::-webkit-scrollbar-thumb { - background: rgba(var(--text-color), 0.3); - border-radius: 1rem; - &:hover { - background: rgba(var(--text-color), 0.5); - } - } - .button--primary:not([disabled]), - .button--danger:not([disabled]) { - transition: filter 0.3s; - &:hover { - filter: brightness(1.3); - } - } - .interact:not([disabled]), - button:not([disabled], .button--primary, .button--danger), - .button:not([disabled], .button--primary, .button--danger) { - transition: background-color 0.3s; - &:hover { - background-color: rgba(var(--text-color), 0.06); - } - } -} - -@supports (overflow: overlay) { - body { - overflow: overlay; - } -} - -.hidden { - display: none !important; -} - -#adblocker_warning { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(var(--foreground-color), 1); - z-index: 50; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - text-align: center; - gap: 1rem; - padding: 1.5rem; - &:empty { - display: none; - } - .icon { - height: 4rem; - width: 4rem; - // fill amber - fill: #ffc107; - } -} + } \ No newline at end of file diff --git a/css/sign-in-bg.svg b/css/sign-in-bg.svg index 077c111..f907c0b 100644 --- a/css/sign-in-bg.svg +++ b/css/sign-in-bg.svg @@ -1 +1,2 @@ -sign-in-bg \ No newline at end of file + +sign-in-bg diff --git a/css/success-art.svg b/css/success-art.svg index 7fc5986..65409ad 100644 --- a/css/success-art.svg +++ b/css/success-art.svg @@ -1 +1,2 @@ -success-art \ No newline at end of file + +success-art diff --git a/css/welcome.svg b/css/welcome.svg index 2dead8d..ab6fca2 100644 --- a/css/welcome.svg +++ b/css/welcome.svg @@ -1 +1,2 @@ -welcome \ No newline at end of file + +welcome diff --git a/index.html b/index.html index d2c3276..80d00ce 100644 --- a/index.html +++ b/index.html @@ -12,15 +12,7 @@ - + @@ -36,7 +28,39 @@ + + + + + + + + + + + + + @@ -287,6 +311,22 @@ FLO + +
+ USDT + + + + +
+ + + + + + + +
BTC @@ -295,8 +335,11 @@
Rupee + USDT BTC + +
@@ -332,6 +375,26 @@ Withdraw + + + + + + +
+ +
+ +
+ + +
+ + + + +
+ +
+ + +
+ + +
+ + + + +
+ +
+
+
+ + + + + + + + + + + + +
+ + + +
+ + +
+ + + + + + +
-
-

Recent transactions

+
+

Recent transactions

+

+ +
+ + + + + + + +
+ tether-usdt-logo
+
+ + + + +
+

Fees

+ Approximate fee: 0.000029983 BNB +

*Exact fee will be calculated after you fill all the required fields

+
+
+ +
+ +
+
+ +
+
+ + + +
@@ -803,29 +1304,39 @@ - - - - - - + + + + + +
+ - + - - + + + + + + +
+
-
-
+ +
--> +
- + tether-usdt-logo + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/bscOperator.js b/scripts/bscOperator.js new file mode 100644 index 0000000..0e9229b --- /dev/null +++ b/scripts/bscOperator.js @@ -0,0 +1,523 @@ + +(function (EXPORTS) { //bscOperator v1.0.2 + /* ETH Crypto and API Operator */ + if (!window.ethers) + return console.error('ethers.js not found') + const bscOperator = EXPORTS; + const isValidAddress = bscOperator.isValidAddress = (address) => { + try { + // Check if the address is a valid checksum address + const isValidChecksum = ethers.utils.isAddress(address); + // Check if the address is a valid non-checksum address + const isValidNonChecksum = ethers.utils.getAddress(address) === address.toLowerCase(); + return isValidChecksum || isValidNonChecksum; + } catch (error) { + return false; + } + } + const BEP20ABI = [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "balance", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + } + ] + const CONTRACT_ADDRESSES = { + usdc: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + usdt: "0x55d398326f99059ff775485246999027b3197955" + } + function getProvider() { + // switches provider based on whether the user is using MetaMask or not + const bscMainnet = { + chainId: 56, + name: 'binance', + rpc: 'https://bsc-dataseed.binance.org/', + explorer: 'https://bscscan.com' + }; + + + if (window.ethereum) { + return new ethers.providers.Web3Provider(window.ethereum); + } else { + return new ethers.providers.JsonRpcProvider(bscMainnet.rpc, bscMainnet) + } + } + function connectToMetaMask() { + return new Promise((resolve, reject) => { + // if (typeof window.ethereum === "undefined") + // return reject("MetaMask not installed"); + return resolve(true) + ethereum + .request({ method: 'eth_requestAccounts' }) + .then((accounts) => { + console.log('Connected to MetaMask') + return resolve(accounts) + }) + .catch((err) => { + console.log(err) + return reject(err) + }) + }) + } + + + const getBalance = bscOperator.getBalance = async (address) => { + try { + if (!address || !isValidAddress(address)) + return new Error('Invalid address'); + // Get the balance + const provider = getProvider(); + const balanceWei = await provider.getBalance(address); + const balanceEth = parseFloat(ethers.utils.formatEther(balanceWei)); + return balanceEth; + } catch (error) { + console.error('Error:', error.message); + return error; + } + } + + + + + + + + + const getTokenBalance = bscOperator.getTokenBalance = async (address, token, { contractAddress } = {}) => { + try { + if (!address) { + throw new Error("Address not specified"); + } + if (!token) { + throw new Error("Token not specified"); + } + if (!CONTRACT_ADDRESSES[token] && !contractAddress) { + throw new Error("Contract address of token not available"); + } + + const provider = getProvider(); // Ensure this returns a valid provider for BSC + const contract = new ethers.Contract(CONTRACT_ADDRESSES[token] || contractAddress, BEP20ABI, provider); + + let balance = await contract.balanceOf(address); + + // Assuming 18 decimals for most tokens like USDT and USDC***************************************************** + // const decimals = 0.00; + const decimals = 18; + const formattedDecimals = decimals.toFixed(1); // This will convert 18 to "18.00" + console.log(formattedDecimals); // Outputs: "18.0" + + balance = parseFloat(ethers.utils.formatUnits(balance, decimals)); + + // Format the balance to 2 decimal places for display + balance = balance.toFixed(2); + + return balance; + } + catch (e) { + // console.error("Error getting token balance:", e.message); + // throw new Error("Failed to get token balance"); + } + } + + + // Example usage: + // Ensure MetaMask is connected and BSC network is selected in MetaMask + const address = '0xYourAddressHere'; // Replace with your actual address + (async () => { + try { + const usdtBalance = await getTokenBalance(address, 'USDT'); + const bnbBalance = await getTokenBalance(address, 'BNB'); + console.log('USDT Balance:', usdtBalance); + console.log('BNB Balance:', bnbBalance); + } catch (error) { + console.error('Error fetching balances:', error.message); + } + })(); + + + + + + + + + + const estimateGas = bscOperator.estimateGas = async ({ privateKey, receiver, amount }) => { + try { + const provider = getProvider(); + const signer = new ethers.Wallet(privateKey, provider); + return provider.estimateGas({ + from: signer.address, + to: receiver, + value: ethers.utils.parseUnits(amount, "ether"), + }); + } catch (e) { + throw new Error(e) + } + } + + const sendTransaction = bscOperator.sendTransaction = async ({ privateKey, receiver, amount }) => { + try { + const provider = getProvider(); + const signer = new ethers.Wallet(privateKey, provider); + const limit = await estimateGas({ privateKey, receiver, amount }) + // Creating and sending the transaction object + return signer.sendTransaction({ + to: receiver, + value: ethers.utils.parseUnits(amount, "ether"), + gasLimit: limit, + nonce: signer.getTransactionCount(), + maxPriorityFeePerGas: ethers.utils.parseUnits("2", "gwei"), + }) + } catch (e) { + throw new Error(e) + } + }; + + + const sendToken = bscOperator.sendToken = async ({ token, privateKey, amount, receiver, contractAddress }) => { + // Create a wallet using the private key + const wallet = new ethers.Wallet(privateKey, getProvider()); + + // Contract interface + const tokenContract = new ethers.Contract(CONTRACT_ADDRESSES[token] || contractAddress, BEP20ABI, wallet); + + // Fetch the correct number of decimals for the token + const decimals = await tokenContract.decimals(); + + // Convert the amount to the smallest unit of the token + const amountWei = ethers.utils.parseUnits(amount.toString(), decimals); + + + + + + + + + // // Estimate gas limit for the transaction + // const gasLimit = await tokenContract.estimateGas.transfer(receiver, amountWei); + + // // Get the current gas price + // const gasPrice = await wallet.provider.getGasPrice(); + + // // Calculate the gas cost + // const gasCost = gasPrice.mul(gasLimit); + + // console.log(`Gas cost: ${ethers.utils.formatEther(gasCost)} BNB`); + + // // Check if wallet has enough balance to cover gas fees + // const balance = await wallet.getBalance(); + // if (balance.lt(gasCost)) { + // throw new Error("Insufficient funds for gas fee"); + // } + + + + + + + + + // ********************************I was changed code from top and use this code************* + try { + // Estimate gas limit for the transaction + const gasLimit = await tokenContract.estimateGas.transfer(receiver, amountWei); + + // Get the current gas price + const gasPrice = await wallet.provider.getGasPrice(); + + // Calculate the gas cost + const gasCost = gasPrice.mul(gasLimit); + const formattedGasCost = ethers.utils.formatEther(gasCost); + + // Display the gas cost in the popup + const gasCostDisplay = document.getElementById('gas_cost_display'); + const gasCostValue = document.getElementById('gas_cost_value'); + + gasCostValue.textContent = formattedGasCost; + gasCostDisplay.style.display = 'block'; // Show the gas cost section + + console.log(`Gas cost: ${formattedGasCost} BNB`); + + // Check if wallet has enough balance to cover gas fees + const balance = await wallet.getBalance(); + if (balance.lt(gasCost)) { + throw new Error("Insufficient funds for gas fee"); + } + } catch (error) { + console.error("Error estimating gas:", error); + alert(error.message); // Optionally show an alert for errors + } + + // */*************** */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + // Call the transfer function on the USDC contract + return tokenContract.transfer(receiver, amountWei, { gasLimit, gasPrice }); + } + })('object' === typeof module ? module.exports : window.bscOperator = {}); \ No newline at end of file diff --git a/scripts/btcOperator.js b/scripts/btcOperator.js index fba0094..fe30513 100644 --- a/scripts/btcOperator.js +++ b/scripts/btcOperator.js @@ -270,6 +270,16 @@ .catch(error => reject(error)) }); + + + // USDT BLOCKCHAIN APIS + +// ***************************** + + +// ***************************** + + const BASE_TX_SIZE = 12, BASE_INPUT_SIZE = 41, LEGACY_INPUT_SIZE = 107, @@ -671,6 +681,7 @@ btcOperator.sendTx = function (senders, privkeys, receivers, amounts, fee = null, options = {}) { return new Promise((resolve, reject) => { createSignedTx(senders, privkeys, receivers, amounts, fee, options).then(result => { + debugger; broadcastTx(result.transaction.serialize()) .then(txid => resolve(txid)) .catch(error => reject(error)); @@ -1016,4 +1027,4 @@ })).catch(error => reject(error)) }); -})('object' === typeof module ? module.exports : window.btcOperator = {}); +})('object' === typeof module ? module.exports : window.btcOperator = {}); \ No newline at end of file diff --git a/scripts/ether.umd.min.js b/scripts/ether.umd.min.js new file mode 100644 index 0000000..0e29784 --- /dev/null +++ b/scripts/ether.umd.min.js @@ -0,0 +1,2 @@ + +(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.ethers=factory())})(this,function(){"use strict";var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x}function createCommonjsModule(fn,basedir,module){return module={path:basedir,exports:{},require:function(path,base){return commonjsRequire(path,base===undefined||base===null?module.path:base)}},fn(module,module.exports),module.exports}function getDefaultExportFromNamespaceIfPresent(n){return n&&Object.prototype.hasOwnProperty.call(n,"default")?n["default"]:n}function getDefaultExportFromNamespaceIfNotNamed(n){return n&&Object.prototype.hasOwnProperty.call(n,"default")&&Object.keys(n).length===1?n["default"]:n}function getAugmentedNamespace(n){if(n.__esModule)return n;var a=Object.defineProperty({},"__esModule",{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k]}})});return a}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var bn=createCommonjsModule(function(module){(function(module,exports){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number)){return number}this.negative=0;this.words=null;this.length=0;this.red=null;if(number!==null){if(base==="le"||base==="be"){endian=base;base=10}this._init(number||0,base||10,endian||"be")}}if(typeof module==="object"){module.exports=BN}else{exports.BN=BN}BN.BN=BN;BN.wordSize=26;var Buffer;try{if(typeof window!=="undefined"&&typeof window.Buffer!=="undefined"){Buffer=window.Buffer}else{Buffer=null.Buffer}}catch(e){}BN.isBN=function isBN(num){if(num instanceof BN){return true}return num!==null&&typeof num==="object"&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)};BN.max=function max(left,right){if(left.cmp(right)>0)return left;return right};BN.min=function min(left,right){if(left.cmp(right)<0)return left;return right};BN.prototype._init=function init(number,base,endian){if(typeof number==="number"){return this._initNumber(number,base,endian)}if(typeof number==="object"){return this._initArray(number,base,endian)}if(base==="hex"){base=16}assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,"");var start=0;if(number[0]==="-"){start++;this.negative=1}if(start=0;i-=3){w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}else if(endian==="le"){for(i=0,j=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}return this._strip()};function parseHex4Bits(string,index){var c=string.charCodeAt(index);if(c>=48&&c<=57){return c-48}else if(c>=65&&c<=70){return c-55}else if(c>=97&&c<=102){return c-87}else{assert(false,"Invalid character in "+string)}}function parseHexByte(string,lowerBound,index){var r=parseHex4Bits(string,index);if(index-1>=lowerBound){r|=parseHex4Bits(string,index-1)<<4}return r}BN.prototype._parseHex=function _parseHex(number,start,endian){this.length=Math.ceil((number.length-start)/6);this.words=new Array(this.length);for(var i=0;i=start;i-=2){w=parseHexByte(number,start,i)<=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}else{var parseLength=number.length-start;for(i=parseLength%2===0?start+1:start;i=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}this._strip()};function parseBase(str,start,end,mul){var r=0;var b=0;var len=Math.min(str.length,end);for(var i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}assert(c>=0&&b1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};if(typeof Symbol!=="undefined"&&typeof Symbol.for==="function"){try{BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}catch(e){BN.prototype.inspect=inspect}}else{BN.prototype.inspect=inspect}function inspect(){return(this.red?""}var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(base,padding){base=base||10;padding=padding|0||1;var out;if(base===16||base==="hex"){out="";var off=0;var carry=0;for(var i=0;i>>24-off&16777215;off+=2;if(off>=26){off-=26;i--}if(carry!==0||i!==this.length-1){out=zeros[6-word.length]+word+out}else{out=word+out}}if(carry!==0){out=carry.toString(16)+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}if(base===(base|0)&&base>=2&&base<=36){var groupSize=groupSizes[base];var groupBase=groupBases[base];out="";var c=this.clone();c.negative=0;while(!c.isZero()){var r=c.modrn(groupBase).toString(base);c=c.idivn(groupBase);if(!c.isZero()){out=zeros[groupSize-r.length]+r+out}else{out=r+out}}if(this.isZero()){out="0"+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var ret=this.words[0];if(this.length===2){ret+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){ret+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-ret:ret};BN.prototype.toJSON=function toJSON(){return this.toString(16,2)};if(Buffer){BN.prototype.toBuffer=function toBuffer(endian,length){return this.toArrayLike(Buffer,endian,length)}}BN.prototype.toArray=function toArray(endian,length){return this.toArrayLike(Array,endian,length)};var allocate=function allocate(ArrayType,size){if(ArrayType.allocUnsafe){return ArrayType.allocUnsafe(size)}return new ArrayType(size)};BN.prototype.toArrayLike=function toArrayLike(ArrayType,endian,length){this._strip();var byteLength=this.byteLength();var reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length");assert(reqLength>0,"Requested array length <= 0");var res=allocate(ArrayType,reqLength);var postfix=endian==="le"?"LE":"BE";this["_toArrayLike"+postfix](res,byteLength);return res};BN.prototype._toArrayLikeLE=function _toArrayLikeLE(res,byteLength){var position=0;var carry=0;for(var i=0,shift=0;i>8&255}if(position>16&255}if(shift===6){if(position>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position=0){res[position--]=word>>8&255}if(position>=0){res[position--]=word>>16&255}if(shift===6){if(position>=0){res[position--]=word>>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position>=0){res[position--]=carry;while(position>=0){res[position--]=0}}};if(Math.clz32){BN.prototype._countBits=function _countBits(w){return 32-Math.clz32(w)}}else{BN.prototype._countBits=function _countBits(w){var t=w;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(w){if(w===0)return 26;var t=w;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var w=this.words[this.length-1];var hi=this._countBits(w);return(this.length-1)*26+hi};function toBitArray(num){var w=new Array(num.bitLength());for(var bit=0;bit>>wbit&1}return w}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var r=0;for(var i=0;inum.length)return this.clone().ior(num);return num.clone().ior(this)};BN.prototype.uor=function uor(num){if(this.length>num.length)return this.clone().iuor(num);return num.clone().iuor(this)};BN.prototype.iuand=function iuand(num){var b;if(this.length>num.length){b=num}else{b=this}for(var i=0;inum.length)return this.clone().iand(num);return num.clone().iand(this)};BN.prototype.uand=function uand(num){if(this.length>num.length)return this.clone().iuand(num);return num.clone().iuand(this)};BN.prototype.iuxor=function iuxor(num){var a;var b;if(this.length>num.length){a=this;b=num}else{a=num;b=this}for(var i=0;inum.length)return this.clone().ixor(num);return num.clone().ixor(this)};BN.prototype.uxor=function uxor(num){if(this.length>num.length)return this.clone().iuxor(num);return num.clone().iuxor(this)};BN.prototype.inotn=function inotn(width){assert(typeof width==="number"&&width>=0);var bytesNeeded=Math.ceil(width/26)|0;var bitsLeft=width%26;this._expand(bytesNeeded);if(bitsLeft>0){bytesNeeded--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-bitsLeft}return this._strip()};BN.prototype.notn=function notn(width){return this.clone().inotn(width)};BN.prototype.setn=function setn(bit,val){assert(typeof bit==="number"&&bit>=0);var off=bit/26|0;var wbit=bit%26;this._expand(off+1);if(val){this.words[off]=this.words[off]|1<num.length){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this.words[this.length]=carry;this.length++}else if(a!==this){for(;inum.length)return this.clone().iadd(num);return num.clone().iadd(this)};BN.prototype.isub=function isub(num){if(num.negative!==0){num.negative=0;var r=this.iadd(num);num.negative=1;return r._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(num);this.negative=1;return this._normSign()}var cmp=this.cmp(num);if(cmp===0){this.negative=0;this.length=1;this.words[0]=0;return this}var a,b;if(cmp>0){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}if(carry===0&&i>>26;var rword=carry&67108863;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=self.words[i]|0;b=num.words[j]|0;r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0){out.words[k]=carry|0}else{out.length--}return out._strip()}var comb10MulTo=function comb10MulTo(self,num,out){var a=self.words;var b=num.words;var o=out.words;var c=0;var lo;var mid;var hi;var a0=a[0]|0;var al0=a0&8191;var ah0=a0>>>13;var a1=a[1]|0;var al1=a1&8191;var ah1=a1>>>13;var a2=a[2]|0;var al2=a2&8191;var ah2=a2>>>13;var a3=a[3]|0;var al3=a3&8191;var ah3=a3>>>13;var a4=a[4]|0;var al4=a4&8191;var ah4=a4>>>13;var a5=a[5]|0;var al5=a5&8191;var ah5=a5>>>13;var a6=a[6]|0;var al6=a6&8191;var ah6=a6>>>13;var a7=a[7]|0;var al7=a7&8191;var ah7=a7>>>13;var a8=a[8]|0;var al8=a8&8191;var ah8=a8>>>13;var a9=a[9]|0;var al9=a9&8191;var ah9=a9>>>13;var b0=b[0]|0;var bl0=b0&8191;var bh0=b0>>>13;var b1=b[1]|0;var bl1=b1&8191;var bh1=b1>>>13;var b2=b[2]|0;var bl2=b2&8191;var bh2=b2>>>13;var b3=b[3]|0;var bl3=b3&8191;var bh3=b3>>>13;var b4=b[4]|0;var bl4=b4&8191;var bh4=b4>>>13;var b5=b[5]|0;var bl5=b5&8191;var bh5=b5>>>13;var b6=b[6]|0;var bl6=b6&8191;var bh6=b6>>>13;var b7=b[7]|0;var bl7=b7&8191;var bh7=b7>>>13;var b8=b[8]|0;var bl8=b8&8191;var bh8=b8>>>13;var b9=b[9]|0;var bl9=b9&8191;var bh9=b9>>>13;out.negative=self.negative^num.negative;out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length++}return out};if(!Math.imul){comb10MulTo=smallMulTo}function bigMulTo(self,num,out){out.negative=num.negative^self.negative;out.length=self.length+num.length;var carry=0;var hncarry=0;for(var k=0;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0){out.words[k]=carry}else{out.length--}return out._strip()}function jumboMulTo(self,num,out){return bigMulTo(self,num,out)}BN.prototype.mulTo=function mulTo(num,out){var res;var len=this.length+num.length;if(this.length===10&&num.length===10){res=comb10MulTo(this,num,out)}else if(len<63){res=smallMulTo(this,num,out)}else if(len<1024){res=bigMulTo(this,num,out)}else{res=jumboMulTo(this,num,out)}return res};function FFTM(x,y){this.x=x;this.y=y}FFTM.prototype.makeRBT=function makeRBT(N){var t=new Array(N);var l=BN.prototype._countBits(N)-1;for(var i=0;i>=1}return rb};FFTM.prototype.permute=function permute(rbt,rws,iws,rtws,itws,N){for(var i=0;i>>1){i++}return 1<>>13;rws[2*i+1]=carry&8191;carry=carry>>>13}for(i=2*len;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}if(carry!==0){this.words[i]=carry;this.length++}return isNegNum?this.ineg():this};BN.prototype.muln=function muln(num){return this.clone().imuln(num)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(num){var w=toBitArray(num);if(w.length===0)return new BN(1);var res=this;for(var i=0;i=0);var r=bits%26;var s=(bits-r)/26;var carryMask=67108863>>>26-r<<26-r;var i;if(r!==0){var carry=0;for(i=0;i>>26-r}if(carry){this.words[i]=carry;this.length++}}if(s!==0){for(i=this.length-1;i>=0;i--){this.words[i+s]=this.words[i]}for(i=0;i=0);var h;if(hint){h=(hint-hint%26)/26}else{h=0}var r=bits%26;var s=Math.min((bits-r)/26,this.length);var mask=67108863^67108863>>>r<s){this.length-=s;for(i=0;i=0&&(carry!==0||i>=h);i--){var word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}if(maskedWords&&carry!==0){maskedWords.words[maskedWords.length++]=carry}if(this.length===0){this.words[0]=0;this.length=1}return this._strip()};BN.prototype.ishrn=function ishrn(bits,hint,extended){assert(this.negative===0);return this.iushrn(bits,hint,extended)};BN.prototype.shln=function shln(bits){return this.clone().ishln(bits)};BN.prototype.ushln=function ushln(bits){return this.clone().iushln(bits)};BN.prototype.shrn=function shrn(bits){return this.clone().ishrn(bits)};BN.prototype.ushrn=function ushrn(bits){return this.clone().iushrn(bits)};BN.prototype.testn=function testn(bit){assert(typeof bit==="number"&&bit>=0);var r=bit%26;var s=(bit-r)/26;var q=1<=0);var r=bits%26;var s=(bits-r)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=s){return this}if(r!==0){s++}this.length=Math.min(s,this.length);if(r!==0){var mask=67108863^67108863>>>r<=67108864;i++){this.words[i]-=67108864;if(i===this.length-1){this.words[i+1]=1}else{this.words[i+1]++}}this.length=Math.max(this.length,i+1);return this};BN.prototype.isubn=function isubn(num){assert(typeof num==="number");assert(num<67108864);if(num<0)return this.iaddn(-num);if(this.negative!==0){this.negative=0;this.iaddn(num);this.negative=1;return this}this.words[0]-=num;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var i=0;i>26)-(right/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()};BN.prototype._wordDiv=function _wordDiv(num,mode){var shift=this.length-num.length;var a=this.clone();var b=num;var bhi=b.words[b.length-1]|0;var bhiBits=this._countBits(bhi);shift=26-bhiBits;if(shift!==0){b=b.ushln(shift);a.iushln(shift);bhi=b.words[b.length-1]|0}var m=a.length-b.length;var q;if(mode!=="mod"){q=new BN(null);q.length=m+1;q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=(a.words[b.length+j]|0)*67108864+(a.words[b.length+j-1]|0);qj=Math.min(qj/bhi|0,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj--;a.negative=0;a._ishlnsubmul(b,1,j);if(!a.isZero()){a.negative^=1}}if(q){q.words[j]=qj}}if(q){q._strip()}a._strip();if(mode!=="div"&&shift!==0){a.iushrn(shift)}return{div:q||null,mod:a}};BN.prototype.divmod=function divmod(num,mode,positive){assert(!num.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var div,mod,res;if(this.negative!==0&&num.negative===0){res=this.neg().divmod(num,mode);if(mode!=="mod"){div=res.div.neg()}if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.iadd(num)}}return{div:div,mod:mod}}if(this.negative===0&&num.negative!==0){res=this.divmod(num.neg(),mode);if(mode!=="mod"){div=res.div.neg()}return{div:div,mod:res.mod}}if((this.negative&num.negative)!==0){res=this.neg().divmod(num.neg(),mode);if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.isub(num)}}return{div:res.div,mod:mod}}if(num.length>this.length||this.cmp(num)<0){return{div:new BN(0),mod:this}}if(num.length===1){if(mode==="div"){return{div:this.divn(num.words[0]),mod:null}}if(mode==="mod"){return{div:null,mod:new BN(this.modrn(num.words[0]))}}return{div:this.divn(num.words[0]),mod:new BN(this.modrn(num.words[0]))}}return this._wordDiv(num,mode)};BN.prototype.div=function div(num){return this.divmod(num,"div",false).div};BN.prototype.mod=function mod(num){return this.divmod(num,"mod",false).mod};BN.prototype.umod=function umod(num){return this.divmod(num,"mod",true).mod};BN.prototype.divRound=function divRound(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=dm.div.negative!==0?dm.mod.isub(num):dm.mod;var half=num.ushrn(1);var r2=num.andln(1);var cmp=mod.cmp(half);if(cmp<0||r2===1&&cmp===0)return dm.div;return dm.div.negative!==0?dm.div.isubn(1):dm.div.iaddn(1)};BN.prototype.modrn=function modrn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var p=(1<<26)%num;var acc=0;for(var i=this.length-1;i>=0;i--){acc=(p*acc+(this.words[i]|0))%num}return isNegNum?-acc:acc};BN.prototype.modn=function modn(num){return this.modrn(num)};BN.prototype.idivn=function idivn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var carry=0;for(var i=this.length-1;i>=0;i--){var w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this._strip();return isNegNum?this.ineg():this};BN.prototype.divn=function divn(num){return this.clone().idivn(num)};BN.prototype.egcd=function egcd(p){assert(p.negative===0);assert(!p.isZero());var x=this;var y=p.clone();if(x.negative!==0){x=x.umod(p)}else{x=x.clone()}var A=new BN(1);var B=new BN(0);var C=new BN(0);var D=new BN(1);var g=0;while(x.isEven()&&y.isEven()){x.iushrn(1);y.iushrn(1);++g}var yp=y.clone();var xp=x.clone();while(!x.isZero()){for(var i=0,im=1;(x.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){x.iushrn(i);while(i-- >0){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}}for(var j=0,jm=1;(y.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){y.iushrn(j);while(j-- >0){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}return{a:C,b:D,gcd:y.iushln(g)}};BN.prototype._invmp=function _invmp(p){assert(p.negative===0);assert(!p.isZero());var a=this;var b=p.clone();if(a.negative!==0){a=a.umod(p)}else{a=a.clone()}var x1=new BN(1);var x2=new BN(0);var delta=b.clone();while(a.cmpn(1)>0&&b.cmpn(1)>0){for(var i=0,im=1;(a.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){a.iushrn(i);while(i-- >0){if(x1.isOdd()){x1.iadd(delta)}x1.iushrn(1)}}for(var j=0,jm=1;(b.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){b.iushrn(j);while(j-- >0){if(x2.isOdd()){x2.iadd(delta)}x2.iushrn(1)}}if(a.cmp(b)>=0){a.isub(b);x1.isub(x2)}else{b.isub(a);x2.isub(x1)}}var res;if(a.cmpn(1)===0){res=x1}else{res=x2}if(res.cmpn(0)<0){res.iadd(p)}return res};BN.prototype.gcd=function gcd(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone();var b=num.clone();a.negative=0;b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++){a.iushrn(1);b.iushrn(1)}do{while(a.isEven()){a.iushrn(1)}while(b.isEven()){b.iushrn(1)}var r=a.cmp(b);if(r<0){var t=a;a=b;b=t}else if(r===0||b.cmpn(1)===0){break}a.isub(b)}while(true);return b.iushln(shift)};BN.prototype.invm=function invm(num){return this.egcd(num).a.umod(num)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(num){return this.words[0]&num};BN.prototype.bincn=function bincn(bit){assert(typeof bit==="number");var r=bit%26;var s=(bit-r)/26;var q=1<>>26;w&=67108863;this.words[i]=w}if(carry!==0){this.words[i]=carry;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(num){var negative=num<0;if(this.negative!==0&&!negative)return-1;if(this.negative===0&&negative)return 1;this._strip();var res;if(this.length>1){res=1}else{if(negative){num=-num}assert(num<=67108863,"Number is too big");var w=this.words[0]|0;res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=this.words[i]|0;var b=num.words[i]|0;if(a===b)continue;if(ab){res=1}break}return res};BN.prototype.gtn=function gtn(num){return this.cmpn(num)===1};BN.prototype.gt=function gt(num){return this.cmp(num)===1};BN.prototype.gten=function gten(num){return this.cmpn(num)>=0};BN.prototype.gte=function gte(num){return this.cmp(num)>=0};BN.prototype.ltn=function ltn(num){return this.cmpn(num)===-1};BN.prototype.lt=function lt(num){return this.cmp(num)===-1};BN.prototype.lten=function lten(num){return this.cmpn(num)<=0};BN.prototype.lte=function lte(num){return this.cmp(num)<=0};BN.prototype.eqn=function eqn(num){return this.cmpn(num)===0};BN.prototype.eq=function eq(num){return this.cmp(num)===0};BN.red=function red(num){return new Red(num)};BN.prototype.toRed=function toRed(ctx){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ctx.convertTo(this)._forceRed(ctx)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(ctx){this.red=ctx;return this};BN.prototype.forceRed=function forceRed(ctx){assert(!this.red,"Already a number in reduction context");return this._forceRed(ctx)};BN.prototype.redAdd=function redAdd(num){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,num)};BN.prototype.redIAdd=function redIAdd(num){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,num)};BN.prototype.redSub=function redSub(num){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,num)};BN.prototype.redISub=function redISub(num){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,num)};BN.prototype.redShl=function redShl(num){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,num)};BN.prototype.redMul=function redMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.mul(this,num)};BN.prototype.redIMul=function redIMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.imul(this,num)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(num){assert(this.red&&!num.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};function MPrime(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var tmp=new BN(null);tmp.words=new Array(Math.ceil(this.n/13));return tmp};MPrime.prototype.ireduce=function ireduce(num){var r=num;var rlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0){r.isub(this.p)}else{if(r.strip!==undefined){r.strip()}else{r._strip()}}return r};MPrime.prototype.split=function split(input,out){input.iushrn(this.n,0,out)};MPrime.prototype.imulK=function imulK(num){return num.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(input,output){var mask=4194303;var outLen=Math.min(input.length,9);for(var i=0;i>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10}else{input.length-=9}};K256.prototype.imulK=function imulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;var lo=0;for(var i=0;i>>=26;num.words[i]=lo;carry=hi}if(carry!==0){num.words[num.length++]=carry}return num};BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if(name==="k256"){prime=new K256}else if(name==="p224"){prime=new P224}else if(name==="p192"){prime=new P192}else if(name==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+name)}primes[name]=prime;return prime};function Red(m){if(typeof m==="string"){var prime=BN._prime(m);this.m=prime.p;this.prime=prime}else{assert(m.gtn(1),"modulus must be greater than 1");this.m=m;this.prime=null}}Red.prototype._verify1=function _verify1(a){assert(a.negative===0,"red works only with positives");assert(a.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(a,b){assert((a.negative|b.negative)===0,"red works only with positives");assert(a.red&&a.red===b.red,"red works only with red numbers")};Red.prototype.imod=function imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);move(a,a.umod(this.m)._forceRed(this));return a};Red.prototype.neg=function neg(a){if(a.isZero()){return a.clone()}return this.m.sub(a)._forceRed(this)};Red.prototype.add=function add(a,b){this._verify2(a,b);var res=a.add(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res._forceRed(this)};Red.prototype.iadd=function iadd(a,b){this._verify2(a,b);var res=a.iadd(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res};Red.prototype.sub=function sub(a,b){this._verify2(a,b);var res=a.sub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res._forceRed(this)};Red.prototype.isub=function isub(a,b){this._verify2(a,b);var res=a.isub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res};Red.prototype.shl=function shl(a,num){this._verify1(a);return this.imod(a.ushln(num))};Red.prototype.imul=function imul(a,b){this._verify2(a,b);return this.imod(a.imul(b))};Red.prototype.mul=function mul(a,b){this._verify2(a,b);return this.imod(a.mul(b))};Red.prototype.isqr=function isqr(a){return this.imul(a,a.clone())};Red.prototype.sqr=function sqr(a){return this.mul(a,a)};Red.prototype.sqrt=function sqrt(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);assert(mod3%2===1);if(mod3===3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}var q=this.m.subn(1);var s=0;while(!q.isZero()&&q.andln(1)===0){s++;q.iushrn(1)}assert(!q.isZero());var one=new BN(1).toRed(this);var nOne=one.redNeg();var lpow=this.m.subn(1).iushrn(1);var z=this.m.bitLength();z=new BN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne)}var c=this.pow(z,q);var r=this.pow(a,q.addn(1).iushrn(1));var t=this.pow(a,q);var m=s;while(t.cmp(one)!==0){var tmp=t;for(var i=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr()}assert(i=0;i--){var word=num.words[i];for(var j=start-1;j>=0;j--){var bit=word>>j&1;if(res!==wnd[0]){res=this.sqr(res)}if(bit===0&¤t===0){currentLen=0;continue}current<<=1;current|=bit;currentLen++;if(currentLen!==windowSize&&(i!==0||j!==0))continue;res=this.mul(res,wnd[current]);currentLen=0;current=0}start=26}return res};Red.prototype.convertTo=function convertTo(num){var r=num.umod(this.m);return r===num?r.clone():r};Red.prototype.convertFrom=function convertFrom(num){var res=num.clone();res.red=null;return res};BN.mont=function mont(num){return new Mont(num)};function Mont(m){Red.call(this,m);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(num){return this.imod(num.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(num){var r=this.imod(num.mul(this.rinv));r.red=null;return r};Mont.prototype.imul=function imul(a,b){if(a.isZero()||b.isZero()){a.words[0]=0;a.length=1;return a}var t=a.imul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.mul=function mul(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.invm=function invm(a){var res=this.imod(a._invmp(this.m).mul(this.r2));return res._forceRed(this)}})("object"==="undefined"||module,commonjsGlobal)});var _version=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="logger/5.6.0"});var _version$1=getDefaultExportFromCjs(_version);var lib=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Logger=exports.ErrorCode=exports.LogLevel=void 0;var _permanentCensorErrors=false;var _censorErrors=false;var LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};var _logLevel=LogLevels["default"];var _globalLogger=null;function _checkNormalize(){try{var missing_1=[];["NFD","NFC","NFKD","NFKC"].forEach(function(form){try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing_1.push(form)}});if(missing_1.length){throw new Error("missing "+missing_1.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}var _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel=exports.LogLevel||(exports.LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_GAS_LIMIT"]="UNPREDICTABLE_GAS_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode=exports.ErrorCode||(exports.ErrorCode={}));var HEX="0123456789abcdef";var Logger=function(){function Logger(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}Logger.prototype._log=function(logLevel,args){var level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)};Logger.prototype.debug=function(){var args=[];for(var _i=0;_i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push("code="+code);messageDetails.push("version="+this.version);var reason=message;var url="";switch(code){case ErrorCode.NUMERIC_FAULT:{url="NUMERIC_FAULT";var fault=message;switch(fault){case"overflow":case"underflow":case"division-by-zero":url+="-"+fault;break;case"negative-power":case"negative-width":url+="-unsupported";break;case"unbound-bitwise-result":url+="-unbound-result";break}break}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:url=code;break}if(url){message+=" [ See: https://links.ethers.org/v5-errors-"+url+" ]"}if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}var error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error};Logger.prototype.throwError=function(message,code,params){throw this.makeError(message,code,params)};Logger.prototype.throwArgumentError=function(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})};Logger.prototype.assert=function(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)};Logger.prototype.assertArgument=function(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)};Logger.prototype.checkNormalize=function(message){if(message==null){message="platform missing String.prototype.normalize"}if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}};Logger.prototype.checkSafeUint53=function(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}};Logger.prototype.checkArgumentCount=function(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}};Logger.prototype.checkNew=function(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}};Logger.prototype.checkAbstract=function(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}};Logger.globalLogger=function(){if(!_globalLogger){_globalLogger=new Logger(_version.version)}return _globalLogger};Logger.setCensorship=function(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent};Logger.setLogLevel=function(logLevel){var level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level};Logger.from=function(version){return new Logger(version)};Logger.errors=ErrorCode;Logger.levels=LogLevel;return Logger}();exports.Logger=Logger});var index=getDefaultExportFromCjs(lib);var _version$2=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="bytes/5.6.1"});var _version$3=getDefaultExportFromCjs(_version$2);var lib$1=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.joinSignature=exports.splitSignature=exports.hexZeroPad=exports.hexStripZeros=exports.hexValue=exports.hexConcat=exports.hexDataSlice=exports.hexDataLength=exports.hexlify=exports.isHexString=exports.zeroPad=exports.stripZeros=exports.concat=exports.arrayify=exports.isBytes=exports.isBytesLike=void 0;var logger=new lib.Logger(_version$2.version);function isHexable(value){return!!value.toHexString}function addSlice(array){if(array.slice){return array}array.slice=function(){var args=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(array,args)))};return array}function isBytesLike(value){return isHexString(value)&&!(value.length%2)||isBytes(value)}exports.isBytesLike=isBytesLike;function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(var i=0;i=256){return false}}return true}exports.isBytes=isBytes;function arrayify(value,options){if(!options){options={}}if(typeof value==="number"){logger.checkSafeUint53(value,"invalid arrayify value");var result=[];while(value){result.unshift(value&255);value=parseInt(String(value/256))}if(result.length===0){result.push(0)}return addSlice(new Uint8Array(result))}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){value=value.toHexString()}if(isHexString(value)){var hex=value.substring(2);if(hex.length%2){if(options.hexPad==="left"){hex="0"+hex}else if(options.hexPad==="right"){hex+="0"}else{logger.throwArgumentError("hex data is odd-length","value",value)}}var result=[];for(var i=0;ilength){logger.throwArgumentError("value out of range","value",arguments[0])}var result=new Uint8Array(length);result.set(value,length-value.length);return addSlice(result)}exports.zeroPad=zeroPad;function isHexString(value,length){if(typeof value!=="string"||!value.match(/^0x[0-9A-Fa-f]*$/)){return false}if(length&&value.length!==2+2*length){return false}return true}exports.isHexString=isHexString;var HexCharacters="0123456789abcdef";function hexlify(value,options){if(!options){options={}}if(typeof value==="number"){logger.checkSafeUint53(value,"invalid hexlify value");var hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes(value)){var result="0x";for(var i=0;i>4]+HexCharacters[v&15]}return result}return logger.throwArgumentError("invalid hexlify value","value",value)}exports.hexlify=hexlify;function hexDataLength(data){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){return null}return(data.length-2)/2}exports.hexDataLength=hexDataLength;function hexDataSlice(data,offset,endOffset){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){logger.throwArgumentError("invalid hexData","value",data)}offset=2+2*offset;if(endOffset!=null){return"0x"+data.substring(offset,2+2*endOffset)}return"0x"+data.substring(offset)}exports.hexDataSlice=hexDataSlice;function hexConcat(items){var result="0x";items.forEach(function(item){result+=hexlify(item).substring(2)});return result}exports.hexConcat=hexConcat;function hexValue(value){var trimmed=hexStripZeros(hexlify(value,{hexPad:"left"}));if(trimmed==="0x"){return"0x0"}return trimmed}exports.hexValue=hexValue;function hexStripZeros(value){if(typeof value!=="string"){value=hexlify(value)}if(!isHexString(value)){logger.throwArgumentError("invalid hex string","value",value)}value=value.substring(2);var offset=0;while(offset2*length+2){logger.throwArgumentError("value out of range","value",arguments[1])}while(value.length<2*length+2){value="0x0"+value.substring(2)}return value}exports.hexZeroPad=hexZeroPad;function splitSignature(signature){var result={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(isBytesLike(signature)){var bytes=arrayify(signature);if(bytes.length===64){result.v=27+(bytes[32]>>7);bytes[32]&=127;result.r=hexlify(bytes.slice(0,32));result.s=hexlify(bytes.slice(32,64))}else if(bytes.length===65){result.r=hexlify(bytes.slice(0,32));result.s=hexlify(bytes.slice(32,64));result.v=bytes[64]}else{logger.throwArgumentError("invalid signature string","signature",signature)}if(result.v<27){if(result.v===0||result.v===1){result.v+=27}else{logger.throwArgumentError("signature invalid v byte","signature",signature)}}result.recoveryParam=1-result.v%2;if(result.recoveryParam){bytes[32]|=128}result._vs=hexlify(bytes.slice(32,64))}else{result.r=signature.r;result.s=signature.s;result.v=signature.v;result.recoveryParam=signature.recoveryParam;result._vs=signature._vs;if(result._vs!=null){var vs_1=zeroPad(arrayify(result._vs),32);result._vs=hexlify(vs_1);var recoveryParam=vs_1[0]>=128?1:0;if(result.recoveryParam==null){result.recoveryParam=recoveryParam}else if(result.recoveryParam!==recoveryParam){logger.throwArgumentError("signature recoveryParam mismatch _vs","signature",signature)}vs_1[0]&=127;var s=hexlify(vs_1);if(result.s==null){result.s=s}else if(result.s!==s){logger.throwArgumentError("signature v mismatch _vs","signature",signature)}}if(result.recoveryParam==null){if(result.v==null){logger.throwArgumentError("signature missing v and recoveryParam","signature",signature)}else if(result.v===0||result.v===1){result.recoveryParam=result.v}else{result.recoveryParam=1-result.v%2}}else{if(result.v==null){result.v=27+result.recoveryParam}else{var recId=result.v===0||result.v===1?result.v:1-result.v%2;if(result.recoveryParam!==recId){logger.throwArgumentError("signature recoveryParam mismatch v","signature",signature)}}}if(result.r==null||!isHexString(result.r)){logger.throwArgumentError("signature missing or invalid r","signature",signature)}else{result.r=hexZeroPad(result.r,32)}if(result.s==null||!isHexString(result.s)){logger.throwArgumentError("signature missing or invalid s","signature",signature)}else{result.s=hexZeroPad(result.s,32)}var vs=arrayify(result.s);if(vs[0]>=128){logger.throwArgumentError("signature s out of range","signature",signature)}if(result.recoveryParam){vs[0]|=128}var _vs=hexlify(vs);if(result._vs){if(!isHexString(result._vs)){logger.throwArgumentError("signature invalid _vs","signature",signature)}result._vs=hexZeroPad(result._vs,32)}if(result._vs==null){result._vs=_vs}else if(result._vs!==_vs){logger.throwArgumentError("signature _vs mismatch v and s","signature",signature)}}result.yParityAndS=result._vs;result.compact=result.r+result.yParityAndS.substring(2);return result}exports.splitSignature=splitSignature;function joinSignature(signature){signature=splitSignature(signature);return hexlify(concat([signature.r,signature.s,signature.recoveryParam?"0x1c":"0x1b"]))}exports.joinSignature=joinSignature});var index$1=getDefaultExportFromCjs(lib$1);var _version$4=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="bignumber/5.6.2"});var _version$5=getDefaultExportFromCjs(_version$4);var bignumber=createCommonjsModule(function(module,exports){"use strict";var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:true});exports._base16To36=exports._base36To16=exports.BigNumber=exports.isBigNumberish=void 0;var bn_js_1=__importDefault(bn);var BN=bn_js_1.default.BN;var logger=new lib.Logger(_version$4.version);var _constructorGuard={};var MAX_SAFE=9007199254740991;function isBigNumberish(value){return value!=null&&(BigNumber.isBigNumber(value)||typeof value==="number"&&value%1===0||typeof value==="string"&&!!value.match(/^-?[0-9]+$/)||(0,lib$1.isHexString)(value)||typeof value==="bigint"||(0,lib$1.isBytes)(value))}exports.isBigNumberish=isBigNumberish;var _warnedToStringRadix=false;var BigNumber=function(){function BigNumber(constructorGuard,hex){if(constructorGuard!==_constructorGuard){logger.throwError("cannot call constructor directly; use BigNumber.from",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"})}this._hex=hex;this._isBigNumber=true;Object.freeze(this)}BigNumber.prototype.fromTwos=function(value){return toBigNumber(toBN(this).fromTwos(value))};BigNumber.prototype.toTwos=function(value){return toBigNumber(toBN(this).toTwos(value))};BigNumber.prototype.abs=function(){if(this._hex[0]==="-"){return BigNumber.from(this._hex.substring(1))}return this};BigNumber.prototype.add=function(other){return toBigNumber(toBN(this).add(toBN(other)))};BigNumber.prototype.sub=function(other){return toBigNumber(toBN(this).sub(toBN(other)))};BigNumber.prototype.div=function(other){var o=BigNumber.from(other);if(o.isZero()){throwFault("division-by-zero","div")}return toBigNumber(toBN(this).div(toBN(other)))};BigNumber.prototype.mul=function(other){return toBigNumber(toBN(this).mul(toBN(other)))};BigNumber.prototype.mod=function(other){var value=toBN(other);if(value.isNeg()){throwFault("division-by-zero","mod")}return toBigNumber(toBN(this).umod(value))};BigNumber.prototype.pow=function(other){var value=toBN(other);if(value.isNeg()){throwFault("negative-power","pow")}return toBigNumber(toBN(this).pow(value))};BigNumber.prototype.and=function(other){var value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("unbound-bitwise-result","and")}return toBigNumber(toBN(this).and(value))};BigNumber.prototype.or=function(other){var value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("unbound-bitwise-result","or")}return toBigNumber(toBN(this).or(value))};BigNumber.prototype.xor=function(other){var value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("unbound-bitwise-result","xor")}return toBigNumber(toBN(this).xor(value))};BigNumber.prototype.mask=function(value){if(this.isNegative()||value<0){throwFault("negative-width","mask")}return toBigNumber(toBN(this).maskn(value))};BigNumber.prototype.shl=function(value){if(this.isNegative()||value<0){throwFault("negative-width","shl")}return toBigNumber(toBN(this).shln(value))};BigNumber.prototype.shr=function(value){if(this.isNegative()||value<0){throwFault("negative-width","shr")}return toBigNumber(toBN(this).shrn(value))};BigNumber.prototype.eq=function(other){return toBN(this).eq(toBN(other))};BigNumber.prototype.lt=function(other){return toBN(this).lt(toBN(other))};BigNumber.prototype.lte=function(other){return toBN(this).lte(toBN(other))};BigNumber.prototype.gt=function(other){return toBN(this).gt(toBN(other))};BigNumber.prototype.gte=function(other){return toBN(this).gte(toBN(other))};BigNumber.prototype.isNegative=function(){return this._hex[0]==="-"};BigNumber.prototype.isZero=function(){return toBN(this).isZero()};BigNumber.prototype.toNumber=function(){try{return toBN(this).toNumber()}catch(error){throwFault("overflow","toNumber",this.toString())}return null};BigNumber.prototype.toBigInt=function(){try{return BigInt(this.toString())}catch(e){}return logger.throwError("this platform does not support BigInt",lib.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})};BigNumber.prototype.toString=function(){if(arguments.length>0){if(arguments[0]===10){if(!_warnedToStringRadix){_warnedToStringRadix=true;logger.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")}}else if(arguments[0]===16){logger.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",lib.Logger.errors.UNEXPECTED_ARGUMENT,{})}else{logger.throwError("BigNumber.toString does not accept parameters",lib.Logger.errors.UNEXPECTED_ARGUMENT,{})}}return toBN(this).toString(10)};BigNumber.prototype.toHexString=function(){return this._hex};BigNumber.prototype.toJSON=function(key){return{type:"BigNumber",hex:this.toHexString()}};BigNumber.from=function(value){if(value instanceof BigNumber){return value}if(typeof value==="string"){if(value.match(/^-?0x[0-9a-f]+$/i)){return new BigNumber(_constructorGuard,toHex(value))}if(value.match(/^-?[0-9]+$/)){return new BigNumber(_constructorGuard,toHex(new BN(value)))}return logger.throwArgumentError("invalid BigNumber string","value",value)}if(typeof value==="number"){if(value%1){throwFault("underflow","BigNumber.from",value)}if(value>=MAX_SAFE||value<=-MAX_SAFE){throwFault("overflow","BigNumber.from",value)}return BigNumber.from(String(value))}var anyValue=value;if(typeof anyValue==="bigint"){return BigNumber.from(anyValue.toString())}if((0,lib$1.isBytes)(anyValue)){return BigNumber.from((0,lib$1.hexlify)(anyValue))}if(anyValue){if(anyValue.toHexString){var hex=anyValue.toHexString();if(typeof hex==="string"){return BigNumber.from(hex)}}else{var hex=anyValue._hex;if(hex==null&&anyValue.type==="BigNumber"){hex=anyValue.hex}if(typeof hex==="string"){if((0,lib$1.isHexString)(hex)||hex[0]==="-"&&(0,lib$1.isHexString)(hex.substring(1))){return BigNumber.from(hex)}}}}return logger.throwArgumentError("invalid BigNumber value","value",value)};BigNumber.isBigNumber=function(value){return!!(value&&value._isBigNumber)};return BigNumber}();exports.BigNumber=BigNumber;function toHex(value){if(typeof value!=="string"){return toHex(value.toString(16))}if(value[0]==="-"){value=value.substring(1);if(value[0]==="-"){logger.throwArgumentError("invalid hex","value",value)}value=toHex(value);if(value==="0x00"){return value}return"-"+value}if(value.substring(0,2)!=="0x"){value="0x"+value}if(value==="0x"){return"0x00"}if(value.length%2){value="0x0"+value.substring(2)}while(value.length>4&&value.substring(0,4)==="0x00"){value="0x"+value.substring(4)}return value}function toBigNumber(value){return BigNumber.from(toHex(value))}function toBN(value){var hex=BigNumber.from(value).toHexString();if(hex[0]==="-"){return new BN("-"+hex.substring(3),16)}return new BN(hex.substring(2),16)}function throwFault(fault,operation,value){var params={fault:fault,operation:operation};if(value!=null){params.value=value}return logger.throwError(fault,lib.Logger.errors.NUMERIC_FAULT,params)}function _base36To16(value){return new BN(value,36).toString(16)}exports._base36To16=_base36To16;function _base16To36(value){return new BN(value,16).toString(36)}exports._base16To36=_base16To36});var bignumber$1=getDefaultExportFromCjs(bignumber);var fixednumber=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FixedNumber=exports.FixedFormat=exports.parseFixed=exports.formatFixed=void 0;var logger=new lib.Logger(_version$4.version);var _constructorGuard={};var Zero=bignumber.BigNumber.from(0);var NegativeOne=bignumber.BigNumber.from(-1);function throwFault(message,fault,operation,value){var params={fault:fault,operation:operation};if(value!==undefined){params.value=value}return logger.throwError(message,lib.Logger.errors.NUMERIC_FAULT,params)}var zeros="0";while(zeros.length<256){zeros+=zeros}function getMultiplier(decimals){if(typeof decimals!=="number"){try{decimals=bignumber.BigNumber.from(decimals).toNumber()}catch(e){}}if(typeof decimals==="number"&&decimals>=0&&decimals<=256&&!(decimals%1)){return"1"+zeros.substring(0,decimals)}return logger.throwArgumentError("invalid decimal size","decimals",decimals)}function formatFixed(value,decimals){if(decimals==null){decimals=0}var multiplier=getMultiplier(decimals);value=bignumber.BigNumber.from(value);var negative=value.lt(Zero);if(negative){value=value.mul(NegativeOne)}var fraction=value.mod(multiplier).toString();while(fraction.length2){logger.throwArgumentError("too many decimal points","value",value)}var whole=comps[0],fraction=comps[1];if(!whole){whole="0"}if(!fraction){fraction="0"}while(fraction[fraction.length-1]==="0"){fraction=fraction.substring(0,fraction.length-1)}if(fraction.length>multiplier.length-1){throwFault("fractional component exceeds decimals","underflow","parseFixed")}if(fraction===""){fraction="0"}while(fraction.length80){logger.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",decimals)}return new FixedFormat(_constructorGuard,signed,width,decimals)};return FixedFormat}();exports.FixedFormat=FixedFormat;var FixedNumber=function(){function FixedNumber(constructorGuard,hex,value,format){if(constructorGuard!==_constructorGuard){logger.throwError("cannot use FixedNumber constructor; use FixedNumber.from",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"})}this.format=format;this._hex=hex;this._value=value;this._isFixedNumber=true;Object.freeze(this)}FixedNumber.prototype._checkFormat=function(other){if(this.format.name!==other.format.name){logger.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",other)}};FixedNumber.prototype.addUnsafe=function(other){this._checkFormat(other);var a=parseFixed(this._value,this.format.decimals);var b=parseFixed(other._value,other.format.decimals);return FixedNumber.fromValue(a.add(b),this.format.decimals,this.format)};FixedNumber.prototype.subUnsafe=function(other){this._checkFormat(other);var a=parseFixed(this._value,this.format.decimals);var b=parseFixed(other._value,other.format.decimals);return FixedNumber.fromValue(a.sub(b),this.format.decimals,this.format)};FixedNumber.prototype.mulUnsafe=function(other){this._checkFormat(other);var a=parseFixed(this._value,this.format.decimals);var b=parseFixed(other._value,other.format.decimals);return FixedNumber.fromValue(a.mul(b).div(this.format._multiplier),this.format.decimals,this.format)};FixedNumber.prototype.divUnsafe=function(other){this._checkFormat(other);var a=parseFixed(this._value,this.format.decimals);var b=parseFixed(other._value,other.format.decimals);return FixedNumber.fromValue(a.mul(this.format._multiplier).div(b),this.format.decimals,this.format)};FixedNumber.prototype.floor=function(){var comps=this.toString().split(".");if(comps.length===1){comps.push("0")}var result=FixedNumber.from(comps[0],this.format);var hasFraction=!comps[1].match(/^(0*)$/);if(this.isNegative()&&hasFraction){result=result.subUnsafe(ONE.toFormat(result.format))}return result};FixedNumber.prototype.ceiling=function(){var comps=this.toString().split(".");if(comps.length===1){comps.push("0")}var result=FixedNumber.from(comps[0],this.format);var hasFraction=!comps[1].match(/^(0*)$/);if(!this.isNegative()&&hasFraction){result=result.addUnsafe(ONE.toFormat(result.format))}return result};FixedNumber.prototype.round=function(decimals){if(decimals==null){decimals=0}var comps=this.toString().split(".");if(comps.length===1){comps.push("0")}if(decimals<0||decimals>80||decimals%1){logger.throwArgumentError("invalid decimal count","decimals",decimals)}if(comps[1].length<=decimals){return this}var factor=FixedNumber.from("1"+zeros.substring(0,decimals),this.format);var bump=BUMP.toFormat(this.format);return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor)};FixedNumber.prototype.isZero=function(){return this._value==="0.0"||this._value==="0"};FixedNumber.prototype.isNegative=function(){return this._value[0]==="-"};FixedNumber.prototype.toString=function(){return this._value};FixedNumber.prototype.toHexString=function(width){if(width==null){return this._hex}if(width%8){logger.throwArgumentError("invalid byte width","width",width)}var hex=bignumber.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();return(0,lib$1.hexZeroPad)(hex,width/8)};FixedNumber.prototype.toUnsafeFloat=function(){return parseFloat(this.toString())};FixedNumber.prototype.toFormat=function(format){return FixedNumber.fromString(this._value,format)};FixedNumber.fromValue=function(value,decimals,format){if(format==null&&decimals!=null&&!(0,bignumber.isBigNumberish)(decimals)){format=decimals;decimals=null}if(decimals==null){decimals=0}if(format==null){format="fixed"}return FixedNumber.fromString(formatFixed(value,decimals),FixedFormat.from(format))};FixedNumber.fromString=function(value,format){if(format==null){format="fixed"}var fixedFormat=FixedFormat.from(format);var numeric=parseFixed(value,fixedFormat.decimals);if(!fixedFormat.signed&&numeric.lt(Zero)){throwFault("unsigned value cannot be negative","overflow","value",value)}var hex=null;if(fixedFormat.signed){hex=numeric.toTwos(fixedFormat.width).toHexString()}else{hex=numeric.toHexString();hex=(0,lib$1.hexZeroPad)(hex,fixedFormat.width/8)}var decimal=formatFixed(numeric,fixedFormat.decimals);return new FixedNumber(_constructorGuard,hex,decimal,fixedFormat)};FixedNumber.fromBytes=function(value,format){if(format==null){format="fixed"}var fixedFormat=FixedFormat.from(format);if((0,lib$1.arrayify)(value).length>fixedFormat.width/8){throw new Error("overflow")}var numeric=bignumber.BigNumber.from(value);if(fixedFormat.signed){numeric=numeric.fromTwos(fixedFormat.width)}var hex=numeric.toTwos((fixedFormat.signed?0:1)+fixedFormat.width).toHexString();var decimal=formatFixed(numeric,fixedFormat.decimals);return new FixedNumber(_constructorGuard,hex,decimal,fixedFormat)};FixedNumber.from=function(value,format){if(typeof value==="string"){return FixedNumber.fromString(value,format)}if((0,lib$1.isBytes)(value)){return FixedNumber.fromBytes(value,format)}try{return FixedNumber.fromValue(value,0,format)}catch(error){if(error.code!==lib.Logger.errors.INVALID_ARGUMENT){throw error}}return logger.throwArgumentError("invalid FixedNumber value","value",value)};FixedNumber.isFixedNumber=function(value){return!!(value&&value._isFixedNumber)};return FixedNumber}();exports.FixedNumber=FixedNumber;var ONE=FixedNumber.from(1);var BUMP=FixedNumber.from("0.5")});var fixednumber$1=getDefaultExportFromCjs(fixednumber);var lib$2=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports._base36To16=exports._base16To36=exports.parseFixed=exports.FixedNumber=exports.FixedFormat=exports.formatFixed=exports.BigNumber=void 0;Object.defineProperty(exports,"BigNumber",{enumerable:true,get:function(){return bignumber.BigNumber}});Object.defineProperty(exports,"formatFixed",{enumerable:true,get:function(){return fixednumber.formatFixed}});Object.defineProperty(exports,"FixedFormat",{enumerable:true,get:function(){return fixednumber.FixedFormat}});Object.defineProperty(exports,"FixedNumber",{enumerable:true,get:function(){return fixednumber.FixedNumber}});Object.defineProperty(exports,"parseFixed",{enumerable:true,get:function(){return fixednumber.parseFixed}});var bignumber_2=bignumber;Object.defineProperty(exports,"_base16To36",{enumerable:true,get:function(){return bignumber_2._base16To36}});Object.defineProperty(exports,"_base36To16",{enumerable:true,get:function(){return bignumber_2._base36To16}})});var index$2=getDefaultExportFromCjs(lib$2);var _version$6=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="properties/5.6.0"});var _version$7=getDefaultExportFromCjs(_version$6);var lib$3=createCommonjsModule(function(module,exports){"use strict";var __awaiter=commonjsGlobal&&commonjsGlobal.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};var __generator=commonjsGlobal&&commonjsGlobal.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]=0||type==="tuple"){if(ModifiersNest[name]){return true}}if(ModifiersBytes[name]||name==="payable"){logger.throwArgumentError("invalid modifier","name",name)}return false}function parseParamType(param,allowIndexed){var originalParam=param;function throwError(i){logger.throwArgumentError("unexpected character at position "+i,"param",param)}param=param.replace(/\s/g," ");function newNode(parent){var node={type:"",name:"",parent:parent,state:{allowType:true}};if(allowIndexed){node.indexed=false}return node}var parent={type:"",name:"",state:{allowType:true}};var node=parent;for(var i=0;i2){logger.throwArgumentError("invalid human-readable ABI signature","value",value)}if(!comps[1].match(/^[0-9]+$/)){logger.throwArgumentError("invalid human-readable ABI signature gas","value",value)}params.gas=lib$2.BigNumber.from(comps[1]);return comps[0]}return value}function parseModifiers(value,params){params.constant=false;params.payable=false;params.stateMutability="nonpayable";value.split(" ").forEach(function(modifier){switch(modifier.trim()){case"constant":params.constant=true;break;case"payable":params.payable=true;params.stateMutability="payable";break;case"nonpayable":params.payable=false;params.stateMutability="nonpayable";break;case"pure":params.constant=true;params.stateMutability="pure";break;case"view":params.constant=true;params.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+modifier)}})}function verifyState(value){var result={constant:false,payable:true,stateMutability:"payable"};if(value.stateMutability!=null){result.stateMutability=value.stateMutability;result.constant=result.stateMutability==="view"||result.stateMutability==="pure";if(value.constant!=null){if(!!value.constant!==result.constant){logger.throwArgumentError("cannot have constant function with mutability "+result.stateMutability,"value",value)}}result.payable=result.stateMutability==="payable";if(value.payable!=null){if(!!value.payable!==result.payable){logger.throwArgumentError("cannot have payable function with mutability "+result.stateMutability,"value",value)}}}else if(value.payable!=null){result.payable=!!value.payable;if(value.constant==null&&!result.payable&&value.type!=="constructor"){logger.throwArgumentError("unable to determine stateMutability","value",value)}result.constant=!!value.constant;if(result.constant){result.stateMutability="view"}else{result.stateMutability=result.payable?"payable":"nonpayable"}if(result.payable&&result.constant){logger.throwArgumentError("cannot have constant payable function","value",value)}}else if(value.constant!=null){result.constant=!!value.constant;result.payable=!result.constant;result.stateMutability=result.constant?"view":"payable"}else if(value.type!=="constructor"){logger.throwArgumentError("unable to determine stateMutability","value",value)}return result}var ConstructorFragment=function(_super){__extends(ConstructorFragment,_super);function ConstructorFragment(){return _super!==null&&_super.apply(this,arguments)||this}ConstructorFragment.prototype.format=function(format){if(!format){format=exports.FormatTypes.sighash}if(!exports.FormatTypes[format]){logger.throwArgumentError("invalid format type","format",format)}if(format===exports.FormatTypes.json){return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,gas:this.gas?this.gas.toNumber():undefined,inputs:this.inputs.map(function(input){return JSON.parse(input.format(format))})})}if(format===exports.FormatTypes.sighash){logger.throwError("cannot format a constructor for sighash",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"})}var result="constructor("+this.inputs.map(function(input){return input.format(format)}).join(format===exports.FormatTypes.full?", ":",")+") ";if(this.stateMutability&&this.stateMutability!=="nonpayable"){result+=this.stateMutability+" "}return result.trim()};ConstructorFragment.from=function(value){if(typeof value==="string"){return ConstructorFragment.fromString(value)}return ConstructorFragment.fromObject(value)};ConstructorFragment.fromObject=function(value){if(ConstructorFragment.isConstructorFragment(value)){return value}if(value.type!=="constructor"){logger.throwArgumentError("invalid constructor object","value",value)}var state=verifyState(value);if(state.constant){logger.throwArgumentError("constructor cannot be constant","value",value)}var params={name:null,type:value.type,inputs:value.inputs?value.inputs.map(ParamType.fromObject):[],payable:state.payable,stateMutability:state.stateMutability,gas:value.gas?lib$2.BigNumber.from(value.gas):null};return new ConstructorFragment(_constructorGuard,params)};ConstructorFragment.fromString=function(value){var params={type:"constructor"};value=parseGas(value,params);var parens=value.match(regexParen);if(!parens||parens[1].trim()!=="constructor"){logger.throwArgumentError("invalid constructor string","value",value)}params.inputs=parseParams(parens[2].trim(),false);parseModifiers(parens[3].trim(),params);return ConstructorFragment.fromObject(params)};ConstructorFragment.isConstructorFragment=function(value){return value&&value._isFragment&&value.type==="constructor"};return ConstructorFragment}(Fragment);exports.ConstructorFragment=ConstructorFragment;var FunctionFragment=function(_super){__extends(FunctionFragment,_super);function FunctionFragment(){return _super!==null&&_super.apply(this,arguments)||this}FunctionFragment.prototype.format=function(format){if(!format){format=exports.FormatTypes.sighash}if(!exports.FormatTypes[format]){logger.throwArgumentError("invalid format type","format",format)}if(format===exports.FormatTypes.json){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,gas:this.gas?this.gas.toNumber():undefined,inputs:this.inputs.map(function(input){return JSON.parse(input.format(format))}),outputs:this.outputs.map(function(output){return JSON.parse(output.format(format))})})}var result="";if(format!==exports.FormatTypes.sighash){result+="function "}result+=this.name+"("+this.inputs.map(function(input){return input.format(format)}).join(format===exports.FormatTypes.full?", ":",")+") ";if(format!==exports.FormatTypes.sighash){if(this.stateMutability){if(this.stateMutability!=="nonpayable"){result+=this.stateMutability+" "}}else if(this.constant){result+="view "}if(this.outputs&&this.outputs.length){result+="returns ("+this.outputs.map(function(output){return output.format(format)}).join(", ")+") "}if(this.gas!=null){result+="@"+this.gas.toString()+" "}}return result.trim()};FunctionFragment.from=function(value){if(typeof value==="string"){return FunctionFragment.fromString(value)}return FunctionFragment.fromObject(value)};FunctionFragment.fromObject=function(value){if(FunctionFragment.isFunctionFragment(value)){return value}if(value.type!=="function"){logger.throwArgumentError("invalid function object","value",value)}var state=verifyState(value);var params={type:value.type,name:verifyIdentifier(value.name),constant:state.constant,inputs:value.inputs?value.inputs.map(ParamType.fromObject):[],outputs:value.outputs?value.outputs.map(ParamType.fromObject):[],payable:state.payable,stateMutability:state.stateMutability,gas:value.gas?lib$2.BigNumber.from(value.gas):null};return new FunctionFragment(_constructorGuard,params)};FunctionFragment.fromString=function(value){var params={type:"function"};value=parseGas(value,params);var comps=value.split(" returns ");if(comps.length>2){logger.throwArgumentError("invalid function string","value",value)}var parens=comps[0].match(regexParen);if(!parens){logger.throwArgumentError("invalid function signature","value",value)}params.name=parens[1].trim();if(params.name){verifyIdentifier(params.name)}params.inputs=parseParams(parens[2],false);parseModifiers(parens[3].trim(),params);if(comps.length>1){var returns=comps[1].match(regexParen);if(returns[1].trim()!=""||returns[3].trim()!=""){logger.throwArgumentError("unexpected tokens","value",value)}params.outputs=parseParams(returns[2],false)}else{params.outputs=[]}return FunctionFragment.fromObject(params)};FunctionFragment.isFunctionFragment=function(value){return value&&value._isFragment&&value.type==="function"};return FunctionFragment}(ConstructorFragment);exports.FunctionFragment=FunctionFragment;function checkForbidden(fragment){var sig=fragment.format();if(sig==="Error(string)"||sig==="Panic(uint256)"){logger.throwArgumentError("cannot specify user defined "+sig+" error","fragment",fragment)}return fragment}var ErrorFragment=function(_super){__extends(ErrorFragment,_super);function ErrorFragment(){return _super!==null&&_super.apply(this,arguments)||this}ErrorFragment.prototype.format=function(format){if(!format){format=exports.FormatTypes.sighash}if(!exports.FormatTypes[format]){logger.throwArgumentError("invalid format type","format",format)}if(format===exports.FormatTypes.json){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(function(input){return JSON.parse(input.format(format))})})}var result="";if(format!==exports.FormatTypes.sighash){result+="error "}result+=this.name+"("+this.inputs.map(function(input){return input.format(format)}).join(format===exports.FormatTypes.full?", ":",")+") ";return result.trim()};ErrorFragment.from=function(value){if(typeof value==="string"){return ErrorFragment.fromString(value)}return ErrorFragment.fromObject(value)};ErrorFragment.fromObject=function(value){if(ErrorFragment.isErrorFragment(value)){return value}if(value.type!=="error"){logger.throwArgumentError("invalid error object","value",value)}var params={type:value.type,name:verifyIdentifier(value.name),inputs:value.inputs?value.inputs.map(ParamType.fromObject):[]};return checkForbidden(new ErrorFragment(_constructorGuard,params))};ErrorFragment.fromString=function(value){var params={type:"error"};var parens=value.match(regexParen);if(!parens){logger.throwArgumentError("invalid error signature","value",value)}params.name=parens[1].trim();if(params.name){verifyIdentifier(params.name)}params.inputs=parseParams(parens[2],false);return checkForbidden(ErrorFragment.fromObject(params))};ErrorFragment.isErrorFragment=function(value){return value&&value._isFragment&&value.type==="error"};return ErrorFragment}(Fragment);exports.ErrorFragment=ErrorFragment;function verifyType(type){if(type.match(/^uint($|[^1-9])/)){type="uint256"+type.substring(4)}else if(type.match(/^int($|[^1-9])/)){type="int256"+type.substring(3)}return type}var regexIdentifier=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function verifyIdentifier(value){if(!value||!value.match(regexIdentifier)){logger.throwArgumentError('invalid identifier "'+value+'"',"value",value)}return value}var regexParen=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function splitNesting(value){value=value.trim();var result=[];var accum="";var depth=0;for(var offset=0;offsetthis.wordSize){logger.throwError("value out-of-bounds",lib.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:bytes.length})}if(bytes.length%this.wordSize){bytes=(0,lib$1.concat)([this._padding.slice(bytes.length%this.wordSize),bytes])}return bytes};Writer.prototype.writeValue=function(value){return this._writeData(this._getValue(value))};Writer.prototype.writeUpdatableValue=function(){var _this=this;var offset=this._data.length;this._data.push(this._padding);this._dataLength+=this.wordSize;return function(value){_this._data[offset]=_this._getValue(value)}};return Writer}();exports.Writer=Writer;var Reader=function(){function Reader(data,wordSize,coerceFunc,allowLoose){(0,lib$3.defineReadOnly)(this,"_data",(0,lib$1.arrayify)(data));(0,lib$3.defineReadOnly)(this,"wordSize",wordSize||32);(0,lib$3.defineReadOnly)(this,"_coerceFunc",coerceFunc);(0,lib$3.defineReadOnly)(this,"allowLoose",allowLoose);this._offset=0}Object.defineProperty(Reader.prototype,"data",{get:function(){return(0,lib$1.hexlify)(this._data)},enumerable:false,configurable:true});Object.defineProperty(Reader.prototype,"consumed",{get:function(){return this._offset},enumerable:false,configurable:true});Reader.coerce=function(name,value){var match=name.match("^u?int([0-9]+)$");if(match&&parseInt(match[1])<=48){value=value.toNumber()}return value};Reader.prototype.coerce=function(name,value){if(this._coerceFunc){return this._coerceFunc(name,value)}return Reader.coerce(name,value)};Reader.prototype._peekBytes=function(offset,length,loose){var alignedLength=Math.ceil(length/this.wordSize)*this.wordSize;if(this._offset+alignedLength>this._data.length){if(this.allowLoose&&loose&&this._offset+length<=this._data.length){alignedLength=length}else{logger.throwError("data out-of-bounds",lib.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+alignedLength})}}return this._data.slice(this._offset,this._offset+alignedLength)};Reader.prototype.subReader=function(offset){return new Reader(this._data.slice(this._offset+offset),this.wordSize,this._coerceFunc,this.allowLoose)};Reader.prototype.readBytes=function(length,loose){var bytes=this._peekBytes(0,length,!!loose);this._offset+=bytes.length;return bytes.slice(0,length)};Reader.prototype.readValue=function(){return lib$2.BigNumber.from(this.readBytes(this.wordSize))};return Reader}();exports.Reader=Reader});var abstractCoder$1=getDefaultExportFromCjs(abstractCoder);var sha3=createCommonjsModule(function(module){(function(){"use strict";var INPUT_ERROR="input is invalid type";var FINALIZE_ERROR="finalize already called";var WINDOW=typeof window==="object";var root=WINDOW?window:{};if(root.JS_SHA3_NO_WINDOW){WINDOW=false}var WEB_WORKER=!WINDOW&&typeof self==="object";var NODE_JS=!root.JS_SHA3_NO_NODE_JS&&typeof process==="object"&&process.versions&&process.versions.node;if(NODE_JS){root=commonjsGlobal}else if(WEB_WORKER){root=self}var COMMON_JS=!root.JS_SHA3_NO_COMMON_JS&&"object"==="object"&&module.exports;var AMD=typeof undefined==="function"&&undefined.amd;var ARRAY_BUFFER=!root.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!=="undefined";var HEX_CHARS="0123456789abcdef".split("");var SHAKE_PADDING=[31,7936,2031616,520093696];var CSHAKE_PADDING=[4,1024,262144,67108864];var KECCAK_PADDING=[1,256,65536,16777216];var PADDING=[6,1536,393216,100663296];var SHIFT=[0,8,16,24];var RC=[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];var BITS=[224,256,384,512];var SHAKE_BITS=[128,256];var OUTPUT_TYPES=["hex","buffer","arrayBuffer","array","digest"];var CSHAKE_BYTEPAD={128:168,256:136};if(root.JS_SHA3_NO_NODE_JS||!Array.isArray){Array.isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"}}if(ARRAY_BUFFER&&(root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)){ArrayBuffer.isView=function(obj){return typeof obj==="object"&&obj.buffer&&obj.buffer.constructor===ArrayBuffer}}var createOutputMethod=function(bits,padding,outputType){return function(message){return new Keccak(bits,padding,bits).update(message)[outputType]()}};var createShakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits){return new Keccak(bits,padding,outputBits).update(message)[outputType]()}};var createCshakeOutputMethod=function(bits,padding,outputType){return function(message,outputBits,n,s){return methods["cshake"+bits].update(message,outputBits,n,s)[outputType]()}};var createKmacOutputMethod=function(bits,padding,outputType){return function(key,message,outputBits,s){return methods["kmac"+bits].update(key,message,outputBits,s)[outputType]()}};var createOutputMethods=function(method,createMethod,bits,padding){for(var i=0;i>5;this.byteCount=this.blockCount<<2;this.outputBlocks=outputBits>>5;this.extraBytes=(outputBits&31)>>3;for(var i=0;i<50;++i){this.s[i]=0}}Keccak.prototype.update=function(message){if(this.finalized){throw new Error(FINALIZE_ERROR)}var notString,type=typeof message;if(type!=="string"){if(type==="object"){if(message===null){throw new Error(INPUT_ERROR)}else if(ARRAY_BUFFER&&message.constructor===ArrayBuffer){message=new Uint8Array(message)}else if(!Array.isArray(message)){if(!ARRAY_BUFFER||!ArrayBuffer.isView(message)){throw new Error(INPUT_ERROR)}}}else{throw new Error(INPUT_ERROR)}notString=true}var blocks=this.blocks,byteCount=this.byteCount,length=message.length,blockCount=this.blockCount,index=0,s=this.s,i,code;while(index>2]|=message[index]<>2]|=code<>2]|=(192|code>>6)<>2]|=(128|code&63)<=57344){blocks[i>>2]|=(224|code>>12)<>2]|=(128|code>>6&63)<>2]|=(128|code&63)<>2]|=(240|code>>18)<>2]|=(128|code>>12&63)<>2]|=(128|code>>6&63)<>2]|=(128|code&63)<=byteCount){this.start=i-byteCount;this.block=blocks[blockCount];for(i=0;i>8;o=x&255;while(o>0){bytes.unshift(o);x=x>>8;o=x&255;++n}if(right){bytes.push(n)}else{bytes.unshift(n)}this.update(bytes);return bytes.length};Keccak.prototype.encodeString=function(str){var notString,type=typeof str;if(type!=="string"){if(type==="object"){if(str===null){throw new Error(INPUT_ERROR)}else if(ARRAY_BUFFER&&str.constructor===ArrayBuffer){str=new Uint8Array(str)}else if(!Array.isArray(str)){if(!ARRAY_BUFFER||!ArrayBuffer.isView(str)){throw new Error(INPUT_ERROR)}}}else{throw new Error(INPUT_ERROR)}notString=true}var bytes=0,length=str.length;if(notString){bytes=length}else{for(var i=0;i=57344){bytes+=3}else{code=65536+((code&1023)<<10|str.charCodeAt(++i)&1023);bytes+=4}}}bytes+=this.encode(bytes*8);this.update(str);return bytes};Keccak.prototype.bytepad=function(strs,w){var bytes=this.encode(w);for(var i=0;i>2]|=this.padding[i&3];if(this.lastByteIndex===this.byteCount){blocks[0]=blocks[blockCount];for(i=1;i>4&15]+HEX_CHARS[block&15]+HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]+HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]+HEX_CHARS[block>>28&15]+HEX_CHARS[block>>24&15]}if(j%blockCount===0){f(s);i=0}}if(extraBytes){block=s[i];hex+=HEX_CHARS[block>>4&15]+HEX_CHARS[block&15];if(extraBytes>1){hex+=HEX_CHARS[block>>12&15]+HEX_CHARS[block>>8&15]}if(extraBytes>2){hex+=HEX_CHARS[block>>20&15]+HEX_CHARS[block>>16&15]}}return hex};Keccak.prototype.arrayBuffer=function(){this.finalize();var blockCount=this.blockCount,s=this.s,outputBlocks=this.outputBlocks,extraBytes=this.extraBytes,i=0,j=0;var bytes=this.outputBits>>3;var buffer;if(extraBytes){buffer=new ArrayBuffer(outputBlocks+1<<2)}else{buffer=new ArrayBuffer(bytes)}var array=new Uint32Array(buffer);while(j>8&255;array[offset+2]=block>>16&255;array[offset+3]=block>>24&255}if(j%blockCount===0){f(s)}}if(extraBytes){offset=j<<2;block=s[i];array[offset]=block&255;if(extraBytes>1){array[offset+1]=block>>8&255}if(extraBytes>2){array[offset+2]=block>>16&255}}return array};function Kmac(bits,padding,outputBits){Keccak.call(this,bits,padding,outputBits)}Kmac.prototype=new Keccak;Kmac.prototype.finalize=function(){this.encode(this.outputBits,true);return Keccak.prototype.finalize.call(this)};var f=function(s){var h,l,n,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16,b17,b18,b19,b20,b21,b22,b23,b24,b25,b26,b27,b28,b29,b30,b31,b32,b33,b34,b35,b36,b37,b38,b39,b40,b41,b42,b43,b44,b45,b46,b47,b48,b49;for(n=0;n<48;n+=2){c0=s[0]^s[10]^s[20]^s[30]^s[40];c1=s[1]^s[11]^s[21]^s[31]^s[41];c2=s[2]^s[12]^s[22]^s[32]^s[42];c3=s[3]^s[13]^s[23]^s[33]^s[43];c4=s[4]^s[14]^s[24]^s[34]^s[44];c5=s[5]^s[15]^s[25]^s[35]^s[45];c6=s[6]^s[16]^s[26]^s[36]^s[46];c7=s[7]^s[17]^s[27]^s[37]^s[47];c8=s[8]^s[18]^s[28]^s[38]^s[48];c9=s[9]^s[19]^s[29]^s[39]^s[49];h=c8^(c2<<1|c3>>>31);l=c9^(c3<<1|c2>>>31);s[0]^=h;s[1]^=l;s[10]^=h;s[11]^=l;s[20]^=h;s[21]^=l;s[30]^=h;s[31]^=l;s[40]^=h;s[41]^=l;h=c0^(c4<<1|c5>>>31);l=c1^(c5<<1|c4>>>31);s[2]^=h;s[3]^=l;s[12]^=h;s[13]^=l;s[22]^=h;s[23]^=l;s[32]^=h;s[33]^=l;s[42]^=h;s[43]^=l;h=c2^(c6<<1|c7>>>31);l=c3^(c7<<1|c6>>>31);s[4]^=h;s[5]^=l;s[14]^=h;s[15]^=l;s[24]^=h;s[25]^=l;s[34]^=h;s[35]^=l;s[44]^=h;s[45]^=l;h=c4^(c8<<1|c9>>>31);l=c5^(c9<<1|c8>>>31);s[6]^=h;s[7]^=l;s[16]^=h;s[17]^=l;s[26]^=h;s[27]^=l;s[36]^=h;s[37]^=l;s[46]^=h;s[47]^=l;h=c6^(c0<<1|c1>>>31);l=c7^(c1<<1|c0>>>31);s[8]^=h;s[9]^=l;s[18]^=h;s[19]^=l;s[28]^=h;s[29]^=l;s[38]^=h;s[39]^=l;s[48]^=h;s[49]^=l;b0=s[0];b1=s[1];b32=s[11]<<4|s[10]>>>28;b33=s[10]<<4|s[11]>>>28;b14=s[20]<<3|s[21]>>>29;b15=s[21]<<3|s[20]>>>29;b46=s[31]<<9|s[30]>>>23;b47=s[30]<<9|s[31]>>>23;b28=s[40]<<18|s[41]>>>14;b29=s[41]<<18|s[40]>>>14;b20=s[2]<<1|s[3]>>>31;b21=s[3]<<1|s[2]>>>31;b2=s[13]<<12|s[12]>>>20;b3=s[12]<<12|s[13]>>>20;b34=s[22]<<10|s[23]>>>22;b35=s[23]<<10|s[22]>>>22;b16=s[33]<<13|s[32]>>>19;b17=s[32]<<13|s[33]>>>19;b48=s[42]<<2|s[43]>>>30;b49=s[43]<<2|s[42]>>>30;b40=s[5]<<30|s[4]>>>2;b41=s[4]<<30|s[5]>>>2;b22=s[14]<<6|s[15]>>>26;b23=s[15]<<6|s[14]>>>26;b4=s[25]<<11|s[24]>>>21;b5=s[24]<<11|s[25]>>>21;b36=s[34]<<15|s[35]>>>17;b37=s[35]<<15|s[34]>>>17;b18=s[45]<<29|s[44]>>>3;b19=s[44]<<29|s[45]>>>3;b10=s[6]<<28|s[7]>>>4;b11=s[7]<<28|s[6]>>>4;b42=s[17]<<23|s[16]>>>9;b43=s[16]<<23|s[17]>>>9;b24=s[26]<<25|s[27]>>>7;b25=s[27]<<25|s[26]>>>7;b6=s[36]<<21|s[37]>>>11;b7=s[37]<<21|s[36]>>>11;b38=s[47]<<24|s[46]>>>8;b39=s[46]<<24|s[47]>>>8;b30=s[8]<<27|s[9]>>>5;b31=s[9]<<27|s[8]>>>5;b12=s[18]<<20|s[19]>>>12;b13=s[19]<<20|s[18]>>>12;b44=s[29]<<7|s[28]>>>25;b45=s[28]<<7|s[29]>>>25;b26=s[38]<<8|s[39]>>>24;b27=s[39]<<8|s[38]>>>24;b8=s[48]<<14|s[49]>>>18;b9=s[49]<<14|s[48]>>>18;s[0]=b0^~b2&b4;s[1]=b1^~b3&b5;s[10]=b10^~b12&b14;s[11]=b11^~b13&b15;s[20]=b20^~b22&b24;s[21]=b21^~b23&b25;s[30]=b30^~b32&b34;s[31]=b31^~b33&b35;s[40]=b40^~b42&b44;s[41]=b41^~b43&b45;s[2]=b2^~b4&b6;s[3]=b3^~b5&b7;s[12]=b12^~b14&b16;s[13]=b13^~b15&b17;s[22]=b22^~b24&b26;s[23]=b23^~b25&b27;s[32]=b32^~b34&b36;s[33]=b33^~b35&b37;s[42]=b42^~b44&b46;s[43]=b43^~b45&b47;s[4]=b4^~b6&b8;s[5]=b5^~b7&b9;s[14]=b14^~b16&b18;s[15]=b15^~b17&b19;s[24]=b24^~b26&b28;s[25]=b25^~b27&b29;s[34]=b34^~b36&b38;s[35]=b35^~b37&b39;s[44]=b44^~b46&b48;s[45]=b45^~b47&b49;s[6]=b6^~b8&b0;s[7]=b7^~b9&b1;s[16]=b16^~b18&b10;s[17]=b17^~b19&b11;s[26]=b26^~b28&b20;s[27]=b27^~b29&b21;s[36]=b36^~b38&b30;s[37]=b37^~b39&b31;s[46]=b46^~b48&b40;s[47]=b47^~b49&b41;s[8]=b8^~b0&b2;s[9]=b9^~b1&b3;s[18]=b18^~b10&b12;s[19]=b19^~b11&b13;s[28]=b28^~b20&b22;s[29]=b29^~b21&b23;s[38]=b38^~b30&b32;s[39]=b39^~b31&b33;s[48]=b48^~b40&b42;s[49]=b49^~b41&b43;s[0]^=RC[n];s[1]^=RC[n+1]}};if(COMMON_JS){module.exports=methods}else{for(i=0;i>=8}return result}function unarrayifyInteger(data,offset,length){var result=0;for(var i=0;ioffset+1+length){logger.throwError("child data too short",lib.Logger.errors.BUFFER_OVERRUN,{})}}return{consumed:1+length,result:result}}function _decode(data,offset){if(data.length===0){logger.throwError("data too short",lib.Logger.errors.BUFFER_OVERRUN,{})}if(data[offset]>=248){var lengthLength=data[offset]-247;if(offset+1+lengthLength>data.length){logger.throwError("data short segment too short",lib.Logger.errors.BUFFER_OVERRUN,{})}var length_2=unarrayifyInteger(data,offset+1,lengthLength);if(offset+1+lengthLength+length_2>data.length){logger.throwError("data long segment too short",lib.Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length_2)}else if(data[offset]>=192){var length_3=data[offset]-192;if(offset+1+length_3>data.length){logger.throwError("data array too short",lib.Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren(data,offset,offset+1,length_3)}else if(data[offset]>=184){var lengthLength=data[offset]-183;if(offset+1+lengthLength>data.length){logger.throwError("data array too short",lib.Logger.errors.BUFFER_OVERRUN,{})}var length_4=unarrayifyInteger(data,offset+1,lengthLength);if(offset+1+lengthLength+length_4>data.length){logger.throwError("data array too short",lib.Logger.errors.BUFFER_OVERRUN,{})}var result=(0,lib$1.hexlify)(data.slice(offset+1+lengthLength,offset+1+lengthLength+length_4));return{consumed:1+lengthLength+length_4,result:result}}else if(data[offset]>=128){var length_5=data[offset]-128;if(offset+1+length_5>data.length){logger.throwError("data too short",lib.Logger.errors.BUFFER_OVERRUN,{})}var result=(0,lib$1.hexlify)(data.slice(offset+1,offset+1+length_5));return{consumed:1+length_5,result:result}}return{consumed:1,result:(0,lib$1.hexlify)(data[offset])}}function decode(data){var bytes=(0,lib$1.arrayify)(data);var decoded=_decode(bytes,0);if(decoded.consumed!==bytes.length){logger.throwArgumentError("invalid rlp data","data",data)}return decoded.result}exports.decode=decode});var index$5=getDefaultExportFromCjs(lib$5);var _version$c=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="address/5.6.1"});var _version$d=getDefaultExportFromCjs(_version$c);var lib$6=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getCreate2Address=exports.getContractAddress=exports.getIcapAddress=exports.isAddress=exports.getAddress=void 0;var logger=new lib.Logger(_version$c.version);function getChecksumAddress(address){if(!(0,lib$1.isHexString)(address,20)){logger.throwArgumentError("invalid address","address",address)}address=address.toLowerCase();var chars=address.substring(2).split("");var expanded=new Uint8Array(40);for(var i=0;i<40;i++){expanded[i]=chars[i].charCodeAt(0)}var hashed=(0,lib$1.arrayify)((0,lib$4.keccak256)(expanded));for(var i=0;i<40;i+=2){if(hashed[i>>1]>>4>=8){chars[i]=chars[i].toUpperCase()}if((hashed[i>>1]&15)>=8){chars[i+1]=chars[i+1].toUpperCase()}}return"0x"+chars.join("")}var MAX_SAFE_INTEGER=9007199254740991;function log10(x){if(Math.log10){return Math.log10(x)}return Math.log(x)/Math.LN10}var ibanLookup={};for(var i=0;i<10;i++){ibanLookup[String(i)]=String(i)}for(var i=0;i<26;i++){ibanLookup[String.fromCharCode(65+i)]=String(10+i)}var safeDigits=Math.floor(log10(MAX_SAFE_INTEGER));function ibanChecksum(address){address=address.toUpperCase();address=address.substring(4)+address.substring(0,2)+"00";var expanded=address.split("").map(function(c){return ibanLookup[c]}).join("");while(expanded.length>=safeDigits){var block=expanded.substring(0,safeDigits);expanded=parseInt(block,10)%97+expanded.substring(block.length)}var checksum=String(98-parseInt(expanded,10)%97);while(checksum.length<2){checksum="0"+checksum}return checksum}function getAddress(address){var result=null;if(typeof address!=="string"){logger.throwArgumentError("invalid address","address",address)}if(address.match(/^(0x)?[0-9a-fA-F]{40}$/)){if(address.substring(0,2)!=="0x"){address="0x"+address}result=getChecksumAddress(address);if(address.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&result!==address){logger.throwArgumentError("bad address checksum","address",address)}}else if(address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){if(address.substring(2,4)!==ibanChecksum(address)){logger.throwArgumentError("bad icap checksum","address",address)}result=(0,lib$2._base36To16)(address.substring(4));while(result.length<40){result="0"+result}result=getChecksumAddress("0x"+result)}else{logger.throwArgumentError("invalid address","address",address)}return result}exports.getAddress=getAddress;function isAddress(address){try{getAddress(address);return true}catch(error){}return false}exports.isAddress=isAddress;function getIcapAddress(address){var base36=(0,lib$2._base16To36)(getAddress(address).substring(2)).toUpperCase();while(base36.length<30){base36="0"+base36}return"XE"+ibanChecksum("XE00"+base36)+base36}exports.getIcapAddress=getIcapAddress;function getContractAddress(transaction){var from=null;try{from=getAddress(transaction.from)}catch(error){logger.throwArgumentError("missing from address","transaction",transaction)}var nonce=(0,lib$1.stripZeros)((0,lib$1.arrayify)(lib$2.BigNumber.from(transaction.nonce).toHexString()));return getAddress((0,lib$1.hexDataSlice)((0,lib$4.keccak256)((0,lib$5.encode)([from,nonce])),12))}exports.getContractAddress=getContractAddress;function getCreate2Address(from,salt,initCodeHash){if((0,lib$1.hexDataLength)(salt)!==32){logger.throwArgumentError("salt must be 32 bytes","salt",salt)}if((0,lib$1.hexDataLength)(initCodeHash)!==32){logger.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",initCodeHash)}return getAddress((0,lib$1.hexDataSlice)((0,lib$4.keccak256)((0,lib$1.concat)(["0xff",getAddress(from),salt,initCodeHash])),12))}exports.getCreate2Address=getCreate2Address});var index$6=getDefaultExportFromCjs(lib$6);var address=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.AddressCoder=void 0;var AddressCoder=function(_super){__extends(AddressCoder,_super);function AddressCoder(localName){return _super.call(this,"address","address",localName,false)||this}AddressCoder.prototype.defaultValue=function(){return"0x0000000000000000000000000000000000000000"};AddressCoder.prototype.encode=function(writer,value){try{value=(0,lib$6.getAddress)(value)}catch(error){this._throwError(error.message,value)}return writer.writeValue(value)};AddressCoder.prototype.decode=function(reader){return(0,lib$6.getAddress)((0,lib$1.hexZeroPad)(reader.readValue().toHexString(),20))};return AddressCoder}(abstractCoder.Coder);exports.AddressCoder=AddressCoder});var address$1=getDefaultExportFromCjs(address);var anonymous=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.AnonymousCoder=void 0;var AnonymousCoder=function(_super){__extends(AnonymousCoder,_super);function AnonymousCoder(coder){var _this=_super.call(this,coder.name,coder.type,undefined,coder.dynamic)||this;_this.coder=coder;return _this}AnonymousCoder.prototype.defaultValue=function(){return this.coder.defaultValue()};AnonymousCoder.prototype.encode=function(writer,value){return this.coder.encode(writer,value)};AnonymousCoder.prototype.decode=function(reader){return this.coder.decode(reader)};return AnonymousCoder}(abstractCoder.Coder);exports.AnonymousCoder=AnonymousCoder});var anonymous$1=getDefaultExportFromCjs(anonymous);var array=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.ArrayCoder=exports.unpack=exports.pack=void 0;var logger=new lib.Logger(_version$8.version);function pack(writer,coders,values){var arrayValues=null;if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){var unique_1={};arrayValues=coders.map(function(coder){var name=coder.localName;if(!name){logger.throwError("cannot encode object for signature with missing names",lib.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:coder,value:values})}if(unique_1[name]){logger.throwError("cannot encode object for signature with duplicate names",lib.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:coder,value:values})}unique_1[name]=true;return values[name]})}else{logger.throwArgumentError("invalid tuple value","tuple",values)}if(coders.length!==arrayValues.length){logger.throwArgumentError("types/value length mismatch","tuple",values)}var staticWriter=new abstractCoder.Writer(writer.wordSize);var dynamicWriter=new abstractCoder.Writer(writer.wordSize);var updateFuncs=[];coders.forEach(function(coder,index){var value=arrayValues[index];if(coder.dynamic){var dynamicOffset_1=dynamicWriter.length;coder.encode(dynamicWriter,value);var updateFunc_1=staticWriter.writeUpdatableValue();updateFuncs.push(function(baseOffset){updateFunc_1(baseOffset+dynamicOffset_1)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(function(func){func(staticWriter.length)});var length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}exports.pack=pack;function unpack(reader,coders){var values=[];var baseReader=reader.subReader(0);coders.forEach(function(coder){var value=null;if(coder.dynamic){var offset=reader.readValue();var offsetReader=baseReader.subReader(offset.toNumber());try{value=coder.decode(offsetReader)}catch(error){if(error.code===lib.Logger.errors.BUFFER_OVERRUN){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(error.code===lib.Logger.errors.BUFFER_OVERRUN){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value!=undefined){values.push(value)}});var uniqueNames=coders.reduce(function(accum,coder){var name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});coders.forEach(function(coder,index){var name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}var value=values[index];if(value instanceof Error){Object.defineProperty(values,name,{enumerable:true,get:function(){throw value}})}else{values[name]=value}});var _loop_1=function(i){var value=values[i];if(value instanceof Error){Object.defineProperty(values,i,{enumerable:true,get:function(){throw value}})}};for(var i=0;i=0?length:"")+"]";var dynamic=length===-1||coder.dynamic;_this=_super.call(this,"array",type,localName,dynamic)||this;_this.coder=coder;_this.length=length;return _this}ArrayCoder.prototype.defaultValue=function(){var defaultChild=this.coder.defaultValue();var result=[];for(var i=0;ireader._data.length){logger.throwError("insufficient data length",lib.Logger.errors.BUFFER_OVERRUN,{length:reader._data.length,count:count})}}var coders=[];for(var i=0;i>6!==2){break}i++}return i}if(reason===Utf8ErrorReason.OVERRUN){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason===Utf8ErrorReason.OVERLONG){output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes,output,badCodepoint)}exports.Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(bytes,onError){if(onError==null){onError=exports.Utf8ErrorFuncs.error}bytes=(0,lib$1.arrayify)(bytes);var result=[];var i=0;while(i>7===0){result.push(c);continue}var extraLength=null;var overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError(Utf8ErrorReason.UNEXPECTED_CONTINUE,i-1,bytes,result)}else{i+=onError(Utf8ErrorReason.BAD_PREFIX,i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError(Utf8ErrorReason.OVERRUN,i-1,bytes,result);continue}var res=c&(1<<8-extraLength-1)-1;for(var j=0;j1114111){i+=onError(Utf8ErrorReason.OUT_OF_RANGE,i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError(Utf8ErrorReason.UTF16_SURROGATE,i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError(Utf8ErrorReason.OVERLONG,i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){if(form===void 0){form=UnicodeNormalizationForm.current}if(form!=UnicodeNormalizationForm.current){logger.checkNormalize();str=str.normalize(form)}var result=[];for(var i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;var c2=str.charCodeAt(i);if(i>=str.length||(c2&64512)!==56320){throw new Error("invalid utf-8 string")}var pair=65536+((c&1023)<<10)+(c2&1023);result.push(pair>>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return(0,lib$1.arrayify)(result)}exports.toUtf8Bytes=toUtf8Bytes;function escapeChar(value){var hex="0000"+value.toString(16);return"\\u"+hex.substring(hex.length-4)}function _toEscapedUtf8String(bytes,onError){return'"'+getUtf8CodePoints(bytes,onError).map(function(codePoint){if(codePoint<256){switch(codePoint){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(codePoint>=32&&codePoint<127){return String.fromCharCode(codePoint)}}if(codePoint<=65535){return escapeChar(codePoint)}codePoint-=65536;return escapeChar((codePoint>>10&1023)+55296)+escapeChar((codePoint&1023)+56320)}).join("")+'"'}exports._toEscapedUtf8String=_toEscapedUtf8String;function _toUtf8String(codePoints){return codePoints.map(function(codePoint){if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}exports._toUtf8String=_toUtf8String;function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}exports.toUtf8String=toUtf8String;function toUtf8CodePoints(str,form){if(form===void 0){form=UnicodeNormalizationForm.current}return getUtf8CodePoints(toUtf8Bytes(str,form))}exports.toUtf8CodePoints=toUtf8CodePoints});var utf8$1=getDefaultExportFromCjs(utf8);var bytes32=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.parseBytes32String=exports.formatBytes32String=void 0;function formatBytes32String(text){var bytes=(0,utf8.toUtf8Bytes)(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return(0,lib$1.hexlify)((0,lib$1.concat)([bytes,lib$7.HashZero]).slice(0,32))}exports.formatBytes32String=formatBytes32String;function parseBytes32String(bytes){var data=(0,lib$1.arrayify)(bytes);if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}var length=31;while(data[length-1]===0){length--}return(0,utf8.toUtf8String)(data.slice(0,length))}exports.parseBytes32String=parseBytes32String});var bytes32$1=getDefaultExportFromCjs(bytes32);var idna=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.nameprep=exports._nameprepTableC=exports._nameprepTableB2=exports._nameprepTableA1=void 0;function bytes2(data){if(data.length%4!==0){throw new Error("bad data")}var result=[];for(var i=0;i=lo&&value<=lo+range.h&&(value-lo)%(range.d||1)===0){if(range.e&&range.e.indexOf(value-lo)!==-1){continue}return range}}return null}var Table_A_1_ranges=createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d");var Table_B_1_flags="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(function(v){return parseInt(v,16)});var Table_B_2_ranges=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}];var Table_B_2_lut_abs=createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3");var Table_B_2_lut_rel=createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7");var Table_B_2_complex=createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",bytes2);var Table_C_ranges=createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function flatten(values){return values.reduce(function(accum,value){value.forEach(function(value){accum.push(value)});return accum},[])}function _nameprepTableA1(codepoint){return!!matchMap(codepoint,Table_A_1_ranges)}exports._nameprepTableA1=_nameprepTableA1;function _nameprepTableB2(codepoint){var range=matchMap(codepoint,Table_B_2_ranges);if(range){return[codepoint+range.s]}var codes=Table_B_2_lut_abs[codepoint];if(codes){return codes}var shift=Table_B_2_lut_rel[codepoint];if(shift){return[codepoint+shift[0]]}var complex=Table_B_2_complex[codepoint];if(complex){return complex}return null}exports._nameprepTableB2=_nameprepTableB2;function _nameprepTableC(codepoint){return!!matchMap(codepoint,Table_C_ranges)}exports._nameprepTableC=_nameprepTableC;function nameprep(value){if(value.match(/^[a-z0-9-]*$/i)&&value.length<=59){return value.toLowerCase()}var codes=(0,utf8.toUtf8CodePoints)(value);codes=flatten(codes.map(function(code){if(Table_B_1_flags.indexOf(code)>=0){return[]}if(code>=65024&&code<=65039){return[]}var codesTableB2=_nameprepTableB2(code);if(codesTableB2){return codesTableB2}return[code]}));codes=(0,utf8.toUtf8CodePoints)((0,utf8._toUtf8String)(codes),utf8.UnicodeNormalizationForm.NFKC);codes.forEach(function(code){if(_nameprepTableC(code)){throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}});codes.forEach(function(code){if(_nameprepTableA1(code)){throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}});var name=(0,utf8._toUtf8String)(codes);if(name.substring(0,1)==="-"||name.substring(2,4)==="--"||name.substring(name.length-1)==="-"){throw new Error("invalid hyphen")}if(name.length>63){throw new Error("too long")}return name}exports.nameprep=nameprep});var idna$1=getDefaultExportFromCjs(idna);var lib$8=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.nameprep=exports.parseBytes32String=exports.formatBytes32String=exports.UnicodeNormalizationForm=exports.Utf8ErrorReason=exports.Utf8ErrorFuncs=exports.toUtf8String=exports.toUtf8CodePoints=exports.toUtf8Bytes=exports._toEscapedUtf8String=void 0;Object.defineProperty(exports,"formatBytes32String",{enumerable:true,get:function(){return bytes32.formatBytes32String}});Object.defineProperty(exports,"parseBytes32String",{enumerable:true,get:function(){return bytes32.parseBytes32String}});Object.defineProperty(exports,"nameprep",{enumerable:true,get:function(){return idna.nameprep}});Object.defineProperty(exports,"_toEscapedUtf8String",{enumerable:true,get:function(){return utf8._toEscapedUtf8String}});Object.defineProperty(exports,"toUtf8Bytes",{enumerable:true,get:function(){return utf8.toUtf8Bytes}});Object.defineProperty(exports,"toUtf8CodePoints",{enumerable:true,get:function(){return utf8.toUtf8CodePoints}});Object.defineProperty(exports,"toUtf8String",{enumerable:true,get:function(){return utf8.toUtf8String}});Object.defineProperty(exports,"UnicodeNormalizationForm",{enumerable:true,get:function(){return utf8.UnicodeNormalizationForm}});Object.defineProperty(exports,"Utf8ErrorFuncs",{enumerable:true,get:function(){return utf8.Utf8ErrorFuncs}});Object.defineProperty(exports,"Utf8ErrorReason",{enumerable:true,get:function(){return utf8.Utf8ErrorReason}})});var index$8=getDefaultExportFromCjs(lib$8);var string=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.StringCoder=void 0;var StringCoder=function(_super){__extends(StringCoder,_super);function StringCoder(localName){return _super.call(this,"string",localName)||this}StringCoder.prototype.defaultValue=function(){return""};StringCoder.prototype.encode=function(writer,value){return _super.prototype.encode.call(this,writer,(0,lib$8.toUtf8Bytes)(value))};StringCoder.prototype.decode=function(reader){return(0,lib$8.toUtf8String)(_super.prototype.decode.call(this,reader))};return StringCoder}(bytes.DynamicBytesCoder);exports.StringCoder=StringCoder});var string$1=getDefaultExportFromCjs(string);var tuple=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.TupleCoder=void 0;var TupleCoder=function(_super){__extends(TupleCoder,_super);function TupleCoder(coders,localName){var _this=this;var dynamic=false;var types=[];coders.forEach(function(coder){if(coder.dynamic){dynamic=true}types.push(coder.type)});var type="tuple("+types.join(",")+")";_this=_super.call(this,"tuple",type,localName,dynamic)||this;_this.coders=coders;return _this}TupleCoder.prototype.defaultValue=function(){var values=[];this.coders.forEach(function(coder){values.push(coder.defaultValue())});var uniqueNames=this.coders.reduce(function(accum,coder){var name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach(function(coder,index){var name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)};TupleCoder.prototype.encode=function(writer,value){return(0,array.pack)(writer,this.coders,value)};TupleCoder.prototype.decode=function(reader){return reader.coerce(this.name,(0,array.unpack)(reader,this.coders))};return TupleCoder}(abstractCoder.Coder);exports.TupleCoder=TupleCoder});var tuple$1=getDefaultExportFromCjs(tuple);var abiCoder=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.defaultAbiCoder=exports.AbiCoder=void 0;var logger=new lib.Logger(_version$8.version);var paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);var paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);var AbiCoder=function(){function AbiCoder(coerceFunc){(0,lib$3.defineReadOnly)(this,"coerceFunc",coerceFunc||null)}AbiCoder.prototype._getCoder=function(param){var _this=this;switch(param.baseType){case"address":return new address.AddressCoder(param.name);case"bool":return new boolean_1.BooleanCoder(param.name);case"string":return new string.StringCoder(param.name);case"bytes":return new bytes.BytesCoder(param.name);case"array":return new array.ArrayCoder(this._getCoder(param.arrayChildren),param.arrayLength,param.name);case"tuple":return new tuple.TupleCoder((param.components||[]).map(function(component){return _this._getCoder(component)}),param.name);case"":return new _null.NullCoder(param.name)}var match=param.type.match(paramTypeNumber);if(match){var size=parseInt(match[2]||"256");if(size===0||size>256||size%8!==0){logger.throwArgumentError("invalid "+match[1]+" bit length","param",param)}return new number.NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){var size=parseInt(match[1]);if(size===0||size>32){logger.throwArgumentError("invalid bytes length","param",param)}return new fixedBytes.FixedBytesCoder(size,param.name)}return logger.throwArgumentError("invalid type","type",param.type)};AbiCoder.prototype._getWordSize=function(){return 32};AbiCoder.prototype._getReader=function(data,allowLoose){return new abstractCoder.Reader(data,this._getWordSize(),this.coerceFunc,allowLoose)};AbiCoder.prototype._getWriter=function(){return new abstractCoder.Writer(this._getWordSize())};AbiCoder.prototype.getDefaultValue=function(types){var _this=this;var coders=types.map(function(type){return _this._getCoder(fragments.ParamType.from(type))});var coder=new tuple.TupleCoder(coders,"_");return coder.defaultValue()};AbiCoder.prototype.encode=function(types,values){var _this=this;if(types.length!==values.length){logger.throwError("types/values length mismatch",lib.Logger.errors.INVALID_ARGUMENT,{count:{types:types.length,values:values.length},value:{types:types,values:values}})}var coders=types.map(function(type){return _this._getCoder(fragments.ParamType.from(type))});var coder=new tuple.TupleCoder(coders,"_");var writer=this._getWriter();coder.encode(writer,values);return writer.data};AbiCoder.prototype.decode=function(types,data,loose){var _this=this;var coders=types.map(function(type){return _this._getCoder(fragments.ParamType.from(type))});var coder=new tuple.TupleCoder(coders,"_");return coder.decode(this._getReader((0,lib$1.arrayify)(data),loose))};return AbiCoder}();exports.AbiCoder=AbiCoder;exports.defaultAbiCoder=new AbiCoder});var abiCoder$1=getDefaultExportFromCjs(abiCoder);var id_1=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.id=void 0;function id(text){return(0,lib$4.keccak256)((0,lib$8.toUtf8Bytes)(text))}exports.id=id});var id=getDefaultExportFromCjs(id_1);var _version$g=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="hash/5.6.1"});var _version$h=getDefaultExportFromCjs(_version$g);var namehash_1=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.dnsEncode=exports.namehash=exports.isValidName=void 0;var logger=new lib.Logger(_version$g.version);var Zeros=new Uint8Array(32);Zeros.fill(0);var Partition=new RegExp("^((.*)\\.)?([^.]+)$");function isValidName(name){try{var comps=name.split(".");for(var i=0;i0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]256||match[2]&&match[2]!==String(width)){logger.throwArgumentError("invalid numeric width","type",type)}var boundsUpper_1=MaxUint256.mask(signed?width-1:width);var boundsLower_1=signed?boundsUpper_1.add(One).mul(NegativeOne):Zero;return function(value){var v=lib$2.BigNumber.from(value);if(v.lt(boundsLower_1)||v.gt(boundsUpper_1)){logger.throwArgumentError("value out-of-bounds for "+type,"value",value)}return(0,lib$1.hexZeroPad)(v.toTwos(256).toHexString(),32)}}}{var match=type.match(/^bytes(\d+)$/);if(match){var width_1=parseInt(match[1]);if(width_1===0||width_1>32||match[1]!==String(width_1)){logger.throwArgumentError("invalid bytes width","type",type)}return function(value){var bytes=(0,lib$1.arrayify)(value);if(bytes.length!==width_1){logger.throwArgumentError("invalid length for "+type,"value",value)}return hexPadRight(value)}}}switch(type){case"address":return function(value){return(0,lib$1.hexZeroPad)((0,lib$6.getAddress)(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return(0,lib$4.keccak256)(value)};case"string":return function(value){return(0,id_1.id)(value)}}return null}function encodeType(name,fields){return name+"("+fields.map(function(_a){var name=_a.name,type=_a.type;return type+" "+name}).join(",")+")"}var TypedDataEncoder=function(){function TypedDataEncoder(types){(0,lib$3.defineReadOnly)(this,"types",Object.freeze((0,lib$3.deepCopy)(types)));(0,lib$3.defineReadOnly)(this,"_encoderCache",{});(0,lib$3.defineReadOnly)(this,"_types",{});var links={};var parents={};var subtypes={};Object.keys(types).forEach(function(type){links[type]={};parents[type]=[];subtypes[type]={}});var _loop_1=function(name_1){var uniqueNames={};types[name_1].forEach(function(field){if(uniqueNames[field.name]){logger.throwArgumentError("duplicate variable name "+JSON.stringify(field.name)+" in "+JSON.stringify(name_1),"types",types)}uniqueNames[field.name]=true;var baseType=field.type.match(/^([^\x5b]*)(\x5b|$)/)[1];if(baseType===name_1){logger.throwArgumentError("circular type reference to "+JSON.stringify(baseType),"types",types)}var encoder=getBaseEncoder(baseType);if(encoder){return}if(!parents[baseType]){logger.throwArgumentError("unknown type "+JSON.stringify(baseType),"types",types)}parents[baseType].push(name_1);links[name_1][baseType]=true})};for(var name_1 in types){_loop_1(name_1)}var primaryTypes=Object.keys(parents).filter(function(n){return parents[n].length===0});if(primaryTypes.length===0){logger.throwArgumentError("missing primary type","types",types)}else if(primaryTypes.length>1){logger.throwArgumentError("ambiguous primary types or unused types: "+primaryTypes.map(function(t){return JSON.stringify(t)}).join(", "),"types",types)}(0,lib$3.defineReadOnly)(this,"primaryType",primaryTypes[0]);function checkCircular(type,found){if(found[type]){logger.throwArgumentError("circular type reference to "+JSON.stringify(type),"types",types)}found[type]=true;Object.keys(links[type]).forEach(function(child){if(!parents[child]){return}checkCircular(child,found);Object.keys(found).forEach(function(subtype){subtypes[subtype][child]=true})});delete found[type]}checkCircular(this.primaryType,{});for(var name_2 in subtypes){var st=Object.keys(subtypes[name_2]);st.sort();this._types[name_2]=encodeType(name_2,types[name_2])+st.map(function(t){return encodeType(t,types[t])}).join("")}}TypedDataEncoder.prototype.getEncoder=function(type){var encoder=this._encoderCache[type];if(!encoder){encoder=this._encoderCache[type]=this._getEncoder(type)}return encoder};TypedDataEncoder.prototype._getEncoder=function(type){var _this=this;{var encoder=getBaseEncoder(type);if(encoder){return encoder}}var match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){var subtype_1=match[1];var subEncoder_1=this.getEncoder(subtype_1);var length_1=parseInt(match[3]);return function(value){if(length_1>=0&&value.length!==length_1){logger.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",value)}var result=value.map(subEncoder_1);if(_this._types[subtype_1]){result=result.map(lib$4.keccak256)}return(0,lib$4.keccak256)((0,lib$1.hexConcat)(result))}}var fields=this.types[type];if(fields){var encodedType_1=(0,id_1.id)(this._types[type]);return function(value){var values=fields.map(function(_a){var name=_a.name,type=_a.type;var result=_this.getEncoder(type)(value[name]);if(_this._types[type]){return(0,lib$4.keccak256)(result)}return result});values.unshift(encodedType_1);return(0,lib$1.hexConcat)(values)}}return logger.throwArgumentError("unknown type: "+type,"type",type)};TypedDataEncoder.prototype.encodeType=function(name){var result=this._types[name];if(!result){logger.throwArgumentError("unknown type: "+JSON.stringify(name),"name",name)}return result};TypedDataEncoder.prototype.encodeData=function(type,value){return this.getEncoder(type)(value)};TypedDataEncoder.prototype.hashStruct=function(name,value){return(0,lib$4.keccak256)(this.encodeData(name,value))};TypedDataEncoder.prototype.encode=function(value){return this.encodeData(this.primaryType,value)};TypedDataEncoder.prototype.hash=function(value){return this.hashStruct(this.primaryType,value)};TypedDataEncoder.prototype._visit=function(type,value,callback){var _this=this;{var encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}var match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){var subtype_2=match[1];var length_2=parseInt(match[3]);if(length_2>=0&&value.length!==length_2){logger.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",value)}return value.map(function(v){return _this._visit(subtype_2,v,callback)})}var fields=this.types[type];if(fields){return fields.reduce(function(accum,_a){var name=_a.name,type=_a.type;accum[name]=_this._visit(type,value[name],callback);return accum},{})}return logger.throwArgumentError("unknown type: "+type,"type",type)};TypedDataEncoder.prototype.visit=function(value,callback){return this._visit(this.primaryType,value,callback)};TypedDataEncoder.from=function(types){return new TypedDataEncoder(types)};TypedDataEncoder.getPrimaryType=function(types){return TypedDataEncoder.from(types).primaryType};TypedDataEncoder.hashStruct=function(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)};TypedDataEncoder.hashDomain=function(domain){var domainFields=[];for(var name_3 in domain){var type=domainFieldTypes[name_3];if(!type){logger.throwArgumentError("invalid typed-data domain key: "+JSON.stringify(name_3),"domain",domain)}domainFields.push({name:name_3,type:type})}domainFields.sort(function(a,b){return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)};TypedDataEncoder.encode=function(domain,types,value){return(0,lib$1.hexConcat)(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])};TypedDataEncoder.hash=function(domain,types,value){return(0,lib$4.keccak256)(TypedDataEncoder.encode(domain,types,value))};TypedDataEncoder.resolveNames=function(domain,types,value,resolveName){return __awaiter(this,void 0,void 0,function(){var ensCache,encoder,_a,_b,_i,name_4,_c,_d;return __generator(this,function(_e){switch(_e.label){case 0:domain=(0,lib$3.shallowCopy)(domain);ensCache={};if(domain.verifyingContract&&!(0,lib$1.isHexString)(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}encoder=TypedDataEncoder.from(types);encoder.visit(value,function(type,value){if(type==="address"&&!(0,lib$1.isHexString)(value,20)){ensCache[value]="0x"}return value});_a=[];for(_b in ensCache)_a.push(_b);_i=0;_e.label=1;case 1:if(!(_i<_a.length))return[3,4];name_4=_a[_i];_c=ensCache;_d=name_4;return[4,resolveName(name_4)];case 2:_c[_d]=_e.sent();_e.label=3;case 3:_i++;return[3,1];case 4:if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,function(type,value){if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return[2,{domain:domain,value:value}]}})})};TypedDataEncoder.getPayload=function(domain,types,value){TypedDataEncoder.hashDomain(domain);var domainValues={};var domainTypes=[];domainFieldNames.forEach(function(name){var value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});var encoder=TypedDataEncoder.from(types);var typesWithDomain=(0,lib$3.shallowCopy)(types);if(typesWithDomain.EIP712Domain){logger.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",types)}else{typesWithDomain.EIP712Domain=domainTypes}encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,function(type,value){if(type.match(/^bytes(\d*)/)){return(0,lib$1.hexlify)((0,lib$1.arrayify)(value))}if(type.match(/^u?int/)){return lib$2.BigNumber.from(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":if(typeof value!=="string"){logger.throwArgumentError("invalid string","value",value)}return value}return logger.throwArgumentError("unsupported type","type",type)})}};return TypedDataEncoder}();exports.TypedDataEncoder=TypedDataEncoder});var typedData$1=getDefaultExportFromCjs(typedData);var lib$9=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports._TypedDataEncoder=exports.hashMessage=exports.messagePrefix=exports.isValidName=exports.namehash=exports.dnsEncode=exports.id=void 0;Object.defineProperty(exports,"id",{enumerable:true,get:function(){return id_1.id}});Object.defineProperty(exports,"dnsEncode",{enumerable:true,get:function(){return namehash_1.dnsEncode}});Object.defineProperty(exports,"isValidName",{enumerable:true,get:function(){return namehash_1.isValidName}});Object.defineProperty(exports,"namehash",{enumerable:true,get:function(){return namehash_1.namehash}});Object.defineProperty(exports,"hashMessage",{enumerable:true,get:function(){return message.hashMessage}});Object.defineProperty(exports,"messagePrefix",{enumerable:true,get:function(){return message.messagePrefix}});Object.defineProperty(exports,"_TypedDataEncoder",{enumerable:true,get:function(){return typedData.TypedDataEncoder}})});var index$9=getDefaultExportFromCjs(lib$9);var _interface=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.Interface=exports.Indexed=exports.ErrorDescription=exports.TransactionDescription=exports.LogDescription=exports.checkResultErrors=void 0;Object.defineProperty(exports,"checkResultErrors",{enumerable:true,get:function(){return abstractCoder.checkResultErrors}});var logger=new lib.Logger(_version$8.version);var LogDescription=function(_super){__extends(LogDescription,_super);function LogDescription(){return _super!==null&&_super.apply(this,arguments)||this}return LogDescription}(lib$3.Description);exports.LogDescription=LogDescription;var TransactionDescription=function(_super){__extends(TransactionDescription,_super);function TransactionDescription(){return _super!==null&&_super.apply(this,arguments)||this}return TransactionDescription}(lib$3.Description);exports.TransactionDescription=TransactionDescription;var ErrorDescription=function(_super){__extends(ErrorDescription,_super);function ErrorDescription(){return _super!==null&&_super.apply(this,arguments)||this}return ErrorDescription}(lib$3.Description);exports.ErrorDescription=ErrorDescription;var Indexed=function(_super){__extends(Indexed,_super);function Indexed(){return _super!==null&&_super.apply(this,arguments)||this}Indexed.isIndexed=function(value){return!!(value&&value._isIndexed)};return Indexed}(lib$3.Description);exports.Indexed=Indexed;var BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:true},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function wrapAccessError(property,error){var wrap=new Error("deferred error during ABI decoding triggered accessing "+property);wrap.error=error;return wrap}var Interface=function(){function Interface(fragments$1){var _newTarget=this.constructor;var _this=this;var abi=[];if(typeof fragments$1==="string"){abi=JSON.parse(fragments$1)}else{abi=fragments$1}(0,lib$3.defineReadOnly)(this,"fragments",abi.map(function(fragment){return fragments.Fragment.from(fragment)}).filter(function(fragment){return fragment!=null}));(0,lib$3.defineReadOnly)(this,"_abiCoder",(0,lib$3.getStatic)(_newTarget,"getAbiCoder")());(0,lib$3.defineReadOnly)(this,"functions",{});(0,lib$3.defineReadOnly)(this,"errors",{});(0,lib$3.defineReadOnly)(this,"events",{});(0,lib$3.defineReadOnly)(this,"structs",{});this.fragments.forEach(function(fragment){var bucket=null;switch(fragment.type){case"constructor":if(_this.deploy){logger.warn("duplicate definition - constructor");return}(0,lib$3.defineReadOnly)(_this,"deploy",fragment);return;case"function":bucket=_this.functions;break;case"event":bucket=_this.events;break;case"error":bucket=_this.errors;break;default:return}var signature=fragment.format();if(bucket[signature]){logger.warn("duplicate definition - "+signature);return}bucket[signature]=fragment});if(!this.deploy){(0,lib$3.defineReadOnly)(this,"deploy",fragments.ConstructorFragment.from({payable:false,type:"constructor"}))}(0,lib$3.defineReadOnly)(this,"_isInterface",true)}Interface.prototype.format=function(format){if(!format){format=fragments.FormatTypes.full}if(format===fragments.FormatTypes.sighash){logger.throwArgumentError("interface does not support formatting sighash","format",format)}var abi=this.fragments.map(function(fragment){return fragment.format(format)});if(format===fragments.FormatTypes.json){return JSON.stringify(abi.map(function(j){return JSON.parse(j)}))}return abi};Interface.getAbiCoder=function(){return abiCoder.defaultAbiCoder};Interface.getAddress=function(address){return(0,lib$6.getAddress)(address)};Interface.getSighash=function(fragment){return(0,lib$1.hexDataSlice)((0,lib$9.id)(fragment.format()),0,4)};Interface.getEventTopic=function(eventFragment){return(0,lib$9.id)(eventFragment.format())};Interface.prototype.getFunction=function(nameOrSignatureOrSighash){if((0,lib$1.isHexString)(nameOrSignatureOrSighash)){for(var name_1 in this.functions){if(nameOrSignatureOrSighash===this.getSighash(name_1)){return this.functions[name_1]}}logger.throwArgumentError("no matching function","sighash",nameOrSignatureOrSighash)}if(nameOrSignatureOrSighash.indexOf("(")===-1){var name_2=nameOrSignatureOrSighash.trim();var matching=Object.keys(this.functions).filter(function(f){return f.split("(")[0]===name_2});if(matching.length===0){logger.throwArgumentError("no matching function","name",name_2)}else if(matching.length>1){logger.throwArgumentError("multiple matching functions","name",name_2)}return this.functions[matching[0]]}var result=this.functions[fragments.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];if(!result){logger.throwArgumentError("no matching function","signature",nameOrSignatureOrSighash)}return result};Interface.prototype.getEvent=function(nameOrSignatureOrTopic){if((0,lib$1.isHexString)(nameOrSignatureOrTopic)){var topichash=nameOrSignatureOrTopic.toLowerCase();for(var name_3 in this.events){if(topichash===this.getEventTopic(name_3)){return this.events[name_3]}}logger.throwArgumentError("no matching event","topichash",topichash)}if(nameOrSignatureOrTopic.indexOf("(")===-1){var name_4=nameOrSignatureOrTopic.trim();var matching=Object.keys(this.events).filter(function(f){return f.split("(")[0]===name_4});if(matching.length===0){logger.throwArgumentError("no matching event","name",name_4)}else if(matching.length>1){logger.throwArgumentError("multiple matching events","name",name_4)}return this.events[matching[0]]}var result=this.events[fragments.EventFragment.fromString(nameOrSignatureOrTopic).format()];if(!result){logger.throwArgumentError("no matching event","signature",nameOrSignatureOrTopic)}return result};Interface.prototype.getError=function(nameOrSignatureOrSighash){if((0,lib$1.isHexString)(nameOrSignatureOrSighash)){var getSighash=(0,lib$3.getStatic)(this.constructor,"getSighash");for(var name_5 in this.errors){var error=this.errors[name_5];if(nameOrSignatureOrSighash===getSighash(error)){return this.errors[name_5]}}logger.throwArgumentError("no matching error","sighash",nameOrSignatureOrSighash)}if(nameOrSignatureOrSighash.indexOf("(")===-1){var name_6=nameOrSignatureOrSighash.trim();var matching=Object.keys(this.errors).filter(function(f){return f.split("(")[0]===name_6});if(matching.length===0){logger.throwArgumentError("no matching error","name",name_6)}else if(matching.length>1){logger.throwArgumentError("multiple matching errors","name",name_6)}return this.errors[matching[0]]}var result=this.errors[fragments.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];if(!result){logger.throwArgumentError("no matching error","signature",nameOrSignatureOrSighash)}return result};Interface.prototype.getSighash=function(fragment){if(typeof fragment==="string"){try{fragment=this.getFunction(fragment)}catch(error){try{fragment=this.getError(fragment)}catch(_){throw error}}}return(0,lib$3.getStatic)(this.constructor,"getSighash")(fragment)};Interface.prototype.getEventTopic=function(eventFragment){if(typeof eventFragment==="string"){eventFragment=this.getEvent(eventFragment)}return(0,lib$3.getStatic)(this.constructor,"getEventTopic")(eventFragment)};Interface.prototype._decodeParams=function(params,data){return this._abiCoder.decode(params,data)};Interface.prototype._encodeParams=function(params,values){return this._abiCoder.encode(params,values)};Interface.prototype.encodeDeploy=function(values){return this._encodeParams(this.deploy.inputs,values||[])};Interface.prototype.decodeErrorResult=function(fragment,data){if(typeof fragment==="string"){fragment=this.getError(fragment)}var bytes=(0,lib$1.arrayify)(data);if((0,lib$1.hexlify)(bytes.slice(0,4))!==this.getSighash(fragment)){logger.throwArgumentError("data signature does not match error "+fragment.name+".","data",(0,lib$1.hexlify)(bytes))}return this._decodeParams(fragment.inputs,bytes.slice(4))};Interface.prototype.encodeErrorResult=function(fragment,values){if(typeof fragment==="string"){fragment=this.getError(fragment)}return(0,lib$1.hexlify)((0,lib$1.concat)([this.getSighash(fragment),this._encodeParams(fragment.inputs,values||[])]))};Interface.prototype.decodeFunctionData=function(functionFragment,data){if(typeof functionFragment==="string"){functionFragment=this.getFunction(functionFragment)}var bytes=(0,lib$1.arrayify)(data);if((0,lib$1.hexlify)(bytes.slice(0,4))!==this.getSighash(functionFragment)){logger.throwArgumentError("data signature does not match function "+functionFragment.name+".","data",(0,lib$1.hexlify)(bytes))}return this._decodeParams(functionFragment.inputs,bytes.slice(4))};Interface.prototype.encodeFunctionData=function(functionFragment,values){if(typeof functionFragment==="string"){functionFragment=this.getFunction(functionFragment)}return(0,lib$1.hexlify)((0,lib$1.concat)([this.getSighash(functionFragment),this._encodeParams(functionFragment.inputs,values||[])]))};Interface.prototype.decodeFunctionResult=function(functionFragment,data){if(typeof functionFragment==="string"){functionFragment=this.getFunction(functionFragment)}var bytes=(0,lib$1.arrayify)(data);var reason=null;var message="";var errorArgs=null;var errorName=null;var errorSignature=null;switch(bytes.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(functionFragment.outputs,bytes)}catch(error){}break;case 4:{var selector=(0,lib$1.hexlify)(bytes.slice(0,4));var builtin=BuiltinErrors[selector];if(builtin){errorArgs=this._abiCoder.decode(builtin.inputs,bytes.slice(4));errorName=builtin.name;errorSignature=builtin.signature;if(builtin.reason){reason=errorArgs[0]}if(errorName==="Error"){message="; VM Exception while processing transaction: reverted with reason string "+JSON.stringify(errorArgs[0])}else if(errorName==="Panic"){message="; VM Exception while processing transaction: reverted with panic code "+errorArgs[0]}}else{try{var error=this.getError(selector);errorArgs=this._abiCoder.decode(error.inputs,bytes.slice(4));errorName=error.name;errorSignature=error.format()}catch(error){}}break}}return logger.throwError("call revert exception"+message,lib.Logger.errors.CALL_EXCEPTION,{method:functionFragment.format(),data:(0,lib$1.hexlify)(data),errorArgs:errorArgs,errorName:errorName,errorSignature:errorSignature,reason:reason})};Interface.prototype.encodeFunctionResult=function(functionFragment,values){if(typeof functionFragment==="string"){functionFragment=this.getFunction(functionFragment)}return(0,lib$1.hexlify)(this._abiCoder.encode(functionFragment.outputs,values||[]))};Interface.prototype.encodeFilterTopics=function(eventFragment,values){var _this=this;if(typeof eventFragment==="string"){eventFragment=this.getEvent(eventFragment)}if(values.length>eventFragment.inputs.length){logger.throwError("too many arguments for "+eventFragment.format(),lib.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:values})}var topics=[];if(!eventFragment.anonymous){topics.push(this.getEventTopic(eventFragment))}var encodeTopic=function(param,value){if(param.type==="string"){return(0,lib$9.id)(value)}else if(param.type==="bytes"){return(0,lib$4.keccak256)((0,lib$1.hexlify)(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}if(param.type.match(/^u?int/)){value=lib$2.BigNumber.from(value).toHexString()}if(param.type==="address"){_this._abiCoder.encode(["address"],[value])}return(0,lib$1.hexZeroPad)((0,lib$1.hexlify)(value),32)};values.forEach(function(value,index){var param=eventFragment.inputs[index];if(!param.indexed){if(value!=null){logger.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+param.name,value)}return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){logger.throwArgumentError("filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(function(value){return encodeTopic(param,value)}))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics};Interface.prototype.encodeEventLog=function(eventFragment,values){var _this=this;if(typeof eventFragment==="string"){eventFragment=this.getEvent(eventFragment)}var topics=[];var dataTypes=[];var dataValues=[];if(!eventFragment.anonymous){topics.push(this.getEventTopic(eventFragment))}if(values.length!==eventFragment.inputs.length){logger.throwArgumentError("event arguments/values mismatch","values",values)}eventFragment.inputs.forEach(function(param,index){var value=values[index];if(param.indexed){if(param.type==="string"){topics.push((0,lib$9.id)(value))}else if(param.type==="bytes"){topics.push((0,lib$4.keccak256)(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(_this._abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this._abiCoder.encode(dataTypes,dataValues),topics:topics}};Interface.prototype.decodeEventLog=function(eventFragment,data,topics){if(typeof eventFragment==="string"){eventFragment=this.getEvent(eventFragment)}if(topics!=null&&!eventFragment.anonymous){var topicHash=this.getEventTopic(eventFragment);if(!(0,lib$1.isHexString)(topics[0],32)||topics[0].toLowerCase()!==topicHash){logger.throwError("fragment/topic mismatch",lib.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:topicHash,value:topics[0]})}topics=topics.slice(1)}var indexed=[];var nonIndexed=[];var dynamic=[];eventFragment.inputs.forEach(function(param,index){if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(fragments.ParamType.fromObject({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});var resultIndexed=topics!=null?this._abiCoder.decode(indexed,(0,lib$1.concat)(topics)):null;var resultNonIndexed=this._abiCoder.decode(nonIndexed,data,true);var result=[];var nonIndexedIndex=0,indexedIndex=0;eventFragment.inputs.forEach(function(param,index){if(param.indexed){if(resultIndexed==null){result[index]=new Indexed({_isIndexed:true,hash:null})}else if(dynamic[index]){result[index]=new Indexed({_isIndexed:true,hash:resultIndexed[indexedIndex++]})}else{try{result[index]=resultIndexed[indexedIndex++]}catch(error){result[index]=error}}}else{try{result[index]=resultNonIndexed[nonIndexedIndex++]}catch(error){result[index]=error}}if(param.name&&result[param.name]==null){var value_1=result[index];if(value_1 instanceof Error){Object.defineProperty(result,param.name,{enumerable:true,get:function(){throw wrapAccessError("property "+JSON.stringify(param.name),value_1)}})}else{result[param.name]=value_1}}});var _loop_1=function(i){var value=result[i];if(value instanceof Error){Object.defineProperty(result,i,{enumerable:true,get:function(){throw wrapAccessError("index "+i,value)}})}};for(var i=0;i0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]=0){throw error}return logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",lib.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:error,tx:tx})})}if(tx.chainId==null){tx.chainId=this.getChainId()}else{tx.chainId=Promise.all([Promise.resolve(tx.chainId),this.getChainId()]).then(function(results){if(results[1]!==0&&results[0]!==results[1]){logger.throwArgumentError("chainId address mismatch","transaction",transaction)}return results[0]})}return[4,(0,lib$3.resolveProperties)(tx)];case 6:return[2,_a.sent()]}})})};Signer.prototype._checkProvider=function(operation){if(!this.provider){logger.throwError("missing provider",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:operation||"_checkProvider"})}};Signer.isSigner=function(value){return!!(value&&value._isSigner)};return Signer}();exports.Signer=Signer;var VoidSigner=function(_super){__extends(VoidSigner,_super);function VoidSigner(address,provider){var _this=_super.call(this)||this;(0,lib$3.defineReadOnly)(_this,"address",address);(0,lib$3.defineReadOnly)(_this,"provider",provider||null);return _this}VoidSigner.prototype.getAddress=function(){return Promise.resolve(this.address)};VoidSigner.prototype._fail=function(message,operation){return Promise.resolve().then(function(){logger.throwError(message,lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:operation})})};VoidSigner.prototype.signMessage=function(message){return this._fail("VoidSigner cannot sign messages","signMessage")};VoidSigner.prototype.signTransaction=function(transaction){return this._fail("VoidSigner cannot sign transactions","signTransaction")};VoidSigner.prototype._signTypedData=function(domain,types,value){return this._fail("VoidSigner cannot sign typed data","signTypedData")};VoidSigner.prototype.connect=function(provider){return new VoidSigner(this.address,provider)};return VoidSigner}(Signer);exports.VoidSigner=VoidSigner});var index$c=getDefaultExportFromCjs(lib$c);var bn$1=createCommonjsModule(function(module){(function(module,exports){"use strict";function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number)){return number}this.negative=0;this.words=null;this.length=0;this.red=null;if(number!==null){if(base==="le"||base==="be"){endian=base;base=10}this._init(number||0,base||10,endian||"be")}}if(typeof module==="object"){module.exports=BN}else{exports.BN=BN}BN.BN=BN;BN.wordSize=26;var Buffer;try{if(typeof window!=="undefined"&&typeof window.Buffer!=="undefined"){Buffer=window.Buffer}else{Buffer=null.Buffer}}catch(e){}BN.isBN=function isBN(num){if(num instanceof BN){return true}return num!==null&&typeof num==="object"&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)};BN.max=function max(left,right){if(left.cmp(right)>0)return left;return right};BN.min=function min(left,right){if(left.cmp(right)<0)return left;return right};BN.prototype._init=function init(number,base,endian){if(typeof number==="number"){return this._initNumber(number,base,endian)}if(typeof number==="object"){return this._initArray(number,base,endian)}if(base==="hex"){base=16}assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,"");var start=0;if(number[0]==="-"){start++;this.negative=1}if(start=0;i-=3){w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}else if(endian==="le"){for(i=0,j=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}return this.strip()};function parseHex4Bits(string,index){var c=string.charCodeAt(index);if(c>=65&&c<=70){return c-55}else if(c>=97&&c<=102){return c-87}else{return c-48&15}}function parseHexByte(string,lowerBound,index){var r=parseHex4Bits(string,index);if(index-1>=lowerBound){r|=parseHex4Bits(string,index-1)<<4}return r}BN.prototype._parseHex=function _parseHex(number,start,endian){this.length=Math.ceil((number.length-start)/6);this.words=new Array(this.length);for(var i=0;i=start;i-=2){w=parseHexByte(number,start,i)<=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}else{var parseLength=number.length-start;for(i=parseLength%2===0?start+1:start;i=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}this.strip()};function parseBase(str,start,end,mul){var r=0;var len=Math.min(str.length,end);for(var i=start;i=49){r+=c-49+10}else if(c>=17){r+=c-17+10}else{r+=c}}return r}BN.prototype._parseBase=function _parseBase(number,base,start){this.words=[0];this.length=1;for(var limbLen=0,limbPow=1;limbPow<=67108863;limbPow*=base){limbLen++}limbLen--;limbPow=limbPow/base|0;var total=number.length-start;var mod=total%limbLen;var end=Math.min(total,total-mod)+start;var word=0;for(var i=start;i1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};BN.prototype.inspect=function inspect(){return(this.red?""};var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(base,padding){base=base||10;padding=padding|0||1;var out;if(base===16||base==="hex"){out="";var off=0;var carry=0;for(var i=0;i>>24-off&16777215;if(carry!==0||i!==this.length-1){out=zeros[6-word.length]+word+out}else{out=word+out}off+=2;if(off>=26){off-=26;i--}}if(carry!==0){out=carry.toString(16)+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}if(base===(base|0)&&base>=2&&base<=36){var groupSize=groupSizes[base];var groupBase=groupBases[base];out="";var c=this.clone();c.negative=0;while(!c.isZero()){var r=c.modn(groupBase).toString(base);c=c.idivn(groupBase);if(!c.isZero()){out=zeros[groupSize-r.length]+r+out}else{out=r+out}}if(this.isZero()){out="0"+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var ret=this.words[0];if(this.length===2){ret+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){ret+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-ret:ret};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(endian,length){assert(typeof Buffer!=="undefined");return this.toArrayLike(Buffer,endian,length)};BN.prototype.toArray=function toArray(endian,length){return this.toArrayLike(Array,endian,length)};BN.prototype.toArrayLike=function toArrayLike(ArrayType,endian,length){var byteLength=this.byteLength();var reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length");assert(reqLength>0,"Requested array length <= 0");this.strip();var littleEndian=endian==="le";var res=new ArrayType(reqLength);var b,i;var q=this.clone();if(!littleEndian){for(i=0;i=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(w){if(w===0)return 26;var t=w;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var w=this.words[this.length-1];var hi=this._countBits(w);return(this.length-1)*26+hi};function toBitArray(num){var w=new Array(num.bitLength());for(var bit=0;bit>>wbit}return w}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var r=0;for(var i=0;inum.length)return this.clone().ior(num);return num.clone().ior(this)};BN.prototype.uor=function uor(num){if(this.length>num.length)return this.clone().iuor(num);return num.clone().iuor(this)};BN.prototype.iuand=function iuand(num){var b;if(this.length>num.length){b=num}else{b=this}for(var i=0;inum.length)return this.clone().iand(num);return num.clone().iand(this)};BN.prototype.uand=function uand(num){if(this.length>num.length)return this.clone().iuand(num);return num.clone().iuand(this)};BN.prototype.iuxor=function iuxor(num){var a;var b;if(this.length>num.length){a=this;b=num}else{a=num;b=this}for(var i=0;inum.length)return this.clone().ixor(num);return num.clone().ixor(this)};BN.prototype.uxor=function uxor(num){if(this.length>num.length)return this.clone().iuxor(num);return num.clone().iuxor(this)};BN.prototype.inotn=function inotn(width){assert(typeof width==="number"&&width>=0);var bytesNeeded=Math.ceil(width/26)|0;var bitsLeft=width%26;this._expand(bytesNeeded);if(bitsLeft>0){bytesNeeded--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-bitsLeft}return this.strip()};BN.prototype.notn=function notn(width){return this.clone().inotn(width)};BN.prototype.setn=function setn(bit,val){assert(typeof bit==="number"&&bit>=0);var off=bit/26|0;var wbit=bit%26;this._expand(off+1);if(val){this.words[off]=this.words[off]|1<num.length){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this.words[this.length]=carry;this.length++}else if(a!==this){for(;inum.length)return this.clone().iadd(num);return num.clone().iadd(this)};BN.prototype.isub=function isub(num){if(num.negative!==0){num.negative=0;var r=this.iadd(num);num.negative=1;return r._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(num);this.negative=1;return this._normSign()}var cmp=this.cmp(num);if(cmp===0){this.negative=0;this.length=1;this.words[0]=0;return this}var a,b;if(cmp>0){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}if(carry===0&&i>>26;var rword=carry&67108863;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=self.words[i]|0;b=num.words[j]|0;r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0){out.words[k]=carry|0}else{out.length--}return out.strip()}var comb10MulTo=function comb10MulTo(self,num,out){var a=self.words;var b=num.words;var o=out.words;var c=0;var lo;var mid;var hi;var a0=a[0]|0;var al0=a0&8191;var ah0=a0>>>13;var a1=a[1]|0;var al1=a1&8191;var ah1=a1>>>13;var a2=a[2]|0;var al2=a2&8191;var ah2=a2>>>13;var a3=a[3]|0;var al3=a3&8191;var ah3=a3>>>13;var a4=a[4]|0;var al4=a4&8191;var ah4=a4>>>13;var a5=a[5]|0;var al5=a5&8191;var ah5=a5>>>13;var a6=a[6]|0;var al6=a6&8191;var ah6=a6>>>13;var a7=a[7]|0;var al7=a7&8191;var ah7=a7>>>13;var a8=a[8]|0;var al8=a8&8191;var ah8=a8>>>13;var a9=a[9]|0;var al9=a9&8191;var ah9=a9>>>13;var b0=b[0]|0;var bl0=b0&8191;var bh0=b0>>>13;var b1=b[1]|0;var bl1=b1&8191;var bh1=b1>>>13;var b2=b[2]|0;var bl2=b2&8191;var bh2=b2>>>13;var b3=b[3]|0;var bl3=b3&8191;var bh3=b3>>>13;var b4=b[4]|0;var bl4=b4&8191;var bh4=b4>>>13;var b5=b[5]|0;var bl5=b5&8191;var bh5=b5>>>13;var b6=b[6]|0;var bl6=b6&8191;var bh6=b6>>>13;var b7=b[7]|0;var bl7=b7&8191;var bh7=b7>>>13;var b8=b[8]|0;var bl8=b8&8191;var bh8=b8>>>13;var b9=b[9]|0;var bl9=b9&8191;var bh9=b9>>>13;out.negative=self.negative^num.negative;out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length++}return out};if(!Math.imul){comb10MulTo=smallMulTo}function bigMulTo(self,num,out){out.negative=num.negative^self.negative;out.length=self.length+num.length;var carry=0;var hncarry=0;for(var k=0;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0){out.words[k]=carry}else{out.length--}return out.strip()}function jumboMulTo(self,num,out){var fftm=new FFTM;return fftm.mulp(self,num,out)}BN.prototype.mulTo=function mulTo(num,out){var res;var len=this.length+num.length;if(this.length===10&&num.length===10){res=comb10MulTo(this,num,out)}else if(len<63){res=smallMulTo(this,num,out)}else if(len<1024){res=bigMulTo(this,num,out)}else{res=jumboMulTo(this,num,out)}return res};function FFTM(x,y){this.x=x;this.y=y}FFTM.prototype.makeRBT=function makeRBT(N){var t=new Array(N);var l=BN.prototype._countBits(N)-1;for(var i=0;i>=1}return rb};FFTM.prototype.permute=function permute(rbt,rws,iws,rtws,itws,N){for(var i=0;i>>1){i++}return 1<>>13;rws[2*i+1]=carry&8191;carry=carry>>>13}for(i=2*len;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}if(carry!==0){this.words[i]=carry;this.length++}return this};BN.prototype.muln=function muln(num){return this.clone().imuln(num)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(num){var w=toBitArray(num);if(w.length===0)return new BN(1);var res=this;for(var i=0;i=0);var r=bits%26;var s=(bits-r)/26;var carryMask=67108863>>>26-r<<26-r;var i;if(r!==0){var carry=0;for(i=0;i>>26-r}if(carry){this.words[i]=carry;this.length++}}if(s!==0){for(i=this.length-1;i>=0;i--){this.words[i+s]=this.words[i]}for(i=0;i=0);var h;if(hint){h=(hint-hint%26)/26}else{h=0}var r=bits%26;var s=Math.min((bits-r)/26,this.length);var mask=67108863^67108863>>>r<s){this.length-=s;for(i=0;i=0&&(carry!==0||i>=h);i--){var word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}if(maskedWords&&carry!==0){maskedWords.words[maskedWords.length++]=carry}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(bits,hint,extended){assert(this.negative===0);return this.iushrn(bits,hint,extended)};BN.prototype.shln=function shln(bits){return this.clone().ishln(bits)};BN.prototype.ushln=function ushln(bits){return this.clone().iushln(bits)};BN.prototype.shrn=function shrn(bits){return this.clone().ishrn(bits)};BN.prototype.ushrn=function ushrn(bits){return this.clone().iushrn(bits)};BN.prototype.testn=function testn(bit){assert(typeof bit==="number"&&bit>=0);var r=bit%26;var s=(bit-r)/26;var q=1<=0);var r=bits%26;var s=(bits-r)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=s){return this}if(r!==0){s++}this.length=Math.min(s,this.length);if(r!==0){var mask=67108863^67108863>>>r<=67108864;i++){this.words[i]-=67108864;if(i===this.length-1){this.words[i+1]=1}else{this.words[i+1]++}}this.length=Math.max(this.length,i+1);return this};BN.prototype.isubn=function isubn(num){assert(typeof num==="number");assert(num<67108864);if(num<0)return this.iaddn(-num);if(this.negative!==0){this.negative=0;this.iaddn(num);this.negative=1;return this}this.words[0]-=num;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var i=0;i>26)-(right/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this.strip();assert(carry===-1);carry=0;for(i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(num,mode){var shift=this.length-num.length;var a=this.clone();var b=num;var bhi=b.words[b.length-1]|0;var bhiBits=this._countBits(bhi);shift=26-bhiBits;if(shift!==0){b=b.ushln(shift);a.iushln(shift);bhi=b.words[b.length-1]|0}var m=a.length-b.length;var q;if(mode!=="mod"){q=new BN(null);q.length=m+1;q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=(a.words[b.length+j]|0)*67108864+(a.words[b.length+j-1]|0);qj=Math.min(qj/bhi|0,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj--;a.negative=0;a._ishlnsubmul(b,1,j);if(!a.isZero()){a.negative^=1}}if(q){q.words[j]=qj}}if(q){q.strip()}a.strip();if(mode!=="div"&&shift!==0){a.iushrn(shift)}return{div:q||null,mod:a}};BN.prototype.divmod=function divmod(num,mode,positive){assert(!num.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var div,mod,res;if(this.negative!==0&&num.negative===0){res=this.neg().divmod(num,mode);if(mode!=="mod"){div=res.div.neg()}if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.iadd(num)}}return{div:div,mod:mod}}if(this.negative===0&&num.negative!==0){res=this.divmod(num.neg(),mode);if(mode!=="mod"){div=res.div.neg()}return{div:div,mod:res.mod}}if((this.negative&num.negative)!==0){res=this.neg().divmod(num.neg(),mode);if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.isub(num)}}return{div:res.div,mod:mod}}if(num.length>this.length||this.cmp(num)<0){return{div:new BN(0),mod:this}}if(num.length===1){if(mode==="div"){return{div:this.divn(num.words[0]),mod:null}}if(mode==="mod"){return{div:null,mod:new BN(this.modn(num.words[0]))}}return{div:this.divn(num.words[0]),mod:new BN(this.modn(num.words[0]))}}return this._wordDiv(num,mode)};BN.prototype.div=function div(num){return this.divmod(num,"div",false).div};BN.prototype.mod=function mod(num){return this.divmod(num,"mod",false).mod};BN.prototype.umod=function umod(num){return this.divmod(num,"mod",true).mod};BN.prototype.divRound=function divRound(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=dm.div.negative!==0?dm.mod.isub(num):dm.mod;var half=num.ushrn(1);var r2=num.andln(1);var cmp=mod.cmp(half);if(cmp<0||r2===1&&cmp===0)return dm.div;return dm.div.negative!==0?dm.div.isubn(1):dm.div.iaddn(1)};BN.prototype.modn=function modn(num){assert(num<=67108863);var p=(1<<26)%num;var acc=0;for(var i=this.length-1;i>=0;i--){acc=(p*acc+(this.words[i]|0))%num}return acc};BN.prototype.idivn=function idivn(num){assert(num<=67108863);var carry=0;for(var i=this.length-1;i>=0;i--){var w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}return this.strip()};BN.prototype.divn=function divn(num){return this.clone().idivn(num)};BN.prototype.egcd=function egcd(p){assert(p.negative===0);assert(!p.isZero());var x=this;var y=p.clone();if(x.negative!==0){x=x.umod(p)}else{x=x.clone()}var A=new BN(1);var B=new BN(0);var C=new BN(0);var D=new BN(1);var g=0;while(x.isEven()&&y.isEven()){x.iushrn(1);y.iushrn(1);++g}var yp=y.clone();var xp=x.clone();while(!x.isZero()){for(var i=0,im=1;(x.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){x.iushrn(i);while(i-- >0){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}}for(var j=0,jm=1;(y.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){y.iushrn(j);while(j-- >0){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}return{a:C,b:D,gcd:y.iushln(g)}};BN.prototype._invmp=function _invmp(p){assert(p.negative===0);assert(!p.isZero());var a=this;var b=p.clone();if(a.negative!==0){a=a.umod(p)}else{a=a.clone()}var x1=new BN(1);var x2=new BN(0);var delta=b.clone();while(a.cmpn(1)>0&&b.cmpn(1)>0){for(var i=0,im=1;(a.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){a.iushrn(i);while(i-- >0){if(x1.isOdd()){x1.iadd(delta)}x1.iushrn(1)}}for(var j=0,jm=1;(b.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){b.iushrn(j);while(j-- >0){if(x2.isOdd()){x2.iadd(delta)}x2.iushrn(1)}}if(a.cmp(b)>=0){a.isub(b);x1.isub(x2)}else{b.isub(a);x2.isub(x1)}}var res;if(a.cmpn(1)===0){res=x1}else{res=x2}if(res.cmpn(0)<0){res.iadd(p)}return res};BN.prototype.gcd=function gcd(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone();var b=num.clone();a.negative=0;b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++){a.iushrn(1);b.iushrn(1)}do{while(a.isEven()){a.iushrn(1)}while(b.isEven()){b.iushrn(1)}var r=a.cmp(b);if(r<0){var t=a;a=b;b=t}else if(r===0||b.cmpn(1)===0){break}a.isub(b)}while(true);return b.iushln(shift)};BN.prototype.invm=function invm(num){return this.egcd(num).a.umod(num)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(num){return this.words[0]&num};BN.prototype.bincn=function bincn(bit){assert(typeof bit==="number");var r=bit%26;var s=(bit-r)/26;var q=1<>>26;w&=67108863;this.words[i]=w}if(carry!==0){this.words[i]=carry;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(num){var negative=num<0;if(this.negative!==0&&!negative)return-1;if(this.negative===0&&negative)return 1;this.strip();var res;if(this.length>1){res=1}else{if(negative){num=-num}assert(num<=67108863,"Number is too big");var w=this.words[0]|0;res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=this.words[i]|0;var b=num.words[i]|0;if(a===b)continue;if(ab){res=1}break}return res};BN.prototype.gtn=function gtn(num){return this.cmpn(num)===1};BN.prototype.gt=function gt(num){return this.cmp(num)===1};BN.prototype.gten=function gten(num){return this.cmpn(num)>=0};BN.prototype.gte=function gte(num){return this.cmp(num)>=0};BN.prototype.ltn=function ltn(num){return this.cmpn(num)===-1};BN.prototype.lt=function lt(num){return this.cmp(num)===-1};BN.prototype.lten=function lten(num){return this.cmpn(num)<=0};BN.prototype.lte=function lte(num){return this.cmp(num)<=0};BN.prototype.eqn=function eqn(num){return this.cmpn(num)===0};BN.prototype.eq=function eq(num){return this.cmp(num)===0};BN.red=function red(num){return new Red(num)};BN.prototype.toRed=function toRed(ctx){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ctx.convertTo(this)._forceRed(ctx)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(ctx){this.red=ctx;return this};BN.prototype.forceRed=function forceRed(ctx){assert(!this.red,"Already a number in reduction context");return this._forceRed(ctx)};BN.prototype.redAdd=function redAdd(num){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,num)};BN.prototype.redIAdd=function redIAdd(num){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,num)};BN.prototype.redSub=function redSub(num){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,num)};BN.prototype.redISub=function redISub(num){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,num)};BN.prototype.redShl=function redShl(num){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,num)};BN.prototype.redMul=function redMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.mul(this,num)};BN.prototype.redIMul=function redIMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.imul(this,num)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(num){assert(this.red&&!num.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};function MPrime(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var tmp=new BN(null);tmp.words=new Array(Math.ceil(this.n/13));return tmp};MPrime.prototype.ireduce=function ireduce(num){var r=num;var rlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0){r.isub(this.p)}else{if(r.strip!==undefined){r.strip()}else{r._strip()}}return r};MPrime.prototype.split=function split(input,out){input.iushrn(this.n,0,out)};MPrime.prototype.imulK=function imulK(num){return num.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(input,output){var mask=4194303;var outLen=Math.min(input.length,9);for(var i=0;i>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10}else{input.length-=9}};K256.prototype.imulK=function imulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;var lo=0;for(var i=0;i>>=26;num.words[i]=lo;carry=hi}if(carry!==0){num.words[num.length++]=carry}return num};BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if(name==="k256"){prime=new K256}else if(name==="p224"){prime=new P224}else if(name==="p192"){prime=new P192}else if(name==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+name)}primes[name]=prime;return prime};function Red(m){if(typeof m==="string"){var prime=BN._prime(m);this.m=prime.p;this.prime=prime}else{assert(m.gtn(1),"modulus must be greater than 1");this.m=m;this.prime=null}}Red.prototype._verify1=function _verify1(a){assert(a.negative===0,"red works only with positives");assert(a.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(a,b){assert((a.negative|b.negative)===0,"red works only with positives");assert(a.red&&a.red===b.red,"red works only with red numbers")};Red.prototype.imod=function imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(a){if(a.isZero()){return a.clone()}return this.m.sub(a)._forceRed(this)};Red.prototype.add=function add(a,b){this._verify2(a,b);var res=a.add(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res._forceRed(this)};Red.prototype.iadd=function iadd(a,b){this._verify2(a,b);var res=a.iadd(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res};Red.prototype.sub=function sub(a,b){this._verify2(a,b);var res=a.sub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res._forceRed(this)};Red.prototype.isub=function isub(a,b){this._verify2(a,b);var res=a.isub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res};Red.prototype.shl=function shl(a,num){this._verify1(a);return this.imod(a.ushln(num))};Red.prototype.imul=function imul(a,b){this._verify2(a,b);return this.imod(a.imul(b))};Red.prototype.mul=function mul(a,b){this._verify2(a,b);return this.imod(a.mul(b))};Red.prototype.isqr=function isqr(a){return this.imul(a,a.clone())};Red.prototype.sqr=function sqr(a){return this.mul(a,a)};Red.prototype.sqrt=function sqrt(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);assert(mod3%2===1);if(mod3===3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}var q=this.m.subn(1);var s=0;while(!q.isZero()&&q.andln(1)===0){s++;q.iushrn(1)}assert(!q.isZero());var one=new BN(1).toRed(this);var nOne=one.redNeg();var lpow=this.m.subn(1).iushrn(1);var z=this.m.bitLength();z=new BN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne)}var c=this.pow(z,q);var r=this.pow(a,q.addn(1).iushrn(1));var t=this.pow(a,q);var m=s;while(t.cmp(one)!==0){var tmp=t;for(var i=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr()}assert(i=0;i--){var word=num.words[i];for(var j=start-1;j>=0;j--){var bit=word>>j&1;if(res!==wnd[0]){res=this.sqr(res)}if(bit===0&¤t===0){currentLen=0;continue}current<<=1;current|=bit;currentLen++;if(currentLen!==windowSize&&(i!==0||j!==0))continue;res=this.mul(res,wnd[current]);currentLen=0;current=0}start=26}return res};Red.prototype.convertTo=function convertTo(num){var r=num.umod(this.m);return r===num?r.clone():r};Red.prototype.convertFrom=function convertFrom(num){var res=num.clone();res.red=null;return res};BN.mont=function mont(num){return new Mont(num)};function Mont(m){Red.call(this,m);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(num){return this.imod(num.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(num){var r=this.imod(num.mul(this.rinv));r.red=null;return r};Mont.prototype.imul=function imul(a,b){if(a.isZero()||b.isZero()){a.words[0]=0;a.length=1;return a}var t=a.imul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.mul=function mul(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.invm=function invm(a){var res=this.imod(a._invmp(this.m).mul(this.r2));return res._forceRed(this)}})("object"==="undefined"||module,commonjsGlobal)});var minimalisticAssert=assert;function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}assert.equal=function assertEqual(l,r,msg){if(l!=r)throw new Error(msg||"Assertion failed: "+l+" != "+r)};var utils_1=createCommonjsModule(function(module,exports){"use strict";var utils=exports;function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if(typeof msg!=="string"){for(var i=0;i>8;var lo=c&255;if(hi)res.push(hi,lo);else res.push(lo)}}return res}utils.toArray=toArray;function zero2(word){if(word.length===1)return"0"+word;else return word}utils.zero2=zero2;function toHex(msg){var res="";for(var i=0;i(ws>>1)-1)z=(ws>>1)-mod;else z=mod;k.isubn(z)}else{z=0}naf[i]=z;k.iushrn(1)}return naf}utils.getNAF=getNAF;function getJSF(k1,k2){var jsf=[[],[]];k1=k1.clone();k2=k2.clone();var d1=0;var d2=0;var m8;while(k1.cmpn(-d1)>0||k2.cmpn(-d2)>0){var m14=k1.andln(3)+d1&3;var m24=k2.andln(3)+d2&3;if(m14===3)m14=-1;if(m24===3)m24=-1;var u1;if((m14&1)===0){u1=0}else{m8=k1.andln(7)+d1&7;if((m8===3||m8===5)&&m24===2)u1=-m14;else u1=m14}jsf[0].push(u1);var u2;if((m24&1)===0){u2=0}else{m8=k2.andln(7)+d2&7;if((m8===3||m8===5)&&m14===2)u2=-m24;else u2=m24}jsf[1].push(u2);if(2*d1===u1+1)d1=1-d1;if(2*d2===u2+1)d2=1-d2;k1.iushrn(1);k2.iushrn(1)}return jsf}utils.getJSF=getJSF;function cachedProperty(obj,name,computer){var key="_"+name;obj.prototype[name]=function cachedProperty(){return this[key]!==undefined?this[key]:this[key]=computer.call(this)}}utils.cachedProperty=cachedProperty;function parseBytes(bytes){return typeof bytes==="string"?utils.toArray(bytes,"hex"):bytes}utils.parseBytes=parseBytes;function intFromLE(bytes){return new bn$1(bytes,"hex","le")}utils.intFromLE=intFromLE});"use strict";var getNAF=utils_1$1.getNAF;var getJSF=utils_1$1.getJSF;var assert$1=utils_1$1.assert;function BaseCurve(type,conf){this.type=type;this.p=new bn$1(conf.p,16);this.red=conf.prime?bn$1.red(conf.prime):bn$1.mont(this.p);this.zero=new bn$1(0).toRed(this.red);this.one=new bn$1(1).toRed(this.red);this.two=new bn$1(2).toRed(this.red);this.n=conf.n&&new bn$1(conf.n,16);this.g=conf.g&&this.pointFromJSON(conf.g,conf.gRed);this._wnafT1=new Array(4);this._wnafT2=new Array(4);this._wnafT3=new Array(4);this._wnafT4=new Array(4);this._bitLength=this.n?this.n.bitLength():0;var adjustCount=this.n&&this.p.div(this.n);if(!adjustCount||adjustCount.cmpn(100)>0){this.redN=null}else{this._maxwellTrick=true;this.redN=this.n.toRed(this.red)}}var base=BaseCurve;BaseCurve.prototype.point=function point(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function _fixedNafMul(p,k){assert$1(p.precomputed);var doubles=p._getDoubles();var naf=getNAF(k,1,this._bitLength);var I=(1<=j;l--)nafW=(nafW<<1)+naf[l];repr.push(nafW)}var a=this.jpoint(null,null,null);var b=this.jpoint(null,null,null);for(var i=I;i>0;i--){for(j=0;j=0;i--){for(var l=0;i>=0&&naf[i]===0;i--)l++;if(i>=0)l++;acc=acc.dblp(l);if(i<0)break;var z=naf[i];assert$1(z!==0);if(p.type==="affine"){if(z>0)acc=acc.mixedAdd(wnd[z-1>>1]);else acc=acc.mixedAdd(wnd[-z-1>>1].neg())}else{if(z>0)acc=acc.add(wnd[z-1>>1]);else acc=acc.add(wnd[-z-1>>1].neg())}}return p.type==="affine"?acc.toP():acc};BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(defW,points,coeffs,len,jacobianResult){var wndWidth=this._wnafT1;var wnd=this._wnafT2;var naf=this._wnafT3;var max=0;var i;var j;var p;for(i=0;i=1;i-=2){var a=i-1;var b=i;if(wndWidth[a]!==1||wndWidth[b]!==1){naf[a]=getNAF(coeffs[a],wndWidth[a],this._bitLength);naf[b]=getNAF(coeffs[b],wndWidth[b],this._bitLength);max=Math.max(naf[a].length,max);max=Math.max(naf[b].length,max);continue}var comb=[points[a],null,null,points[b]];if(points[a].y.cmp(points[b].y)===0){comb[1]=points[a].add(points[b]);comb[2]=points[a].toJ().mixedAdd(points[b].neg())}else if(points[a].y.cmp(points[b].y.redNeg())===0){comb[1]=points[a].toJ().mixedAdd(points[b]);comb[2]=points[a].add(points[b].neg())}else{comb[1]=points[a].toJ().mixedAdd(points[b]);comb[2]=points[a].toJ().mixedAdd(points[b].neg())}var index=[-3,-1,-5,-7,0,7,5,1,3];var jsf=getJSF(coeffs[a],coeffs[b]);max=Math.max(jsf[0].length,max);naf[a]=new Array(max);naf[b]=new Array(max);for(j=0;j=0;i--){var k=0;while(i>=0){var zero=true;for(j=0;j=0)k++;acc=acc.dblp(k);if(i<0)break;for(j=0;j0)p=wnd[j][z-1>>1];else if(z<0)p=wnd[j][-z-1>>1].neg();if(p.type==="affine")acc=acc.mixedAdd(p);else acc=acc.add(p)}}for(i=0;i=Math.ceil((k.bitLength()+1)/doubles.step)};BasePoint.prototype._getDoubles=function _getDoubles(step,power){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var doubles=[this];var acc=this;for(var i=0;i=0){a2=a0;b2=b0}if(a1.negative){a1=a1.neg();b1=b1.neg()}if(a2.negative){a2=a2.neg();b2=b2.neg()}return[{a:a1,b:b1},{a:a2,b:b2}]};ShortCurve.prototype._endoSplit=function _endoSplit(k){var basis=this.endo.basis;var v1=basis[0];var v2=basis[1];var c1=v2.b.mul(k).divRound(this.n);var c2=v1.b.neg().mul(k).divRound(this.n);var p1=c1.mul(v1.a);var p2=c2.mul(v2.a);var q1=c1.mul(v1.b);var q2=c2.mul(v2.b);var k1=k.sub(p1).sub(p2);var k2=q1.add(q2).neg();return{k1:k1,k2:k2}};ShortCurve.prototype.pointFromX=function pointFromX(x,odd){x=new bn$1(x,16);if(!x.red)x=x.toRed(this.red);var y2=x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);var y=y2.redSqrt();if(y.redSqr().redSub(y2).cmp(this.zero)!==0)throw new Error("invalid point");var isOdd=y.fromRed().isOdd();if(odd&&!isOdd||!odd&&isOdd)y=y.redNeg();return this.point(x,y)};ShortCurve.prototype.validate=function validate(point){if(point.inf)return true;var x=point.x;var y=point.y;var ax=this.a.redMul(x);var rhs=x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);return y.redSqr().redISub(rhs).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(points,coeffs,jacobianResult){var npoints=this._endoWnafT1;var ncoeffs=this._endoWnafT2;for(var i=0;i";return""};Point.prototype.isInfinity=function isInfinity(){return this.inf};Point.prototype.add=function add(p){if(this.inf)return p;if(p.inf)return this;if(this.eq(p))return this.dbl();if(this.neg().eq(p))return this.curve.point(null,null);if(this.x.cmp(p.x)===0)return this.curve.point(null,null);var c=this.y.redSub(p.y);if(c.cmpn(0)!==0)c=c.redMul(this.x.redSub(p.x).redInvm());var nx=c.redSqr().redISub(this.x).redISub(p.x);var ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)};Point.prototype.dbl=function dbl(){if(this.inf)return this;var ys1=this.y.redAdd(this.y);if(ys1.cmpn(0)===0)return this.curve.point(null,null);var a=this.curve.a;var x2=this.x.redSqr();var dyinv=ys1.redInvm();var c=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);var nx=c.redSqr().redISub(this.x.redAdd(this.x));var ny=c.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)};Point.prototype.getX=function getX(){return this.x.fromRed()};Point.prototype.getY=function getY(){return this.y.fromRed()};Point.prototype.mul=function mul(k){k=new bn$1(k,16);if(this.isInfinity())return this;else if(this._hasDoubles(k))return this.curve._fixedNafMul(this,k);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[k]);else return this.curve._wnafMul(this,k)};Point.prototype.mulAdd=function mulAdd(k1,p2,k2){var points=[this,p2];var coeffs=[k1,k2];if(this.curve.endo)return this.curve._endoWnafMulAdd(points,coeffs);else return this.curve._wnafMulAdd(1,points,coeffs,2)};Point.prototype.jmulAdd=function jmulAdd(k1,p2,k2){var points=[this,p2];var coeffs=[k1,k2];if(this.curve.endo)return this.curve._endoWnafMulAdd(points,coeffs,true);else return this.curve._wnafMulAdd(1,points,coeffs,2,true)};Point.prototype.eq=function eq(p){return this===p||this.inf===p.inf&&(this.inf||this.x.cmp(p.x)===0&&this.y.cmp(p.y)===0)};Point.prototype.neg=function neg(_precompute){if(this.inf)return this;var res=this.curve.point(this.x,this.y.redNeg());if(_precompute&&this.precomputed){var pre=this.precomputed;var negate=function(p){return p.neg()};res.precomputed={naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(negate)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(negate)}}}return res};Point.prototype.toJ=function toJ(){if(this.inf)return this.curve.jpoint(null,null,null);var res=this.curve.jpoint(this.x,this.y,this.curve.one);return res};function JPoint(curve,x,y,z){base.BasePoint.call(this,curve,"jacobian");if(x===null&&y===null&&z===null){this.x=this.curve.one;this.y=this.curve.one;this.z=new bn$1(0)}else{this.x=new bn$1(x,16);this.y=new bn$1(y,16);this.z=new bn$1(z,16)}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}inherits_browser(JPoint,base.BasePoint);ShortCurve.prototype.jpoint=function jpoint(x,y,z){return new JPoint(this,x,y,z)};JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var zinv=this.z.redInvm();var zinv2=zinv.redSqr();var ax=this.x.redMul(zinv2);var ay=this.y.redMul(zinv2).redMul(zinv);return this.curve.point(ax,ay)};JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function add(p){if(this.isInfinity())return p;if(p.isInfinity())return this;var pz2=p.z.redSqr();var z2=this.z.redSqr();var u1=this.x.redMul(pz2);var u2=p.x.redMul(z2);var s1=this.y.redMul(pz2.redMul(p.z));var s2=p.y.redMul(z2.redMul(this.z));var h=u1.redSub(u2);var r=s1.redSub(s2);if(h.cmpn(0)===0){if(r.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var h2=h.redSqr();var h3=h2.redMul(h);var v=u1.redMul(h2);var nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v);var ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));var nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)};JPoint.prototype.mixedAdd=function mixedAdd(p){if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;var z2=this.z.redSqr();var u1=this.x;var u2=p.x.redMul(z2);var s1=this.y;var s2=p.y.redMul(z2).redMul(this.z);var h=u1.redSub(u2);var r=s1.redSub(s2);if(h.cmpn(0)===0){if(r.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var h2=h.redSqr();var h3=h2.redMul(h);var v=u1.redMul(h2);var nx=r.redSqr().redIAdd(h3).redISub(v).redISub(v);var ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));var nz=this.z.redMul(h);return this.curve.jpoint(nx,ny,nz)};JPoint.prototype.dblp=function dblp(pow){if(pow===0)return this;if(this.isInfinity())return this;if(!pow)return this.dbl();var i;if(this.curve.zeroA||this.curve.threeA){var r=this;for(i=0;i=0)return false;rx.redIAdd(t);if(this.x.cmp(rx)===0)return true}};JPoint.prototype.inspect=function inspect(){if(this.isInfinity())return"";return""};JPoint.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0};var curve_1=createCommonjsModule(function(module,exports){"use strict";var curve=exports;curve.base=base;curve.short=short_1;curve.mont=null;curve.edwards=null});"use strict";var inherits_1=inherits_browser;function isSurrogatePair(msg,i){if((msg.charCodeAt(i)&64512)!==55296){return false}if(i<0||i+1>=msg.length){return false}return(msg.charCodeAt(i+1)&64512)===56320}function toArray(msg,enc){if(Array.isArray(msg))return msg.slice();if(!msg)return[];var res=[];if(typeof msg==="string"){if(!enc){var p=0;for(var i=0;i>6|192;res[p++]=c&63|128}else if(isSurrogatePair(msg,i)){c=65536+((c&1023)<<10)+(msg.charCodeAt(++i)&1023);res[p++]=c>>18|240;res[p++]=c>>12&63|128;res[p++]=c>>6&63|128;res[p++]=c&63|128}else{res[p++]=c>>12|224;res[p++]=c>>6&63|128;res[p++]=c&63|128}}}else if(enc==="hex"){msg=msg.replace(/[^a-z0-9]+/gi,"");if(msg.length%2!==0)msg="0"+msg;for(i=0;i>>24|w>>>8&65280|w<<8&16711680|(w&255)<<24;return res>>>0}var htonl_1=htonl;function toHex32(msg,endian){var res="";for(var i=0;i>>0}return res}var join32_1=join32;function split32(msg,endian){var res=new Array(msg.length*4);for(var i=0,k=0;i>>24;res[k+1]=m>>>16&255;res[k+2]=m>>>8&255;res[k+3]=m&255}else{res[k+3]=m>>>24;res[k+2]=m>>>16&255;res[k+1]=m>>>8&255;res[k]=m&255}}return res}var split32_1=split32;function rotr32(w,b){return w>>>b|w<<32-b}var rotr32_1=rotr32;function rotl32(w,b){return w<>>32-b}var rotl32_1=rotl32;function sum32(a,b){return a+b>>>0}var sum32_1=sum32;function sum32_3(a,b,c){return a+b+c>>>0}var sum32_3_1=sum32_3;function sum32_4(a,b,c,d){return a+b+c+d>>>0}var sum32_4_1=sum32_4;function sum32_5(a,b,c,d,e){return a+b+c+d+e>>>0}var sum32_5_1=sum32_5;function sum64(buf,pos,ah,al){var bh=buf[pos];var bl=buf[pos+1];var lo=al+bl>>>0;var hi=(lo>>0;buf[pos+1]=lo}var sum64_1=sum64;function sum64_hi(ah,al,bh,bl){var lo=al+bl>>>0;var hi=(lo>>0}var sum64_hi_1=sum64_hi;function sum64_lo(ah,al,bh,bl){var lo=al+bl;return lo>>>0}var sum64_lo_1=sum64_lo;function sum64_4_hi(ah,al,bh,bl,ch,cl,dh,dl){var carry=0;var lo=al;lo=lo+bl>>>0;carry+=lo>>0;carry+=lo>>0;carry+=lo>>0}var sum64_4_hi_1=sum64_4_hi;function sum64_4_lo(ah,al,bh,bl,ch,cl,dh,dl){var lo=al+bl+cl+dl;return lo>>>0}var sum64_4_lo_1=sum64_4_lo;function sum64_5_hi(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var carry=0;var lo=al;lo=lo+bl>>>0;carry+=lo>>0;carry+=lo>>0;carry+=lo>>0;carry+=lo>>0}var sum64_5_hi_1=sum64_5_hi;function sum64_5_lo(ah,al,bh,bl,ch,cl,dh,dl,eh,el){var lo=al+bl+cl+dl+el;return lo>>>0}var sum64_5_lo_1=sum64_5_lo;function rotr64_hi(ah,al,num){var r=al<<32-num|ah>>>num;return r>>>0}var rotr64_hi_1=rotr64_hi;function rotr64_lo(ah,al,num){var r=ah<<32-num|al>>>num;return r>>>0}var rotr64_lo_1=rotr64_lo;function shr64_hi(ah,al,num){return ah>>>num}var shr64_hi_1=shr64_hi;function shr64_lo(ah,al,num){var r=ah<<32-num|al>>>num;return r>>>0}var shr64_lo_1=shr64_lo;var utils={inherits:inherits_1,toArray:toArray_1,toHex:toHex_1,htonl:htonl_1,toHex32:toHex32_1,zero2:zero2_1,zero8:zero8_1,join32:join32_1,split32:split32_1,rotr32:rotr32_1,rotl32:rotl32_1,sum32:sum32_1,sum32_3:sum32_3_1,sum32_4:sum32_4_1,sum32_5:sum32_5_1,sum64:sum64_1,sum64_hi:sum64_hi_1,sum64_lo:sum64_lo_1,sum64_4_hi:sum64_4_hi_1,sum64_4_lo:sum64_4_lo_1,sum64_5_hi:sum64_5_hi_1,sum64_5_lo:sum64_5_lo_1,rotr64_hi:rotr64_hi_1,rotr64_lo:rotr64_lo_1,shr64_hi:shr64_hi_1,shr64_lo:shr64_lo_1};"use strict";function BlockHash(){this.pending=null;this.pendingTotal=0;this.blockSize=this.constructor.blockSize;this.outSize=this.constructor.outSize;this.hmacStrength=this.constructor.hmacStrength;this.padLength=this.constructor.padLength/8;this.endian="big";this._delta8=this.blockSize/8;this._delta32=this.blockSize/32}var BlockHash_1=BlockHash;BlockHash.prototype.update=function update(msg,enc){msg=utils.toArray(msg,enc);if(!this.pending)this.pending=msg;else this.pending=this.pending.concat(msg);this.pendingTotal+=msg.length;if(this.pending.length>=this._delta8){msg=this.pending;var r=msg.length%this._delta8;this.pending=msg.slice(msg.length-r,msg.length);if(this.pending.length===0)this.pending=null;msg=utils.join32(msg,0,msg.length-r,this.endian);for(var i=0;i>>24&255;res[i++]=len>>>16&255;res[i++]=len>>>8&255;res[i++]=len&255}else{res[i++]=len&255;res[i++]=len>>>8&255;res[i++]=len>>>16&255;res[i++]=len>>>24&255;res[i++]=0;res[i++]=0;res[i++]=0;res[i++]=0;for(t=8;t>>3}var g0_256_1=g0_256;function g1_256(x){return rotr32$1(x,17)^rotr32$1(x,19)^x>>>10}var g1_256_1=g1_256;var common$1={ft_1:ft_1_1,ch32:ch32_1,maj32:maj32_1,p32:p32_1,s0_256:s0_256_1,s1_256:s1_256_1,g0_256:g0_256_1,g1_256:g1_256_1};"use strict";var rotl32$1=utils.rotl32;var sum32$1=utils.sum32;var sum32_5$1=utils.sum32_5;var ft_1$1=common$1.ft_1;var BlockHash$1=common.BlockHash;var sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$1.call(this);this.h=[1732584193,4023233417,2562383102,271733878,3285377520];this.W=new Array(80)}utils.inherits(SHA1,BlockHash$1);var _1=SHA1;SHA1.blockSize=512;SHA1.outSize=160;SHA1.hmacStrength=80;SHA1.padLength=64;SHA1.prototype._update=function _update(msg,start){var W=this.W;for(var i=0;i<16;i++)W[i]=msg[start+i];for(;ithis.blockSize)key=(new this.Hash).update(key).digest();minimalisticAssert(key.length<=this.blockSize);for(var i=key.length;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._init(entropy,nonce,pers)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function init(entropy,nonce,pers){var seed=entropy.concat(nonce).concat(pers);this.K=new Array(this.outLen/8);this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._update(entropy.concat(add||[]));this._reseed=1};HmacDRBG.prototype.generate=function generate(len,enc,add,addEnc){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");if(typeof enc!=="string"){addEnc=add;add=enc;enc=null}if(add){add=utils_1.toArray(add,addEnc||"hex");this._update(add)}var temp=[];while(temp.length"};"use strict";var assert$4=utils_1$1.assert;function Signature(options,enc){if(options instanceof Signature)return options;if(this._importDER(options,enc))return;assert$4(options.r&&options.s,"Signature without r or s");this.r=new bn$1(options.r,16);this.s=new bn$1(options.s,16);if(options.recoveryParam===undefined)this.recoveryParam=null;else this.recoveryParam=options.recoveryParam}var signature=Signature;function Position(){this.place=0}function getLength(buf,p){var initial=buf[p.place++];if(!(initial&128)){return initial}var octetLen=initial&15;if(octetLen===0||octetLen>4){return false}var val=0;for(var i=0,off=p.place;i>>=0}if(val<=127){return false}p.place=off;return val}function rmPadding(buf){var i=0;var len=buf.length-1;while(!buf[i]&&!(buf[i+1]&128)&&i>>3);arr.push(octets|128);while(--octets){arr.push(len>>>(octets<<3)&255)}arr.push(len)}Signature.prototype.toDER=function toDER(enc){var r=this.r.toArray();var s=this.s.toArray();if(r[0]&128)r=[0].concat(r);if(s[0]&128)s=[0].concat(s);r=rmPadding(r);s=rmPadding(s);while(!s[0]&&!(s[1]&128)){s=s.slice(1)}var arr=[2];constructLength(arr,r.length);arr=arr.concat(r);arr.push(2);constructLength(arr,s.length);var backHalf=arr.concat(s);var res=[48];constructLength(res,backHalf.length);res=res.concat(backHalf);return utils_1$1.encode(res,enc)};"use strict";var rand=function(){throw new Error("unsupported")};var assert$5=utils_1$1.assert;function EC(options){if(!(this instanceof EC))return new EC(options);if(typeof options==="string"){assert$5(Object.prototype.hasOwnProperty.call(curves_1,options),"Unknown curve "+options);options=curves_1[options]}if(options instanceof curves_1.PresetCurve)options={curve:options};this.curve=options.curve.curve;this.n=this.curve.n;this.nh=this.n.ushrn(1);this.g=this.curve.g;this.g=options.curve.g;this.g.precompute(options.curve.n.bitLength()+1);this.hash=options.hash||options.curve.hash}var ec=EC;EC.prototype.keyPair=function keyPair(options){return new key(this,options)};EC.prototype.keyFromPrivate=function keyFromPrivate(priv,enc){return key.fromPrivate(this,priv,enc)};EC.prototype.keyFromPublic=function keyFromPublic(pub,enc){return key.fromPublic(this,pub,enc)};EC.prototype.genKeyPair=function genKeyPair(options){if(!options)options={};var drbg=new hmacDrbg({hash:this.hash,pers:options.pers,persEnc:options.persEnc||"utf8",entropy:options.entropy||rand(this.hash.hmacStrength),entropyEnc:options.entropy&&options.entropyEnc||"utf8",nonce:this.n.toArray()});var bytes=this.n.byteLength();var ns2=this.n.sub(new bn$1(2));for(;;){var priv=new bn$1(drbg.generate(bytes));if(priv.cmp(ns2)>0)continue;priv.iaddn(1);return this.keyFromPrivate(priv)}};EC.prototype._truncateToN=function _truncateToN(msg,truncOnly){var delta=msg.byteLength()*8-this.n.bitLength();if(delta>0)msg=msg.ushrn(delta);if(!truncOnly&&msg.cmp(this.n)>=0)return msg.sub(this.n);else return msg};EC.prototype.sign=function sign(msg,key,enc,options){if(typeof enc==="object"){options=enc;enc=null}if(!options)options={};key=this.keyFromPrivate(key,enc);msg=this._truncateToN(new bn$1(msg,16));var bytes=this.n.byteLength();var bkey=key.getPrivate().toArray("be",bytes);var nonce=msg.toArray("be",bytes);var drbg=new hmacDrbg({hash:this.hash,entropy:bkey,nonce:nonce,pers:options.pers,persEnc:options.persEnc||"utf8"});var ns1=this.n.sub(new bn$1(1));for(var iter=0;;iter++){var k=options.k?options.k(iter):new bn$1(drbg.generate(this.n.byteLength()));k=this._truncateToN(k,true);if(k.cmpn(1)<=0||k.cmp(ns1)>=0)continue;var kp=this.g.mul(k);if(kp.isInfinity())continue;var kpX=kp.getX();var r=kpX.umod(this.n);if(r.cmpn(0)===0)continue;var s=k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));s=s.umod(this.n);if(s.cmpn(0)===0)continue;var recoveryParam=(kp.getY().isOdd()?1:0)|(kpX.cmp(r)!==0?2:0);if(options.canonical&&s.cmp(this.nh)>0){s=this.n.sub(s);recoveryParam^=1}return new signature({r:r,s:s,recoveryParam:recoveryParam})}};EC.prototype.verify=function verify(msg,signature$1,key,enc){msg=this._truncateToN(new bn$1(msg,16));key=this.keyFromPublic(key,enc);signature$1=new signature(signature$1,"hex");var r=signature$1.r;var s=signature$1.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return false;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return false;var sinv=s.invm(this.n);var u1=sinv.mul(msg).umod(this.n);var u2=sinv.mul(r).umod(this.n);var p;if(!this.curve._maxwellTrick){p=this.g.mulAdd(u1,key.getPublic(),u2);if(p.isInfinity())return false;return p.getX().umod(this.n).cmp(r)===0}p=this.g.jmulAdd(u1,key.getPublic(),u2);if(p.isInfinity())return false;return p.eqXToP(r)};EC.prototype.recoverPubKey=function(msg,signature$1,j,enc){assert$5((3&j)===j,"The recovery param is more than two bits");signature$1=new signature(signature$1,enc);var n=this.n;var e=new bn$1(msg);var r=signature$1.r;var s=signature$1.s;var isYOdd=j&1;var isSecondKey=j>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&isSecondKey)throw new Error("Unable to find sencond key candinate");if(isSecondKey)r=this.curve.pointFromX(r.add(this.curve.n),isYOdd);else r=this.curve.pointFromX(r,isYOdd);var rInv=signature$1.r.invm(n);var s1=n.sub(e).mul(rInv).umod(n);var s2=s.mul(rInv).umod(n);return this.g.mulAdd(s1,r,s2)};EC.prototype.getKeyRecoveryParam=function(e,signature$1,Q,enc){signature$1=new signature(signature$1,enc);if(signature$1.recoveryParam!==null)return signature$1.recoveryParam;for(var i=0;i<4;i++){var Qprime;try{Qprime=this.recoverPubKey(e,signature$1,i)}catch(e){continue}if(Qprime.eq(Q))return i}throw new Error("Unable to find valid recovery factor")};var elliptic_1=createCommonjsModule(function(module,exports){"use strict";var elliptic=exports;elliptic.version={version:"6.5.4"}.version;elliptic.utils=utils_1$1;elliptic.rand=function(){throw new Error("unsupported")};elliptic.curve=curve_1;elliptic.curves=curves_1;elliptic.ec=ec;elliptic.eddsa=null});var elliptic=createCommonjsModule(function(module,exports){"use strict";var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:true});exports.EC=void 0;var elliptic_1$1=__importDefault(elliptic_1);var EC=elliptic_1$1.default.ec;exports.EC=EC});var elliptic$1=getDefaultExportFromCjs(elliptic);var _version$m=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="signing-key/5.6.2"});var _version$n=getDefaultExportFromCjs(_version$m);var lib$d=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.computePublicKey=exports.recoverPublicKey=exports.SigningKey=void 0;var logger=new lib.Logger(_version$m.version);var _curve=null;function getCurve(){if(!_curve){_curve=new elliptic.EC("secp256k1")}return _curve}var SigningKey=function(){function SigningKey(privateKey){(0,lib$3.defineReadOnly)(this,"curve","secp256k1");(0,lib$3.defineReadOnly)(this,"privateKey",(0,lib$1.hexlify)(privateKey));if((0,lib$1.hexDataLength)(this.privateKey)!==32){logger.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]")}var keyPair=getCurve().keyFromPrivate((0,lib$1.arrayify)(this.privateKey));(0,lib$3.defineReadOnly)(this,"publicKey","0x"+keyPair.getPublic(false,"hex"));(0,lib$3.defineReadOnly)(this,"compressedPublicKey","0x"+keyPair.getPublic(true,"hex"));(0,lib$3.defineReadOnly)(this,"_isSigningKey",true)}SigningKey.prototype._addPoint=function(other){var p0=getCurve().keyFromPublic((0,lib$1.arrayify)(this.publicKey));var p1=getCurve().keyFromPublic((0,lib$1.arrayify)(other));return"0x"+p0.pub.add(p1.pub).encodeCompressed("hex")};SigningKey.prototype.signDigest=function(digest){var keyPair=getCurve().keyFromPrivate((0,lib$1.arrayify)(this.privateKey));var digestBytes=(0,lib$1.arrayify)(digest);if(digestBytes.length!==32){logger.throwArgumentError("bad digest length","digest",digest)}var signature=keyPair.sign(digestBytes,{canonical:true});return(0,lib$1.splitSignature)({recoveryParam:signature.recoveryParam,r:(0,lib$1.hexZeroPad)("0x"+signature.r.toString(16),32),s:(0,lib$1.hexZeroPad)("0x"+signature.s.toString(16),32)})};SigningKey.prototype.computeSharedSecret=function(otherKey){var keyPair=getCurve().keyFromPrivate((0,lib$1.arrayify)(this.privateKey));var otherKeyPair=getCurve().keyFromPublic((0,lib$1.arrayify)(computePublicKey(otherKey)));return(0,lib$1.hexZeroPad)("0x"+keyPair.derive(otherKeyPair.getPublic()).toString(16),32)};SigningKey.isSigningKey=function(value){return!!(value&&value._isSigningKey)};return SigningKey}();exports.SigningKey=SigningKey;function recoverPublicKey(digest,signature){var sig=(0,lib$1.splitSignature)(signature);var rs={r:(0,lib$1.arrayify)(sig.r),s:(0,lib$1.arrayify)(sig.s)};return"0x"+getCurve().recoverPubKey((0,lib$1.arrayify)(digest),rs,sig.recoveryParam).encode("hex",false)}exports.recoverPublicKey=recoverPublicKey;function computePublicKey(key,compressed){var bytes=(0,lib$1.arrayify)(key);if(bytes.length===32){var signingKey=new SigningKey(bytes);if(compressed){return"0x"+getCurve().keyFromPrivate(bytes).getPublic(true,"hex")}return signingKey.publicKey}else if(bytes.length===33){if(compressed){return(0,lib$1.hexlify)(bytes)}return"0x"+getCurve().keyFromPublic(bytes).getPublic(false,"hex")}else if(bytes.length===65){if(!compressed){return(0,lib$1.hexlify)(bytes)}return"0x"+getCurve().keyFromPublic(bytes).getPublic(true,"hex")}return logger.throwArgumentError("invalid public or private key","key","[REDACTED]")}exports.computePublicKey=computePublicKey});var index$d=getDefaultExportFromCjs(lib$d);var _version$o=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="transactions/5.6.2"});var _version$p=getDefaultExportFromCjs(_version$o);var lib$e=createCommonjsModule(function(module,exports){"use strict";var __createBinding=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(o,m,k,k2){if(k2===undefined)k2=k;Object.defineProperty(o,k2,{enumerable:true,get:function(){return m[k]}})}:function(o,m,k,k2){if(k2===undefined)k2=k;o[k2]=m[k]});var __setModuleDefault=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:true,value:v})}:function(o,v){o["default"]=v});var __importStar=commonjsGlobal&&commonjsGlobal.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)if(k!=="default"&&Object.prototype.hasOwnProperty.call(mod,k))__createBinding(result,mod,k);__setModuleDefault(result,mod);return result};Object.defineProperty(exports,"__esModule",{value:true});exports.parse=exports.serialize=exports.accessListify=exports.recoverAddress=exports.computeAddress=exports.TransactionTypes=void 0;var RLP=__importStar(lib$5);var logger=new lib.Logger(_version$o.version);var TransactionTypes;(function(TransactionTypes){TransactionTypes[TransactionTypes["legacy"]=0]="legacy";TransactionTypes[TransactionTypes["eip2930"]=1]="eip2930";TransactionTypes[TransactionTypes["eip1559"]=2]="eip1559"})(TransactionTypes=exports.TransactionTypes||(exports.TransactionTypes={}));function handleAddress(value){if(value==="0x"){return null}return(0,lib$6.getAddress)(value)}function handleNumber(value){if(value==="0x"){return lib$7.Zero}return lib$2.BigNumber.from(value)}var transactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"gasPrice",maxLength:32,numeric:true},{name:"gasLimit",maxLength:32,numeric:true},{name:"to",length:20},{name:"value",maxLength:32,numeric:true},{name:"data"}];var allowedTransactionKeys={chainId:true,data:true,gasLimit:true,gasPrice:true,nonce:true,to:true,type:true,value:true};function computeAddress(key){var publicKey=(0,lib$d.computePublicKey)(key);return(0,lib$6.getAddress)((0,lib$1.hexDataSlice)((0,lib$4.keccak256)((0,lib$1.hexDataSlice)(publicKey,1)),12))}exports.computeAddress=computeAddress;function recoverAddress(digest,signature){return computeAddress((0,lib$d.recoverPublicKey)((0,lib$1.arrayify)(digest),signature))}exports.recoverAddress=recoverAddress;function formatNumber(value,name){var result=(0,lib$1.stripZeros)(lib$2.BigNumber.from(value).toHexString());if(result.length>32){logger.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}return result}function accessSetify(addr,storageKeys){return{address:(0,lib$6.getAddress)(addr),storageKeys:(storageKeys||[]).map(function(storageKey,index){if((0,lib$1.hexDataLength)(storageKey)!==32){logger.throwArgumentError("invalid access list storageKey","accessList["+addr+":"+index+"]",storageKey)}return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map(function(set,index){if(Array.isArray(set)){if(set.length>2){logger.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value["+index+"]",set)}return accessSetify(set[0],set[1])}return accessSetify(set.address,set.storageKeys)})}var result=Object.keys(value).map(function(addr){var storageKeys=value[addr].reduce(function(accum,storageKey){accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort(function(a,b){return a.address.localeCompare(b.address)});return result}exports.accessListify=accessListify;function formatAccessList(value){return accessListify(value).map(function(set){return[set.address,set.storageKeys]})}function _serializeEip1559(transaction,signature){if(transaction.gasPrice!=null){var gasPrice=lib$2.BigNumber.from(transaction.gasPrice);var maxFeePerGas=lib$2.BigNumber.from(transaction.maxFeePerGas||0);if(!gasPrice.eq(maxFeePerGas)){logger.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:gasPrice,maxFeePerGas:maxFeePerGas})}}var fields=[formatNumber(transaction.chainId||0,"chainId"),formatNumber(transaction.nonce||0,"nonce"),formatNumber(transaction.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),formatNumber(transaction.maxFeePerGas||0,"maxFeePerGas"),formatNumber(transaction.gasLimit||0,"gasLimit"),transaction.to!=null?(0,lib$6.getAddress)(transaction.to):"0x",formatNumber(transaction.value||0,"value"),transaction.data||"0x",formatAccessList(transaction.accessList||[])];if(signature){var sig=(0,lib$1.splitSignature)(signature);fields.push(formatNumber(sig.recoveryParam,"recoveryParam"));fields.push((0,lib$1.stripZeros)(sig.r));fields.push((0,lib$1.stripZeros)(sig.s))}return(0,lib$1.hexConcat)(["0x02",RLP.encode(fields)])}function _serializeEip2930(transaction,signature){var fields=[formatNumber(transaction.chainId||0,"chainId"),formatNumber(transaction.nonce||0,"nonce"),formatNumber(transaction.gasPrice||0,"gasPrice"),formatNumber(transaction.gasLimit||0,"gasLimit"),transaction.to!=null?(0,lib$6.getAddress)(transaction.to):"0x",formatNumber(transaction.value||0,"value"),transaction.data||"0x",formatAccessList(transaction.accessList||[])];if(signature){var sig=(0,lib$1.splitSignature)(signature);fields.push(formatNumber(sig.recoveryParam,"recoveryParam"));fields.push((0,lib$1.stripZeros)(sig.r));fields.push((0,lib$1.stripZeros)(sig.s))}return(0,lib$1.hexConcat)(["0x01",RLP.encode(fields)])}function _serialize(transaction,signature){(0,lib$3.checkProperties)(transaction,allowedTransactionKeys);var raw=[];transactionFields.forEach(function(fieldInfo){var value=transaction[fieldInfo.name]||[];var options={};if(fieldInfo.numeric){options.hexPad="left"}value=(0,lib$1.arrayify)((0,lib$1.hexlify)(value,options));if(fieldInfo.length&&value.length!==fieldInfo.length&&value.length>0){logger.throwArgumentError("invalid length for "+fieldInfo.name,"transaction:"+fieldInfo.name,value)}if(fieldInfo.maxLength){value=(0,lib$1.stripZeros)(value);if(value.length>fieldInfo.maxLength){logger.throwArgumentError("invalid length for "+fieldInfo.name,"transaction:"+fieldInfo.name,value)}}raw.push((0,lib$1.hexlify)(value))});var chainId=0;if(transaction.chainId!=null){chainId=transaction.chainId;if(typeof chainId!=="number"){logger.throwArgumentError("invalid transaction.chainId","transaction",transaction)}}else if(signature&&!(0,lib$1.isBytesLike)(signature)&&signature.v>28){chainId=Math.floor((signature.v-35)/2)}if(chainId!==0){raw.push((0,lib$1.hexlify)(chainId));raw.push("0x");raw.push("0x")}if(!signature){return RLP.encode(raw)}var sig=(0,lib$1.splitSignature)(signature);var v=27+sig.recoveryParam;if(chainId!==0){raw.pop();raw.pop();raw.pop();v+=chainId*2+8;if(sig.v>28&&sig.v!==v){logger.throwArgumentError("transaction.chainId/signature.v mismatch","signature",signature)}}else if(sig.v!==v){logger.throwArgumentError("transaction.chainId/signature.v mismatch","signature",signature)}raw.push((0,lib$1.hexlify)(v));raw.push((0,lib$1.stripZeros)((0,lib$1.arrayify)(sig.r)));raw.push((0,lib$1.stripZeros)((0,lib$1.arrayify)(sig.s)));return RLP.encode(raw)}function serialize(transaction,signature){if(transaction.type==null||transaction.type===0){if(transaction.accessList!=null){logger.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",transaction)}return _serialize(transaction,signature)}switch(transaction.type){case 1:return _serializeEip2930(transaction,signature);case 2:return _serializeEip1559(transaction,signature);default:break}return logger.throwError("unsupported transaction type: "+transaction.type,lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:transaction.type})}exports.serialize=serialize;function _parseEipSignature(tx,fields,serialize){try{var recid=handleNumber(fields[0]).toNumber();if(recid!==0&&recid!==1){throw new Error("bad recid")}tx.v=recid}catch(error){logger.throwArgumentError("invalid v for transaction type: 1","v",fields[0])}tx.r=(0,lib$1.hexZeroPad)(fields[1],32);tx.s=(0,lib$1.hexZeroPad)(fields[2],32);try{var digest=(0,lib$4.keccak256)(serialize(tx));tx.from=recoverAddress(digest,{r:tx.r,s:tx.s,recoveryParam:tx.v})}catch(error){}}function _parseEip1559(payload){var transaction=RLP.decode(payload.slice(1));if(transaction.length!==9&&transaction.length!==12){logger.throwArgumentError("invalid component count for transaction type: 2","payload",(0,lib$1.hexlify)(payload))}var maxPriorityFeePerGas=handleNumber(transaction[2]);var maxFeePerGas=handleNumber(transaction[3]);var tx={type:2,chainId:handleNumber(transaction[0]).toNumber(),nonce:handleNumber(transaction[1]).toNumber(),maxPriorityFeePerGas:maxPriorityFeePerGas,maxFeePerGas:maxFeePerGas,gasPrice:null,gasLimit:handleNumber(transaction[4]),to:handleAddress(transaction[5]),value:handleNumber(transaction[6]),data:transaction[7],accessList:accessListify(transaction[8])};if(transaction.length===9){return tx}tx.hash=(0,lib$4.keccak256)(payload);_parseEipSignature(tx,transaction.slice(9),_serializeEip1559);return tx}function _parseEip2930(payload){var transaction=RLP.decode(payload.slice(1));if(transaction.length!==8&&transaction.length!==11){logger.throwArgumentError("invalid component count for transaction type: 1","payload",(0,lib$1.hexlify)(payload))}var tx={type:1,chainId:handleNumber(transaction[0]).toNumber(),nonce:handleNumber(transaction[1]).toNumber(),gasPrice:handleNumber(transaction[2]),gasLimit:handleNumber(transaction[3]),to:handleAddress(transaction[4]),value:handleNumber(transaction[5]),data:transaction[6],accessList:accessListify(transaction[7])};if(transaction.length===8){return tx}tx.hash=(0,lib$4.keccak256)(payload);_parseEipSignature(tx,transaction.slice(8),_serializeEip2930);return tx}function _parse(rawTransaction){var transaction=RLP.decode(rawTransaction);if(transaction.length!==9&&transaction.length!==6){logger.throwArgumentError("invalid raw transaction","rawTransaction",rawTransaction)}var tx={nonce:handleNumber(transaction[0]).toNumber(),gasPrice:handleNumber(transaction[1]),gasLimit:handleNumber(transaction[2]),to:handleAddress(transaction[3]),value:handleNumber(transaction[4]),data:transaction[5],chainId:0};if(transaction.length===6){return tx}try{tx.v=lib$2.BigNumber.from(transaction[6]).toNumber()}catch(error){return tx}tx.r=(0,lib$1.hexZeroPad)(transaction[7],32);tx.s=(0,lib$1.hexZeroPad)(transaction[8],32);if(lib$2.BigNumber.from(tx.r).isZero()&&lib$2.BigNumber.from(tx.s).isZero()){tx.chainId=tx.v;tx.v=0}else{tx.chainId=Math.floor((tx.v-35)/2);if(tx.chainId<0){tx.chainId=0}var recoveryParam=tx.v-27;var raw=transaction.slice(0,6);if(tx.chainId!==0){raw.push((0,lib$1.hexlify)(tx.chainId));raw.push("0x");raw.push("0x");recoveryParam-=tx.chainId*2+8}var digest=(0,lib$4.keccak256)(RLP.encode(raw));try{tx.from=recoverAddress(digest,{r:(0,lib$1.hexlify)(tx.r),s:(0,lib$1.hexlify)(tx.s),recoveryParam:recoveryParam})}catch(error){}tx.hash=(0,lib$4.keccak256)(rawTransaction)}tx.type=null;return tx}function parse(rawTransaction){var payload=(0,lib$1.arrayify)(rawTransaction);if(payload[0]>127){return _parse(payload)}switch(payload[0]){case 1:return _parseEip2930(payload);case 2:return _parseEip1559(payload);default:break}return logger.throwError("unsupported transaction type: "+payload[0],lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:payload[0]})}exports.parse=parse});var index$e=getDefaultExportFromCjs(lib$e);var _version$q=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="contracts/5.6.2"});var _version$r=getDefaultExportFromCjs(_version$q);var lib$f=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var __awaiter=commonjsGlobal&&commonjsGlobal.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};var __generator=commonjsGlobal&&commonjsGlobal.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]1){return}name=name.substring(1);var signature=signatures[0];try{if(_this[name]==null){(0,lib$3.defineReadOnly)(_this,name,_this[signature])}}catch(e){}if(_this.functions[name]==null){(0,lib$3.defineReadOnly)(_this.functions,name,_this.functions[signature])}if(_this.callStatic[name]==null){(0,lib$3.defineReadOnly)(_this.callStatic,name,_this.callStatic[signature])}if(_this.populateTransaction[name]==null){(0,lib$3.defineReadOnly)(_this.populateTransaction,name,_this.populateTransaction[signature])}if(_this.estimateGas[name]==null){(0,lib$3.defineReadOnly)(_this.estimateGas,name,_this.estimateGas[signature])}})}BaseContract.getContractAddress=function(transaction){return(0,lib$6.getContractAddress)(transaction)};BaseContract.getInterface=function(contractInterface){if(lib$a.Interface.isInterface(contractInterface)){return contractInterface}return new lib$a.Interface(contractInterface)};BaseContract.prototype.deployed=function(){return this._deployed()};BaseContract.prototype._deployed=function(blockTag){var _this=this;if(!this._deployedPromise){if(this.deployTransaction){this._deployedPromise=this.deployTransaction.wait().then(function(){return _this})}else{this._deployedPromise=this.provider.getCode(this.address,blockTag).then(function(code){if(code==="0x"){logger.throwError("contract not deployed",lib.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:_this.address,operation:"getDeployed"})}return _this})}}return this._deployedPromise};BaseContract.prototype.fallback=function(overrides){var _this=this;if(!this.signer){logger.throwError("sending a transactions require a signer",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"})}var tx=(0,lib$3.shallowCopy)(overrides||{});["from","to"].forEach(function(key){if(tx[key]==null){return}logger.throwError("cannot override "+key,lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:key})});tx.to=this.resolvedAddress;return this.deployed().then(function(){return _this.signer.sendTransaction(tx)})};BaseContract.prototype.connect=function(signerOrProvider){if(typeof signerOrProvider==="string"){signerOrProvider=new lib$c.VoidSigner(signerOrProvider,this.provider)}var contract=new this.constructor(this.address,this.interface,signerOrProvider);if(this.deployTransaction){(0,lib$3.defineReadOnly)(contract,"deployTransaction",this.deployTransaction)}return contract};BaseContract.prototype.attach=function(addressOrName){return new this.constructor(addressOrName,this.interface,this.signer||this.provider)};BaseContract.isIndexed=function(value){return lib$a.Indexed.isIndexed(value)};BaseContract.prototype._normalizeRunningEvent=function(runningEvent){if(this._runningEvents[runningEvent.tag]){return this._runningEvents[runningEvent.tag]}return runningEvent};BaseContract.prototype._getRunningEvent=function(eventName){if(typeof eventName==="string"){if(eventName==="error"){return this._normalizeRunningEvent(new ErrorRunningEvent)}if(eventName==="event"){return this._normalizeRunningEvent(new RunningEvent("event",null))}if(eventName==="*"){return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface))}var fragment=this.interface.getEvent(eventName);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,fragment))}if(eventName.topics&&eventName.topics.length>0){try{var topic=eventName.topics[0];if(typeof topic!=="string"){throw new Error("invalid topic")}var fragment=this.interface.getEvent(topic);return this._normalizeRunningEvent(new FragmentRunningEvent(this.address,this.interface,fragment,eventName.topics))}catch(error){}var filter={address:this.address,topics:eventName.topics};return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter),filter))}return this._normalizeRunningEvent(new WildcardRunningEvent(this.address,this.interface))};BaseContract.prototype._checkRunningEvents=function(runningEvent){if(runningEvent.listenerCount()===0){delete this._runningEvents[runningEvent.tag];var emit=this._wrappedEmits[runningEvent.tag];if(emit&&runningEvent.filter){this.provider.off(runningEvent.filter,emit);delete this._wrappedEmits[runningEvent.tag]}}};BaseContract.prototype._wrapEvent=function(runningEvent,log,listener){var _this=this;var event=(0,lib$3.deepCopy)(log);event.removeListener=function(){if(!listener){return}runningEvent.removeListener(listener);_this._checkRunningEvents(runningEvent)};event.getBlock=function(){return _this.provider.getBlock(log.blockHash)};event.getTransaction=function(){return _this.provider.getTransaction(log.transactionHash)};event.getTransactionReceipt=function(){return _this.provider.getTransactionReceipt(log.transactionHash)};runningEvent.prepareEvent(event);return event};BaseContract.prototype._addEventListener=function(runningEvent,listener,once){var _this=this;if(!this.provider){logger.throwError("events require a provider or a signer with a provider",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"})}runningEvent.addListener(listener,once);this._runningEvents[runningEvent.tag]=runningEvent;if(!this._wrappedEmits[runningEvent.tag]){var wrappedEmit=function(log){var event=_this._wrapEvent(runningEvent,log,listener);if(event.decodeError==null){try{var args=runningEvent.getEmit(event);_this.emit.apply(_this,__spreadArray([runningEvent.filter],args,false))}catch(error){event.decodeError=error.error}}if(runningEvent.filter!=null){_this.emit("event",event)}if(event.decodeError!=null){_this.emit("error",event.decodeError,event)}};this._wrappedEmits[runningEvent.tag]=wrappedEmit;if(runningEvent.filter!=null){this.provider.on(runningEvent.filter,wrappedEmit)}}};BaseContract.prototype.queryFilter=function(event,fromBlockOrBlockhash,toBlock){var _this=this;var runningEvent=this._getRunningEvent(event);var filter=(0,lib$3.shallowCopy)(runningEvent.filter);if(typeof fromBlockOrBlockhash==="string"&&(0,lib$1.isHexString)(fromBlockOrBlockhash,32)){if(toBlock!=null){logger.throwArgumentError("cannot specify toBlock with blockhash","toBlock",toBlock)}filter.blockHash=fromBlockOrBlockhash}else{filter.fromBlock=fromBlockOrBlockhash!=null?fromBlockOrBlockhash:0;filter.toBlock=toBlock!=null?toBlock:"latest"}return this.provider.getLogs(filter).then(function(logs){return logs.map(function(log){return _this._wrapEvent(runningEvent,log,null)})})};BaseContract.prototype.on=function(event,listener){this._addEventListener(this._getRunningEvent(event),listener,false);return this};BaseContract.prototype.once=function(event,listener){this._addEventListener(this._getRunningEvent(event),listener,true);return this};BaseContract.prototype.emit=function(eventName){var args=[];for(var _i=1;_i0;this._checkRunningEvents(runningEvent);return result};BaseContract.prototype.listenerCount=function(eventName){var _this=this;if(!this.provider){return 0}if(eventName==null){return Object.keys(this._runningEvents).reduce(function(accum,key){return accum+_this._runningEvents[key].listenerCount()},0)}return this._getRunningEvent(eventName).listenerCount()};BaseContract.prototype.listeners=function(eventName){if(!this.provider){return[]}if(eventName==null){var result_1=[];for(var tag in this._runningEvents){this._runningEvents[tag].listeners().forEach(function(listener){result_1.push(listener)})}return result_1}return this._getRunningEvent(eventName).listeners()};BaseContract.prototype.removeAllListeners=function(eventName){if(!this.provider){return this}if(eventName==null){for(var tag in this._runningEvents){var runningEvent_1=this._runningEvents[tag];runningEvent_1.removeAllListeners();this._checkRunningEvents(runningEvent_1)}return this}var runningEvent=this._getRunningEvent(eventName);runningEvent.removeAllListeners();this._checkRunningEvents(runningEvent);return this};BaseContract.prototype.off=function(eventName,listener){if(!this.provider){return this}var runningEvent=this._getRunningEvent(eventName);runningEvent.removeListener(listener);this._checkRunningEvents(runningEvent);return this};BaseContract.prototype.removeListener=function(eventName,listener){return this.off(eventName,listener)};return BaseContract}();exports.BaseContract=BaseContract;var Contract=function(_super){__extends(Contract,_super);function Contract(){return _super!==null&&_super.apply(this,arguments)||this}return Contract}(BaseContract);exports.Contract=Contract;var ContractFactory=function(){function ContractFactory(contractInterface,bytecode,signer){var _newTarget=this.constructor;var bytecodeHex=null;if(typeof bytecode==="string"){bytecodeHex=bytecode}else if((0,lib$1.isBytes)(bytecode)){bytecodeHex=(0,lib$1.hexlify)(bytecode)}else if(bytecode&&typeof bytecode.object==="string"){bytecodeHex=bytecode.object}else{bytecodeHex="!"}if(bytecodeHex.substring(0,2)!=="0x"){bytecodeHex="0x"+bytecodeHex}if(!(0,lib$1.isHexString)(bytecodeHex)||bytecodeHex.length%2){logger.throwArgumentError("invalid bytecode","bytecode",bytecode)}if(signer&&!lib$c.Signer.isSigner(signer)){logger.throwArgumentError("invalid signer","signer",signer)}(0,lib$3.defineReadOnly)(this,"bytecode",bytecodeHex);(0,lib$3.defineReadOnly)(this,"interface",(0,lib$3.getStatic)(_newTarget,"getInterface")(contractInterface));(0,lib$3.defineReadOnly)(this,"signer",signer||null)}ContractFactory.prototype.getDeployTransaction=function(){var args=[];for(var _i=0;_i0){digits.push(carry%this.base);carry=carry/this.base|0}}var string="";for(var k=0;source[k]===0&&k=0;--q){string+=this.alphabet[digits[q]]}return string};BaseX.prototype.decode=function(value){if(typeof value!=="string"){throw new TypeError("Expected String")}var bytes=[];if(value.length===0){return new Uint8Array(bytes)}bytes.push(0);for(var i=0;i>=8}while(carry>0){bytes.push(carry&255);carry>>=8}}for(var k=0;value[k]===this._leader&&k>24&255;block1[salt.length+1]=i>>16&255;block1[salt.length+2]=i>>8&255;block1[salt.length+3]=i&255;var U=(0,lib$1.arrayify)((0,lib$h.computeHmac)(hashAlgorithm,password,block1));if(!hLen){hLen=U.length;T=new Uint8Array(hLen);l=Math.ceil(keylen/hLen);r=keylen-(l-1)*hLen}T.set(U);for(var j=1;j=256){throw new Error("Depth too large!")}return base58check((0,lib$1.concat)([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",(0,lib$1.hexlify)(this.depth),this.parentFingerprint,(0,lib$1.hexZeroPad)((0,lib$1.hexlify)(this.index),4),this.chainCode,this.privateKey!=null?(0,lib$1.concat)(["0x00",this.privateKey]):this.publicKey]))},enumerable:false,configurable:true});HDNode.prototype.neuter=function(){return new HDNode(_constructorGuard,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)};HDNode.prototype._derive=function(index){if(index>4294967295){throw new Error("invalid index - "+String(index))}var path=this.path;if(path){path+="/"+(index&~HardenedBit)}var data=new Uint8Array(37);if(index&HardenedBit){if(!this.privateKey){throw new Error("cannot derive child of neutered node")}data.set((0,lib$1.arrayify)(this.privateKey),1);if(path){path+="'"}}else{data.set((0,lib$1.arrayify)(this.publicKey))}for(var i=24;i>=0;i-=8){data[33+(i>>3)]=index>>24-i&255}var I=(0,lib$1.arrayify)((0,lib$h.computeHmac)(lib$h.SupportedAlgorithm.sha512,this.chainCode,data));var IL=I.slice(0,32);var IR=I.slice(32);var ki=null;var Ki=null;if(this.privateKey){ki=bytes32(lib$2.BigNumber.from(IL).add(this.privateKey).mod(N))}else{var ek=new lib$d.SigningKey((0,lib$1.hexlify)(IL));Ki=ek._addPoint(this.publicKey)}var mnemonicOrPath=path;var srcMnemonic=this.mnemonic;if(srcMnemonic){mnemonicOrPath=Object.freeze({phrase:srcMnemonic.phrase,path:path,locale:srcMnemonic.locale||"en"})}return new HDNode(_constructorGuard,ki,Ki,this.fingerprint,bytes32(IR),index,this.depth+1,mnemonicOrPath)};HDNode.prototype.derivePath=function(path){var components=path.split("/");if(components.length===0||components[0]==="m"&&this.depth!==0){throw new Error("invalid path - "+path)}if(components[0]==="m"){components.shift()}var result=this;for(var i=0;i=HardenedBit){throw new Error("invalid path index - "+component)}result=result._derive(HardenedBit+index)}else if(component.match(/^[0-9]+$/)){var index=parseInt(component);if(index>=HardenedBit){throw new Error("invalid path index - "+component)}result=result._derive(index)}else{throw new Error("invalid path component - "+component)}}return result};HDNode._fromSeed=function(seed,mnemonic){var seedArray=(0,lib$1.arrayify)(seed);if(seedArray.length<16||seedArray.length>64){throw new Error("invalid seed")}var I=(0,lib$1.arrayify)((0,lib$h.computeHmac)(lib$h.SupportedAlgorithm.sha512,MasterSecret,seedArray));return new HDNode(_constructorGuard,bytes32(I.slice(0,32)),null,"0x00000000",bytes32(I.slice(32)),0,0,mnemonic)};HDNode.fromMnemonic=function(mnemonic,password,wordlist){wordlist=getWordlist(wordlist);mnemonic=entropyToMnemonic(mnemonicToEntropy(mnemonic,wordlist),wordlist);return HDNode._fromSeed(mnemonicToSeed(mnemonic,password),{phrase:mnemonic,path:"m",locale:wordlist.locale})};HDNode.fromSeed=function(seed){return HDNode._fromSeed(seed,null)};HDNode.fromExtendedKey=function(extendedKey){var bytes=lib$g.Base58.decode(extendedKey);if(bytes.length!==82||base58check(bytes.slice(0,78))!==extendedKey){logger.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}var depth=bytes[4];var parentFingerprint=(0,lib$1.hexlify)(bytes.slice(5,9));var index=parseInt((0,lib$1.hexlify)(bytes.slice(9,13)).substring(2),16);var chainCode=(0,lib$1.hexlify)(bytes.slice(13,45));var key=bytes.slice(45,78);switch((0,lib$1.hexlify)(bytes.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new HDNode(_constructorGuard,null,(0,lib$1.hexlify)(key),parentFingerprint,chainCode,index,depth,null);case"0x0488ade4":case"0x04358394 ":if(key[0]!==0){break}return new HDNode(_constructorGuard,(0,lib$1.hexlify)(key.slice(1)),null,parentFingerprint,chainCode,index,depth,null)}return logger.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")};return HDNode}();exports.HDNode=HDNode;function mnemonicToSeed(mnemonic,password){if(!password){password=""}var salt=(0,lib$8.toUtf8Bytes)("mnemonic"+password,lib$8.UnicodeNormalizationForm.NFKD);return(0,lib$i.pbkdf2)((0,lib$8.toUtf8Bytes)(mnemonic,lib$8.UnicodeNormalizationForm.NFKD),salt,2048,64,"sha512")}exports.mnemonicToSeed=mnemonicToSeed;function mnemonicToEntropy(mnemonic,wordlist){wordlist=getWordlist(wordlist);logger.checkNormalize();var words=wordlist.split(mnemonic);if(words.length%3!==0){throw new Error("invalid mnemonic")}var entropy=(0,lib$1.arrayify)(new Uint8Array(Math.ceil(11*words.length/8)));var offset=0;for(var i=0;i>3]|=1<<7-offset%8}offset++}}var entropyBits=32*words.length/3;var checksumBits=words.length/3;var checksumMask=getUpperMask(checksumBits);var checksum=(0,lib$1.arrayify)((0,lib$h.sha256)(entropy.slice(0,entropyBits/8)))[0]&checksumMask;if(checksum!==(entropy[entropy.length-1]&checksumMask)){throw new Error("invalid checksum")}return(0,lib$1.hexlify)(entropy.slice(0,entropyBits/8))}exports.mnemonicToEntropy=mnemonicToEntropy;function entropyToMnemonic(entropy,wordlist){wordlist=getWordlist(wordlist);entropy=(0,lib$1.arrayify)(entropy);if(entropy.length%4!==0||entropy.length<16||entropy.length>32){throw new Error("invalid entropy")}var indices=[0];var remainingBits=11;for(var i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}var checksumBits=entropy.length/4;var checksum=(0,lib$1.arrayify)((0,lib$h.sha256)(entropy))[0]&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(function(index){return wordlist.getWord(index)}))}exports.entropyToMnemonic=entropyToMnemonic;function isValidMnemonic(mnemonic,wordlist){try{mnemonicToEntropy(mnemonic,wordlist);return true}catch(error){}return false}exports.isValidMnemonic=isValidMnemonic;function getAccountPath(index){if(typeof index!=="number"||index<0||index>=HardenedBit||index%1){logger.throwArgumentError("invalid account index","index",index)}return"m/44'/60'/"+index+"'/0/0"}exports.getAccountPath=getAccountPath});var index$k=getDefaultExportFromCjs(lib$k);var _version$y=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="random/5.6.1"});var _version$z=getDefaultExportFromCjs(_version$y);var browserRandom=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.randomBytes=void 0;var logger=new lib.Logger(_version$y.version);function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof commonjsGlobal!=="undefined"){return commonjsGlobal}throw new Error("unable to locate global object")}var anyGlobal=getGlobal();var crypto=anyGlobal.crypto||anyGlobal.msCrypto;if(!crypto||!crypto.getRandomValues){logger.warn("WARNING: Missing strong random number source");crypto={getRandomValues:function(buffer){return logger.throwError("no secure random source avaialble",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}}}function randomBytes(length){if(length<=0||length>1024||length%1||length!=length){logger.throwArgumentError("invalid length","length",length)}var result=new Uint8Array(length);crypto.getRandomValues(result);return(0,lib$1.arrayify)(result)}exports.randomBytes=randomBytes});var browserRandom$1=getDefaultExportFromCjs(browserRandom);var shuffle=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.shuffled=void 0;function shuffled(array){array=array.slice();for(var i=array.length-1;i>0;i--){var j=Math.floor(Math.random()*(i+1));var tmp=array[i];array[i]=array[j];array[j]=tmp}return array}exports.shuffled=shuffled});var shuffle$1=getDefaultExportFromCjs(shuffle);var lib$l=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.shuffled=exports.randomBytes=void 0;Object.defineProperty(exports,"randomBytes",{enumerable:true,get:function(){return browserRandom.randomBytes}});Object.defineProperty(exports,"shuffled",{enumerable:true,get:function(){return shuffle.shuffled}})});var index$l=getDefaultExportFromCjs(lib$l);var aesJs=createCommonjsModule(function(module,exports){"use strict";(function(root){function checkInt(value){return parseInt(value)===value}function checkInts(arrayish){if(!checkInt(arrayish.length)){return false}for(var i=0;i255){return false}}return true}function coerceArray(arg,copy){if(arg.buffer&&ArrayBuffer.isView(arg)&&arg.name==="Uint8Array"){if(copy){if(arg.slice){arg=arg.slice()}else{arg=Array.prototype.slice.call(arg)}}return arg}if(Array.isArray(arg)){if(!checkInts(arg)){throw new Error("Array contains invalid value: "+arg)}return new Uint8Array(arg)}if(checkInt(arg.length)&&checkInts(arg)){return new Uint8Array(arg)}throw new Error("unsupported array-like object")}function createArray(length){return new Uint8Array(length)}function copyArray(sourceArray,targetArray,targetStart,sourceStart,sourceEnd){if(sourceStart!=null||sourceEnd!=null){if(sourceArray.slice){sourceArray=sourceArray.slice(sourceStart,sourceEnd)}else{sourceArray=Array.prototype.slice.call(sourceArray,sourceStart,sourceEnd)}}targetArray.set(sourceArray,targetStart)}var convertUtf8=function(){function toBytes(text){var result=[],i=0;text=encodeURI(text);while(i191&&c<224){result.push(String.fromCharCode((c&31)<<6|bytes[i+1]&63));i+=2}else{result.push(String.fromCharCode((c&15)<<12|(bytes[i+1]&63)<<6|bytes[i+2]&63));i+=3}}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var convertHex=function(){function toBytes(text){var result=[];for(var i=0;i>4]+Hex[v&15])}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var numberOfRounds={16:10,24:12,32:14};var rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];var S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];var T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986];var T2=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766];var T3=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126];var T4=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436];var T5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890];var T6=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935];var T7=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600];var T8=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480];var U1=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795];var U2=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855];var U3=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150];var U4=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(bytes){var result=[];for(var i=0;i>2;this._Ke[index][i%4]=tk[i];this._Kd[rounds-index][i%4]=tk[i]}var rconpointer=0;var t=KC,tt;while(t>16&255]<<24^S[tt>>8&255]<<16^S[tt&255]<<8^S[tt>>24&255]^rcon[rconpointer]<<24;rconpointer+=1;if(KC!=8){for(var i=1;i>8&255]<<8^S[tt>>16&255]<<16^S[tt>>24&255]<<24;for(var i=KC/2+1;i>2;c=t%4;this._Ke[r][c]=tk[i];this._Kd[rounds-r][c]=tk[i++];t++}}for(var r=1;r>24&255]^U2[tt>>16&255]^U3[tt>>8&255]^U4[tt&255]}}};AES.prototype.encrypt=function(plaintext){if(plaintext.length!=16){throw new Error("invalid plaintext size (must be 16 bytes)")}var rounds=this._Ke.length-1;var a=[0,0,0,0];var t=convertToInt32(plaintext);for(var i=0;i<4;i++){t[i]^=this._Ke[0][i]}for(var r=1;r>24&255]^T2[t[(i+1)%4]>>16&255]^T3[t[(i+2)%4]>>8&255]^T4[t[(i+3)%4]&255]^this._Ke[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Ke[rounds][i];result[4*i]=(S[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(S[t[(i+1)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(S[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(S[t[(i+3)%4]&255]^tt)&255}return result};AES.prototype.decrypt=function(ciphertext){if(ciphertext.length!=16){throw new Error("invalid ciphertext size (must be 16 bytes)")}var rounds=this._Kd.length-1;var a=[0,0,0,0];var t=convertToInt32(ciphertext);for(var i=0;i<4;i++){t[i]^=this._Kd[0][i]}for(var r=1;r>24&255]^T6[t[(i+3)%4]>>16&255]^T7[t[(i+2)%4]>>8&255]^T8[t[(i+1)%4]&255]^this._Kd[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Kd[rounds][i];result[4*i]=(Si[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(Si[t[(i+3)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(Si[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(Si[t[(i+1)%4]&255]^tt)&255}return result};var ModeOfOperationECB=function(key){if(!(this instanceof ModeOfOperationECB)){throw Error("AES must be instanitated with `new`")}this.description="Electronic Code Block";this.name="ecb";this._aes=new AES(key)};ModeOfOperationECB.prototype.encrypt=function(plaintext){plaintext=coerceArray(plaintext);if(plaintext.length%16!==0){throw new Error("invalid plaintext size (must be multiple of 16 bytes)")}var ciphertext=createArray(plaintext.length);var block=createArray(16);for(var i=0;i=0;--index){this._counter[index]=value%256;value=value>>8}};Counter.prototype.setBytes=function(bytes){bytes=coerceArray(bytes,true);if(bytes.length!=16){throw new Error("invalid counter bytes size (must be 16 bytes)")}this._counter=bytes};Counter.prototype.increment=function(){for(var i=15;i>=0;i--){if(this._counter[i]===255){this._counter[i]=0}else{this._counter[i]++;break}}};var ModeOfOperationCTR=function(key,counter){if(!(this instanceof ModeOfOperationCTR)){throw Error("AES must be instanitated with `new`")}this.description="Counter";this.name="ctr";if(!(counter instanceof Counter)){counter=new Counter(counter)}this._counter=counter;this._remainingCounter=null;this._remainingCounterIndex=16;this._aes=new AES(key)};ModeOfOperationCTR.prototype.encrypt=function(plaintext){var encrypted=coerceArray(plaintext,true);for(var i=0;i16){throw new Error("PKCS#7 padding byte out of range")}var length=data.length-padder;for(var i=0;i=64){let a=h0,b=h1,c=h2,d=h3,e=h4,f=h5,g=h6,h=h7,u,i,j,t1,t2;for(i=0;i<16;i++){j=off+i*4;w[i]=(p[j]&255)<<24|(p[j+1]&255)<<16|(p[j+2]&255)<<8|p[j+3]&255}for(i=16;i<64;i++){u=w[i-2];t1=(u>>>17|u<<32-17)^(u>>>19|u<<32-19)^u>>>10;u=w[i-15];t2=(u>>>7|u<<32-7)^(u>>>18|u<<32-18)^u>>>3;w[i]=(t1+w[i-7]|0)+(t2+w[i-16]|0)|0}for(i=0;i<64;i++){t1=(((e>>>6|e<<32-6)^(e>>>11|e<<32-11)^(e>>>25|e<<32-25))+(e&f^~e&g)|0)+(h+(K[i]+w[i]|0)|0)|0;t2=((a>>>2|a<<32-2)^(a>>>13|a<<32-13)^(a>>>22|a<<32-22))+(a&b^a&c^b&c)|0;h=g;g=f;f=e;e=d+t1|0;d=c;c=b;b=a;a=t1+t2|0}h0=h0+a|0;h1=h1+b|0;h2=h2+c|0;h3=h3+d|0;h4=h4+e|0;h5=h5+f|0;h6=h6+g|0;h7=h7+h|0;off+=64;len-=64}}blocks(m);let i,bytesLeft=m.length%64,bitLenHi=m.length/536870912|0,bitLenLo=m.length<<3,numZeros=bytesLeft<56?56:120,p=m.slice(m.length-bytesLeft,m.length);p.push(128);for(i=bytesLeft+1;i>>24&255);p.push(bitLenHi>>>16&255);p.push(bitLenHi>>>8&255);p.push(bitLenHi>>>0&255);p.push(bitLenLo>>>24&255);p.push(bitLenLo>>>16&255);p.push(bitLenLo>>>8&255);p.push(bitLenLo>>>0&255);blocks(p);return[h0>>>24&255,h0>>>16&255,h0>>>8&255,h0>>>0&255,h1>>>24&255,h1>>>16&255,h1>>>8&255,h1>>>0&255,h2>>>24&255,h2>>>16&255,h2>>>8&255,h2>>>0&255,h3>>>24&255,h3>>>16&255,h3>>>8&255,h3>>>0&255,h4>>>24&255,h4>>>16&255,h4>>>8&255,h4>>>0&255,h5>>>24&255,h5>>>16&255,h5>>>8&255,h5>>>0&255,h6>>>24&255,h6>>>16&255,h6>>>8&255,h6>>>0&255,h7>>>24&255,h7>>>16&255,h7>>>8&255,h7>>>0&255]}function PBKDF2_HMAC_SHA256_OneIter(password,salt,dkLen){password=password.length<=64?password:SHA256(password);const innerLen=64+salt.length+4;const inner=new Array(innerLen);const outerKey=new Array(64);let i;let dk=[];for(i=0;i<64;i++){inner[i]=54}for(i=0;i=innerLen-4;i--){inner[i]++;if(inner[i]<=255)return;inner[i]=0}}while(dkLen>=32){incrementCounter();dk=dk.concat(SHA256(outerKey.concat(SHA256(inner))));dkLen-=32}if(dkLen>0){incrementCounter();dk=dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0,dkLen))}return dk}function blockmix_salsa8(BY,Yi,r,x,_X){let i;arraycopy(BY,(2*r-1)*16,_X,0,16);for(i=0;i<2*r;i++){blockxor(BY,i*16,_X,16);salsa20_8(_X,x);arraycopy(_X,0,BY,Yi+i*16,16)}for(i=0;i>>32-b}function salsa20_8(B,x){arraycopy(B,0,x,0,16);for(let i=8;i>0;i-=2){x[4]^=R(x[0]+x[12],7);x[8]^=R(x[4]+x[0],9);x[12]^=R(x[8]+x[4],13);x[0]^=R(x[12]+x[8],18);x[9]^=R(x[5]+x[1],7);x[13]^=R(x[9]+x[5],9);x[1]^=R(x[13]+x[9],13);x[5]^=R(x[1]+x[13],18);x[14]^=R(x[10]+x[6],7);x[2]^=R(x[14]+x[10],9);x[6]^=R(x[2]+x[14],13);x[10]^=R(x[6]+x[2],18);x[3]^=R(x[15]+x[11],7);x[7]^=R(x[3]+x[15],9);x[11]^=R(x[7]+x[3],13);x[15]^=R(x[11]+x[7],18);x[1]^=R(x[0]+x[3],7);x[2]^=R(x[1]+x[0],9);x[3]^=R(x[2]+x[1],13);x[0]^=R(x[3]+x[2],18);x[6]^=R(x[5]+x[4],7);x[7]^=R(x[6]+x[5],9);x[4]^=R(x[7]+x[6],13);x[5]^=R(x[4]+x[7],18);x[11]^=R(x[10]+x[9],7);x[8]^=R(x[11]+x[10],9);x[9]^=R(x[8]+x[11],13);x[10]^=R(x[9]+x[8],18);x[12]^=R(x[15]+x[14],7);x[13]^=R(x[12]+x[15],9);x[14]^=R(x[13]+x[12],13);x[15]^=R(x[14]+x[13],18)}for(let i=0;i<16;++i){B[i]+=x[i]}}function blockxor(S,Si,D,len){for(let i=0;i=256){return false}}return true}function ensureInteger(value,name){if(typeof value!=="number"||value%1){throw new Error("invalid "+name)}return value}function _scrypt(password,salt,N,r,p,dkLen,callback){N=ensureInteger(N,"N");r=ensureInteger(r,"r");p=ensureInteger(p,"p");dkLen=ensureInteger(dkLen,"dkLen");if(N===0||(N&N-1)!==0){throw new Error("N must be power of 2")}if(N>MAX_VALUE/128/r){throw new Error("N too large")}if(r>MAX_VALUE/128/p){throw new Error("r too large")}if(!checkBufferish(password)){throw new Error("password must be an array or buffer")}password=Array.prototype.slice.call(password);if(!checkBufferish(salt)){throw new Error("salt must be an array or buffer")}salt=Array.prototype.slice.call(salt);let b=PBKDF2_HMAC_SHA256_OneIter(password,salt,p*128*r);const B=new Uint32Array(p*32*r);for(let i=0;ilimit){steps=limit}for(let i=0;ilimit){steps=limit}for(let i=0;i>0&255);b.push(B[i]>>8&255);b.push(B[i]>>16&255);b.push(B[i]>>24&255)}const derivedKey=PBKDF2_HMAC_SHA256_OneIter(password,b,dkLen);if(callback){callback(null,1,derivedKey)}return derivedKey}if(callback){nextTick(incrementalSMix)}};if(!callback){while(true){const derivedKey=incrementalSMix();if(derivedKey!=undefined){return derivedKey}}}incrementalSMix()}const lib={scrypt:function(password,salt,N,r,p,dkLen,progressCallback){return new Promise(function(resolve,reject){let lastProgress=0;if(progressCallback){progressCallback(0)}_scrypt(password,salt,N,r,p,dkLen,function(error,progress,key){if(error){reject(error)}else if(key){if(progressCallback&&lastProgress!==1){progressCallback(1)}resolve(new Uint8Array(key))}else if(progressCallback&&progress!==lastProgress){lastProgress=progress;return progressCallback(progress)}})})},syncScrypt:function(password,salt,N,r,p,dkLen){return new Uint8Array(_scrypt(password,salt,N,r,p,dkLen))}};if("object"!=="undefined"){module.exports=lib}else if(typeof undefined==="function"&&undefined.amd){undefined(lib)}else if(root){if(root.scrypt){root._scrypt=root.scrypt}root.scrypt=lib}})(commonjsGlobal)});var keystore=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var __awaiter=commonjsGlobal&&commonjsGlobal.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};var __generator=commonjsGlobal&&commonjsGlobal.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&attemptLimit%1===0,"invalid connection throttle limit","connection.throttleLimit",attemptLimit);var throttleCallback=typeof connection==="object"?connection.throttleCallback:null;var throttleSlotInterval=typeof connection==="object"&&typeof connection.throttleSlotInterval==="number"?connection.throttleSlotInterval:100;logger.assertArgument(throttleSlotInterval>0&&throttleSlotInterval%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",throttleSlotInterval);var errorPassThrough=typeof connection==="object"?!!connection.errorPassThrough:false;var headers={};var url=null;var options={method:"GET"};var allow304=false;var timeout=2*60*1e3;if(typeof connection==="string"){url=connection}else if(typeof connection==="object"){if(connection==null||connection.url==null){logger.throwArgumentError("missing URL","connection.url",connection)}url=connection.url;if(typeof connection.timeout==="number"&&connection.timeout>0){timeout=connection.timeout}if(connection.headers){for(var key in connection.headers){headers[key.toLowerCase()]={key:key,value:String(connection.headers[key])};if(["if-none-match","if-modified-since"].indexOf(key.toLowerCase())>=0){allow304=true}}}options.allowGzip=!!connection.allowGzip;if(connection.user!=null&&connection.password!=null){if(url.substring(0,6)!=="https:"&&connection.allowInsecureAuthentication!==true){logger.throwError("basic authentication requires a secure https url",lib.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:url,user:connection.user,password:"[REDACTED]"})}var authorization=connection.user+":"+connection.password;headers["authorization"]={key:"Authorization",value:"Basic "+(0,lib$p.encode)((0,lib$8.toUtf8Bytes)(authorization))}}if(connection.skipFetchSetup!=null){options.skipFetchSetup=!!connection.skipFetchSetup}}var reData=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i");var dataMatch=url?url.match(reData):null;if(dataMatch){try{var response={statusCode:200,statusMessage:"OK",headers:{"content-type":dataMatch[1]},body:(0,lib$p.decode)(dataMatch[2])};var result=response.body;if(processFunc){result=processFunc(response.body,response)}return Promise.resolve(result)}catch(error){logger.throwError("processing response error",lib.Logger.errors.SERVER_ERROR,{body:bodyify(dataMatch[1],dataMatch[2]),error:error,requestBody:null,requestMethod:"GET",url:url})}}if(body){options.method="POST";options.body=body;if(headers["content-type"]==null){headers["content-type"]={key:"Content-Type",value:"application/octet-stream"}}if(headers["content-length"]==null){headers["content-length"]={key:"Content-Length",value:String(body.length)}}}var flatHeaders={};Object.keys(headers).forEach(function(key){var header=headers[key];flatHeaders[header.key]=header.value});options.headers=flatHeaders;var runningTimeout=function(){var timer=null;var promise=new Promise(function(resolve,reject){if(timeout){timer=setTimeout(function(){if(timer==null){return}timer=null;reject(logger.makeError("timeout",lib.Logger.errors.TIMEOUT,{requestBody:bodyify(options.body,flatHeaders["content-type"]),requestMethod:options.method,timeout:timeout,url:url}))},timeout)}});var cancel=function(){if(timer==null){return}clearTimeout(timer);timer=null};return{promise:promise,cancel:cancel}}();var runningFetch=function(){return __awaiter(this,void 0,void 0,function(){var attempt,response,location_1,tryAgain,stall,retryAfter,error_1,body_1,result,error_2,tryAgain,timeout_1;return __generator(this,function(_a){switch(_a.label){case 0:attempt=0;_a.label=1;case 1:if(!(attempt=300)){runningTimeout.cancel();logger.throwError("bad response",lib.Logger.errors.SERVER_ERROR,{status:response.statusCode,headers:response.headers,body:bodyify(body_1,response.headers?response.headers["content-type"]:null),requestBody:bodyify(options.body,flatHeaders["content-type"]),requestMethod:options.method,url:url})}if(!processFunc)return[3,18];_a.label=11;case 11:_a.trys.push([11,13,,18]);return[4,processFunc(body_1,response)];case 12:result=_a.sent();runningTimeout.cancel();return[2,result];case 13:error_2=_a.sent();if(!(error_2.throttleRetry&&attemptretryLimit){if(cancel()){reject(new Error("retry limit reached"))}return}var timeout=options.interval*parseInt(String(Math.random()*Math.pow(2,attempt)));if(timeoutoptions.ceiling){timeout=options.ceiling}setTimeout(check,timeout)}return null},function(error){if(cancel()){reject(error)}})}check()})}exports.poll=poll});var index$q=getDefaultExportFromCjs(lib$q);"use strict";var ALPHABET="qpzry9x8gf2tvdw0s3jn54khce6mua7l";var ALPHABET_MAP={};for(var z=0;z>25;return(pre&33554431)<<5^-(b>>0&1)&996825010^-(b>>1&1)&642813549^-(b>>2&1)&513874426^-(b>>3&1)&1027748829^-(b>>4&1)&705979059}function prefixChk(prefix){var chk=1;for(var i=0;i126)return"Invalid prefix ("+prefix+")";chk=polymodStep(chk)^c>>5}chk=polymodStep(chk);for(i=0;iLIMIT)throw new TypeError("Exceeds length limit");prefix=prefix.toLowerCase();var chk=prefixChk(prefix);if(typeof chk==="string")throw new Error(chk);var result=prefix+"1";for(var i=0;i>5!==0)throw new Error("Non 5-bit word");chk=polymodStep(chk)^x;result+=ALPHABET.charAt(x)}for(i=0;i<6;++i){chk=polymodStep(chk)}chk^=1;for(i=0;i<6;++i){var v=chk>>(5-i)*5&31;result+=ALPHABET.charAt(v)}return result}function __decode(str,LIMIT){LIMIT=LIMIT||90;if(str.length<8)return str+" too short";if(str.length>LIMIT)return"Exceeds length limit";var lowered=str.toLowerCase();var uppered=str.toUpperCase();if(str!==lowered&&str!==uppered)return"Mixed-case string "+str;str=lowered;var split=str.lastIndexOf("1");if(split===-1)return"No separator character for "+str;if(split===0)return"Missing prefix for "+str;var prefix=str.slice(0,split);var wordChars=str.slice(split+1);if(wordChars.length<6)return"Data too short";var chk=prefixChk(prefix);if(typeof chk==="string")return chk;var words=[];for(var i=0;i=wordChars.length)continue;words.push(v)}if(chk!==1)return"Invalid checksum for "+str;return{prefix:prefix,words:words}}function decodeUnsafe(){var res=__decode.apply(null,arguments);if(typeof res==="object")return res}function decode(str){var res=__decode.apply(null,arguments);if(typeof res==="object")return res;throw new Error(res)}function convert(data,inBits,outBits,pad){var value=0;var bits=0;var maxV=(1<=outBits){bits-=outBits;result.push(value>>bits&maxV)}}if(pad){if(bits>0){result.push(value<=inBits)return"Excess padding";if(value<0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&topics[topics.length-1]==null){topics.pop()}return topics.map(function(topic){if(Array.isArray(topic)){var unique_1={};topic.forEach(function(topic){unique_1[checkTopic(topic)]=true});var sorted=Object.keys(unique_1);sorted.sort();return sorted.join("|")}else{return checkTopic(topic)}}).join("&")}function deserializeTopics(data){if(data===""){return[]}return data.split(/&/g).map(function(topic){if(topic===""){return[]}var comps=topic.split("|").map(function(topic){return topic==="null"?null:topic});return comps.length===1?comps[0]:comps})}function getEventTag(eventName){if(typeof eventName==="string"){eventName=eventName.toLowerCase();if((0,lib$1.hexDataLength)(eventName)===32){return"tx:"+eventName}if(eventName.indexOf(":")===-1){return eventName}}else if(Array.isArray(eventName)){return"filter:*:"+serializeTopics(eventName)}else if(lib$b.ForkEvent.isForkEvent(eventName)){logger.warn("not implemented");throw new Error("not implemented")}else if(eventName&&typeof eventName==="object"){return"filter:"+(eventName.address||"*")+":"+serializeTopics(eventName.topics||[])}throw new Error("invalid event - "+eventName)}function getTime(){return(new Date).getTime()}function stall(duration){return new Promise(function(resolve){setTimeout(resolve,duration)})}var PollableEvents=["block","network","pending","poll"];var Event=function(){function Event(tag,listener,once){(0,lib$3.defineReadOnly)(this,"tag",tag);(0,lib$3.defineReadOnly)(this,"listener",listener);(0,lib$3.defineReadOnly)(this,"once",once);this._lastBlockNumber=-2;this._inflight=false}Object.defineProperty(Event.prototype,"event",{get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag},enumerable:false,configurable:true});Object.defineProperty(Event.prototype,"type",{get:function(){return this.tag.split(":")[0]},enumerable:false,configurable:true});Object.defineProperty(Event.prototype,"hash",{get:function(){var comps=this.tag.split(":");if(comps[0]!=="tx"){return null}return comps[1]},enumerable:false,configurable:true});Object.defineProperty(Event.prototype,"filter",{get:function(){var comps=this.tag.split(":");if(comps[0]!=="filter"){return null}var address=comps[1];var topics=deserializeTopics(comps[2]);var filter={};if(topics.length>0){filter.topics=topics}if(address&&address!=="*"){filter.address=address}return filter},enumerable:false,configurable:true});Event.prototype.pollable=function(){return this.tag.indexOf(":")>=0||PollableEvents.indexOf(this.tag)>=0};return Event}();exports.Event=Event;var coinInfos={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function bytes32ify(value){return(0,lib$1.hexZeroPad)(lib$2.BigNumber.from(value).toHexString(),32)}function base58Encode(data){return lib$g.Base58.encode((0,lib$1.concat)([data,(0,lib$1.hexDataSlice)((0,lib$h.sha256)((0,lib$h.sha256)(data)),0,4)]))}var matcherIpfs=new RegExp("^(ipfs)://(.*)$","i");var matchers=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),matcherIpfs,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function _parseString(result,start){try{return(0,lib$8.toUtf8String)(_parseBytes(result,start))}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}var offset=lib$2.BigNumber.from((0,lib$1.hexDataSlice)(result,start,start+32)).toNumber();var length=lib$2.BigNumber.from((0,lib$1.hexDataSlice)(result,offset,offset+32)).toNumber();return(0,lib$1.hexDataSlice)(result,offset+32,offset+32+length)}function getIpfsLink(link){if(link.match(/^ipfs:\/\/ipfs\//i)){link=link.substring(12)}else if(link.match(/^ipfs:\/\//i)){link=link.substring(7)}else{logger.throwArgumentError("unsupported IPFS format","link",link)}return"https://gateway.ipfs.io/ipfs/"+link}function numPad(value){var result=(0,lib$1.arrayify)(value);if(result.length>32){throw new Error("internal; should not happen")}var padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}var result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}function encodeBytes(datas){var result=[];var byteCount=0;for(var i=0;i=1&&length_1<=75){return base58Encode((0,lib$1.concat)([[coinInfo.p2pkh],"0x"+p2pkh[2]]))}}}if(coinInfo.p2sh!=null){var p2sh=hexBytes.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(p2sh){var length_2=parseInt(p2sh[1],16);if(p2sh[2].length===length_2*2&&length_2>=1&&length_2<=75){return base58Encode((0,lib$1.concat)([[coinInfo.p2sh],"0x"+p2sh[2]]))}}}if(coinInfo.prefix!=null){var length_3=bytes[1];var version_1=bytes[0];if(version_1===0){if(length_3!==20&&length_3!==32){version_1=-1}}else{version_1=-1}if(version_1>=0&&bytes.length===2+length_3&&length_3>=1&&length_3<=75){var words=bech32_1.default.toWords(bytes.slice(2));words.unshift(version_1);return bech32_1.default.encode(coinInfo.prefix,words)}}return null};Resolver.prototype.getAddress=function(coinType){return __awaiter(this,void 0,void 0,function(){var result,error_2,hexBytes,address;return __generator(this,function(_a){switch(_a.label){case 0:if(coinType==null){coinType=60}if(!(coinType===60))return[3,4];_a.label=1;case 1:_a.trys.push([1,3,,4]);return[4,this._fetch("0x3b3b57de")];case 2:result=_a.sent();if(result==="0x"||result===lib$7.HashZero){return[2,null]}return[2,this.provider.formatter.callAddress(result)];case 3:error_2=_a.sent();if(error_2.code===lib.Logger.errors.CALL_EXCEPTION){return[2,null]}throw error_2;case 4:return[4,this._fetchBytes("0xf1cb7e06",bytes32ify(coinType))];case 5:hexBytes=_a.sent();if(hexBytes==null||hexBytes==="0x"){return[2,null]}address=this._getAddress(coinType,hexBytes);if(address==null){logger.throwError("invalid or unsupported coin data",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress("+coinType+")",coinType:coinType,data:hexBytes})}return[2,address]}})})};Resolver.prototype.getAvatar=function(){return __awaiter(this,void 0,void 0,function(){var linkage,avatar,i,match,scheme,_a,selector,owner,_b,comps,addr,tokenId,tokenOwner,_c,_d,balance,_e,_f,tx,metadataUrl,_g,metadata,imageUrl,ipfs,error_3;return __generator(this,function(_h){switch(_h.label){case 0:linkage=[{type:"name",content:this.name}];_h.label=1;case 1:_h.trys.push([1,19,,20]);return[4,this.getText("avatar")];case 2:avatar=_h.sent();if(avatar==null){return[2,null]}i=0;_h.label=3;case 3:if(!(i=0?null:JSON.stringify({data:data,sender:sender});return[4,(0,lib$q.fetchJson)({url:href,errorPassThrough:true},json,function(value,response){value.status=response.statusCode;return value})];case 2:result=_a.sent();if(result.data){return[2,result.data]}errorMessage=result.message||"unknown error";if(result.status>=400&&result.status<500){return[2,logger.throwError("response not found during CCIP fetch: "+errorMessage,lib.Logger.errors.SERVER_ERROR,{url:url,errorMessage:errorMessage})]}errorMessages.push(errorMessage);_a.label=3;case 3:i++;return[3,1];case 4:return[2,logger.throwError("error encountered during CCIP fetch: "+errorMessages.map(function(m){return JSON.stringify(m)}).join(", "),lib.Logger.errors.SERVER_ERROR,{urls:urls,errorMessages:errorMessages})]}})})};BaseProvider.prototype._getInternalBlockNumber=function(maxAge){return __awaiter(this,void 0,void 0,function(){var internalBlockNumber,result,error_5,reqTime,checkInternalBlockNumber;var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this._ready()];case 1:_a.sent();if(!(maxAge>0))return[3,7];_a.label=2;case 2:if(!this._internalBlockNumber)return[3,7];internalBlockNumber=this._internalBlockNumber;_a.label=3;case 3:_a.trys.push([3,5,,6]);return[4,internalBlockNumber];case 4:result=_a.sent();if(getTime()-result.respTime<=maxAge){return[2,result.blockNumber]}return[3,7];case 5:error_5=_a.sent();if(this._internalBlockNumber===internalBlockNumber){return[3,7]}return[3,6];case 6:return[3,2];case 7:reqTime=getTime();checkInternalBlockNumber=(0,lib$3.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(function(network){return null},function(error){return error})}).then(function(_a){var blockNumber=_a.blockNumber,networkError=_a.networkError;if(networkError){if(_this._internalBlockNumber===checkInternalBlockNumber){_this._internalBlockNumber=null}throw networkError}var respTime=getTime();blockNumber=lib$2.BigNumber.from(blockNumber).toNumber();if(blockNumber<_this._maxInternalBlockNumber){blockNumber=_this._maxInternalBlockNumber}_this._maxInternalBlockNumber=blockNumber;_this._setFastBlockNumber(blockNumber);return{blockNumber:blockNumber,reqTime:reqTime,respTime:respTime}});this._internalBlockNumber=checkInternalBlockNumber;checkInternalBlockNumber.catch(function(error){if(_this._internalBlockNumber===checkInternalBlockNumber){_this._internalBlockNumber=null}});return[4,checkInternalBlockNumber];case 8:return[2,_a.sent().blockNumber]}})})};BaseProvider.prototype.poll=function(){return __awaiter(this,void 0,void 0,function(){var pollId,runners,blockNumber,error_6,i;var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:pollId=nextPollId++;runners=[];blockNumber=null;_a.label=1;case 1:_a.trys.push([1,3,,4]);return[4,this._getInternalBlockNumber(100+this.pollingInterval/2)];case 2:blockNumber=_a.sent();return[3,4];case 3:error_6=_a.sent();this.emit("error",error_6);return[2];case 4:this._setFastBlockNumber(blockNumber);this.emit("poll",pollId,blockNumber);if(blockNumber===this._lastBlockNumber){this.emit("didPoll",pollId);return[2]}if(this._emitted.block===-2){this._emitted.block=blockNumber-1}if(Math.abs(this._emitted.block-blockNumber)>1e3){logger.warn("network block skew detected; skipping block events (emitted="+this._emitted.block+" blockNumber"+blockNumber+")");this.emit("error",logger.makeError("network block skew detected",lib.Logger.errors.NETWORK_ERROR,{blockNumber:blockNumber,event:"blockSkew",previousBlockNumber:this._emitted.block}));this.emit("block",blockNumber)}else{for(i=this._emitted.block+1;i<=blockNumber;i++){this.emit("block",i)}}if(this._emitted.block!==blockNumber){this._emitted.block=blockNumber;Object.keys(this._emitted).forEach(function(key){if(key==="block"){return}var eventBlockNumber=_this._emitted[key];if(eventBlockNumber==="pending"){return}if(blockNumber-eventBlockNumber>12){delete _this._emitted[key]}})}if(this._lastBlockNumber===-2){this._lastBlockNumber=blockNumber-1}this._events.forEach(function(event){switch(event.type){case"tx":{var hash_2=event.hash;var runner=_this.getTransactionReceipt(hash_2).then(function(receipt){if(!receipt||receipt.blockNumber==null){return null}_this._emitted["t:"+hash_2]=receipt.blockNumber;_this.emit(hash_2,receipt);return null}).catch(function(error){_this.emit("error",error)});runners.push(runner);break}case"filter":{if(!event._inflight){event._inflight=true;var filter_1=event.filter;filter_1.fromBlock=event._lastBlockNumber+1;filter_1.toBlock=blockNumber;if(filter_1.toBlock-_this._maxFilterBlockRange>filter_1.fromBlock){filter_1.fromBlock=filter_1.toBlock-_this._maxFilterBlockRange}var runner=_this.getLogs(filter_1).then(function(logs){event._inflight=false;if(logs.length===0){return}logs.forEach(function(log){if(log.blockNumber>event._lastBlockNumber){event._lastBlockNumber=log.blockNumber}_this._emitted["b:"+log.blockHash]=log.blockNumber;_this._emitted["t:"+log.transactionHash]=log.blockNumber;_this.emit(filter_1,log)})}).catch(function(error){_this.emit("error",error);event._inflight=false});runners.push(runner)}break}}});this._lastBlockNumber=blockNumber;Promise.all(runners).then(function(){_this.emit("didPoll",pollId)}).catch(function(error){_this.emit("error",error)});return[2]}})})};BaseProvider.prototype.resetEventsBlock=function(blockNumber){this._lastBlockNumber=blockNumber-1;if(this.polling){this.poll()}};Object.defineProperty(BaseProvider.prototype,"network",{get:function(){return this._network},enumerable:false,configurable:true});BaseProvider.prototype.detectNetwork=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,logger.throwError("provider does not support network detection",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})]})})};BaseProvider.prototype.getNetwork=function(){return __awaiter(this,void 0,void 0,function(){var network,currentNetwork,error;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this._ready()];case 1:network=_a.sent();return[4,this.detectNetwork()];case 2:currentNetwork=_a.sent();if(!(network.chainId!==currentNetwork.chainId))return[3,5];if(!this.anyNetwork)return[3,4];this._network=currentNetwork;this._lastBlockNumber=-2;this._fastBlockNumber=null;this._fastBlockNumberPromise=null;this._fastQueryDate=0;this._emitted.block=-2;this._maxInternalBlockNumber=-1024;this._internalBlockNumber=null;this.emit("network",currentNetwork,network);return[4,stall(0)];case 3:_a.sent();return[2,this._network];case 4:error=logger.makeError("underlying network changed",lib.Logger.errors.NETWORK_ERROR,{event:"changed",network:network,detectedNetwork:currentNetwork});this.emit("error",error);throw error;case 5:return[2,network]}})})};Object.defineProperty(BaseProvider.prototype,"blockNumber",{get:function(){var _this=this;this._getInternalBlockNumber(100+this.pollingInterval/2).then(function(blockNumber){_this._setFastBlockNumber(blockNumber)},function(error){});return this._fastBlockNumber!=null?this._fastBlockNumber:-1},enumerable:false,configurable:true});Object.defineProperty(BaseProvider.prototype,"polling",{get:function(){return this._poller!=null},set:function(value){var _this=this;if(value&&!this._poller){this._poller=setInterval(function(){_this.poll()},this.pollingInterval);if(!this._bootstrapPoll){this._bootstrapPoll=setTimeout(function(){_this.poll();_this._bootstrapPoll=setTimeout(function(){if(!_this._poller){_this.poll()}_this._bootstrapPoll=null},_this.pollingInterval)},0)}}else if(!value&&this._poller){clearInterval(this._poller);this._poller=null}},enumerable:false,configurable:true});Object.defineProperty(BaseProvider.prototype,"pollingInterval",{get:function(){return this._pollingInterval},set:function(value){var _this=this;if(typeof value!=="number"||value<=0||parseInt(String(value))!=value){throw new Error("invalid polling interval")}this._pollingInterval=value;if(this._poller){clearInterval(this._poller);this._poller=setInterval(function(){_this.poll()},this._pollingInterval)}},enumerable:false,configurable:true});BaseProvider.prototype._getFastBlockNumber=function(){var _this=this;var now=getTime();if(now-this._fastQueryDate>2*this._pollingInterval){this._fastQueryDate=now;this._fastBlockNumberPromise=this.getBlockNumber().then(function(blockNumber){if(_this._fastBlockNumber==null||blockNumber>_this._fastBlockNumber){_this._fastBlockNumber=blockNumber}return _this._fastBlockNumber})}return this._fastBlockNumberPromise};BaseProvider.prototype._setFastBlockNumber=function(blockNumber){if(this._fastBlockNumber!=null&&blockNumberthis._fastBlockNumber){this._fastBlockNumber=blockNumber;this._fastBlockNumberPromise=Promise.resolve(blockNumber)}};BaseProvider.prototype.waitForTransaction=function(transactionHash,confirmations,timeout){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this._waitForTransaction(transactionHash,confirmations==null?1:confirmations,timeout||0,null)]})})};BaseProvider.prototype._waitForTransaction=function(transactionHash,confirmations,timeout,replaceable){return __awaiter(this,void 0,void 0,function(){var receipt;var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getTransactionReceipt(transactionHash)];case 1:receipt=_a.sent();if((receipt?receipt.confirmations:0)>=confirmations){return[2,receipt]}return[2,new Promise(function(resolve,reject){var cancelFuncs=[];var done=false;var alreadyDone=function(){if(done){return true}done=true;cancelFuncs.forEach(function(func){func()});return false};var minedHandler=function(receipt){if(receipt.confirmations0){var timer_1=setTimeout(function(){if(alreadyDone()){return}reject(logger.makeError("timeout exceeded",lib.Logger.errors.TIMEOUT,{timeout:timeout}))},timeout);if(timer_1.unref){timer_1.unref()}cancelFuncs.push(function(){clearTimeout(timer_1)})}})]}})})};BaseProvider.prototype.getBlockNumber=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this._getInternalBlockNumber(0)]})})};BaseProvider.prototype.getGasPrice=function(){return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getNetwork()];case 1:_a.sent();return[4,this.perform("getGasPrice",{})];case 2:result=_a.sent();try{return[2,lib$2.BigNumber.from(result)]}catch(error){return[2,logger.throwError("bad result from backend",lib.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:result,error:error})]}return[2]}})})};BaseProvider.prototype.getBalance=function(addressOrName,blockTag){return __awaiter(this,void 0,void 0,function(){var params,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getNetwork()];case 1:_a.sent();return[4,(0,lib$3.resolveProperties)({address:this._getAddress(addressOrName),blockTag:this._getBlockTag(blockTag)})];case 2:params=_a.sent();return[4,this.perform("getBalance",params)];case 3:result=_a.sent();try{return[2,lib$2.BigNumber.from(result)]}catch(error){return[2,logger.throwError("bad result from backend",lib.Logger.errors.SERVER_ERROR,{method:"getBalance",params:params,result:result,error:error})]}return[2]}})})};BaseProvider.prototype.getTransactionCount=function(addressOrName,blockTag){return __awaiter(this,void 0,void 0,function(){var params,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getNetwork()];case 1:_a.sent();return[4,(0,lib$3.resolveProperties)({address:this._getAddress(addressOrName),blockTag:this._getBlockTag(blockTag)})];case 2:params=_a.sent();return[4,this.perform("getTransactionCount",params)];case 3:result=_a.sent();try{return[2,lib$2.BigNumber.from(result).toNumber()]}catch(error){return[2,logger.throwError("bad result from backend",lib.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:params,result:result,error:error})]}return[2]}})})};BaseProvider.prototype.getCode=function(addressOrName,blockTag){return __awaiter(this,void 0,void 0,function(){var params,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getNetwork()];case 1:_a.sent();return[4,(0,lib$3.resolveProperties)({address:this._getAddress(addressOrName),blockTag:this._getBlockTag(blockTag)})];case 2:params=_a.sent();return[4,this.perform("getCode",params)];case 3:result=_a.sent();try{return[2,(0,lib$1.hexlify)(result)]}catch(error){return[2,logger.throwError("bad result from backend",lib.Logger.errors.SERVER_ERROR,{method:"getCode",params:params,result:result,error:error})]}return[2]}})})};BaseProvider.prototype.getStorageAt=function(addressOrName,position,blockTag){return __awaiter(this,void 0,void 0,function(){var params,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getNetwork()];case 1:_a.sent();return[4,(0,lib$3.resolveProperties)({address:this._getAddress(addressOrName),blockTag:this._getBlockTag(blockTag),position:Promise.resolve(position).then(function(p){return(0,lib$1.hexValue)(p)})})];case 2:params=_a.sent();return[4,this.perform("getStorageAt",params)];case 3:result=_a.sent();try{return[2,(0,lib$1.hexlify)(result)]}catch(error){return[2,logger.throwError("bad result from backend",lib.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:params,result:result,error:error})]}return[2]}})})};BaseProvider.prototype._wrapTransaction=function(tx,hash,startBlock){var _this=this;if(hash!=null&&(0,lib$1.hexDataLength)(hash)!==32){throw new Error("invalid response - sendTransaction")}var result=tx;if(hash!=null&&tx.hash!==hash){logger.throwError("Transaction hash mismatch from Provider.sendTransaction.",lib.Logger.errors.UNKNOWN_ERROR,{expectedHash:tx.hash,returnedHash:hash})}result.wait=function(confirms,timeout){return __awaiter(_this,void 0,void 0,function(){var replacement,receipt;return __generator(this,function(_a){switch(_a.label){case 0:if(confirms==null){confirms=1}if(timeout==null){timeout=0}replacement=undefined;if(confirms!==0&&startBlock!=null){replacement={data:tx.data,from:tx.from,nonce:tx.nonce,to:tx.to,value:tx.value,startBlock:startBlock}}return[4,this._waitForTransaction(tx.hash,confirms,timeout,replacement)];case 1:receipt=_a.sent();if(receipt==null&&confirms===0){return[2,null]}this._emitted["t:"+tx.hash]=receipt.blockNumber;if(receipt.status===0){logger.throwError("transaction failed",lib.Logger.errors.CALL_EXCEPTION,{transactionHash:tx.hash,transaction:tx,receipt:receipt})}return[2,receipt]}})})};return result};BaseProvider.prototype.sendTransaction=function(signedTransaction){return __awaiter(this,void 0,void 0,function(){var hexTx,tx,blockNumber,hash,error_7;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getNetwork()];case 1:_a.sent();return[4,Promise.resolve(signedTransaction).then(function(t){return(0,lib$1.hexlify)(t)})];case 2:hexTx=_a.sent();tx=this.formatter.transaction(signedTransaction);if(tx.confirmations==null){tx.confirmations=0}return[4,this._getInternalBlockNumber(100+2*this.pollingInterval)];case 3:blockNumber=_a.sent();_a.label=4;case 4:_a.trys.push([4,6,,7]);return[4,this.perform("sendTransaction",{signedTransaction:hexTx})];case 5:hash=_a.sent();return[2,this._wrapTransaction(tx,hash,blockNumber)];case 6:error_7=_a.sent();error_7.transaction=tx;error_7.transactionHash=tx.hash;throw error_7;case 7:return[2]}})})};BaseProvider.prototype._getTransactionRequest=function(transaction){return __awaiter(this,void 0,void 0,function(){var values,tx,_a,_b;var _this=this;return __generator(this,function(_c){switch(_c.label){case 0:return[4,transaction];case 1:values=_c.sent();tx={};["from","to"].forEach(function(key){if(values[key]==null){return}tx[key]=Promise.resolve(values[key]).then(function(v){return v?_this._getAddress(v):null})});["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(function(key){if(values[key]==null){return}tx[key]=Promise.resolve(values[key]).then(function(v){return v?lib$2.BigNumber.from(v):null})});["type"].forEach(function(key){if(values[key]==null){return}tx[key]=Promise.resolve(values[key]).then(function(v){return v!=null?v:null})});if(values.accessList){tx.accessList=this.formatter.accessList(values.accessList)}["data"].forEach(function(key){if(values[key]==null){return}tx[key]=Promise.resolve(values[key]).then(function(v){return v?(0,lib$1.hexlify)(v):null})});_b=(_a=this.formatter).transactionRequest;return[4,(0,lib$3.resolveProperties)(tx)];case 2:return[2,_b.apply(_a,[_c.sent()])]}})})};BaseProvider.prototype._getFilter=function(filter){return __awaiter(this,void 0,void 0,function(){var result,_a,_b;var _this=this;return __generator(this,function(_c){switch(_c.label){case 0:return[4,filter];case 1:filter=_c.sent();result={};if(filter.address!=null){result.address=this._getAddress(filter.address)}["blockHash","topics"].forEach(function(key){if(filter[key]==null){return}result[key]=filter[key]});["fromBlock","toBlock"].forEach(function(key){if(filter[key]==null){return}result[key]=_this._getBlockTag(filter[key])});_b=(_a=this.formatter).filter;return[4,(0,lib$3.resolveProperties)(result)];case 2:return[2,_b.apply(_a,[_c.sent()])]}})})};BaseProvider.prototype._call=function(transaction,blockTag,attempt){return __awaiter(this,void 0,void 0,function(){var txSender,result,data,sender,urls,urlsOffset,urlsLength,urlsData,u,url,calldata,callbackSelector,extraData,ccipResult,tx,error_8;return __generator(this,function(_a){switch(_a.label){case 0:if(attempt>=MAX_CCIP_REDIRECTS){logger.throwError("CCIP read exceeded maximum redirections",lib.Logger.errors.SERVER_ERROR,{redirects:attempt,transaction:transaction})}txSender=transaction.to;return[4,this.perform("call",{transaction:transaction,blockTag:blockTag})];case 1:result=_a.sent();if(!(attempt>=0&&blockTag==="latest"&&txSender!=null&&result.substring(0,10)==="0x556f1830"&&(0,lib$1.hexDataLength)(result)%32===4))return[3,5];_a.label=2;case 2:_a.trys.push([2,4,,5]);data=(0,lib$1.hexDataSlice)(result,4);sender=(0,lib$1.hexDataSlice)(data,0,32);if(!lib$2.BigNumber.from(sender).eq(txSender)){logger.throwError("CCIP Read sender did not match",lib.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:transaction,data:result})}urls=[];urlsOffset=lib$2.BigNumber.from((0,lib$1.hexDataSlice)(data,32,64)).toNumber();urlsLength=lib$2.BigNumber.from((0,lib$1.hexDataSlice)(data,urlsOffset,urlsOffset+32)).toNumber();urlsData=(0,lib$1.hexDataSlice)(data,urlsOffset+32);for(u=0;uthis._emitted.block){return[2,null]}}return[2,undefined]}if(!includeTransactions)return[3,8];blockNumber_1=null;i=0;_a.label=2;case 2:if(!(i0};BaseProvider.prototype._stopEvent=function(event){this.polling=this._events.filter(function(e){return e.pollable()}).length>0};BaseProvider.prototype._addEventListener=function(eventName,listener,once){var event=new Event(getEventTag(eventName),listener,once);this._events.push(event);this._startEvent(event);return this};BaseProvider.prototype.on=function(eventName,listener){return this._addEventListener(eventName,listener,false)};BaseProvider.prototype.once=function(eventName,listener){return this._addEventListener(eventName,listener,true)};BaseProvider.prototype.emit=function(eventName){var _this=this;var args=[];for(var _i=1;_i0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]=0&&message.match(/gas required exceeds allowance|always failing transaction|execution reverted/)){logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",lib.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:error,method:method,transaction:transaction})}throw error}function timer(timeout){return new Promise(function(resolve){setTimeout(resolve,timeout)})}function getResult(payload){if(payload.error){var error=new Error(payload.error.message);error.code=payload.error.code;error.data=payload.error.data;throw error}return payload.result}function getLowerCase(value){if(value){return value.toLowerCase()}return value}var _constructorGuard={};var JsonRpcSigner=function(_super){__extends(JsonRpcSigner,_super);function JsonRpcSigner(constructorGuard,provider,addressOrIndex){var _this=_super.call(this)||this;if(constructorGuard!==_constructorGuard){throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner")}(0,lib$3.defineReadOnly)(_this,"provider",provider);if(addressOrIndex==null){addressOrIndex=0}if(typeof addressOrIndex==="string"){(0,lib$3.defineReadOnly)(_this,"_address",_this.provider.formatter.address(addressOrIndex));(0,lib$3.defineReadOnly)(_this,"_index",null)}else if(typeof addressOrIndex==="number"){(0,lib$3.defineReadOnly)(_this,"_index",addressOrIndex);(0,lib$3.defineReadOnly)(_this,"_address",null)}else{logger.throwArgumentError("invalid address or index","addressOrIndex",addressOrIndex)}return _this}JsonRpcSigner.prototype.connect=function(provider){return logger.throwError("cannot alter JSON-RPC Signer connection",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})};JsonRpcSigner.prototype.connectUnchecked=function(){return new UncheckedJsonRpcSigner(_constructorGuard,this.provider,this._address||this._index)};JsonRpcSigner.prototype.getAddress=function(){var _this=this;if(this._address){return Promise.resolve(this._address)}return this.provider.send("eth_accounts",[]).then(function(accounts){if(accounts.length<=_this._index){logger.throwError("unknown account #"+_this._index,lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"})}return _this.provider.formatter.address(accounts[_this._index])})};JsonRpcSigner.prototype.sendUncheckedTransaction=function(transaction){var _this=this;transaction=(0,lib$3.shallowCopy)(transaction);var fromAddress=this.getAddress().then(function(address){if(address){address=address.toLowerCase()}return address});if(transaction.gasLimit==null){var estimate=(0,lib$3.shallowCopy)(transaction);estimate.from=fromAddress;transaction.gasLimit=this.provider.estimateGas(estimate)}if(transaction.to!=null){transaction.to=Promise.resolve(transaction.to).then(function(to){return __awaiter(_this,void 0,void 0,function(){var address;return __generator(this,function(_a){switch(_a.label){case 0:if(to==null){return[2,null]}return[4,this.provider.resolveName(to)];case 1:address=_a.sent();if(address==null){logger.throwArgumentError("provided ENS name resolves to null","tx.to",to)}return[2,address]}})})})}return(0,lib$3.resolveProperties)({tx:(0,lib$3.resolveProperties)(transaction),sender:fromAddress}).then(function(_a){var tx=_a.tx,sender=_a.sender;if(tx.from!=null){if(tx.from.toLowerCase()!==sender){logger.throwArgumentError("from address mismatch","transaction",transaction)}}else{tx.from=sender}var hexTx=_this.provider.constructor.hexlifyTransaction(tx,{from:true});return _this.provider.send("eth_sendTransaction",[hexTx]).then(function(hash){return hash},function(error){return checkError("sendTransaction",error,hexTx)})})};JsonRpcSigner.prototype.signTransaction=function(transaction){return logger.throwError("signing transactions is unsupported",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})};JsonRpcSigner.prototype.sendTransaction=function(transaction){return __awaiter(this,void 0,void 0,function(){var blockNumber,hash,error_1;var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval)];case 1:blockNumber=_a.sent();return[4,this.sendUncheckedTransaction(transaction)];case 2:hash=_a.sent();_a.label=3;case 3:_a.trys.push([3,5,,6]);return[4,(0,lib$q.poll)(function(){return __awaiter(_this,void 0,void 0,function(){var tx;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.provider.getTransaction(hash)];case 1:tx=_a.sent();if(tx===null){return[2,undefined]}return[2,this.provider._wrapTransaction(tx,hash,blockNumber)]}})})},{oncePoll:this.provider})];case 4:return[2,_a.sent()];case 5:error_1=_a.sent();error_1.transactionHash=hash;throw error_1;case 6:return[2]}})})};JsonRpcSigner.prototype.signMessage=function(message){return __awaiter(this,void 0,void 0,function(){var data,address;return __generator(this,function(_a){switch(_a.label){case 0:data=typeof message==="string"?(0,lib$8.toUtf8Bytes)(message):message;return[4,this.getAddress()];case 1:address=_a.sent();return[4,this.provider.send("personal_sign",[(0,lib$1.hexlify)(data),address.toLowerCase()])];case 2:return[2,_a.sent()]}})})};JsonRpcSigner.prototype._legacySignMessage=function(message){return __awaiter(this,void 0,void 0,function(){var data,address;return __generator(this,function(_a){switch(_a.label){case 0:data=typeof message==="string"?(0,lib$8.toUtf8Bytes)(message):message;return[4,this.getAddress()];case 1:address=_a.sent();return[4,this.provider.send("eth_sign",[address.toLowerCase(),(0,lib$1.hexlify)(data)])];case 2:return[2,_a.sent()]}})})};JsonRpcSigner.prototype._signTypedData=function(domain,types,value){return __awaiter(this,void 0,void 0,function(){var populated,address;var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,lib$9._TypedDataEncoder.resolveNames(domain,types,value,function(name){return _this.provider.resolveName(name)})];case 1:populated=_a.sent();return[4,this.getAddress()];case 2:address=_a.sent();return[4,this.provider.send("eth_signTypedData_v4",[address.toLowerCase(),JSON.stringify(lib$9._TypedDataEncoder.getPayload(populated.domain,types,populated.value))])];case 3:return[2,_a.sent()]}})})};JsonRpcSigner.prototype.unlock=function(password){return __awaiter(this,void 0,void 0,function(){var provider,address;return __generator(this,function(_a){switch(_a.label){case 0:provider=this.provider;return[4,this.getAddress()];case 1:address=_a.sent();return[2,provider.send("personal_unlockAccount",[address.toLowerCase(),password,null])]}})})};return JsonRpcSigner}(lib$c.Signer);exports.JsonRpcSigner=JsonRpcSigner;var UncheckedJsonRpcSigner=function(_super){__extends(UncheckedJsonRpcSigner,_super);function UncheckedJsonRpcSigner(){return _super!==null&&_super.apply(this,arguments)||this}UncheckedJsonRpcSigner.prototype.sendTransaction=function(transaction){var _this=this;return this.sendUncheckedTransaction(transaction).then(function(hash){return{hash:hash,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(confirmations){return _this.provider.waitForTransaction(hash,confirmations)}}})};return UncheckedJsonRpcSigner}(JsonRpcSigner);var allowedTransactionKeys={chainId:true,data:true,gasLimit:true,gasPrice:true,nonce:true,to:true,value:true,type:true,accessList:true,maxFeePerGas:true,maxPriorityFeePerGas:true};var JsonRpcProvider=function(_super){__extends(JsonRpcProvider,_super);function JsonRpcProvider(url,network){var _this=this;var networkOrReady=network;if(networkOrReady==null){networkOrReady=new Promise(function(resolve,reject){setTimeout(function(){_this.detectNetwork().then(function(network){resolve(network)},function(error){reject(error)})},0)})}_this=_super.call(this,networkOrReady)||this;if(!url){url=(0,lib$3.getStatic)(_this.constructor,"defaultUrl")()}if(typeof url==="string"){(0,lib$3.defineReadOnly)(_this,"connection",Object.freeze({url:url}))}else{(0,lib$3.defineReadOnly)(_this,"connection",Object.freeze((0,lib$3.shallowCopy)(url)))}_this._nextId=42;return _this}Object.defineProperty(JsonRpcProvider.prototype,"_cache",{get:function(){if(this._eventLoopCache==null){this._eventLoopCache={}}return this._eventLoopCache},enumerable:false,configurable:true});JsonRpcProvider.defaultUrl=function(){return"http://localhost:8545"};JsonRpcProvider.prototype.detectNetwork=function(){var _this=this;if(!this._cache["detectNetwork"]){this._cache["detectNetwork"]=this._uncachedDetectNetwork();setTimeout(function(){_this._cache["detectNetwork"]=null},0)}return this._cache["detectNetwork"]};JsonRpcProvider.prototype._uncachedDetectNetwork=function(){return __awaiter(this,void 0,void 0,function(){var chainId,error_2,error_3,getNetwork;return __generator(this,function(_a){switch(_a.label){case 0:return[4,timer(0)];case 1:_a.sent();chainId=null;_a.label=2;case 2:_a.trys.push([2,4,,9]);return[4,this.send("eth_chainId",[])];case 3:chainId=_a.sent();return[3,9];case 4:error_2=_a.sent();_a.label=5;case 5:_a.trys.push([5,7,,8]);return[4,this.send("net_version",[])];case 6:chainId=_a.sent();return[3,8];case 7:error_3=_a.sent();return[3,8];case 8:return[3,9];case 9:if(chainId!=null){getNetwork=(0,lib$3.getStatic)(this.constructor,"getNetwork");try{return[2,getNetwork(lib$2.BigNumber.from(chainId).toNumber())]}catch(error){return[2,logger.throwError("could not detect network",lib.Logger.errors.NETWORK_ERROR,{chainId:chainId,event:"invalidNetwork",serverError:error})]}}return[2,logger.throwError("could not detect network",lib.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})]}})})};JsonRpcProvider.prototype.getSigner=function(addressOrIndex){return new JsonRpcSigner(_constructorGuard,this,addressOrIndex)};JsonRpcProvider.prototype.getUncheckedSigner=function(addressOrIndex){return this.getSigner(addressOrIndex).connectUnchecked()};JsonRpcProvider.prototype.listAccounts=function(){var _this=this;return this.send("eth_accounts",[]).then(function(accounts){return accounts.map(function(a){return _this.formatter.address(a)})})};JsonRpcProvider.prototype.send=function(method,params){var _this=this;var request={method:method,params:params,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,lib$3.deepCopy)(request),provider:this});var cache=["eth_chainId","eth_blockNumber"].indexOf(method)>=0;if(cache&&this._cache[method]){return this._cache[method]}var result=(0,lib$q.fetchJson)(this.connection,JSON.stringify(request),getResult).then(function(result){_this.emit("debug",{action:"response",request:request,response:result,provider:_this});return result},function(error){_this.emit("debug",{action:"response",error:error,request:request,provider:_this});throw error});if(cache){this._cache[method]=result;setTimeout(function(){_this._cache[method]=null},0)}return result};JsonRpcProvider.prototype.prepareRequest=function(method,params){switch(method){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[getLowerCase(params.address),params.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[getLowerCase(params.address),params.blockTag]];case"getCode":return["eth_getCode",[getLowerCase(params.address),params.blockTag]];case"getStorageAt":return["eth_getStorageAt",[getLowerCase(params.address),(0,lib$1.hexZeroPad)(params.position,32),params.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[params.signedTransaction]];case"getBlock":if(params.blockTag){return["eth_getBlockByNumber",[params.blockTag,!!params.includeTransactions]]}else if(params.blockHash){return["eth_getBlockByHash",[params.blockHash,!!params.includeTransactions]]}return null;case"getTransaction":return["eth_getTransactionByHash",[params.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[params.transactionHash]];case"call":{var hexlifyTransaction=(0,lib$3.getStatic)(this.constructor,"hexlifyTransaction");return["eth_call",[hexlifyTransaction(params.transaction,{from:true}),params.blockTag]]}case"estimateGas":{var hexlifyTransaction=(0,lib$3.getStatic)(this.constructor,"hexlifyTransaction");return["eth_estimateGas",[hexlifyTransaction(params.transaction,{from:true})]]}case"getLogs":if(params.filter&¶ms.filter.address!=null){params.filter.address=getLowerCase(params.filter.address)}return["eth_getLogs",[params.filter]];default:break}return null};JsonRpcProvider.prototype.perform=function(method,params){return __awaiter(this,void 0,void 0,function(){var tx,feeData,args,error_4;return __generator(this,function(_a){switch(_a.label){case 0:if(!(method==="call"||method==="estimateGas"))return[3,2];tx=params.transaction;if(!(tx&&tx.type!=null&&lib$2.BigNumber.from(tx.type).isZero()))return[3,2];if(!(tx.maxFeePerGas==null&&tx.maxPriorityFeePerGas==null))return[3,2];return[4,this.getFeeData()];case 1:feeData=_a.sent();if(feeData.maxFeePerGas==null&&feeData.maxPriorityFeePerGas==null){params=(0,lib$3.shallowCopy)(params);params.transaction=(0,lib$3.shallowCopy)(tx);delete params.transaction.type}_a.label=2;case 2:args=this.prepareRequest(method,params);if(args==null){logger.throwError(method+" not implemented",lib.Logger.errors.NOT_IMPLEMENTED,{operation:method})}_a.label=3;case 3:_a.trys.push([3,5,,6]);return[4,this.send(args[0],args[1])];case 4:return[2,_a.sent()];case 5:error_4=_a.sent();return[2,checkError(method,error_4,params)];case 6:return[2]}})})};JsonRpcProvider.prototype._startEvent=function(event){if(event.tag==="pending"){this._startPending()}_super.prototype._startEvent.call(this,event)};JsonRpcProvider.prototype._startPending=function(){if(this._pendingFilter!=null){return}var self=this;var pendingFilter=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=pendingFilter;pendingFilter.then(function(filterId){function poll(){self.send("eth_getFilterChanges",[filterId]).then(function(hashes){if(self._pendingFilter!=pendingFilter){return null}var seq=Promise.resolve();hashes.forEach(function(hash){self._emitted["t:"+hash.toLowerCase()]="pending";seq=seq.then(function(){return self.getTransaction(hash).then(function(tx){self.emit("pending",tx);return null})})});return seq.then(function(){return timer(1e3)})}).then(function(){if(self._pendingFilter!=pendingFilter){self.send("eth_uninstallFilter",[filterId]);return}setTimeout(function(){poll()},0);return null}).catch(function(error){})}poll();return filterId}).catch(function(error){})};JsonRpcProvider.prototype._stopEvent=function(event){if(event.tag==="pending"&&this.listenerCount("pending")===0){this._pendingFilter=null}_super.prototype._stopEvent.call(this,event)};JsonRpcProvider.hexlifyTransaction=function(transaction,allowExtra){var allowed=(0,lib$3.shallowCopy)(allowedTransactionKeys);if(allowExtra){for(var key in allowExtra){if(allowExtra[key]){allowed[key]=true}}}(0,lib$3.checkProperties)(transaction,allowed);var result={};["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(key){if(transaction[key]==null){return}var value=(0,lib$1.hexValue)(lib$2.BigNumber.from(transaction[key]));if(key==="gasLimit"){key="gas"}result[key]=value});["from","to","data"].forEach(function(key){if(transaction[key]==null){return}result[key]=(0,lib$1.hexlify)(transaction[key])});if(transaction.accessList){result["accessList"]=(0,lib$e.accessListify)(transaction.accessList)}return result};return JsonRpcProvider}(baseProvider.BaseProvider);exports.JsonRpcProvider=JsonRpcProvider});var jsonRpcProvider$1=getDefaultExportFromCjs(jsonRpcProvider);var browserWs=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.WebSocket=void 0;var WS=null;exports.WebSocket=WS;try{exports.WebSocket=WS=WebSocket;if(WS==null){throw new Error("inject please")}}catch(error){var logger_2=new lib.Logger(_version$I.version);exports.WebSocket=WS=function(){logger_2.throwError("WebSockets not supported in this environment",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}});var browserWs$1=getDefaultExportFromCjs(browserWs);var websocketProvider=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var __awaiter=commonjsGlobal&&commonjsGlobal.__awaiter||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator["throw"](value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};var __generator=commonjsGlobal&&commonjsGlobal.__generator||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]=0){error.throttleRetry=true}throw error}return result.result}function getJsonResult(result){if(result&&result.status==0&&result.message=="NOTOK"&&(result.result||"").toLowerCase().indexOf("rate limit")>=0){var error=new Error("throttled response");error.result=JSON.stringify(result);error.throttleRetry=true;throw error}if(result.jsonrpc!="2.0"){var error=new Error("invalid response");error.result=JSON.stringify(result);throw error}if(result.error){var error=new Error(result.error.message||"unknown error");if(result.error.code){error.code=result.error.code}if(result.error.data){error.data=result.error.data}throw error}return result.result}function checkLogTag(blockTag){if(blockTag==="pending"){throw new Error("pending not supported")}if(blockTag==="latest"){return blockTag}return parseInt(blockTag.substring(2),16)}var defaultApiKey="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function checkError(method,error,transaction){if(method==="call"&&error.code===lib.Logger.errors.SERVER_ERROR){var e=error.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){var data=e.data;if(data){data="0x"+data.replace(/^.*0x/i,"")}if((0,lib$1.isHexString)(data)){return data}logger.throwError("missing revert data in call exception",lib.Logger.errors.CALL_EXCEPTION,{error:error,data:"0x"})}}var message=error.message;if(error.code===lib.Logger.errors.SERVER_ERROR){if(error.error&&typeof error.error.message==="string"){message=error.error.message}else if(typeof error.body==="string"){message=error.body}else if(typeof error.responseText==="string"){message=error.responseText}}message=(message||"").toLowerCase();if(message.match(/insufficient funds/)){logger.throwError("insufficient funds for intrinsic transaction cost",lib.Logger.errors.INSUFFICIENT_FUNDS,{error:error,method:method,transaction:transaction})}if(message.match(/same hash was already imported|transaction nonce is too low|nonce too low/)){logger.throwError("nonce has already been used",lib.Logger.errors.NONCE_EXPIRED,{error:error,method:method,transaction:transaction})}if(message.match(/another transaction with same nonce/)){logger.throwError("replacement fee too low",lib.Logger.errors.REPLACEMENT_UNDERPRICED,{error:error,method:method,transaction:transaction})}if(message.match(/execution failed due to an exception|execution reverted/)){logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",lib.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:error,method:method,transaction:transaction})}throw error}var EtherscanProvider=function(_super){__extends(EtherscanProvider,_super);function EtherscanProvider(network,apiKey){var _this=_super.call(this,network)||this;(0,lib$3.defineReadOnly)(_this,"baseUrl",_this.getBaseUrl());(0,lib$3.defineReadOnly)(_this,"apiKey",apiKey||defaultApiKey);return _this}EtherscanProvider.prototype.getBaseUrl=function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"optimism":return"https://api-optimistic.etherscan.io";default:}return logger.throwArgumentError("unsupported network","network",this.network.name)};EtherscanProvider.prototype.getUrl=function(module,params){var query=Object.keys(params).reduce(function(accum,key){var value=params[key];if(value!=null){accum+="&"+key+"="+value}return accum},"");var apiKey=this.apiKey?"&apikey="+this.apiKey:"";return this.baseUrl+"/api?module="+module+query+apiKey};EtherscanProvider.prototype.getPostUrl=function(){return this.baseUrl+"/api"};EtherscanProvider.prototype.getPostData=function(module,params){params.module=module;params.apikey=this.apiKey;return params};EtherscanProvider.prototype.fetch=function(module,params,post){return __awaiter(this,void 0,void 0,function(){var url,payload,procFunc,connection,payloadStr,result;var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:url=post?this.getPostUrl():this.getUrl(module,params);payload=post?this.getPostData(module,params):null;procFunc=module==="proxy"?getJsonResult:getResult;this.emit("debug",{action:"request",request:url,provider:this});connection={url:url,throttleSlotInterval:1e3,throttleCallback:function(attempt,url){if(_this.isCommunityResource()){(0,formatter.showThrottleMessage)()}return Promise.resolve(true)}};payloadStr=null;if(payload){connection.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"};payloadStr=Object.keys(payload).map(function(key){return key+"="+payload[key]}).join("&")}return[4,(0,lib$q.fetchJson)(connection,payloadStr,procFunc||getJsonResult)];case 1:result=_a.sent();this.emit("debug",{action:"response",request:url,response:(0,lib$3.deepCopy)(result),provider:this});return[2,result]}})})};EtherscanProvider.prototype.detectNetwork=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.network]})})};EtherscanProvider.prototype.perform=function(method,params){return __awaiter(this,void 0,void 0,function(){var _a,postData,error_1,postData,error_2,args,topic0,logs,blocks,i,log,block,_b;return __generator(this,function(_c){switch(_c.label){case 0:_a=method;switch(_a){case"getBlockNumber":return[3,1];case"getGasPrice":return[3,2];case"getBalance":return[3,3];case"getTransactionCount":return[3,4];case"getCode":return[3,5];case"getStorageAt":return[3,6];case"sendTransaction":return[3,7];case"getBlock":return[3,8];case"getTransaction":return[3,9];case"getTransactionReceipt":return[3,10];case"call":return[3,11];case"estimateGas":return[3,15];case"getLogs":return[3,19];case"getEtherPrice":return[3,26]}return[3,28];case 1:return[2,this.fetch("proxy",{action:"eth_blockNumber"})];case 2:return[2,this.fetch("proxy",{action:"eth_gasPrice"})];case 3:return[2,this.fetch("account",{action:"balance",address:params.address,tag:params.blockTag})];case 4:return[2,this.fetch("proxy",{action:"eth_getTransactionCount",address:params.address,tag:params.blockTag})];case 5:return[2,this.fetch("proxy",{action:"eth_getCode",address:params.address,tag:params.blockTag})];case 6:return[2,this.fetch("proxy",{action:"eth_getStorageAt",address:params.address,position:params.position,tag:params.blockTag})];case 7:return[2,this.fetch("proxy",{action:"eth_sendRawTransaction",hex:params.signedTransaction},true).catch(function(error){return checkError("sendTransaction",error,params.signedTransaction)})];case 8:if(params.blockTag){return[2,this.fetch("proxy",{action:"eth_getBlockByNumber",tag:params.blockTag,boolean:params.includeTransactions?"true":"false"})]}throw new Error("getBlock by blockHash not implemented");case 9:return[2,this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:params.transactionHash})];case 10:return[2,this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:params.transactionHash})];case 11:if(params.blockTag!=="latest"){throw new Error("EtherscanProvider does not support blockTag for call")}postData=getTransactionPostData(params.transaction);postData.module="proxy";postData.action="eth_call";_c.label=12;case 12:_c.trys.push([12,14,,15]);return[4,this.fetch("proxy",postData,true)];case 13:return[2,_c.sent()];case 14:error_1=_c.sent();return[2,checkError("call",error_1,params.transaction)];case 15:postData=getTransactionPostData(params.transaction);postData.module="proxy";postData.action="eth_estimateGas";_c.label=16;case 16:_c.trys.push([16,18,,19]);return[4,this.fetch("proxy",postData,true)];case 17:return[2,_c.sent()];case 18:error_2=_c.sent();return[2,checkError("estimateGas",error_2,params.transaction)];case 19:args={action:"getLogs"};if(params.filter.fromBlock){args.fromBlock=checkLogTag(params.filter.fromBlock)}if(params.filter.toBlock){args.toBlock=checkLogTag(params.filter.toBlock)}if(params.filter.address){args.address=params.filter.address}if(params.filter.topics&¶ms.filter.topics.length>0){if(params.filter.topics.length>1){logger.throwError("unsupported topic count",lib.Logger.errors.UNSUPPORTED_OPERATION,{topics:params.filter.topics})}if(params.filter.topics.length===1){topic0=params.filter.topics[0];if(typeof topic0!=="string"||topic0.length!==66){logger.throwError("unsupported topic format",lib.Logger.errors.UNSUPPORTED_OPERATION,{topic0:topic0})}args.topic0=topic0}}return[4,this.fetch("logs",args)];case 20:logs=_c.sent();blocks={};i=0;_c.label=21;case 21:if(!(i0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]maxDelta){return null}return(a+b)/2}function serialize(value){if(value===null){return"null"}else if(typeof value==="number"||typeof value==="boolean"){return JSON.stringify(value)}else if(typeof value==="string"){return value}else if(lib$2.BigNumber.isBigNumber(value)){return value.toString()}else if(Array.isArray(value)){return JSON.stringify(value.map(function(i){return serialize(i)}))}else if(typeof value==="object"){var keys=Object.keys(value);keys.sort();return"{"+keys.map(function(key){var v=value[key];if(typeof v==="function"){v="[function]"}else{v=serialize(v)}return JSON.stringify(key)+":"+v}).join(",")+"}"}throw new Error("unknown value type: "+typeof value)}var nextRid=1;function stall(duration){var cancel=null;var timer=null;var promise=new Promise(function(resolve){cancel=function(){if(timer){clearTimeout(timer);timer=null}resolve()};timer=setTimeout(cancel,duration)});var wait=function(func){promise=promise.then(func);return promise};function getPromise(){return promise}return{cancel:cancel,getPromise:getPromise,wait:wait}}var ForwardErrors=[lib.Logger.errors.CALL_EXCEPTION,lib.Logger.errors.INSUFFICIENT_FUNDS,lib.Logger.errors.NONCE_EXPIRED,lib.Logger.errors.REPLACEMENT_UNDERPRICED,lib.Logger.errors.UNPREDICTABLE_GAS_LIMIT];var ForwardProperties=["address","args","errorArgs","errorSignature","method","transaction"];function exposeDebugConfig(config,now){var result={weight:config.weight};Object.defineProperty(result,"provider",{get:function(){return config.provider}});if(config.start){result.start=config.start}if(now){result.duration=now-config.start}if(config.done){if(config.error){result.error=config.error}else{result.result=config.result||null}}return result}function normalizedTally(normalize,quorum){return function(configs){var tally={};configs.forEach(function(c){var value=normalize(c.result);if(!tally[value]){tally[value]={count:0,result:c.result}}tally[value].count++});var keys=Object.keys(tally);for(var i=0;i=quorum){return check.result}}return undefined}}function getProcessFunc(provider,method,params){var normalize=serialize;switch(method){case"getBlockNumber":return function(configs){var values=configs.map(function(c){return c.result});var blockNumber=median(configs.map(function(c){return c.result}),2);if(blockNumber==null){return undefined}blockNumber=Math.ceil(blockNumber);if(values.indexOf(blockNumber+1)>=0){blockNumber++}if(blockNumber>=provider._highestBlockNumber){provider._highestBlockNumber=blockNumber}return provider._highestBlockNumber};case"getGasPrice":return function(configs){var values=configs.map(function(c){return c.result});values.sort();return values[Math.floor(values.length/2)]};case"getEtherPrice":return function(configs){return median(configs.map(function(c){return c.result}))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":normalize=function(tx){if(tx==null){return null}tx=(0,lib$3.shallowCopy)(tx);tx.confirmations=-1;return serialize(tx)};break;case"getBlock":if(params.includeTransactions){normalize=function(block){if(block==null){return null}block=(0,lib$3.shallowCopy)(block);block.transactions=block.transactions.map(function(tx){tx=(0,lib$3.shallowCopy)(tx);tx.confirmations=-1;return tx});return serialize(block)}}else{normalize=function(block){if(block==null){return null}return serialize(block)}}break;default:throw new Error("unknown method: "+method)}return normalizedTally(normalize,provider.quorum)}function waitForSync(config,blockNumber){return __awaiter(this,void 0,void 0,function(){var provider;return __generator(this,function(_a){provider=config.provider;if(provider.blockNumber!=null&&provider.blockNumber>=blockNumber||blockNumber===-1){return[2,provider]}return[2,(0,lib$q.poll)(function(){return new Promise(function(resolve,reject){setTimeout(function(){if(provider.blockNumber>=blockNumber){return resolve(provider)}if(config.cancelled){return resolve(null)}return resolve(undefined)},0)})},{oncePoll:provider})]})})}function getRunner(config,currentBlockNumber,method,params){return __awaiter(this,void 0,void 0,function(){var provider,_a,filter;return __generator(this,function(_b){switch(_b.label){case 0:provider=config.provider;_a=method;switch(_a){case"getBlockNumber":return[3,1];case"getGasPrice":return[3,1];case"getEtherPrice":return[3,2];case"getBalance":return[3,3];case"getTransactionCount":return[3,3];case"getCode":return[3,3];case"getStorageAt":return[3,6];case"getBlock":return[3,9];case"call":return[3,12];case"estimateGas":return[3,12];case"getTransaction":return[3,15];case"getTransactionReceipt":return[3,15];case"getLogs":return[3,16]}return[3,19];case 1:return[2,provider[method]()];case 2:if(provider.getEtherPrice){return[2,provider.getEtherPrice()]}return[3,19];case 3:if(!(params.blockTag&&(0,lib$1.isHexString)(params.blockTag)))return[3,5];return[4,waitForSync(config,currentBlockNumber)];case 4:provider=_b.sent();_b.label=5;case 5:return[2,provider[method](params.address,params.blockTag||"latest")];case 6:if(!(params.blockTag&&(0,lib$1.isHexString)(params.blockTag)))return[3,8];return[4,waitForSync(config,currentBlockNumber)];case 7:provider=_b.sent();_b.label=8;case 8:return[2,provider.getStorageAt(params.address,params.position,params.blockTag||"latest")];case 9:if(!(params.blockTag&&(0,lib$1.isHexString)(params.blockTag)))return[3,11];return[4,waitForSync(config,currentBlockNumber)];case 10:provider=_b.sent();_b.label=11;case 11:return[2,provider[params.includeTransactions?"getBlockWithTransactions":"getBlock"](params.blockTag||params.blockHash)];case 12:if(!(params.blockTag&&(0,lib$1.isHexString)(params.blockTag)))return[3,14];return[4,waitForSync(config,currentBlockNumber)];case 13:provider=_b.sent();_b.label=14;case 14:return[2,provider[method](params.transaction)];case 15:return[2,provider[method](params.transactionHash)];case 16:filter=params.filter;if(!(filter.fromBlock&&(0,lib$1.isHexString)(filter.fromBlock)||filter.toBlock&&(0,lib$1.isHexString)(filter.toBlock)))return[3,18];return[4,waitForSync(config,currentBlockNumber)];case 17:provider=_b.sent();_b.label=18;case 18:return[2,provider.getLogs(filter)];case 19:return[2,logger.throwError("unknown method error",lib.Logger.errors.UNKNOWN_ERROR,{method:method,params:params})]}})})}var FallbackProvider=function(_super){__extends(FallbackProvider,_super);function FallbackProvider(providers,quorum){var _this=this;if(providers.length===0){logger.throwArgumentError("missing providers","providers",providers)}var providerConfigs=providers.map(function(configOrProvider,index){if(lib$b.Provider.isProvider(configOrProvider)){var stallTimeout=(0,formatter.isCommunityResource)(configOrProvider)?2e3:750;var priority=1;return Object.freeze({provider:configOrProvider,weight:1,stallTimeout:stallTimeout,priority:priority})}var config=(0,lib$3.shallowCopy)(configOrProvider);if(config.priority==null){config.priority=1}if(config.stallTimeout==null){config.stallTimeout=(0,formatter.isCommunityResource)(configOrProvider)?2e3:750}if(config.weight==null){config.weight=1}var weight=config.weight;if(weight%1||weight>512||weight<1){logger.throwArgumentError("invalid weight; must be integer in [1, 512]","providers["+index+"].weight",weight)}return Object.freeze(config)});var total=providerConfigs.reduce(function(accum,c){return accum+c.weight},0);if(quorum==null){quorum=total/2}else if(quorum>total){logger.throwArgumentError("quorum will always fail; larger than total weight","quorum",quorum)}var networkOrReady=checkNetworks(providerConfigs.map(function(c){return c.provider.network}));if(networkOrReady==null){networkOrReady=new Promise(function(resolve,reject){setTimeout(function(){_this.detectNetwork().then(resolve,reject)},0)})}_this=_super.call(this,networkOrReady)||this;(0,lib$3.defineReadOnly)(_this,"providerConfigs",Object.freeze(providerConfigs));(0,lib$3.defineReadOnly)(_this,"quorum",quorum);_this._highestBlockNumber=-1;return _this}FallbackProvider.prototype.detectNetwork=function(){return __awaiter(this,void 0,void 0,function(){var networks;return __generator(this,function(_a){switch(_a.label){case 0:return[4,Promise.all(this.providerConfigs.map(function(c){return c.provider.getNetwork()}))];case 1:networks=_a.sent();return[2,checkNetworks(networks)]}})})};FallbackProvider.prototype.perform=function(method,params){return __awaiter(this,void 0,void 0,function(){var results,i_1,result,processFunc,configs,currentBlockNumber,i,first,_loop_1,this_1,state_1;var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:if(!(method==="sendTransaction"))return[3,2];return[4,Promise.all(this.providerConfigs.map(function(c){return c.provider.sendTransaction(params.signedTransaction).then(function(result){return result.hash},function(error){return error})}))];case 1:results=_a.sent();for(i_1=0;i_1=this_1.quorum))return[3,5];result=processFunc(results);if(result!==undefined){configs.forEach(function(c){if(c.staller){c.staller.cancel()}c.cancelled=true});return[2,{value:result}]}if(!!first)return[3,4];return[4,stall(100).getPromise()];case 3:_b.sent();_b.label=4;case 4:first=false;_b.label=5;case 5:errors=configs.reduce(function(accum,c){if(!c.done||c.error==null){return accum}var code=c.error.code;if(ForwardErrors.indexOf(code)>=0){if(!accum[code]){accum[code]={error:c.error,weight:0}}accum[code].weight+=c.weight}return accum},{});Object.keys(errors).forEach(function(errorCode){var tally=errors[errorCode];if(tally.weight<_this.quorum){return}configs.forEach(function(c){if(c.staller){c.staller.cancel()}c.cancelled=true});var e=tally.error;var props={};ForwardProperties.forEach(function(name){if(e[name]==null){return}props[name]=e[name]});logger.throwError(e.reason||e.message,errorCode,props)});if(configs.filter(function(c){return!c.done}).length===0){return[2,"break"]}return[2]}})};this_1=this;_a.label=5;case 5:if(!true)return[3,7];return[5,_loop_1()];case 6:state_1=_a.sent();if(typeof state_1==="object")return[2,state_1.value];if(state_1==="break")return[3,7];return[3,5];case 7:configs.forEach(function(c){if(c.staller){c.staller.cancel()}c.cancelled=true});return[2,logger.throwError("failed to meet quorum",lib.Logger.errors.SERVER_ERROR,{method:method,params:params,results:configs.map(function(c){return exposeDebugConfig(c)}),provider:this})]}})})};return FallbackProvider}(baseProvider.BaseProvider);exports.FallbackProvider=FallbackProvider});var fallbackProvider$1=getDefaultExportFromCjs(fallbackProvider);var browserIpcProvider=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.IpcProvider=void 0;var IpcProvider=null;exports.IpcProvider=IpcProvider});var browserIpcProvider$1=getDefaultExportFromCjs(browserIpcProvider);var infuraProvider=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.InfuraProvider=exports.InfuraWebSocketProvider=void 0;var logger=new lib.Logger(_version$I.version);var defaultProjectId="84842078b09946638c03157f83405213";var InfuraWebSocketProvider=function(_super){__extends(InfuraWebSocketProvider,_super);function InfuraWebSocketProvider(network,apiKey){var _this=this;var provider=new InfuraProvider(network,apiKey);var connection=provider.connection;if(connection.password){logger.throwError("INFURA WebSocket project secrets unsupported",lib.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"})}var url=connection.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");_this=_super.call(this,url,network)||this;(0,lib$3.defineReadOnly)(_this,"apiKey",provider.projectId);(0,lib$3.defineReadOnly)(_this,"projectId",provider.projectId);(0,lib$3.defineReadOnly)(_this,"projectSecret",provider.projectSecret);return _this}InfuraWebSocketProvider.prototype.isCommunityResource=function(){return this.projectId===defaultProjectId};return InfuraWebSocketProvider}(websocketProvider.WebSocketProvider);exports.InfuraWebSocketProvider=InfuraWebSocketProvider;var InfuraProvider=function(_super){__extends(InfuraProvider,_super);function InfuraProvider(){return _super!==null&&_super.apply(this,arguments)||this}InfuraProvider.getWebSocketProvider=function(network,apiKey){return new InfuraWebSocketProvider(network,apiKey)};InfuraProvider.getApiKey=function(apiKey){var apiKeyObj={apiKey:defaultProjectId,projectId:defaultProjectId,projectSecret:null};if(apiKey==null){return apiKeyObj}if(typeof apiKey==="string"){apiKeyObj.projectId=apiKey}else if(apiKey.projectSecret!=null){logger.assertArgument(typeof apiKey.projectId==="string","projectSecret requires a projectId","projectId",apiKey.projectId);logger.assertArgument(typeof apiKey.projectSecret==="string","invalid projectSecret","projectSecret","[REDACTED]");apiKeyObj.projectId=apiKey.projectId;apiKeyObj.projectSecret=apiKey.projectSecret}else if(apiKey.projectId){apiKeyObj.projectId=apiKey.projectId}apiKeyObj.apiKey=apiKeyObj.projectId;return apiKeyObj};InfuraProvider.getUrl=function(network,apiKey){var host=null;switch(network?network.name:"unknown"){case"homestead":host="mainnet.infura.io";break;case"ropsten":host="ropsten.infura.io";break;case"rinkeby":host="rinkeby.infura.io";break;case"kovan":host="kovan.infura.io";break;case"goerli":host="goerli.infura.io";break;case"matic":host="polygon-mainnet.infura.io";break;case"maticmum":host="polygon-mumbai.infura.io";break;case"optimism":host="optimism-mainnet.infura.io";break;case"optimism-kovan":host="optimism-kovan.infura.io";break;case"arbitrum":host="arbitrum-mainnet.infura.io";break;case"arbitrum-rinkeby":host="arbitrum-rinkeby.infura.io";break;default:logger.throwError("unsupported network",lib.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:network})}var connection={allowGzip:true,url:"https:/"+"/"+host+"/v3/"+apiKey.projectId,throttleCallback:function(attempt,url){if(apiKey.projectId===defaultProjectId){(0,formatter.showThrottleMessage)()}return Promise.resolve(true)}};if(apiKey.projectSecret!=null){connection.user="";connection.password=apiKey.projectSecret}return connection};InfuraProvider.prototype.isCommunityResource=function(){return this.projectId===defaultProjectId};return InfuraProvider}(urlJsonRpcProvider.UrlJsonRpcProvider);exports.InfuraProvider=InfuraProvider});var infuraProvider$1=getDefaultExportFromCjs(infuraProvider);var jsonRpcBatchProvider=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.JsonRpcBatchProvider=void 0;var JsonRpcBatchProvider=function(_super){__extends(JsonRpcBatchProvider,_super);function JsonRpcBatchProvider(){return _super!==null&&_super.apply(this,arguments)||this}JsonRpcBatchProvider.prototype.send=function(method,params){var _this=this;var request={method:method,params:params,id:this._nextId++,jsonrpc:"2.0"};if(this._pendingBatch==null){this._pendingBatch=[]}var inflightRequest={request:request,resolve:null,reject:null};var promise=new Promise(function(resolve,reject){inflightRequest.resolve=resolve;inflightRequest.reject=reject});this._pendingBatch.push(inflightRequest);if(!this._pendingBatchAggregator){this._pendingBatchAggregator=setTimeout(function(){var batch=_this._pendingBatch;_this._pendingBatch=null;_this._pendingBatchAggregator=null;var request=batch.map(function(inflight){return inflight.request});_this.emit("debug",{action:"requestBatch",request:(0,lib$3.deepCopy)(request),provider:_this});return(0,lib$q.fetchJson)(_this.connection,JSON.stringify(request)).then(function(result){_this.emit("debug",{action:"response",request:request,response:result,provider:_this});batch.forEach(function(inflightRequest,index){var payload=result[index];if(payload.error){var error=new Error(payload.error.message);error.code=payload.error.code;error.data=payload.error.data;inflightRequest.reject(error)}else{inflightRequest.resolve(payload.result)}})},function(error){_this.emit("debug",{action:"response",error:error,request:request,provider:_this});batch.forEach(function(inflightRequest){inflightRequest.reject(error)})})},10)}return promise};return JsonRpcBatchProvider}(jsonRpcProvider.JsonRpcProvider);exports.JsonRpcBatchProvider=JsonRpcBatchProvider});var jsonRpcBatchProvider$1=getDefaultExportFromCjs(jsonRpcBatchProvider);var nodesmithProvider=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.NodesmithProvider=void 0;var logger=new lib.Logger(_version$I.version);var defaultApiKey="ETHERS_JS_SHARED";var NodesmithProvider=function(_super){__extends(NodesmithProvider,_super);function NodesmithProvider(){return _super!==null&&_super.apply(this,arguments)||this}NodesmithProvider.getApiKey=function(apiKey){if(apiKey&&typeof apiKey!=="string"){logger.throwArgumentError("invalid apiKey","apiKey",apiKey)}return apiKey||defaultApiKey};NodesmithProvider.getUrl=function(network,apiKey){logger.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var host=null;switch(network.name){case"homestead":host="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":host="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":host="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":host="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":host="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:logger.throwArgumentError("unsupported network","network",arguments[0])}return host+"?apiKey="+apiKey};return NodesmithProvider}(urlJsonRpcProvider.UrlJsonRpcProvider);exports.NodesmithProvider=NodesmithProvider});var nodesmithProvider$1=getDefaultExportFromCjs(nodesmithProvider);var pocketProvider=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.PocketProvider=void 0;var logger=new lib.Logger(_version$I.version);var defaultApplicationIds={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};var PocketProvider=function(_super){__extends(PocketProvider,_super);function PocketProvider(network,apiKey){var _newTarget=this.constructor;var _this=this;if(apiKey==null){var n=(0,lib$3.getStatic)(_newTarget,"getNetwork")(network);if(n){var applicationId=defaultApplicationIds[n.name];if(applicationId){apiKey={applicationId:applicationId,loadBalancer:true}}}if(apiKey==null){logger.throwError("unsupported network",lib.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:network})}}_this=_super.call(this,network,apiKey)||this;return _this}PocketProvider.getApiKey=function(apiKey){if(apiKey==null){logger.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",apiKey)}var apiKeyObj={applicationId:null,loadBalancer:false,applicationSecretKey:null};if(typeof apiKey==="string"){apiKeyObj.applicationId=apiKey}else if(apiKey.applicationSecretKey!=null){logger.assertArgument(typeof apiKey.applicationId==="string","applicationSecretKey requires an applicationId","applicationId",apiKey.applicationId);logger.assertArgument(typeof apiKey.applicationSecretKey==="string","invalid applicationSecretKey","applicationSecretKey","[REDACTED]");apiKeyObj.applicationId=apiKey.applicationId;apiKeyObj.applicationSecretKey=apiKey.applicationSecretKey;apiKeyObj.loadBalancer=!!apiKey.loadBalancer}else if(apiKey.applicationId){logger.assertArgument(typeof apiKey.applicationId==="string","apiKey.applicationId must be a string","apiKey.applicationId",apiKey.applicationId);apiKeyObj.applicationId=apiKey.applicationId;apiKeyObj.loadBalancer=!!apiKey.loadBalancer}else{logger.throwArgumentError("unsupported PocketProvider apiKey","apiKey",apiKey)}return apiKeyObj};PocketProvider.getUrl=function(network,apiKey){var host=null;switch(network?network.name:"unknown"){case"homestead":host="eth-mainnet.gateway.pokt.network";break;case"ropsten":host="eth-ropsten.gateway.pokt.network";break;case"rinkeby":host="eth-rinkeby.gateway.pokt.network";break;case"goerli":host="eth-goerli.gateway.pokt.network";break;default:logger.throwError("unsupported network",lib.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:network})}var url=null;if(apiKey.loadBalancer){url="https://"+host+"/v1/lb/"+apiKey.applicationId}else{url="https://"+host+"/v1/"+apiKey.applicationId}var connection={url:url};connection.headers={};if(apiKey.applicationSecretKey!=null){connection.user="";connection.password=apiKey.applicationSecretKey}return connection};PocketProvider.prototype.isCommunityResource=function(){return this.applicationId===defaultApplicationIds[this.network.name]};return PocketProvider}(urlJsonRpcProvider.UrlJsonRpcProvider);exports.PocketProvider=PocketProvider});var pocketProvider$1=getDefaultExportFromCjs(pocketProvider);var web3Provider=createCommonjsModule(function(module,exports){"use strict";var __extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.Web3Provider=void 0;var logger=new lib.Logger(_version$I.version);var _nextId=1;function buildWeb3LegacyFetcher(provider,sendFunc){var fetcher="Web3LegacyFetcher";return function(method,params){var _this=this;var request={method:method,params:params,id:_nextId++,jsonrpc:"2.0"};return new Promise(function(resolve,reject){_this.emit("debug",{action:"request",fetcher:fetcher,request:(0,lib$3.deepCopy)(request),provider:_this});sendFunc(request,function(error,response){if(error){_this.emit("debug",{action:"response",fetcher:fetcher,error:error,request:request,provider:_this});return reject(error)}_this.emit("debug",{action:"response",fetcher:fetcher,request:request,response:response,provider:_this});if(response.error){var error_1=new Error(response.error.message);error_1.code=response.error.code;error_1.data=response.error.data;return reject(error_1)}resolve(response.result)})})}}function buildEip1193Fetcher(provider){return function(method,params){var _this=this;if(params==null){params=[]}var request={method:method,params:params};this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,lib$3.deepCopy)(request),provider:this});return provider.request(request).then(function(response){_this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:request,response:response,provider:_this});return response},function(error){_this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:request,error:error,provider:_this});throw error})}}var Web3Provider=function(_super){__extends(Web3Provider,_super);function Web3Provider(provider,network){var _this=this;if(provider==null){logger.throwArgumentError("missing provider","provider",provider)}var path=null;var jsonRpcFetchFunc=null;var subprovider=null;if(typeof provider==="function"){path="unknown:";jsonRpcFetchFunc=provider}else{path=provider.host||provider.path||"";if(!path&&provider.isMetaMask){path="metamask"}subprovider=provider;if(provider.request){if(path===""){path="eip-1193:"}jsonRpcFetchFunc=buildEip1193Fetcher(provider)}else if(provider.sendAsync){jsonRpcFetchFunc=buildWeb3LegacyFetcher(provider,provider.sendAsync.bind(provider))}else if(provider.send){jsonRpcFetchFunc=buildWeb3LegacyFetcher(provider,provider.send.bind(provider))}else{logger.throwArgumentError("unsupported provider","provider",provider)}if(!path){path="unknown:"}}_this=_super.call(this,path,network)||this;(0,lib$3.defineReadOnly)(_this,"jsonRpcFetchFunc",jsonRpcFetchFunc);(0,lib$3.defineReadOnly)(_this,"provider",subprovider);return _this}Web3Provider.prototype.send=function(method,params){return this.jsonRpcFetchFunc(method,params)};return Web3Provider}(jsonRpcProvider.JsonRpcProvider);exports.Web3Provider=Web3Provider});var web3Provider$1=getDefaultExportFromCjs(web3Provider);var lib$r=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Formatter=exports.showThrottleMessage=exports.isCommunityResourcable=exports.isCommunityResource=exports.getNetwork=exports.getDefaultProvider=exports.JsonRpcSigner=exports.IpcProvider=exports.WebSocketProvider=exports.Web3Provider=exports.StaticJsonRpcProvider=exports.PocketProvider=exports.NodesmithProvider=exports.JsonRpcBatchProvider=exports.JsonRpcProvider=exports.InfuraWebSocketProvider=exports.InfuraProvider=exports.EtherscanProvider=exports.CloudflareProvider=exports.AnkrProvider=exports.AlchemyWebSocketProvider=exports.AlchemyProvider=exports.FallbackProvider=exports.UrlJsonRpcProvider=exports.Resolver=exports.BaseProvider=exports.Provider=void 0;Object.defineProperty(exports,"Provider",{enumerable:true,get:function(){return lib$b.Provider}});Object.defineProperty(exports,"getNetwork",{enumerable:true,get:function(){return lib$o.getNetwork}});Object.defineProperty(exports,"BaseProvider",{enumerable:true,get:function(){return baseProvider.BaseProvider}});Object.defineProperty(exports,"Resolver",{enumerable:true,get:function(){return baseProvider.Resolver}});Object.defineProperty(exports,"AlchemyProvider",{enumerable:true,get:function(){return alchemyProvider.AlchemyProvider}});Object.defineProperty(exports,"AlchemyWebSocketProvider",{enumerable:true,get:function(){return alchemyProvider.AlchemyWebSocketProvider}});Object.defineProperty(exports,"AnkrProvider",{enumerable:true,get:function(){return ankrProvider.AnkrProvider}});Object.defineProperty(exports,"CloudflareProvider",{enumerable:true,get:function(){return cloudflareProvider.CloudflareProvider}});Object.defineProperty(exports,"EtherscanProvider",{enumerable:true,get:function(){return etherscanProvider.EtherscanProvider}});Object.defineProperty(exports,"FallbackProvider",{enumerable:true,get:function(){return fallbackProvider.FallbackProvider}});Object.defineProperty(exports,"IpcProvider",{enumerable:true,get:function(){return browserIpcProvider.IpcProvider}});Object.defineProperty(exports,"InfuraProvider",{enumerable:true,get:function(){return infuraProvider.InfuraProvider}});Object.defineProperty(exports,"InfuraWebSocketProvider",{enumerable:true,get:function(){return infuraProvider.InfuraWebSocketProvider}});Object.defineProperty(exports,"JsonRpcProvider",{enumerable:true,get:function(){return jsonRpcProvider.JsonRpcProvider}});Object.defineProperty(exports,"JsonRpcSigner",{enumerable:true,get:function(){return jsonRpcProvider.JsonRpcSigner}});Object.defineProperty(exports,"JsonRpcBatchProvider",{enumerable:true,get:function(){return jsonRpcBatchProvider.JsonRpcBatchProvider}});Object.defineProperty(exports,"NodesmithProvider",{enumerable:true,get:function(){return nodesmithProvider.NodesmithProvider}});Object.defineProperty(exports,"PocketProvider",{enumerable:true,get:function(){return pocketProvider.PocketProvider}});Object.defineProperty(exports,"StaticJsonRpcProvider",{enumerable:true,get:function(){return urlJsonRpcProvider.StaticJsonRpcProvider}});Object.defineProperty(exports,"UrlJsonRpcProvider",{enumerable:true,get:function(){return urlJsonRpcProvider.UrlJsonRpcProvider}});Object.defineProperty(exports,"Web3Provider",{enumerable:true,get:function(){return web3Provider.Web3Provider}});Object.defineProperty(exports,"WebSocketProvider",{enumerable:true,get:function(){return websocketProvider.WebSocketProvider}});Object.defineProperty(exports,"Formatter",{enumerable:true,get:function(){return formatter.Formatter}});Object.defineProperty(exports,"isCommunityResourcable",{enumerable:true,get:function(){return formatter.isCommunityResourcable}});Object.defineProperty(exports,"isCommunityResource",{enumerable:true,get:function(){return formatter.isCommunityResource}});Object.defineProperty(exports,"showThrottleMessage",{enumerable:true,get:function(){return formatter.showThrottleMessage}});var logger=new lib.Logger(_version$I.version);function getDefaultProvider(network,options){if(network==null){network="homestead"}if(typeof network==="string"){var match=network.match(/^(ws|http)s?:/i);if(match){switch(match[1].toLowerCase()){case"http":case"https":return new jsonRpcProvider.JsonRpcProvider(network);case"ws":case"wss":return new websocketProvider.WebSocketProvider(network);default:logger.throwArgumentError("unsupported URL scheme","network",network)}}}var n=(0,lib$o.getNetwork)(network);if(!n||!n._defaultProvider){logger.throwError("unsupported getDefaultProvider network",lib.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:network})}return n._defaultProvider({FallbackProvider:fallbackProvider.FallbackProvider,AlchemyProvider:alchemyProvider.AlchemyProvider,AnkrProvider:ankrProvider.AnkrProvider,CloudflareProvider:cloudflareProvider.CloudflareProvider,EtherscanProvider:etherscanProvider.EtherscanProvider,InfuraProvider:infuraProvider.InfuraProvider,JsonRpcProvider:jsonRpcProvider.JsonRpcProvider,NodesmithProvider:nodesmithProvider.NodesmithProvider,PocketProvider:pocketProvider.PocketProvider,Web3Provider:web3Provider.Web3Provider,IpcProvider:browserIpcProvider.IpcProvider},options)}exports.getDefaultProvider=getDefaultProvider});var index$r=getDefaultExportFromCjs(lib$r);var _version$K=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="solidity/5.6.1"});var _version$L=getDefaultExportFromCjs(_version$K);var lib$s=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.sha256=exports.keccak256=exports.pack=void 0;var regexBytes=new RegExp("^bytes([0-9]+)$");var regexNumber=new RegExp("^(u?int)([0-9]*)$");var regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");var Zeros="0000000000000000000000000000000000000000000000000000000000000000";var logger=new lib.Logger(_version$K.version);function _pack(type,value,isArray){switch(type){case"address":if(isArray){return(0,lib$1.zeroPad)(value,32)}return(0,lib$1.arrayify)(value);case"string":return(0,lib$8.toUtf8Bytes)(value);case"bytes":return(0,lib$1.arrayify)(value);case"bool":value=value?"0x01":"0x00";if(isArray){return(0,lib$1.zeroPad)(value,32)}return(0,lib$1.arrayify)(value)}var match=type.match(regexNumber);if(match){var size=parseInt(match[2]||"256");if(match[2]&&String(size)!==match[2]||size%8!==0||size===0||size>256){logger.throwArgumentError("invalid number type","type",type)}if(isArray){size=256}value=lib$2.BigNumber.from(value).toTwos(size);return(0,lib$1.zeroPad)(value,size/8)}match=type.match(regexBytes);if(match){var size=parseInt(match[1]);if(String(size)!==match[1]||size===0||size>32){logger.throwArgumentError("invalid bytes type","type",type)}if((0,lib$1.arrayify)(value).byteLength!==size){logger.throwArgumentError("invalid value for "+type,"value",value)}if(isArray){return(0,lib$1.arrayify)((value+Zeros).substring(0,66))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){var baseType_1=match[1];var count=parseInt(match[2]||String(value.length));if(count!=value.length){logger.throwArgumentError("invalid array length for "+type,"value",value)}var result_1=[];value.forEach(function(value){result_1.push(_pack(baseType_1,value,true))});return(0,lib$1.concat)(result_1)}return logger.throwArgumentError("invalid type","type",type)}function pack(types,values){if(types.length!=values.length){logger.throwArgumentError("wrong number of values; expected ${ types.length }","values",values)}var tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return(0,lib$1.hexlify)((0,lib$1.concat)(tight))}exports.pack=pack;function keccak256(types,values){return(0,lib$4.keccak256)(pack(types,values))}exports.keccak256=keccak256;function sha256(types,values){return(0,lib$h.sha256)(pack(types,values))}exports.sha256=sha256});var index$s=getDefaultExportFromCjs(lib$s);var _version$M=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="units/5.6.1"});var _version$N=getDefaultExportFromCjs(_version$M);var lib$t=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.parseEther=exports.formatEther=exports.parseUnits=exports.formatUnits=exports.commify=void 0;var logger=new lib.Logger(_version$M.version);var names=["wei","kwei","mwei","gwei","szabo","finney","ether"];function commify(value){var comps=String(value).split(".");if(comps.length>2||!comps[0].match(/^-?[0-9]*$/)||comps[1]&&!comps[1].match(/^[0-9]*$/)||value==="."||value==="-."){logger.throwArgumentError("invalid value","value",value)}var whole=comps[0];var negative="";if(whole.substring(0,1)==="-"){negative="-";whole=whole.substring(1)}while(whole.substring(0,1)==="0"){whole=whole.substring(1)}if(whole===""){whole="0"}var suffix="";if(comps.length===2){suffix="."+(comps[1]||"0")}while(suffix.length>2&&suffix[suffix.length-1]==="0"){suffix=suffix.substring(0,suffix.length-1)}var formatted=[];while(whole.length){if(whole.length<=3){formatted.unshift(whole);break}else{var index=whole.length-3;formatted.unshift(whole.substring(index));whole=whole.substring(0,index)}}return negative+formatted.join(",")+suffix}exports.commify=commify;function formatUnits(value,unitName){if(typeof unitName==="string"){var index=names.indexOf(unitName);if(index!==-1){unitName=3*index}}return(0,lib$2.formatFixed)(value,unitName!=null?unitName:18)}exports.formatUnits=formatUnits;function parseUnits(value,unitName){if(typeof value!=="string"){logger.throwArgumentError("value must be a string","value",value)}if(typeof unitName==="string"){var index=names.indexOf(unitName);if(index!==-1){unitName=3*index}}return(0,lib$2.parseFixed)(value,unitName!=null?unitName:18)}exports.parseUnits=parseUnits;function formatEther(wei){return formatUnits(wei,18)}exports.formatEther=formatEther;function parseEther(ether){return parseUnits(ether,18)}exports.parseEther=parseEther});var index$t=getDefaultExportFromCjs(lib$t);var utils$3=createCommonjsModule(function(module,exports){"use strict";var __createBinding=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(o,m,k,k2){if(k2===undefined)k2=k;Object.defineProperty(o,k2,{enumerable:true,get:function(){return m[k]}})}:function(o,m,k,k2){if(k2===undefined)k2=k;o[k2]=m[k]});var __setModuleDefault=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:true,value:v})}:function(o,v){o["default"]=v});var __importStar=commonjsGlobal&&commonjsGlobal.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)if(k!=="default"&&Object.prototype.hasOwnProperty.call(mod,k))__createBinding(result,mod,k);__setModuleDefault(result,mod);return result};Object.defineProperty(exports,"__esModule",{value:true});exports.formatBytes32String=exports.Utf8ErrorFuncs=exports.toUtf8String=exports.toUtf8CodePoints=exports.toUtf8Bytes=exports._toEscapedUtf8String=exports.nameprep=exports.hexDataSlice=exports.hexDataLength=exports.hexZeroPad=exports.hexValue=exports.hexStripZeros=exports.hexConcat=exports.isHexString=exports.hexlify=exports.base64=exports.base58=exports.TransactionDescription=exports.LogDescription=exports.Interface=exports.SigningKey=exports.HDNode=exports.defaultPath=exports.isBytesLike=exports.isBytes=exports.zeroPad=exports.stripZeros=exports.concat=exports.arrayify=exports.shallowCopy=exports.resolveProperties=exports.getStatic=exports.defineReadOnly=exports.deepCopy=exports.checkProperties=exports.poll=exports.fetchJson=exports._fetchData=exports.RLP=exports.Logger=exports.checkResultErrors=exports.FormatTypes=exports.ParamType=exports.FunctionFragment=exports.EventFragment=exports.ErrorFragment=exports.ConstructorFragment=exports.Fragment=exports.defaultAbiCoder=exports.AbiCoder=void 0;exports.Indexed=exports.Utf8ErrorReason=exports.UnicodeNormalizationForm=exports.SupportedAlgorithm=exports.mnemonicToSeed=exports.isValidMnemonic=exports.entropyToMnemonic=exports.mnemonicToEntropy=exports.getAccountPath=exports.verifyTypedData=exports.verifyMessage=exports.recoverPublicKey=exports.computePublicKey=exports.recoverAddress=exports.computeAddress=exports.getJsonWalletAddress=exports.TransactionTypes=exports.serializeTransaction=exports.parseTransaction=exports.accessListify=exports.joinSignature=exports.splitSignature=exports.soliditySha256=exports.solidityKeccak256=exports.solidityPack=exports.shuffled=exports.randomBytes=exports.sha512=exports.sha256=exports.ripemd160=exports.keccak256=exports.computeHmac=exports.commify=exports.parseUnits=exports.formatUnits=exports.parseEther=exports.formatEther=exports.isAddress=exports.getCreate2Address=exports.getContractAddress=exports.getIcapAddress=exports.getAddress=exports._TypedDataEncoder=exports.id=exports.isValidName=exports.namehash=exports.hashMessage=exports.dnsEncode=exports.parseBytes32String=void 0;Object.defineProperty(exports,"AbiCoder",{enumerable:true,get:function(){return lib$a.AbiCoder}});Object.defineProperty(exports,"checkResultErrors",{enumerable:true,get:function(){return lib$a.checkResultErrors}});Object.defineProperty(exports,"ConstructorFragment",{enumerable:true,get:function(){return lib$a.ConstructorFragment}});Object.defineProperty(exports,"defaultAbiCoder",{enumerable:true,get:function(){return lib$a.defaultAbiCoder}});Object.defineProperty(exports,"ErrorFragment",{enumerable:true,get:function(){return lib$a.ErrorFragment}});Object.defineProperty(exports,"EventFragment",{enumerable:true,get:function(){return lib$a.EventFragment}});Object.defineProperty(exports,"FormatTypes",{enumerable:true,get:function(){return lib$a.FormatTypes}});Object.defineProperty(exports,"Fragment",{enumerable:true,get:function(){return lib$a.Fragment}});Object.defineProperty(exports,"FunctionFragment",{enumerable:true,get:function(){return lib$a.FunctionFragment}});Object.defineProperty(exports,"Indexed",{enumerable:true,get:function(){return lib$a.Indexed}});Object.defineProperty(exports,"Interface",{enumerable:true,get:function(){return lib$a.Interface}});Object.defineProperty(exports,"LogDescription",{enumerable:true,get:function(){return lib$a.LogDescription}});Object.defineProperty(exports,"ParamType",{enumerable:true,get:function(){return lib$a.ParamType}});Object.defineProperty(exports,"TransactionDescription",{enumerable:true,get:function(){return lib$a.TransactionDescription}});Object.defineProperty(exports,"getAddress",{enumerable:true,get:function(){return lib$6.getAddress}});Object.defineProperty(exports,"getCreate2Address",{enumerable:true,get:function(){return lib$6.getCreate2Address}});Object.defineProperty(exports,"getContractAddress",{enumerable:true,get:function(){return lib$6.getContractAddress}});Object.defineProperty(exports,"getIcapAddress",{enumerable:true,get:function(){return lib$6.getIcapAddress}});Object.defineProperty(exports,"isAddress",{enumerable:true,get:function(){return lib$6.isAddress}});var base64=__importStar(lib$p);exports.base64=base64;Object.defineProperty(exports,"base58",{enumerable:true,get:function(){return lib$g.Base58}});Object.defineProperty(exports,"arrayify",{enumerable:true,get:function(){return lib$1.arrayify}});Object.defineProperty(exports,"concat",{enumerable:true,get:function(){return lib$1.concat}});Object.defineProperty(exports,"hexConcat",{enumerable:true,get:function(){return lib$1.hexConcat}});Object.defineProperty(exports,"hexDataSlice",{enumerable:true,get:function(){return lib$1.hexDataSlice}});Object.defineProperty(exports,"hexDataLength",{enumerable:true,get:function(){return lib$1.hexDataLength}});Object.defineProperty(exports,"hexlify",{enumerable:true,get:function(){return lib$1.hexlify}});Object.defineProperty(exports,"hexStripZeros",{enumerable:true,get:function(){return lib$1.hexStripZeros}});Object.defineProperty(exports,"hexValue",{enumerable:true,get:function(){return lib$1.hexValue}});Object.defineProperty(exports,"hexZeroPad",{enumerable:true,get:function(){return lib$1.hexZeroPad}});Object.defineProperty(exports,"isBytes",{enumerable:true,get:function(){return lib$1.isBytes}});Object.defineProperty(exports,"isBytesLike",{enumerable:true,get:function(){return lib$1.isBytesLike}});Object.defineProperty(exports,"isHexString",{enumerable:true,get:function(){return lib$1.isHexString}});Object.defineProperty(exports,"joinSignature",{enumerable:true,get:function(){return lib$1.joinSignature}});Object.defineProperty(exports,"zeroPad",{enumerable:true,get:function(){return lib$1.zeroPad}});Object.defineProperty(exports,"splitSignature",{enumerable:true,get:function(){return lib$1.splitSignature}});Object.defineProperty(exports,"stripZeros",{enumerable:true,get:function(){return lib$1.stripZeros}});Object.defineProperty(exports,"_TypedDataEncoder",{enumerable:true,get:function(){return lib$9._TypedDataEncoder}});Object.defineProperty(exports,"dnsEncode",{enumerable:true,get:function(){return lib$9.dnsEncode}});Object.defineProperty(exports,"hashMessage",{enumerable:true,get:function(){return lib$9.hashMessage}});Object.defineProperty(exports,"id",{enumerable:true,get:function(){return lib$9.id}});Object.defineProperty(exports,"isValidName",{enumerable:true,get:function(){return lib$9.isValidName}});Object.defineProperty(exports,"namehash",{enumerable:true,get:function(){return lib$9.namehash}});Object.defineProperty(exports,"defaultPath",{enumerable:true,get:function(){return lib$k.defaultPath}});Object.defineProperty(exports,"entropyToMnemonic",{enumerable:true,get:function(){return lib$k.entropyToMnemonic}});Object.defineProperty(exports,"getAccountPath",{enumerable:true,get:function(){return lib$k.getAccountPath}});Object.defineProperty(exports,"HDNode",{enumerable:true,get:function(){return lib$k.HDNode}});Object.defineProperty(exports,"isValidMnemonic",{enumerable:true,get:function(){return lib$k.isValidMnemonic}});Object.defineProperty(exports,"mnemonicToEntropy",{enumerable:true,get:function(){return lib$k.mnemonicToEntropy}});Object.defineProperty(exports,"mnemonicToSeed",{enumerable:true,get:function(){return lib$k.mnemonicToSeed}});Object.defineProperty(exports,"getJsonWalletAddress",{enumerable:true,get:function(){return lib$m.getJsonWalletAddress}});Object.defineProperty(exports,"keccak256",{enumerable:true,get:function(){return lib$4.keccak256}});Object.defineProperty(exports,"Logger",{enumerable:true,get:function(){return lib.Logger}});Object.defineProperty(exports,"computeHmac",{enumerable:true,get:function(){return lib$h.computeHmac}});Object.defineProperty(exports,"ripemd160",{enumerable:true,get:function(){return lib$h.ripemd160}});Object.defineProperty(exports,"sha256",{enumerable:true,get:function(){return lib$h.sha256}});Object.defineProperty(exports,"sha512",{enumerable:true,get:function(){return lib$h.sha512}});Object.defineProperty(exports,"solidityKeccak256",{enumerable:true,get:function(){return lib$s.keccak256}});Object.defineProperty(exports,"solidityPack",{enumerable:true,get:function(){return lib$s.pack}});Object.defineProperty(exports,"soliditySha256",{enumerable:true,get:function(){return lib$s.sha256}});Object.defineProperty(exports,"randomBytes",{enumerable:true,get:function(){return lib$l.randomBytes}});Object.defineProperty(exports,"shuffled",{enumerable:true,get:function(){return lib$l.shuffled}});Object.defineProperty(exports,"checkProperties",{enumerable:true,get:function(){return lib$3.checkProperties}});Object.defineProperty(exports,"deepCopy",{enumerable:true,get:function(){return lib$3.deepCopy}});Object.defineProperty(exports,"defineReadOnly",{enumerable:true,get:function(){return lib$3.defineReadOnly}});Object.defineProperty(exports,"getStatic",{enumerable:true,get:function(){return lib$3.getStatic}});Object.defineProperty(exports,"resolveProperties",{enumerable:true,get:function(){return lib$3.resolveProperties}});Object.defineProperty(exports,"shallowCopy",{enumerable:true,get:function(){return lib$3.shallowCopy}});var RLP=__importStar(lib$5);exports.RLP=RLP;Object.defineProperty(exports,"computePublicKey",{enumerable:true,get:function(){return lib$d.computePublicKey}});Object.defineProperty(exports,"recoverPublicKey",{enumerable:true,get:function(){return lib$d.recoverPublicKey}});Object.defineProperty(exports,"SigningKey",{enumerable:true,get:function(){return lib$d.SigningKey}});Object.defineProperty(exports,"formatBytes32String",{enumerable:true,get:function(){return lib$8.formatBytes32String}});Object.defineProperty(exports,"nameprep",{enumerable:true,get:function(){return lib$8.nameprep}});Object.defineProperty(exports,"parseBytes32String",{enumerable:true,get:function(){return lib$8.parseBytes32String}});Object.defineProperty(exports,"_toEscapedUtf8String",{enumerable:true,get:function(){return lib$8._toEscapedUtf8String}});Object.defineProperty(exports,"toUtf8Bytes",{enumerable:true,get:function(){return lib$8.toUtf8Bytes}});Object.defineProperty(exports,"toUtf8CodePoints",{enumerable:true,get:function(){return lib$8.toUtf8CodePoints}});Object.defineProperty(exports,"toUtf8String",{enumerable:true,get:function(){return lib$8.toUtf8String}});Object.defineProperty(exports,"Utf8ErrorFuncs",{enumerable:true,get:function(){return lib$8.Utf8ErrorFuncs}});Object.defineProperty(exports,"accessListify",{enumerable:true,get:function(){return lib$e.accessListify}});Object.defineProperty(exports,"computeAddress",{enumerable:true,get:function(){return lib$e.computeAddress}});Object.defineProperty(exports,"parseTransaction",{enumerable:true,get:function(){return lib$e.parse}});Object.defineProperty(exports,"recoverAddress",{enumerable:true,get:function(){return lib$e.recoverAddress}});Object.defineProperty(exports,"serializeTransaction",{enumerable:true,get:function(){return lib$e.serialize}});Object.defineProperty(exports,"TransactionTypes",{enumerable:true,get:function(){return lib$e.TransactionTypes}});Object.defineProperty(exports,"commify",{enumerable:true,get:function(){return lib$t.commify}});Object.defineProperty(exports,"formatEther",{enumerable:true,get:function(){return lib$t.formatEther}});Object.defineProperty(exports,"parseEther",{enumerable:true,get:function(){return lib$t.parseEther}});Object.defineProperty(exports,"formatUnits",{enumerable:true,get:function(){return lib$t.formatUnits}});Object.defineProperty(exports,"parseUnits",{enumerable:true,get:function(){return lib$t.parseUnits}});Object.defineProperty(exports,"verifyMessage",{enumerable:true,get:function(){return lib$n.verifyMessage}});Object.defineProperty(exports,"verifyTypedData",{enumerable:true,get:function(){return lib$n.verifyTypedData}});Object.defineProperty(exports,"_fetchData",{enumerable:true,get:function(){return lib$q._fetchData}});Object.defineProperty(exports,"fetchJson",{enumerable:true,get:function(){return lib$q.fetchJson}});Object.defineProperty(exports,"poll",{enumerable:true,get:function(){return lib$q.poll}});var sha2_2=lib$h;Object.defineProperty(exports,"SupportedAlgorithm",{enumerable:true,get:function(){return sha2_2.SupportedAlgorithm}});var strings_2=lib$8;Object.defineProperty(exports,"UnicodeNormalizationForm",{enumerable:true,get:function(){return strings_2.UnicodeNormalizationForm}});Object.defineProperty(exports,"Utf8ErrorReason",{enumerable:true,get:function(){return strings_2.Utf8ErrorReason}})});var utils$4=getDefaultExportFromCjs(utils$3);var _version$O=createCommonjsModule(function(module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;exports.version="ethers/5.6.9"});var _version$P=getDefaultExportFromCjs(_version$O);var ethers=createCommonjsModule(function(module,exports){"use strict";var __createBinding=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(o,m,k,k2){if(k2===undefined)k2=k;Object.defineProperty(o,k2,{enumerable:true,get:function(){return m[k]}})}:function(o,m,k,k2){if(k2===undefined)k2=k;o[k2]=m[k]});var __setModuleDefault=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:true,value:v})}:function(o,v){o["default"]=v});var __importStar=commonjsGlobal&&commonjsGlobal.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)if(k!=="default"&&Object.prototype.hasOwnProperty.call(mod,k))__createBinding(result,mod,k);__setModuleDefault(result,mod);return result};Object.defineProperty(exports,"__esModule",{value:true});exports.Wordlist=exports.version=exports.wordlists=exports.utils=exports.logger=exports.errors=exports.constants=exports.FixedNumber=exports.BigNumber=exports.ContractFactory=exports.Contract=exports.BaseContract=exports.providers=exports.getDefaultProvider=exports.VoidSigner=exports.Wallet=exports.Signer=void 0;Object.defineProperty(exports,"BaseContract",{enumerable:true,get:function(){return lib$f.BaseContract}});Object.defineProperty(exports,"Contract",{enumerable:true,get:function(){return lib$f.Contract}});Object.defineProperty(exports,"ContractFactory",{enumerable:true,get:function(){return lib$f.ContractFactory}});Object.defineProperty(exports,"BigNumber",{enumerable:true,get:function(){return lib$2.BigNumber}});Object.defineProperty(exports,"FixedNumber",{enumerable:true,get:function(){return lib$2.FixedNumber}});Object.defineProperty(exports,"Signer",{enumerable:true,get:function(){return lib$c.Signer}});Object.defineProperty(exports,"VoidSigner",{enumerable:true,get:function(){return lib$c.VoidSigner}});Object.defineProperty(exports,"Wallet",{enumerable:true,get:function(){return lib$n.Wallet}});var constants=__importStar(lib$7);exports.constants=constants;var providers=__importStar(lib$r);exports.providers=providers;var providers_1=lib$r;Object.defineProperty(exports,"getDefaultProvider",{enumerable:true,get:function(){return providers_1.getDefaultProvider}});Object.defineProperty(exports,"Wordlist",{enumerable:true,get:function(){return lib$j.Wordlist}});Object.defineProperty(exports,"wordlists",{enumerable:true,get:function(){return lib$j.wordlists}});var utils=__importStar(utils$3);exports.utils=utils;Object.defineProperty(exports,"errors",{enumerable:true,get:function(){return lib.ErrorCode}});Object.defineProperty(exports,"version",{enumerable:true,get:function(){return _version$O.version}});var logger=new lib.Logger(_version$O.version);exports.logger=logger});var ethers$1=getDefaultExportFromCjs(ethers);var lib$u=createCommonjsModule(function(module,exports){"use strict";var __createBinding=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(o,m,k,k2){if(k2===undefined)k2=k;Object.defineProperty(o,k2,{enumerable:true,get:function(){return m[k]}})}:function(o,m,k,k2){if(k2===undefined)k2=k;o[k2]=m[k]});var __setModuleDefault=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:true,value:v})}:function(o,v){o["default"]=v});var __importStar=commonjsGlobal&&commonjsGlobal.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)if(k!=="default"&&Object.prototype.hasOwnProperty.call(mod,k))__createBinding(result,mod,k);__setModuleDefault(result,mod);return result};Object.defineProperty(exports,"__esModule",{value:true});exports.Wordlist=exports.version=exports.wordlists=exports.utils=exports.logger=exports.errors=exports.constants=exports.FixedNumber=exports.BigNumber=exports.ContractFactory=exports.Contract=exports.BaseContract=exports.providers=exports.getDefaultProvider=exports.VoidSigner=exports.Wallet=exports.Signer=exports.ethers=void 0;var ethers$1=__importStar(ethers);exports.ethers=ethers$1;try{var anyGlobal=window;if(anyGlobal._ethers==null){anyGlobal._ethers=ethers$1}}catch(error){}var ethers_1=ethers;Object.defineProperty(exports,"Signer",{enumerable:true,get:function(){return ethers_1.Signer}});Object.defineProperty(exports,"Wallet",{enumerable:true,get:function(){return ethers_1.Wallet}});Object.defineProperty(exports,"VoidSigner",{enumerable:true,get:function(){return ethers_1.VoidSigner}});Object.defineProperty(exports,"getDefaultProvider",{enumerable:true,get:function(){return ethers_1.getDefaultProvider}});Object.defineProperty(exports,"providers",{enumerable:true,get:function(){return ethers_1.providers}});Object.defineProperty(exports,"BaseContract",{enumerable:true,get:function(){return ethers_1.BaseContract}});Object.defineProperty(exports,"Contract",{enumerable:true,get:function(){return ethers_1.Contract}});Object.defineProperty(exports,"ContractFactory",{enumerable:true,get:function(){return ethers_1.ContractFactory}});Object.defineProperty(exports,"BigNumber",{enumerable:true,get:function(){return ethers_1.BigNumber}});Object.defineProperty(exports,"FixedNumber",{enumerable:true,get:function(){return ethers_1.FixedNumber}});Object.defineProperty(exports,"constants",{enumerable:true,get:function(){return ethers_1.constants}});Object.defineProperty(exports,"errors",{enumerable:true,get:function(){return ethers_1.errors}});Object.defineProperty(exports,"logger",{enumerable:true,get:function(){return ethers_1.logger}});Object.defineProperty(exports,"utils",{enumerable:true,get:function(){return ethers_1.utils}});Object.defineProperty(exports,"wordlists",{enumerable:true,get:function(){return ethers_1.wordlists}});Object.defineProperty(exports,"version",{enumerable:true,get:function(){return ethers_1.version}});Object.defineProperty(exports,"Wordlist",{enumerable:true,get:function(){return ethers_1.Wordlist}})});var index$u=getDefaultExportFromCjs(lib$u);return index$u}); diff --git a/scripts/floBlockchainAPI.js b/scripts/floBlockchainAPI.js index 4cc37ac..03cfa39 100644 --- a/scripts/floBlockchainAPI.js +++ b/scripts/floBlockchainAPI.js @@ -3,6 +3,9 @@ 'use strict'; const floBlockchainAPI = EXPORTS; + + + const DEFAULT = { blockchain: floGlobals.blockchain, apiURL: { @@ -152,6 +155,10 @@ }); } + + + + function getScriptPubKey(address) { var tx = bitjs.transaction(); tx.addoutput(address, 0); diff --git a/scripts/floCloudAPI.js b/scripts/floCloudAPI.js index 2b66cc6..60aa6f7 100644 --- a/scripts/floCloudAPI.js +++ b/scripts/floCloudAPI.js @@ -309,6 +309,7 @@ const _liveRequest = {}; function liveRequest(floID, request, callback) { + const filterData = typeof request.status !== 'undefined' ? data => { if (request.status) diff --git a/scripts/floEthereum.js b/scripts/floEthereum.js new file mode 100644 index 0000000..7a211e8 --- /dev/null +++ b/scripts/floEthereum.js @@ -0,0 +1,57 @@ +(function (EXPORTS) { //floEthereum v1.0.1a + /* FLO Ethereum Operators */ + /* Make sure you added Taproot, Keccak, FLO and BTC Libraries before */ + 'use strict'; + const floEthereum = EXPORTS; + + const ethAddressFromPrivateKey = floEthereum.ethAddressFromPrivateKey = function (privateKey, onlyEvenY = false) { + var t1, t1_x, t1_y, t1_y_BigInt, t2, t3, t4; + var groupOrder = BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"); + + t1 = bitjs.newPubkey(privateKey); + t1_x = t1.slice(2, 66); t1_y = t1.slice(-64); + if (onlyEvenY) { + t1_y_BigInt = BigInt("0x" + t1_y); + if (t1_y_BigInt % 2n !== 0n) { t1_y_BigInt = (groupOrder - t1_y_BigInt) % groupOrder; t1_y = t1_y_BigInt.toString(16) } + }; + + t2 = t1_x.toString(16) + t1_y.toString(16); + t3 = keccak.keccak_256(Crypto.util.hexToBytes(t2)); + t4 = keccak.extractLast20Bytes(t3); + return "0x" + t4; + } + + const ethAddressFromCompressedPublicKey = floEthereum.ethAddressFromCompressedPublicKey = function (compressedPublicKey) { + var t1, t2, t3, t4; + t1 = coinjs.compressedToUncompressed(compressedPublicKey); + t2 = t1.slice(2); + t3 = keccak.keccak_256(Crypto.util.hexToBytes(t2)); + t4 = keccak.extractLast20Bytes(t3); + return "0x" + t4; + } + + const ethPrivateKeyFromUntweakedPrivateKey = floEthereum.ethPrivateKeyFromUntweakedPrivateKey = function (untweakedPrivateKey) { + var t1; + t1 = hex.encode(taproot.taprootTweakPrivKey(hex.decode(untweakedPrivateKey))); + return t1; + } + + const ethAddressFromUntweakedPrivateKey = floEthereum.ethAddressFromUntweakedPrivateKey = function (untweakedPrivateKey) { + var t1, t2; + t1 = hex.encode(taproot.taprootTweakPrivKey(hex.decode(untweakedPrivateKey))); + t2 = ethAddressFromPrivateKey(t1); + return t2; + } + + const ethAddressFromTaprootAddress = floEthereum.ethAddressFromTaprootAddress = function (taprootAddress) { + var t1, t2, t3, t4; + t1 = coinjs.addressDecode(taprootAddress); + t2 = t1.outstring.slice(4); + t3 = "02" + t2; + t4 = ethAddressFromCompressedPublicKey(t3); + return t4; + } + + + +})('object' === typeof module ? module.exports : window.floEthereum = {}); \ No newline at end of file diff --git a/scripts/floEthereum.min.js b/scripts/floEthereum.min.js new file mode 100644 index 0000000..9bb95f0 --- /dev/null +++ b/scripts/floEthereum.min.js @@ -0,0 +1,2 @@ + +!function(EXPORTS){"use strict";const floEthereum="object"===typeof module?module.exports:window.floEthereum={},ethAddressFromPrivateKey=floEthereum.ethAddressFromPrivateKey=function(privateKey,onlyEvenY=!1){var t1,t1_x,t1_y,t1_y_BigInt,t2,t3,groupOrder=BigInt("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F");return t1_x=(t1=bitjs.newPubkey(privateKey)).slice(2,66),t1_y=t1.slice(-64),onlyEvenY&&(t1_y_BigInt=BigInt("0x"+t1_y))%2n!==0n&&(t1_y=(t1_y_BigInt=(groupOrder-t1_y_BigInt)%groupOrder).toString(16)),t2=t1_x.toString(16)+t1_y.toString(16),t3=keccak.keccak_256(Crypto.util.hexToBytes(t2)),"0x"+keccak.extractLast20Bytes(t3)},ethAddressFromCompressedPublicKey=floEthereum.ethAddressFromCompressedPublicKey=function(compressedPublicKey){var t2,t3;return t2=coinjs.compressedToUncompressed(compressedPublicKey).slice(2),t3=keccak.keccak_256(Crypto.util.hexToBytes(t2)),"0x"+keccak.extractLast20Bytes(t3)};floEthereum.ethPrivateKeyFromUntweakedPrivateKey=function(untweakedPrivateKey){return hex.encode(taproot.taprootTweakPrivKey(hex.decode(untweakedPrivateKey)))},floEthereum.ethAddressFromUntweakedPrivateKey=function(untweakedPrivateKey){var t1;return t1=hex.encode(taproot.taprootTweakPrivKey(hex.decode(untweakedPrivateKey))),ethAddressFromPrivateKey(t1)},floEthereum.ethAddressFromTaprootAddress=function(taprootAddress){var t2;return t2=coinjs.addressDecode(taprootAddress).outstring.slice(4),ethAddressFromCompressedPublicKey("02"+t2)}}(); diff --git a/scripts/floTokenAPI.js b/scripts/floTokenAPI.js index bb803fd..3306204 100644 --- a/scripts/floTokenAPI.js +++ b/scripts/floTokenAPI.js @@ -66,17 +66,49 @@ }); } + // const getBalance = tokenAPI.getBalance = function (floID, token = DEFAULT.currency) { + // return new Promise((resolve, reject) => { + // fetch_api(`api/v2/floAddressInfo/${floID}`).then(result => { + // let token_balance = 0 + // if(result.floAddressBalances != null && typeof result.floAddressBalances == "object" && token in result.floAddressBalances){ + // token_balance = result.floAddressBalances[token]["balance"] || 0 + // } + // resolve(token_balance) + // }).catch(error => reject(error)) + // }) + // } + const getBalance = tokenAPI.getBalance = function (floID, token = DEFAULT.currency) { return new Promise((resolve, reject) => { - fetch_api(`api/v2/floAddressInfo/${floID}`).then(result => { - let token_balance = 0 - if(result.floAddressBalances != null && typeof result.floAddressBalances == "object" && token in result.floAddressBalances){ - token_balance = result.floAddressBalances[token]["balance"] || 0 + // Fetch the default currency balance + fetch_api(`api/v2/floAddressInfo/${floID}`) + .then(result => { + let tokenBalance = 0; + let usdtBalance = 0; + + // Check if the result contains token balances + if (result.floAddressBalances != null && typeof result.floAddressBalances == "object") { + // Get the balance for the default token + if (token in result.floAddressBalances) { + tokenBalance = result.floAddressBalances[token]["balance"] || 0; } - resolve(token_balance) - }).catch(error => reject(error)) - }) - } + + // Get the balance for USDT if available + if ("usdt" in result.floAddressBalances) { + usdtBalance = result.floAddressBalances["usdt"]["balance"] || 0; + } + } + + // Resolve both balances as an object + resolve({ + [token]: tokenBalance, + usdt: usdtBalance + }); + }) + .catch(error => reject(error)); + }); + }; + tokenAPI.getTx = function (txID) { return new Promise((resolve, reject) => { @@ -182,16 +214,16 @@ const util = tokenAPI.util = {}; - util.parseTxData = function (txData) { + util.parseTxData = function (txData) { let parsedData = {}; for (let p in txData.parsedFloData) parsedData[p] = txData.parsedFloData[p]; - parsedData.sender = txData.vin[0].addresses[0]; - for (let vout of txData.vout) + parsedData.sender = txData.transactionDetails?.vin[0].addr; + for (let vout of txData.transactionDetails?.vout ?? []) if (vout.scriptPubKey.addresses[0] !== parsedData.sender) parsedData.receiver = vout.scriptPubKey.addresses[0]; - parsedData.time = txData.time; + parsedData.time = txData.transactionDetails?.time??''; return parsedData; } -})('object' === typeof module ? module.exports : window.floTokenAPI = {}); +})('object' === typeof module ? module.exports : window.floTokenAPI = {}); \ No newline at end of file diff --git a/scripts/floTokenAPI.min.js b/scripts/floTokenAPI.min.js index a50b5e5..e48b82d 100644 --- a/scripts/floTokenAPI.min.js +++ b/scripts/floTokenAPI.min.js @@ -1 +1,2 @@ -!function(EXPORTS){"use strict";const tokenAPI="object"===typeof module?module.exports:window.floTokenAPI={},DEFAULT={apiURL:[floGlobals.tokenURL||"https://ranchimallflo.ranchimall.net/"],currency:floGlobals.currency||"rupee"},torExitNodes=new Set(["185.241.208.232","194.26.192.64","171.25.193.25","80.67.167.81","192.42.116.187","198.98.51.189","89.58.26.216","109.70.100.4","149.56.22.133","5.45.102.93","178.17.174.14","192.42.116.196","185.220.101.4","45.141.215.62","94.102.51.15","192.42.116.213","107.189.28.166","185.241.208.243","45.141.215.80","193.26.115.61","192.42.116.175","149.56.44.47","107.189.13.91","87.118.116.103","178.17.171.102","185.243.218.110","192.42.116.208","89.58.41.156","2.58.56.43","104.192.1.138","45.95.169.184","107.189.8.56","176.58.121.177","185.220.101.31","45.141.215.200","109.70.100.1","185.244.192.175","185.129.61.2","144.172.118.41","192.42.116.184","45.151.167.10","185.220.101.27","91.203.144.194","45.141.215.88","179.43.182.232","185.220.101.5","109.70.100.2","107.189.14.4","94.16.116.81","185.220.101.8","185.220.101.12","88.80.20.86","23.154.177.15","45.141.215.56","5.42.66.6","23.129.64.225","104.244.75.74","45.95.169.228","37.187.5.192","45.141.215.169","109.70.100.66","45.79.144.222","185.227.68.78","179.43.159.199","2.57.122.246","192.42.116.201","185.220.102.248","195.176.3.23","45.138.16.42","216.73.159.75","185.165.169.239","23.129.64.213","109.70.100.6","45.80.158.27","45.138.16.240","178.20.55.16","192.42.116.173","51.15.249.160","192.42.116.200","185.220.102.254","45.141.215.63","193.218.118.151","192.42.116.211","185.100.85.24","185.195.71.12","107.189.8.181","193.189.100.199","109.70.100.69","185.100.87.250","31.220.93.201","89.236.112.100","45.141.215.90","185.35.202.222","109.70.100.65","95.142.161.63","192.42.116.181","192.42.116.23","194.26.192.77","193.189.100.198","180.150.226.99","23.129.64.227","107.189.4.23","45.141.215.235","185.220.102.252","109.70.100.67","185.220.100.255","185.220.101.21","185.100.85.22","128.31.0.13","46.182.21.248","192.42.116.174","185.241.208.115","185.220.101.1","192.42.116.202","45.141.215.97","185.243.218.204","78.142.18.219","192.42.116.192","190.120.229.98","192.42.116.177","45.138.16.113","192.42.116.212","185.220.101.3","45.138.16.222","5.42.80.232","87.118.122.51","107.189.11.166","185.220.102.245","185.220.102.251","46.182.21.250","5.255.103.235","185.243.218.89","185.193.52.180","185.220.101.24","2.57.122.215","45.15.157.177","185.220.100.253","37.48.120.64","204.8.156.142","192.42.116.179","185.220.100.240","185.241.208.236","185.195.71.244","193.105.134.155","51.15.59.15","185.100.85.23","45.151.167.11","82.197.182.161","192.42.116.191","27.255.75.198","171.25.193.79","45.95.169.255","45.138.16.230","107.189.29.103","163.172.213.212","95.143.193.125","23.154.177.7","185.220.101.23","195.176.3.24","107.189.1.9","192.42.116.182","23.137.249.240","192.42.116.189","23.129.64.146","45.138.16.107","107.189.5.121","107.189.30.236","94.16.121.91","109.70.100.70","185.254.196.141","194.15.112.133","192.42.116.180","173.249.57.253","185.220.102.250","185.100.85.25","185.220.101.13","185.220.101.25","192.42.116.199","23.154.177.2","107.189.31.232","45.141.215.81","192.42.116.220","185.67.82.114","45.141.215.114","185.243.218.61","107.189.13.184","107.189.10.141","104.244.79.61","185.106.94.195","176.126.253.190","23.154.177.22","192.42.116.210","185.220.102.249","23.184.48.127","192.42.116.218","91.208.75.4","192.42.116.178","178.175.148.209","208.109.36.224","23.137.251.61","94.142.241.194","162.251.5.152","23.154.177.4","45.138.16.76","45.9.150.103","213.252.140.118","185.243.218.95","45.134.225.36","109.70.100.5","185.243.218.202","185.220.101.19","192.42.116.176","109.70.100.71","45.151.167.13","185.220.102.4","185.220.102.7","104.244.79.50","178.17.174.198","199.195.249.214","66.146.193.33","107.189.8.238","139.99.8.57","45.141.215.95","192.42.116.219","114.199.75.111","185.220.100.242","5.42.80.234","173.237.206.68","139.99.172.11","23.129.64.143","80.241.60.207","192.42.116.194","45.95.169.226","185.220.102.8","109.70.100.3","179.43.159.200","192.42.116.217","185.220.101.6","198.98.50.199","185.100.87.192","193.189.100.202","163.172.45.102","185.220.101.0","107.189.8.133","185.129.61.6","104.244.78.233","192.42.116.15","192.42.116.195","45.141.215.110","193.189.100.203","77.48.28.237","104.244.79.232","193.26.115.43","199.195.250.165","190.211.254.97","45.141.215.61","185.220.101.17","192.42.116.203","185.220.102.247","91.132.144.59","185.141.147.129","23.129.64.149","185.183.157.214","95.211.244.28","192.42.116.188","188.214.104.21","192.42.116.186","192.42.116.197","107.189.13.247","212.73.134.204","185.235.146.29","188.68.49.235","92.205.237.227","23.154.177.12","199.195.253.180","171.25.193.234","185.241.208.71","96.66.15.152","94.16.121.226","204.85.191.9","91.210.59.57","5.255.115.42","185.220.103.113","216.239.90.19","77.91.87.79","192.42.116.216","23.154.177.23","192.42.116.198","173.255.255.215","144.217.80.80","107.189.10.175","45.95.169.227","103.251.167.20","185.220.101.30","5.255.125.196","198.98.48.192","185.220.102.242","23.154.177.18","185.86.148.90","185.142.239.49","185.220.101.2","5.255.100.219","107.189.5.7","199.195.251.119","185.220.101.10","92.246.84.133","66.220.242.222","184.105.48.40","23.129.64.133","185.130.44.108","192.42.116.20","185.181.61.115","192.42.116.19","149.202.79.129","146.59.35.38","23.154.177.20","185.191.204.254","23.154.177.3","185.233.100.23","23.154.177.19","45.92.1.74","107.189.31.225","89.58.18.10","138.59.18.110","185.246.188.73","192.42.116.221","104.244.77.192","192.42.116.214","178.170.37.11","188.68.41.191","192.42.116.183","185.220.103.115","178.175.135.7","209.141.51.30","141.98.11.62","171.25.193.235","23.137.249.143","179.43.159.197","192.99.168.180","185.220.101.11","185.243.218.41","89.234.157.254","47.243.74.136","107.189.28.199","185.129.61.9","185.220.101.28","185.220.101.29","5.255.99.5","179.43.182.58","185.129.61.3","23.129.64.135","107.189.30.69","51.15.227.109","185.207.107.216","185.129.61.129","185.100.87.41","23.129.64.145","179.43.159.201","23.129.64.224","192.42.116.28","93.99.104.194","185.244.192.184","45.95.169.223","104.244.73.43","185.56.83.83","87.120.254.48","185.185.170.27","195.88.74.206","107.174.138.172","109.70.100.68","23.129.64.139","94.230.208.147","77.91.85.147","77.81.247.72","2.58.56.220","185.220.103.7","149.202.79.101","5.255.104.202","178.175.148.195","83.96.213.63","185.100.87.174","79.137.195.103","185.220.101.20","107.189.3.11","185.220.101.22","185.220.101.7","217.12.221.131","179.43.159.196","45.95.169.230","107.189.1.160","208.109.215.188","171.25.193.78","204.194.29.4","104.244.77.80","162.247.72.199","89.58.52.25","192.42.116.209","217.146.2.41","185.220.103.117","23.154.177.10","91.208.75.3","94.230.208.148","95.128.43.164","171.25.193.20","102.130.113.9","91.92.109.43","107.189.7.144","185.220.102.240","5.255.124.150","198.98.60.158","185.227.134.106","193.233.233.221","71.19.144.106","185.84.31.254","23.129.64.132","62.171.137.169","193.189.100.196","185.220.101.18","107.189.12.3","91.208.75.178","193.35.18.49","185.246.188.74","45.132.246.245","209.141.55.26","198.98.48.20","185.129.61.1","108.61.189.136","185.220.102.243","107.189.1.96","185.100.87.136","213.95.149.22","23.129.64.217","192.42.116.185","5.45.104.176","192.42.116.193","23.154.177.16","198.98.49.203","171.25.193.77","91.208.75.153","162.247.74.216","179.43.159.194","54.36.108.162","198.98.48.33","188.68.52.231","185.220.100.252","205.185.124.193","104.244.73.190","185.100.87.139","23.154.177.25","77.105.146.42","79.137.202.92","51.38.81.135","87.118.116.90","23.129.64.134","185.246.188.67","185.129.62.62","185.220.100.241","82.221.131.71","209.141.59.116","194.195.120.132","185.207.107.130","178.218.144.99","172.104.243.155","93.99.104.128","87.118.122.30","185.100.87.253","51.195.91.124","104.192.3.74","185.252.232.218","23.129.64.141","5.196.95.34","185.220.102.6","23.184.48.128","193.239.232.102","185.220.101.16","91.203.145.116","185.129.61.4","23.129.64.147","37.228.129.63","45.151.167.12","93.95.228.205","185.220.102.244","209.141.54.203","93.95.230.165","94.142.244.16","162.247.72.192","185.146.232.234","81.16.33.42","107.189.30.86","51.81.222.62","23.154.177.5","77.220.196.253","72.167.47.69","185.220.101.26","104.219.236.100","192.42.116.204","185.246.128.161","200.122.181.2","199.195.253.247","109.201.133.100","142.44.234.69","89.147.110.202","89.185.85.140","104.244.79.44","5.2.79.179","23.129.64.130","104.244.78.187","23.154.177.13","5.255.97.221","92.205.129.119","80.82.78.14","23.154.177.8","51.38.113.118","45.61.184.205","107.189.31.134","185.220.103.114","179.48.251.188","135.125.205.25","198.98.54.49","193.189.100.205","185.220.102.253","45.79.50.161","202.69.76.36","79.137.198.213","46.166.139.111","5.255.111.64","51.89.138.51","216.73.159.101","166.70.207.2","96.27.198.133","194.15.115.212","46.234.47.105","146.59.35.246","23.137.248.100","185.220.102.241","107.189.14.43","212.95.50.77","128.127.180.156","80.67.172.162","185.129.61.5","185.129.61.10","23.129.64.214","185.220.100.254","160.119.249.240","185.243.218.46","185.220.102.246","104.244.74.97","23.129.64.228","23.129.64.218","185.220.100.243","54.36.101.21","5.255.99.124","107.189.13.253","130.149.80.199","171.25.193.80","144.24.197.112","199.195.251.78","23.129.64.223","195.80.151.30","185.7.33.146","107.189.4.12","45.95.169.229","107.189.6.124","46.38.255.27","107.189.8.226","143.42.199.223","103.251.167.10","185.34.33.2","5.255.98.23","74.82.47.194","194.163.157.49","192.42.116.215","185.220.101.14","194.15.113.118","89.147.108.62","185.220.101.15","185.42.170.203","23.154.177.6","162.247.74.27","199.195.253.124","193.189.100.201","62.182.84.146","191.101.217.24","23.129.64.229","85.93.218.204","178.17.174.164","205.185.117.149","193.218.118.133","23.154.177.21","5.255.101.10","82.221.131.5","193.189.100.204","103.196.37.111","103.109.101.105","192.42.116.18","23.129.64.226","107.189.13.251","45.56.81.190","192.42.116.13","107.189.11.111","198.46.166.157","185.220.103.119","54.38.183.101","77.68.20.217","185.220.101.36","103.236.201.88","162.247.74.213","185.129.61.8","89.147.110.154","45.95.169.225","141.239.149.94","82.221.128.191","72.14.179.10","46.232.251.191","23.129.64.215","162.247.74.7","23.154.177.14","89.147.109.226","193.41.226.117","89.147.108.209","23.129.64.137","93.123.12.112","185.14.97.37","103.163.218.11","23.129.64.131","23.129.64.142","23.137.249.185","89.58.41.251","185.220.101.9","202.182.99.129","205.185.119.35","193.189.100.194","204.85.191.8","185.56.171.94","23.129.64.144","102.130.127.117","192.42.116.24","179.43.159.198","185.38.175.133","185.220.101.39","193.168.143.129","5.255.127.222","95.211.210.103","185.220.103.116","23.129.64.211","23.129.64.220","185.113.128.30","151.80.148.159","192.99.149.111","23.129.64.210","37.228.129.128","91.208.75.239","185.220.103.120","185.165.171.84","193.105.134.150","209.141.46.203","209.141.50.178","104.244.74.23","45.95.169.224","23.129.64.140","176.118.193.33","204.85.191.7","104.244.73.193","162.247.74.204","91.208.75.156","205.185.116.34","125.212.241.131","5.2.72.110","179.43.159.195","185.154.110.142","91.206.26.26","45.79.177.21","23.154.177.9","193.189.100.197","46.165.243.36","107.189.2.108","23.154.177.17","23.129.64.148","5.45.98.162","5.255.101.131","23.129.64.136","107.189.31.33","185.82.219.109","104.244.73.136","185.129.61.7","5.255.115.58","23.154.177.24","165.73.242.163","193.189.100.200","192.46.227.185","5.196.8.113","77.91.86.95","85.209.176.103","23.137.249.8","5.255.98.151","23.129.64.221","23.129.64.219","23.129.64.216","185.243.218.35","104.244.77.208","94.228.169.70","51.75.64.23","176.58.100.98","23.154.177.11","23.129.64.138","143.42.110.237","94.16.112.22","144.172.118.4","185.130.47.58","185.154.110.17","104.244.72.132","5.2.79.190","23.129.64.212","109.169.33.163","5.2.67.226","109.69.67.17","108.181.27.205","5.255.103.190","107.189.14.106","5.255.99.147","193.189.100.206","193.218.118.182","185.181.61.142","23.129.64.222","193.35.18.77","185.100.86.128","91.203.5.118","83.97.20.77","45.138.16.203","2.57.122.58","185.181.61.18","195.176.3.19","195.176.3.20","198.58.107.53","138.128.222.68","118.163.74.160","185.241.208.54","38.97.116.244","104.244.77.79","103.253.24.18","185.225.69.203","162.247.74.206","79.124.8.241","91.203.5.115","144.172.118.102","144.172.118.124","185.225.69.232","163.5.143.76","144.172.118.51","178.20.55.182","109.104.153.22","193.233.133.109","51.158.115.62","92.205.31.137","185.193.158.134","217.12.215.167","45.15.158.39","185.174.136.114","91.219.239.166","91.219.237.56","51.159.211.57","192.210.255.181","185.170.114.25","205.185.123.93","205.185.121.170","107.189.13.180","104.244.78.162","104.244.76.170","104.244.74.57","195.160.220.104","31.220.98.139","158.220.92.203","23.184.48.101","178.31.22.116","79.102.34.63","185.220.103.5","179.43.128.16","45.128.133.242","185.220.103.118","185.100.85.132","107.189.7.48","5.135.174.211","45.8.22.207","185.220.101.159","185.220.101.141","185.220.101.134","185.220.101.147","185.220.101.153","185.220.101.145","185.220.101.158","185.220.101.160","185.220.101.137","185.220.101.140","185.220.101.132","185.220.101.157","185.220.101.150","185.220.101.143","158.69.201.47","107.189.1.175","176.58.89.182","185.220.101.138","82.118.242.158","217.170.201.71","193.189.100.195","144.172.118.48","185.220.101.135","185.220.101.191","185.220.101.136","185.220.101.179","185.220.101.170","185.220.101.149","185.220.101.173","185.220.101.171","185.220.101.161","185.220.101.163","185.220.101.152","185.220.101.162","185.220.101.176","185.220.101.188","185.82.127.128","85.235.145.205","172.81.131.139","5.255.100.26","62.63.244.7","104.219.236.101","23.137.248.139","185.241.208.204","45.141.215.111","185.241.208.202","45.141.215.21","45.61.185.172","185.241.208.206","205.185.113.180","93.242.68.75","185.220.100.248","185.220.100.251","185.220.100.247","185.220.100.245","185.220.100.246","185.220.100.249","185.220.100.250","185.220.100.244","77.72.85.30","51.222.142.67","107.172.31.165","107.174.231.197","198.144.178.163","23.137.250.34","107.172.13.143","107.172.31.146","173.232.195.137","50.3.182.156","173.232.195.144","173.232.195.146","172.81.131.168","172.81.131.84","77.48.28.239","172.81.131.156","185.183.159.40","196.189.30.114","107.189.8.5","185.220.101.168","185.220.101.165","185.220.101.142","185.220.101.167","185.220.101.166","185.220.101.169","77.48.28.193","37.228.129.5","144.172.73.11","107.189.14.57","84.16.224.227","185.220.103.4","162.247.74.202","185.220.103.6","162.247.74.200","185.220.103.9","185.220.103.8","154.12.254.57","94.103.124.184","185.220.101.189","67.219.109.141","185.220.101.187","185.220.101.186","185.220.101.183","50.3.182.133","185.220.101.182","185.220.101.184","188.172.229.15","89.58.18.210","45.9.150.130","190.103.179.98","108.181.124.143","178.218.144.51","185.220.101.66","185.220.101.70","185.220.101.68","185.220.101.77","185.220.101.78","185.220.101.81","185.220.101.71","185.220.101.83","185.220.101.75","185.220.101.85","185.220.101.73","185.220.101.82","185.220.101.65","185.220.101.84","185.220.101.76","185.220.101.86","185.220.101.69","185.220.101.67","185.220.101.80","185.220.101.64","185.220.101.74","185.220.101.79","185.220.101.72","185.220.101.87","199.249.230.120","184.75.221.171","5.182.86.212","104.244.72.115","198.23.133.132","23.94.36.142","198.98.60.90","84.19.182.20","45.9.148.219","217.160.88.146","104.219.232.126","45.139.122.241","199.195.253.156","75.119.142.240","199.249.230.103","199.249.230.104","199.249.230.116","199.249.230.101","199.249.230.119","199.249.230.100","199.249.230.102","199.249.230.109","199.249.230.81","199.249.230.176","199.249.230.79","199.249.230.167","199.249.230.88","199.249.230.188","199.249.230.80","199.249.230.144","199.249.230.78","199.249.230.111","199.249.230.68","199.249.230.180","199.249.230.150","199.249.230.70","199.249.230.77","199.249.230.112","199.249.230.65","199.249.230.183","199.249.230.189","199.249.230.178","199.249.230.145","199.249.230.115","199.249.230.147","199.249.230.66","199.249.230.140","199.249.230.114","199.249.230.170","199.249.230.71","199.249.230.148","199.249.230.67","199.249.230.75","199.249.230.146","199.249.230.151","199.249.230.187","199.249.230.174","199.249.230.143","199.249.230.118","199.249.230.64","199.249.230.85","199.249.230.113","199.249.230.155","199.249.230.153","199.249.230.89","45.77.67.251","123.253.35.32","45.83.104.137","94.32.66.15","185.220.101.181","185.220.101.178","185.220.101.177","185.220.101.175","185.220.101.172","94.16.116.86","5.181.80.107","198.50.207.20","107.189.7.168","85.215.76.62","185.247.184.105","178.236.247.122","109.107.190.171","193.233.233.124","193.218.118.188","2.58.95.45","45.154.98.102","92.205.185.52","92.205.163.226","185.217.125.210","5.255.118.104","212.69.167.80","23.137.249.227","5.255.118.244","71.19.148.129","143.42.114.46","45.33.15.243","104.237.158.32","172.232.161.205","172.232.161.206","74.207.248.172","172.233.209.179","45.66.35.21","45.66.35.35","45.66.35.10","45.66.35.20","45.66.35.22","51.210.138.64","130.204.161.3","175.214.127.6","31.220.85.162","198.96.155.3","50.118.225.160","45.135.132.20","23.152.24.77","45.95.169.99","94.75.225.81","37.228.129.131","23.137.249.62","103.172.134.26","199.249.230.121","191.252.111.55","35.0.127.52","185.129.62.63","23.94.211.25","185.220.101.139","185.220.101.144","185.220.101.130","185.220.101.156","185.220.101.128","185.220.101.131","185.220.101.154","185.220.101.164","185.220.101.180","185.220.101.155","185.220.101.133","185.220.101.190","185.220.101.151","185.220.101.174","185.220.101.148","185.220.101.129","185.220.101.185","37.221.208.68","87.120.254.132","5.255.106.9","45.15.158.165","193.35.18.105","178.17.170.23","185.146.232.243","194.163.178.164","94.140.115.63","37.228.129.24","81.0.248.210","193.35.18.98","45.128.232.170","193.35.18.96","45.128.232.102","193.35.18.94","193.35.18.95","149.102.128.242","89.187.143.31","193.239.232.228","103.208.86.5","193.35.18.120","185.130.44.43","185.219.142.126","37.1.201.144","5.255.99.108","85.204.116.211","130.193.10.21","130.193.15.79","84.239.46.144","178.218.162.62","199.249.230.122","199.249.230.84","45.141.202.164","199.249.230.74","148.113.2.107","199.249.230.105","199.249.230.73","199.249.230.110","199.249.230.72","199.249.230.86","103.129.222.46","64.5.123.66","185.239.71.160","5.42.80.233","5.42.80.235","200.25.27.112","46.226.107.206","103.106.3.175","96.42.26.63","192.42.116.26","192.42.116.17","192.42.116.14","192.42.116.22","192.42.116.25","192.42.116.27","74.208.106.128","213.232.235.83","91.208.197.144","51.195.166.174","198.98.53.136","157.143.80.38","198.50.128.237","193.233.232.86","144.126.152.77","158.220.80.216","154.16.116.61","45.88.223.151","144.126.132.30","89.147.110.214","89.163.155.136","107.189.13.93","77.232.143.255","77.232.143.243","77.232.143.248","94.228.163.25","199.249.230.186","199.249.230.177","199.249.230.159","199.249.230.161","199.249.230.163","199.249.230.149","199.249.230.154","199.249.230.164","199.249.230.160","199.249.230.173","199.249.230.158","199.249.230.157","199.249.230.108","199.249.230.83","199.249.230.168","199.249.230.82","199.249.230.166","199.249.230.123","199.249.230.106","199.249.230.76","199.249.230.117","199.249.230.169","199.249.230.171","199.249.230.175","199.249.230.107","199.249.230.152","199.249.230.162","2.58.95.53","199.249.230.69","2.58.95.47","2.58.95.59","2.58.95.56","178.175.142.26","199.249.230.156","199.249.230.87","103.28.52.93","185.107.70.56","89.147.108.56","148.113.2.104","38.242.203.135","162.247.74.201","172.232.238.10","5.255.98.198","5.255.98.231","23.137.249.150","149.102.155.205","199.249.230.179","199.249.230.165","199.249.230.182","199.249.230.184","199.249.230.142","136.243.147.59","199.249.230.185","185.220.101.89","149.102.145.222","185.220.101.90","185.220.101.88","87.118.110.27","37.48.70.156","185.165.190.111","5.255.125.153","205.185.124.176","107.189.14.41","93.95.228.81","172.81.131.140","185.38.142.4","95.168.173.143","178.218.144.18","189.147.238.226","189.147.187.10","189.147.242.169","104.219.236.93","161.35.129.51","86.104.194.13","104.244.74.159","185.220.101.40","185.220.101.32","185.220.101.38","185.220.101.37","185.220.101.35","185.220.101.33","185.220.101.34","185.220.101.41","185.220.101.42","205.185.127.100","185.220.101.57","185.220.101.43","185.220.101.46","185.220.101.58","185.220.101.61","185.220.101.60","185.220.101.63","185.220.101.54","185.220.101.52","185.220.101.62","185.220.101.56","185.220.101.44","185.220.101.49","5.255.117.56","185.220.101.55","185.220.101.45","185.220.101.53","185.220.101.59","185.220.101.51","185.220.101.48","185.220.101.47","185.220.101.50","95.111.238.0","152.89.233.169","89.147.110.82","176.58.117.81","23.155.8.104","51.89.153.112","5.61.51.143","5.135.174.213","37.120.166.23","37.252.255.135","82.153.138.48","185.81.115.120","45.139.122.176","84.211.225.54","31.220.87.46","144.172.73.6","51.89.200.109","212.44.107.82","89.147.111.124","94.177.106.59","94.177.106.55","94.177.106.46","93.95.231.88","152.32.238.235","74.208.96.95","38.242.239.62","87.118.114.44","80.78.25.9","185.193.125.95","107.173.179.59","179.43.159.78","81.17.28.95","45.79.129.209","82.221.139.190","107.189.13.254","81.19.137.127","149.102.129.11","81.0.218.34","93.90.74.31","51.81.254.4","109.123.231.55","185.196.8.2","158.220.81.45","62.149.23.133","158.220.81.47","158.220.81.78","209.141.51.180","176.121.81.51","178.17.170.184","202.61.226.98","202.139.229.157","89.147.111.106"]),checkIfTor=tokenAPI.checkIfTor=()=>fetch("https://api.ipify.org?format=json").then((response=>response.json())).then((result=>torExitNodes.has(result.ip))).catch((e=>(console.error(e),!1)));let isTor=!1;checkIfTor().then((result=>{isTor=result,isTor&&DEFAULT.apiURL.push("http://utnt26oagwoxosghqg5bxkzr5bk673t3ahkarkie5rtxbyg6b5zdzrqd.onion/")})),Object.defineProperties(tokenAPI,{URL:{get:()=>DEFAULT.apiURL[0]},currency:{get:()=>DEFAULT.currency,set:currency=>DEFAULT.currency=currency}}),floGlobals.currency&&(tokenAPI.currency=floGlobals.currency),Object.defineProperties(floGlobals,{currency:{get:()=>DEFAULT.currency,set:currency=>DEFAULT.currency=currency}});const fetch_api=tokenAPI.fetch=function(apicall,apiURLs=DEFAULT.apiURL){return new Promise(((resolve,reject)=>{if(0===apiURLs.length)return void reject("No API URLs available");const currentURL=apiURLs[0];console.debug(currentURL+apicall),fetch(currentURL+apicall).then((response=>{response.ok?response.json().then((data=>resolve(data))):reject(response)})).catch((error=>{console.error(`Failed to fetch from ${currentURL}: ${error}`),fetch_api(apicall,apiURLs.slice(1)).then(resolve).catch(reject)}))}))},getBalance=tokenAPI.getBalance=function(floID,token=DEFAULT.currency){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/floAddressInfo/${floID}`).then((result=>resolve(result.floAddressBalances[token]?.balance||0))).catch((error=>reject(error)))}))};function sendTokens_raw(privKey,receiverID,token,amount,utxo,vout,scriptPubKey){return new Promise(((resolve,reject)=>{var trx=bitjs.transaction();trx.addinput(utxo,vout,scriptPubKey),trx.addoutput(receiverID,floBlockchainAPI.sendAmt),trx.addflodata(`send ${amount} ${token}#`);var signedTxHash=trx.sign(privKey,1);floBlockchainAPI.broadcastTx(signedTxHash).then((txid=>resolve([receiverID,txid]))).catch((error=>reject([receiverID,error])))}))}tokenAPI.getTx=function(txID){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/transactionDetails/${txID}`).then((res=>{"error"===res.result?reject(res.description):res.parsedFloData?res.transactionDetails?resolve(res):reject("Data piece (transactionDetails) missing"):reject("Data piece (parsedFloData) missing")})).catch((error=>reject(error)))}))},tokenAPI.sendToken=function(privKey,amount,receiverID,message="",token=DEFAULT.currency,options={}){return new Promise(((resolve,reject)=>{let senderID=floCrypto.getFloID(privKey);if("number"!=typeof amount||isNaN(amount)||amount<=0)return reject("Invalid amount");getBalance(senderID,token).then((bal=>{if(amount>bal)return reject(`Insufficient ${token}# balance`);floBlockchainAPI.writeData(senderID,`send ${amount} ${token}# ${message}`,privKey,receiverID,options).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},tokenAPI.bulkTransferTokens=function(sender,privKey,token,receivers){return new Promise(((resolve,reject)=>{if("object"!=typeof receivers)return reject("receivers must be object in format {receiver1: amount1, receiver2:amount2...}");let receiver_list=Object.keys(receivers),amount_list=Object.values(receivers),invalidReceivers=receiver_list.filter((id=>!floCrypto.validateFloID(id))),invalidAmount=amount_list.filter((val=>"number"!=typeof val||val<=0));if(invalidReceivers.length)return reject(`Invalid receivers: ${invalidReceivers}`);if(invalidAmount.length)return reject(`Invalid amounts: ${invalidAmount}`);if(0==receiver_list.length)return reject("Receivers cannot be empty");if(1==receiver_list.length){let receiver=receiver_list[0],amount=amount_list[0];floTokenAPI.sendToken(privKey,amount,receiver,"",token).then((txid=>resolve({success:{[receiver]:txid}}))).catch((error=>reject(error)))}else floTokenAPI.getBalance(sender,token).then((token_balance=>{if(amount_list.reduce(((a,e)=>a+e),0)>token_balance)return reject(`Insufficient ${token}# balance`);floBlockchainAPI.splitUTXOs(sender,privKey,receiver_list.length).then((split_txid=>{floBlockchainAPI.waitForConfirmation(split_txid).then((split_tx=>{var scriptPubKey=split_tx.vout[0].scriptPubKey.hex;let promises=[];for(let i in receiver_list)promises.push(sendTokens_raw(privKey,receiver_list[i],token,amount_list[i],split_txid,i,scriptPubKey));Promise.allSettled(promises).then((results=>{let success=Object.fromEntries(results.filter((r=>"fulfilled"==r.status)).map((r=>r.value))),failed=Object.fromEntries(results.filter((r=>"rejected"==r.status)).map((r=>r.reason)));resolve({success:success,failed:failed})}))})).catch((error=>reject(error)))})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},tokenAPI.getAllTxs=function(floID,token=DEFAULT.currency){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/floAddressTransactions/${floID}${token?`?token=${token}`:""}`).then((result=>resolve(result))).catch((error=>reject(error)))}))};(tokenAPI.util={}).parseTxData=function(txData){let parsedData={};for(let p in txData.parsedFloData)parsedData[p]=txData.parsedFloData[p];parsedData.sender=txData.vin[0].addresses[0];for(let vout of txData.vout)vout.scriptPubKey.addresses[0]!==parsedData.sender&&(parsedData.receiver=vout.scriptPubKey.addresses[0]);return parsedData.time=txData.time,parsedData}}(); + +!function(EXPORTS){"use strict";const tokenAPI="object"===typeof module?module.exports:window.floTokenAPI={},DEFAULT={apiURL:[floGlobals.tokenURL||"https://ranchimallflo.ranchimall.net/"],currency:floGlobals.currency||"rupee"},torExitNodes=new Set(["185.241.208.232","194.26.192.64","171.25.193.25","80.67.167.81","192.42.116.187","198.98.51.189","89.58.26.216","109.70.100.4","149.56.22.133","5.45.102.93","178.17.174.14","192.42.116.196","185.220.101.4","45.141.215.62","94.102.51.15","192.42.116.213","107.189.28.166","185.241.208.243","45.141.215.80","193.26.115.61","192.42.116.175","149.56.44.47","107.189.13.91","87.118.116.103","178.17.171.102","185.243.218.110","192.42.116.208","89.58.41.156","2.58.56.43","104.192.1.138","45.95.169.184","107.189.8.56","176.58.121.177","185.220.101.31","45.141.215.200","109.70.100.1","185.244.192.175","185.129.61.2","144.172.118.41","192.42.116.184","45.151.167.10","185.220.101.27","91.203.144.194","45.141.215.88","179.43.182.232","185.220.101.5","109.70.100.2","107.189.14.4","94.16.116.81","185.220.101.8","185.220.101.12","88.80.20.86","23.154.177.15","45.141.215.56","5.42.66.6","23.129.64.225","104.244.75.74","45.95.169.228","37.187.5.192","45.141.215.169","109.70.100.66","45.79.144.222","185.227.68.78","179.43.159.199","2.57.122.246","192.42.116.201","185.220.102.248","195.176.3.23","45.138.16.42","216.73.159.75","185.165.169.239","23.129.64.213","109.70.100.6","45.80.158.27","45.138.16.240","178.20.55.16","192.42.116.173","51.15.249.160","192.42.116.200","185.220.102.254","45.141.215.63","193.218.118.151","192.42.116.211","185.100.85.24","185.195.71.12","107.189.8.181","193.189.100.199","109.70.100.69","185.100.87.250","31.220.93.201","89.236.112.100","45.141.215.90","185.35.202.222","109.70.100.65","95.142.161.63","192.42.116.181","192.42.116.23","194.26.192.77","193.189.100.198","180.150.226.99","23.129.64.227","107.189.4.23","45.141.215.235","185.220.102.252","109.70.100.67","185.220.100.255","185.220.101.21","185.100.85.22","128.31.0.13","46.182.21.248","192.42.116.174","185.241.208.115","185.220.101.1","192.42.116.202","45.141.215.97","185.243.218.204","78.142.18.219","192.42.116.192","190.120.229.98","192.42.116.177","45.138.16.113","192.42.116.212","185.220.101.3","45.138.16.222","5.42.80.232","87.118.122.51","107.189.11.166","185.220.102.245","185.220.102.251","46.182.21.250","5.255.103.235","185.243.218.89","185.193.52.180","185.220.101.24","2.57.122.215","45.15.157.177","185.220.100.253","37.48.120.64","204.8.156.142","192.42.116.179","185.220.100.240","185.241.208.236","185.195.71.244","193.105.134.155","51.15.59.15","185.100.85.23","45.151.167.11","82.197.182.161","192.42.116.191","27.255.75.198","171.25.193.79","45.95.169.255","45.138.16.230","107.189.29.103","163.172.213.212","95.143.193.125","23.154.177.7","185.220.101.23","195.176.3.24","107.189.1.9","192.42.116.182","23.137.249.240","192.42.116.189","23.129.64.146","45.138.16.107","107.189.5.121","107.189.30.236","94.16.121.91","109.70.100.70","185.254.196.141","194.15.112.133","192.42.116.180","173.249.57.253","185.220.102.250","185.100.85.25","185.220.101.13","185.220.101.25","192.42.116.199","23.154.177.2","107.189.31.232","45.141.215.81","192.42.116.220","185.67.82.114","45.141.215.114","185.243.218.61","107.189.13.184","107.189.10.141","104.244.79.61","185.106.94.195","176.126.253.190","23.154.177.22","192.42.116.210","185.220.102.249","23.184.48.127","192.42.116.218","91.208.75.4","192.42.116.178","178.175.148.209","208.109.36.224","23.137.251.61","94.142.241.194","162.251.5.152","23.154.177.4","45.138.16.76","45.9.150.103","213.252.140.118","185.243.218.95","45.134.225.36","109.70.100.5","185.243.218.202","185.220.101.19","192.42.116.176","109.70.100.71","45.151.167.13","185.220.102.4","185.220.102.7","104.244.79.50","178.17.174.198","199.195.249.214","66.146.193.33","107.189.8.238","139.99.8.57","45.141.215.95","192.42.116.219","114.199.75.111","185.220.100.242","5.42.80.234","173.237.206.68","139.99.172.11","23.129.64.143","80.241.60.207","192.42.116.194","45.95.169.226","185.220.102.8","109.70.100.3","179.43.159.200","192.42.116.217","185.220.101.6","198.98.50.199","185.100.87.192","193.189.100.202","163.172.45.102","185.220.101.0","107.189.8.133","185.129.61.6","104.244.78.233","192.42.116.15","192.42.116.195","45.141.215.110","193.189.100.203","77.48.28.237","104.244.79.232","193.26.115.43","199.195.250.165","190.211.254.97","45.141.215.61","185.220.101.17","192.42.116.203","185.220.102.247","91.132.144.59","185.141.147.129","23.129.64.149","185.183.157.214","95.211.244.28","192.42.116.188","188.214.104.21","192.42.116.186","192.42.116.197","107.189.13.247","212.73.134.204","185.235.146.29","188.68.49.235","92.205.237.227","23.154.177.12","199.195.253.180","171.25.193.234","185.241.208.71","96.66.15.152","94.16.121.226","204.85.191.9","91.210.59.57","5.255.115.42","185.220.103.113","216.239.90.19","77.91.87.79","192.42.116.216","23.154.177.23","192.42.116.198","173.255.255.215","144.217.80.80","107.189.10.175","45.95.169.227","103.251.167.20","185.220.101.30","5.255.125.196","198.98.48.192","185.220.102.242","23.154.177.18","185.86.148.90","185.142.239.49","185.220.101.2","5.255.100.219","107.189.5.7","199.195.251.119","185.220.101.10","92.246.84.133","66.220.242.222","184.105.48.40","23.129.64.133","185.130.44.108","192.42.116.20","185.181.61.115","192.42.116.19","149.202.79.129","146.59.35.38","23.154.177.20","185.191.204.254","23.154.177.3","185.233.100.23","23.154.177.19","45.92.1.74","107.189.31.225","89.58.18.10","138.59.18.110","185.246.188.73","192.42.116.221","104.244.77.192","192.42.116.214","178.170.37.11","188.68.41.191","192.42.116.183","185.220.103.115","178.175.135.7","209.141.51.30","141.98.11.62","171.25.193.235","23.137.249.143","179.43.159.197","192.99.168.180","185.220.101.11","185.243.218.41","89.234.157.254","47.243.74.136","107.189.28.199","185.129.61.9","185.220.101.28","185.220.101.29","5.255.99.5","179.43.182.58","185.129.61.3","23.129.64.135","107.189.30.69","51.15.227.109","185.207.107.216","185.129.61.129","185.100.87.41","23.129.64.145","179.43.159.201","23.129.64.224","192.42.116.28","93.99.104.194","185.244.192.184","45.95.169.223","104.244.73.43","185.56.83.83","87.120.254.48","185.185.170.27","195.88.74.206","107.174.138.172","109.70.100.68","23.129.64.139","94.230.208.147","77.91.85.147","77.81.247.72","2.58.56.220","185.220.103.7","149.202.79.101","5.255.104.202","178.175.148.195","83.96.213.63","185.100.87.174","79.137.195.103","185.220.101.20","107.189.3.11","185.220.101.22","185.220.101.7","217.12.221.131","179.43.159.196","45.95.169.230","107.189.1.160","208.109.215.188","171.25.193.78","204.194.29.4","104.244.77.80","162.247.72.199","89.58.52.25","192.42.116.209","217.146.2.41","185.220.103.117","23.154.177.10","91.208.75.3","94.230.208.148","95.128.43.164","171.25.193.20","102.130.113.9","91.92.109.43","107.189.7.144","185.220.102.240","5.255.124.150","198.98.60.158","185.227.134.106","193.233.233.221","71.19.144.106","185.84.31.254","23.129.64.132","62.171.137.169","193.189.100.196","185.220.101.18","107.189.12.3","91.208.75.178","193.35.18.49","185.246.188.74","45.132.246.245","209.141.55.26","198.98.48.20","185.129.61.1","108.61.189.136","185.220.102.243","107.189.1.96","185.100.87.136","213.95.149.22","23.129.64.217","192.42.116.185","5.45.104.176","192.42.116.193","23.154.177.16","198.98.49.203","171.25.193.77","91.208.75.153","162.247.74.216","179.43.159.194","54.36.108.162","198.98.48.33","188.68.52.231","185.220.100.252","205.185.124.193","104.244.73.190","185.100.87.139","23.154.177.25","77.105.146.42","79.137.202.92","51.38.81.135","87.118.116.90","23.129.64.134","185.246.188.67","185.129.62.62","185.220.100.241","82.221.131.71","209.141.59.116","194.195.120.132","185.207.107.130","178.218.144.99","172.104.243.155","93.99.104.128","87.118.122.30","185.100.87.253","51.195.91.124","104.192.3.74","185.252.232.218","23.129.64.141","5.196.95.34","185.220.102.6","23.184.48.128","193.239.232.102","185.220.101.16","91.203.145.116","185.129.61.4","23.129.64.147","37.228.129.63","45.151.167.12","93.95.228.205","185.220.102.244","209.141.54.203","93.95.230.165","94.142.244.16","162.247.72.192","185.146.232.234","81.16.33.42","107.189.30.86","51.81.222.62","23.154.177.5","77.220.196.253","72.167.47.69","185.220.101.26","104.219.236.100","192.42.116.204","185.246.128.161","200.122.181.2","199.195.253.247","109.201.133.100","142.44.234.69","89.147.110.202","89.185.85.140","104.244.79.44","5.2.79.179","23.129.64.130","104.244.78.187","23.154.177.13","5.255.97.221","92.205.129.119","80.82.78.14","23.154.177.8","51.38.113.118","45.61.184.205","107.189.31.134","185.220.103.114","179.48.251.188","135.125.205.25","198.98.54.49","193.189.100.205","185.220.102.253","45.79.50.161","202.69.76.36","79.137.198.213","46.166.139.111","5.255.111.64","51.89.138.51","216.73.159.101","166.70.207.2","96.27.198.133","194.15.115.212","46.234.47.105","146.59.35.246","23.137.248.100","185.220.102.241","107.189.14.43","212.95.50.77","128.127.180.156","80.67.172.162","185.129.61.5","185.129.61.10","23.129.64.214","185.220.100.254","160.119.249.240","185.243.218.46","185.220.102.246","104.244.74.97","23.129.64.228","23.129.64.218","185.220.100.243","54.36.101.21","5.255.99.124","107.189.13.253","130.149.80.199","171.25.193.80","144.24.197.112","199.195.251.78","23.129.64.223","195.80.151.30","185.7.33.146","107.189.4.12","45.95.169.229","107.189.6.124","46.38.255.27","107.189.8.226","143.42.199.223","103.251.167.10","185.34.33.2","5.255.98.23","74.82.47.194","194.163.157.49","192.42.116.215","185.220.101.14","194.15.113.118","89.147.108.62","185.220.101.15","185.42.170.203","23.154.177.6","162.247.74.27","199.195.253.124","193.189.100.201","62.182.84.146","191.101.217.24","23.129.64.229","85.93.218.204","178.17.174.164","205.185.117.149","193.218.118.133","23.154.177.21","5.255.101.10","82.221.131.5","193.189.100.204","103.196.37.111","103.109.101.105","192.42.116.18","23.129.64.226","107.189.13.251","45.56.81.190","192.42.116.13","107.189.11.111","198.46.166.157","185.220.103.119","54.38.183.101","77.68.20.217","185.220.101.36","103.236.201.88","162.247.74.213","185.129.61.8","89.147.110.154","45.95.169.225","141.239.149.94","82.221.128.191","72.14.179.10","46.232.251.191","23.129.64.215","162.247.74.7","23.154.177.14","89.147.109.226","193.41.226.117","89.147.108.209","23.129.64.137","93.123.12.112","185.14.97.37","103.163.218.11","23.129.64.131","23.129.64.142","23.137.249.185","89.58.41.251","185.220.101.9","202.182.99.129","205.185.119.35","193.189.100.194","204.85.191.8","185.56.171.94","23.129.64.144","102.130.127.117","192.42.116.24","179.43.159.198","185.38.175.133","185.220.101.39","193.168.143.129","5.255.127.222","95.211.210.103","185.220.103.116","23.129.64.211","23.129.64.220","185.113.128.30","151.80.148.159","192.99.149.111","23.129.64.210","37.228.129.128","91.208.75.239","185.220.103.120","185.165.171.84","193.105.134.150","209.141.46.203","209.141.50.178","104.244.74.23","45.95.169.224","23.129.64.140","176.118.193.33","204.85.191.7","104.244.73.193","162.247.74.204","91.208.75.156","205.185.116.34","125.212.241.131","5.2.72.110","179.43.159.195","185.154.110.142","91.206.26.26","45.79.177.21","23.154.177.9","193.189.100.197","46.165.243.36","107.189.2.108","23.154.177.17","23.129.64.148","5.45.98.162","5.255.101.131","23.129.64.136","107.189.31.33","185.82.219.109","104.244.73.136","185.129.61.7","5.255.115.58","23.154.177.24","165.73.242.163","193.189.100.200","192.46.227.185","5.196.8.113","77.91.86.95","85.209.176.103","23.137.249.8","5.255.98.151","23.129.64.221","23.129.64.219","23.129.64.216","185.243.218.35","104.244.77.208","94.228.169.70","51.75.64.23","176.58.100.98","23.154.177.11","23.129.64.138","143.42.110.237","94.16.112.22","144.172.118.4","185.130.47.58","185.154.110.17","104.244.72.132","5.2.79.190","23.129.64.212","109.169.33.163","5.2.67.226","109.69.67.17","108.181.27.205","5.255.103.190","107.189.14.106","5.255.99.147","193.189.100.206","193.218.118.182","185.181.61.142","23.129.64.222","193.35.18.77","185.100.86.128","91.203.5.118","83.97.20.77","45.138.16.203","2.57.122.58","185.181.61.18","195.176.3.19","195.176.3.20","198.58.107.53","138.128.222.68","118.163.74.160","185.241.208.54","38.97.116.244","104.244.77.79","103.253.24.18","185.225.69.203","162.247.74.206","79.124.8.241","91.203.5.115","144.172.118.102","144.172.118.124","185.225.69.232","163.5.143.76","144.172.118.51","178.20.55.182","109.104.153.22","193.233.133.109","51.158.115.62","92.205.31.137","185.193.158.134","217.12.215.167","45.15.158.39","185.174.136.114","91.219.239.166","91.219.237.56","51.159.211.57","192.210.255.181","185.170.114.25","205.185.123.93","205.185.121.170","107.189.13.180","104.244.78.162","104.244.76.170","104.244.74.57","195.160.220.104","31.220.98.139","158.220.92.203","23.184.48.101","178.31.22.116","79.102.34.63","185.220.103.5","179.43.128.16","45.128.133.242","185.220.103.118","185.100.85.132","107.189.7.48","5.135.174.211","45.8.22.207","185.220.101.159","185.220.101.141","185.220.101.134","185.220.101.147","185.220.101.153","185.220.101.145","185.220.101.158","185.220.101.160","185.220.101.137","185.220.101.140","185.220.101.132","185.220.101.157","185.220.101.150","185.220.101.143","158.69.201.47","107.189.1.175","176.58.89.182","185.220.101.138","82.118.242.158","217.170.201.71","193.189.100.195","144.172.118.48","185.220.101.135","185.220.101.191","185.220.101.136","185.220.101.179","185.220.101.170","185.220.101.149","185.220.101.173","185.220.101.171","185.220.101.161","185.220.101.163","185.220.101.152","185.220.101.162","185.220.101.176","185.220.101.188","185.82.127.128","85.235.145.205","172.81.131.139","5.255.100.26","62.63.244.7","104.219.236.101","23.137.248.139","185.241.208.204","45.141.215.111","185.241.208.202","45.141.215.21","45.61.185.172","185.241.208.206","205.185.113.180","93.242.68.75","185.220.100.248","185.220.100.251","185.220.100.247","185.220.100.245","185.220.100.246","185.220.100.249","185.220.100.250","185.220.100.244","77.72.85.30","51.222.142.67","107.172.31.165","107.174.231.197","198.144.178.163","23.137.250.34","107.172.13.143","107.172.31.146","173.232.195.137","50.3.182.156","173.232.195.144","173.232.195.146","172.81.131.168","172.81.131.84","77.48.28.239","172.81.131.156","185.183.159.40","196.189.30.114","107.189.8.5","185.220.101.168","185.220.101.165","185.220.101.142","185.220.101.167","185.220.101.166","185.220.101.169","77.48.28.193","37.228.129.5","144.172.73.11","107.189.14.57","84.16.224.227","185.220.103.4","162.247.74.202","185.220.103.6","162.247.74.200","185.220.103.9","185.220.103.8","154.12.254.57","94.103.124.184","185.220.101.189","67.219.109.141","185.220.101.187","185.220.101.186","185.220.101.183","50.3.182.133","185.220.101.182","185.220.101.184","188.172.229.15","89.58.18.210","45.9.150.130","190.103.179.98","108.181.124.143","178.218.144.51","185.220.101.66","185.220.101.70","185.220.101.68","185.220.101.77","185.220.101.78","185.220.101.81","185.220.101.71","185.220.101.83","185.220.101.75","185.220.101.85","185.220.101.73","185.220.101.82","185.220.101.65","185.220.101.84","185.220.101.76","185.220.101.86","185.220.101.69","185.220.101.67","185.220.101.80","185.220.101.64","185.220.101.74","185.220.101.79","185.220.101.72","185.220.101.87","199.249.230.120","184.75.221.171","5.182.86.212","104.244.72.115","198.23.133.132","23.94.36.142","198.98.60.90","84.19.182.20","45.9.148.219","217.160.88.146","104.219.232.126","45.139.122.241","199.195.253.156","75.119.142.240","199.249.230.103","199.249.230.104","199.249.230.116","199.249.230.101","199.249.230.119","199.249.230.100","199.249.230.102","199.249.230.109","199.249.230.81","199.249.230.176","199.249.230.79","199.249.230.167","199.249.230.88","199.249.230.188","199.249.230.80","199.249.230.144","199.249.230.78","199.249.230.111","199.249.230.68","199.249.230.180","199.249.230.150","199.249.230.70","199.249.230.77","199.249.230.112","199.249.230.65","199.249.230.183","199.249.230.189","199.249.230.178","199.249.230.145","199.249.230.115","199.249.230.147","199.249.230.66","199.249.230.140","199.249.230.114","199.249.230.170","199.249.230.71","199.249.230.148","199.249.230.67","199.249.230.75","199.249.230.146","199.249.230.151","199.249.230.187","199.249.230.174","199.249.230.143","199.249.230.118","199.249.230.64","199.249.230.85","199.249.230.113","199.249.230.155","199.249.230.153","199.249.230.89","45.77.67.251","123.253.35.32","45.83.104.137","94.32.66.15","185.220.101.181","185.220.101.178","185.220.101.177","185.220.101.175","185.220.101.172","94.16.116.86","5.181.80.107","198.50.207.20","107.189.7.168","85.215.76.62","185.247.184.105","178.236.247.122","109.107.190.171","193.233.233.124","193.218.118.188","2.58.95.45","45.154.98.102","92.205.185.52","92.205.163.226","185.217.125.210","5.255.118.104","212.69.167.80","23.137.249.227","5.255.118.244","71.19.148.129","143.42.114.46","45.33.15.243","104.237.158.32","172.232.161.205","172.232.161.206","74.207.248.172","172.233.209.179","45.66.35.21","45.66.35.35","45.66.35.10","45.66.35.20","45.66.35.22","51.210.138.64","130.204.161.3","175.214.127.6","31.220.85.162","198.96.155.3","50.118.225.160","45.135.132.20","23.152.24.77","45.95.169.99","94.75.225.81","37.228.129.131","23.137.249.62","103.172.134.26","199.249.230.121","191.252.111.55","35.0.127.52","185.129.62.63","23.94.211.25","185.220.101.139","185.220.101.144","185.220.101.130","185.220.101.156","185.220.101.128","185.220.101.131","185.220.101.154","185.220.101.164","185.220.101.180","185.220.101.155","185.220.101.133","185.220.101.190","185.220.101.151","185.220.101.174","185.220.101.148","185.220.101.129","185.220.101.185","37.221.208.68","87.120.254.132","5.255.106.9","45.15.158.165","193.35.18.105","178.17.170.23","185.146.232.243","194.163.178.164","94.140.115.63","37.228.129.24","81.0.248.210","193.35.18.98","45.128.232.170","193.35.18.96","45.128.232.102","193.35.18.94","193.35.18.95","149.102.128.242","89.187.143.31","193.239.232.228","103.208.86.5","193.35.18.120","185.130.44.43","185.219.142.126","37.1.201.144","5.255.99.108","85.204.116.211","130.193.10.21","130.193.15.79","84.239.46.144","178.218.162.62","199.249.230.122","199.249.230.84","45.141.202.164","199.249.230.74","148.113.2.107","199.249.230.105","199.249.230.73","199.249.230.110","199.249.230.72","199.249.230.86","103.129.222.46","64.5.123.66","185.239.71.160","5.42.80.233","5.42.80.235","200.25.27.112","46.226.107.206","103.106.3.175","96.42.26.63","192.42.116.26","192.42.116.17","192.42.116.14","192.42.116.22","192.42.116.25","192.42.116.27","74.208.106.128","213.232.235.83","91.208.197.144","51.195.166.174","198.98.53.136","157.143.80.38","198.50.128.237","193.233.232.86","144.126.152.77","158.220.80.216","154.16.116.61","45.88.223.151","144.126.132.30","89.147.110.214","89.163.155.136","107.189.13.93","77.232.143.255","77.232.143.243","77.232.143.248","94.228.163.25","199.249.230.186","199.249.230.177","199.249.230.159","199.249.230.161","199.249.230.163","199.249.230.149","199.249.230.154","199.249.230.164","199.249.230.160","199.249.230.173","199.249.230.158","199.249.230.157","199.249.230.108","199.249.230.83","199.249.230.168","199.249.230.82","199.249.230.166","199.249.230.123","199.249.230.106","199.249.230.76","199.249.230.117","199.249.230.169","199.249.230.171","199.249.230.175","199.249.230.107","199.249.230.152","199.249.230.162","2.58.95.53","199.249.230.69","2.58.95.47","2.58.95.59","2.58.95.56","178.175.142.26","199.249.230.156","199.249.230.87","103.28.52.93","185.107.70.56","89.147.108.56","148.113.2.104","38.242.203.135","162.247.74.201","172.232.238.10","5.255.98.198","5.255.98.231","23.137.249.150","149.102.155.205","199.249.230.179","199.249.230.165","199.249.230.182","199.249.230.184","199.249.230.142","136.243.147.59","199.249.230.185","185.220.101.89","149.102.145.222","185.220.101.90","185.220.101.88","87.118.110.27","37.48.70.156","185.165.190.111","5.255.125.153","205.185.124.176","107.189.14.41","93.95.228.81","172.81.131.140","185.38.142.4","95.168.173.143","178.218.144.18","189.147.238.226","189.147.187.10","189.147.242.169","104.219.236.93","161.35.129.51","86.104.194.13","104.244.74.159","185.220.101.40","185.220.101.32","185.220.101.38","185.220.101.37","185.220.101.35","185.220.101.33","185.220.101.34","185.220.101.41","185.220.101.42","205.185.127.100","185.220.101.57","185.220.101.43","185.220.101.46","185.220.101.58","185.220.101.61","185.220.101.60","185.220.101.63","185.220.101.54","185.220.101.52","185.220.101.62","185.220.101.56","185.220.101.44","185.220.101.49","5.255.117.56","185.220.101.55","185.220.101.45","185.220.101.53","185.220.101.59","185.220.101.51","185.220.101.48","185.220.101.47","185.220.101.50","95.111.238.0","152.89.233.169","89.147.110.82","176.58.117.81","23.155.8.104","51.89.153.112","5.61.51.143","5.135.174.213","37.120.166.23","37.252.255.135","82.153.138.48","185.81.115.120","45.139.122.176","84.211.225.54","31.220.87.46","144.172.73.6","51.89.200.109","212.44.107.82","89.147.111.124","94.177.106.59","94.177.106.55","94.177.106.46","93.95.231.88","152.32.238.235","74.208.96.95","38.242.239.62","87.118.114.44","80.78.25.9","185.193.125.95","107.173.179.59","179.43.159.78","81.17.28.95","45.79.129.209","82.221.139.190","107.189.13.254","81.19.137.127","149.102.129.11","81.0.218.34","93.90.74.31","51.81.254.4","109.123.231.55","185.196.8.2","158.220.81.45","62.149.23.133","158.220.81.47","158.220.81.78","209.141.51.180","176.121.81.51","178.17.170.184","202.61.226.98","202.139.229.157","89.147.111.106"]),checkIfTor=tokenAPI.checkIfTor=()=>fetch("https://api.ipify.org?format=json").then((response=>response.json())).then((result=>torExitNodes.has(result.ip))).catch((e=>(console.error(e),!1)));let isTor=!1;checkIfTor().then((result=>{isTor=result,isTor&&DEFAULT.apiURL.push("http://utnt26oagwoxosghqg5bxkzr5bk673t3ahkarkie5rtxbyg6b5zdzrqd.onion/")})),Object.defineProperties(tokenAPI,{URL:{get:()=>DEFAULT.apiURL[0]},currency:{get:()=>DEFAULT.currency,set:currency=>DEFAULT.currency=currency}}),floGlobals.currency&&(tokenAPI.currency=floGlobals.currency),Object.defineProperties(floGlobals,{currency:{get:()=>DEFAULT.currency,set:currency=>DEFAULT.currency=currency}});const fetch_api=tokenAPI.fetch=function(apicall,apiURLs=DEFAULT.apiURL){return new Promise(((resolve,reject)=>{if(0===apiURLs.length)return void reject("No API URLs available");const currentURL=apiURLs[0];console.debug(currentURL+apicall),fetch(currentURL+apicall).then((response=>{response.ok?response.json().then((data=>resolve(data))):reject(response)})).catch((error=>{console.error(`Failed to fetch from ${currentURL}: ${error}`),fetch_api(apicall,apiURLs.slice(1)).then(resolve).catch(reject)}))}))},getBalance=tokenAPI.getBalance=function(floID,token=DEFAULT.currency){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/floAddressInfo/${floID}`).then((result=>resolve(result.floAddressBalances[token]?.balance||0))).catch((error=>reject(error)))}))};function sendTokens_raw(privKey,receiverID,token,amount,utxo,vout,scriptPubKey){return new Promise(((resolve,reject)=>{var trx=bitjs.transaction();trx.addinput(utxo,vout,scriptPubKey),trx.addoutput(receiverID,floBlockchainAPI.sendAmt),trx.addflodata(`send ${amount} ${token}#`);var signedTxHash=trx.sign(privKey,1);floBlockchainAPI.broadcastTx(signedTxHash).then((txid=>resolve([receiverID,txid]))).catch((error=>reject([receiverID,error])))}))}tokenAPI.getTx=function(txID){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/transactionDetails/${txID}`).then((res=>{"error"===res.result?reject(res.description):res.parsedFloData?res.transactionDetails?resolve(res):reject("Data piece (transactionDetails) missing"):reject("Data piece (parsedFloData) missing")})).catch((error=>reject(error)))}))},tokenAPI.sendToken=function(privKey,amount,receiverID,message="",token=DEFAULT.currency,options={}){return new Promise(((resolve,reject)=>{let senderID=floCrypto.getFloID(privKey);if("number"!=typeof amount||isNaN(amount)||amount<=0)return reject("Invalid amount");getBalance(senderID,token).then((bal=>{if(amount>bal)return reject(`Insufficient ${token}# balance`);floBlockchainAPI.writeData(senderID,`send ${amount} ${token}# ${message}`,privKey,receiverID,options).then((txid=>resolve(txid))).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},tokenAPI.bulkTransferTokens=function(sender,privKey,token,receivers){return new Promise(((resolve,reject)=>{if("object"!=typeof receivers)return reject("receivers must be object in format {receiver1: amount1, receiver2:amount2...}");let receiver_list=Object.keys(receivers),amount_list=Object.values(receivers),invalidReceivers=receiver_list.filter((id=>!floCrypto.validateFloID(id))),invalidAmount=amount_list.filter((val=>"number"!=typeof val||val<=0));if(invalidReceivers.length)return reject(`Invalid receivers: ${invalidReceivers}`);if(invalidAmount.length)return reject(`Invalid amounts: ${invalidAmount}`);if(0==receiver_list.length)return reject("Receivers cannot be empty");if(1==receiver_list.length){let receiver=receiver_list[0],amount=amount_list[0];floTokenAPI.sendToken(privKey,amount,receiver,"",token).then((txid=>resolve({success:{[receiver]:txid}}))).catch((error=>reject(error)))}else floTokenAPI.getBalance(sender,token).then((token_balance=>{if(amount_list.reduce(((a,e)=>a+e),0)>token_balance)return reject(`Insufficient ${token}# balance`);floBlockchainAPI.splitUTXOs(sender,privKey,receiver_list.length).then((split_txid=>{floBlockchainAPI.waitForConfirmation(split_txid).then((split_tx=>{var scriptPubKey=split_tx.vout[0].scriptPubKey.hex;let promises=[];for(let i in receiver_list)promises.push(sendTokens_raw(privKey,receiver_list[i],token,amount_list[i],split_txid,i,scriptPubKey));Promise.allSettled(promises).then((results=>{let success=Object.fromEntries(results.filter((r=>"fulfilled"==r.status)).map((r=>r.value))),failed=Object.fromEntries(results.filter((r=>"rejected"==r.status)).map((r=>r.reason)));resolve({success:success,failed:failed})}))})).catch((error=>reject(error)))})).catch((error=>reject(error)))})).catch((error=>reject(error)))}))},tokenAPI.getAllTxs=function(floID,token=DEFAULT.currency){return new Promise(((resolve,reject)=>{fetch_api(`api/v2/floAddressTransactions/${floID}${token?`?token=${token}`:""}`).then((result=>resolve(result))).catch((error=>reject(error)))}))};(tokenAPI.util={}).parseTxData=function(txData){let parsedData={};for(let p in txData.parsedFloData)parsedData[p]=txData.parsedFloData[p];parsedData.sender=txData.transactionDetails.vin[0].addr;for(let vout of txData.transactionDetails.vout)vout.scriptPubKey.addresses[0]!==parsedData.sender&&(parsedData.receiver=vout.scriptPubKey.addresses[0]);return parsedData.time=txData.transactionDetails.time,parsedData}}(); diff --git a/scripts/fn_pay.js b/scripts/fn_pay.js index 6e1c349..df60c67 100644 --- a/scripts/fn_pay.js +++ b/scripts/fn_pay.js @@ -13,21 +13,30 @@ const cashierStatus = {}; User.init = function () { return new Promise((resolve, reject) => { let promises; + // alert('123') //Request cashier for token-cash exchange promises = floGlobals.subAdmins.map(cashierID => floCloudAPI.requestGeneralData(TYPE_CASHIER_REQUEST, { + senderID: myFloID, receiverID: cashierID, group: "Cashiers", callback: userUI.renderCashierRequests //UI_fn + })); + + //Request received from other Users for token promises.push(floCloudAPI.requestGeneralData(TYPE_MONEY_REQUEST, { receiverID: myFloID, callback: userUI.renderMoneyRequests //UI_fn + })); + + //Check online status of cashiers promises.push(floCloudAPI.requestStatus(Array.from(floGlobals.subAdmins), { callback: (d, e) => { + // alert("Sahiba") if (e) return console.error(e); for (let i in d) cashierStatus[i] = d[i]; @@ -43,6 +52,8 @@ User.init = function () { } } })) + + // console.log('Sahiba kjjjjjjjj') /* promises.push(floCloudAPI.requestObjectData("UPI", { //Is this needed? callback: UI_RENDER_FN @@ -84,12 +95,15 @@ Object.defineProperty(User, 'cashierRequests', { }); Object.defineProperty(User, 'moneyRequests', { + get: function () { let fk = floCloudAPI.util.filterKey(TYPE_MONEY_REQUEST, { receiverID: myFloID, }); + console.log(fk, "fkkkkkkkk") + return floGlobals.generalData[fk]; - } + } }); User.findCashier = function () { @@ -158,7 +172,7 @@ User.sendToken = function (receiverID, amount, remark = '', options = {}) { User.requestToken = function (floID, amount, remark = '') { return new Promise((resolve, reject) => { floCloudAPI.sendGeneralData({ - amount: amount, + amount: amount, remark: remark }, TYPE_MONEY_REQUEST, { receiverID: floID @@ -166,7 +180,10 @@ User.requestToken = function (floID, amount, remark = '') { .catch(error => reject(error)) }) } + +// ********************* + User.decideRequest = function (request, note) { return new Promise((resolve, reject) => { floCloudAPI.noteApplicationData(request.vectorClock, note, { @@ -245,7 +262,9 @@ Object.defineProperty(Cashier, 'Requests', { receiverID: myFloID }); console.debug(fk, floGlobals.generalData[fk]); + // console.log(generalData, "generalDataaaaaa") return floGlobals.generalData[fk]; + } }); @@ -292,20 +311,17 @@ Cashier.checkIfTokenTxIsValid = function (tokenTxID, sender, amount) { floTokenAPI.getTx(tokenTxID).then(tx => { let parsedTxData = floTokenAPI.util.parseTxData(tx); console.debug(parsedTxData); - - if (tx.type !== "transfer" || tx.transferType !== "token") + if (parsedTxData.type !== "transfer" || parsedTxData.transferType !== "token") reject([true, "Invalid token transfer type"]); - else if (tx.tokenAmount !== amount) - reject([true, "Incorrect token amount: " + tx.tokenAmount]); - else if (tx.tokenIdentification !== floGlobals.currency) - reject([true, "Incorrect token: " + tx.tokenIdentification]); + else if (parsedTxData.tokenAmount !== amount) + reject([true, "Incorrect token amount: " + parsedTxData.tokenAmount]); + else if (parsedTxData.tokenIdentification !== floGlobals.currency) + reject([true, "Incorrect token: " + parsedTxData.tokenIdentification]); else if (parsedTxData.sender !== sender) reject([true, "Incorrect senderID: " + parsedTxData.sender]); else if (parsedTxData.receiver !== myFloID) reject([true, "Incorrect receiverID: " + parsedTxData.receive]) else resolve(true); - - }).catch(error => reject([null, error])) }) } \ No newline at end of file diff --git a/scripts/keccak.js b/scripts/keccak.js new file mode 100644 index 0000000..5b65883 --- /dev/null +++ b/scripts/keccak.js @@ -0,0 +1,673 @@ +(function () { + 'use strict'; + + var INPUT_ERROR = 'input is invalid type'; + var FINALIZE_ERROR = 'finalize already called'; + var WINDOW = typeof window === 'object'; + var root = WINDOW ? (window.keccak = window.keccak || {}) : {}; + if (root.JS_SHA3_NO_WINDOW) { + WINDOW = false; + } + var WEB_WORKER = !WINDOW && typeof self === 'object'; + var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; + if (NODE_JS) { + root = global; + } else if (WEB_WORKER) { + root = self; + } + var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports; + var AMD = typeof define === 'function' && define.amd; + var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; + var HEX_CHARS = '0123456789abcdef'.split(''); + var SHAKE_PADDING = [31, 7936, 2031616, 520093696]; + var CSHAKE_PADDING = [4, 1024, 262144, 67108864]; + var KECCAK_PADDING = [1, 256, 65536, 16777216]; + var PADDING = [6, 1536, 393216, 100663296]; + var SHIFT = [0, 8, 16, 24]; + var RC = [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]; + var BITS = [224, 256, 384, 512]; + var SHAKE_BITS = [128, 256]; + var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest']; + var CSHAKE_BYTEPAD = { + '128': 168, + '256': 136 + }; + + + var isArray = root.JS_SHA3_NO_NODE_JS || !Array.isArray + ? function (obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + } + : Array.isArray; + + var isView = (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) + ? function (obj) { + return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer; + } + : ArrayBuffer.isView; + + // [message: string, isString: bool] + var formatMessage = function (message) { + var type = typeof message; + if (type === 'string') { + return [message, true]; + } + if (type !== 'object' || message === null) { + throw new Error(INPUT_ERROR); + } + if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { + return [new Uint8Array(message), false]; + } + if (!isArray(message) && !isView(message)) { + throw new Error(INPUT_ERROR); + } + return [message, false]; + } + + var empty = function (message) { + return formatMessage(message)[0].length === 0; + }; + + var createOutputMethod = function (bits, padding, outputType) { + return function (message) { + return new Keccak(bits, padding, bits).update(message)[outputType](); + }; + }; + + var createShakeOutputMethod = function (bits, padding, outputType) { + return function (message, outputBits) { + return new Keccak(bits, padding, outputBits).update(message)[outputType](); + }; + }; + + var createCshakeOutputMethod = function (bits, padding, outputType) { + return function (message, outputBits, n, s) { + return methods['cshake' + bits].update(message, outputBits, n, s)[outputType](); + }; + }; + + var createKmacOutputMethod = function (bits, padding, outputType) { + return function (key, message, outputBits, s) { + return methods['kmac' + bits].update(key, message, outputBits, s)[outputType](); + }; + }; + + var createOutputMethods = function (method, createMethod, bits, padding) { + for (var i = 0; i < OUTPUT_TYPES.length; ++i) { + var type = OUTPUT_TYPES[i]; + method[type] = createMethod(bits, padding, type); + } + return method; + }; + + var createMethod = function (bits, padding) { + var method = createOutputMethod(bits, padding, 'hex'); + method.create = function () { + return new Keccak(bits, padding, bits); + }; + method.update = function (message) { + return method.create().update(message); + }; + return createOutputMethods(method, createOutputMethod, bits, padding); + }; + + var createShakeMethod = function (bits, padding) { + var method = createShakeOutputMethod(bits, padding, 'hex'); + method.create = function (outputBits) { + return new Keccak(bits, padding, outputBits); + }; + method.update = function (message, outputBits) { + return method.create(outputBits).update(message); + }; + return createOutputMethods(method, createShakeOutputMethod, bits, padding); + }; + + var createCshakeMethod = function (bits, padding) { + var w = CSHAKE_BYTEPAD[bits]; + var method = createCshakeOutputMethod(bits, padding, 'hex'); + method.create = function (outputBits, n, s) { + if (empty(n) && empty(s)) { + return methods['shake' + bits].create(outputBits); + } else { + return new Keccak(bits, padding, outputBits).bytepad([n, s], w); + } + }; + method.update = function (message, outputBits, n, s) { + return method.create(outputBits, n, s).update(message); + }; + return createOutputMethods(method, createCshakeOutputMethod, bits, padding); + }; + + var createKmacMethod = function (bits, padding) { + var w = CSHAKE_BYTEPAD[bits]; + var method = createKmacOutputMethod(bits, padding, 'hex'); + method.create = function (key, outputBits, s) { + return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w); + }; + method.update = function (key, message, outputBits, s) { + return method.create(key, outputBits, s).update(message); + }; + return createOutputMethods(method, createKmacOutputMethod, bits, padding); + }; + + var algorithms = [ + { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod }, + { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod }, + { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod }, + { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod }, + { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod } + ]; + + var methods = {}, methodNames = []; + + for (var i = 0; i < algorithms.length; ++i) { + var algorithm = algorithms[i]; + var bits = algorithm.bits; + for (var j = 0; j < bits.length; ++j) { + var methodName = algorithm.name + '_' + bits[j]; + methodNames.push(methodName); + methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding); + if (algorithm.name !== 'sha3') { + var newMethodName = algorithm.name + bits[j]; + methodNames.push(newMethodName); + methods[newMethodName] = methods[methodName]; + } + } + } + + methodNames.push("extractLast20Bytes"); + methods["extractLast20Bytes"] = extractLast20Bytes; + + + function Keccak(bits, padding, outputBits) { + this.blocks = []; + this.s = []; + this.padding = padding; + this.outputBits = outputBits; + this.reset = true; + this.finalized = false; + this.block = 0; + this.start = 0; + this.blockCount = (1600 - (bits << 1)) >> 5; + this.byteCount = this.blockCount << 2; + this.outputBlocks = outputBits >> 5; + this.extraBytes = (outputBits & 31) >> 3; + + for (var i = 0; i < 50; ++i) { + this.s[i] = 0; + } + } + + Keccak.prototype.update = function (message) { + if (this.finalized) { + throw new Error(FINALIZE_ERROR); + } + var result = formatMessage(message); + message = result[0]; + var isString = result[1]; + var blocks = this.blocks, byteCount = this.byteCount, length = message.length, + blockCount = this.blockCount, index = 0, s = this.s, i, code; + + while (index < length) { + if (this.reset) { + this.reset = false; + blocks[0] = this.block; + for (i = 1; i < blockCount + 1; ++i) { + blocks[i] = 0; + } + } + if (isString) { + for (i = this.start; index < length && i < byteCount; ++index) { + code = message.charCodeAt(index); + if (code < 0x80) { + blocks[i >> 2] |= code << SHIFT[i++ & 3]; + } else if (code < 0x800) { + blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else if (code < 0xd800 || code >= 0xe000) { + blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff)); + blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; + blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; + } + } + } else { + for (i = this.start; index < length && i < byteCount; ++index) { + blocks[i >> 2] |= message[index] << SHIFT[i++ & 3]; + } + } + this.lastByteIndex = i; + if (i >= byteCount) { + this.start = i - byteCount; + this.block = blocks[blockCount]; + for (i = 0; i < blockCount; ++i) { + s[i] ^= blocks[i]; + } + f(s); + this.reset = true; + } else { + this.start = i; + } + } + return this; + }; + + Keccak.prototype.encode = function (x, right) { + var o = x & 255, n = 1; + var bytes = [o]; + x = x >> 8; + o = x & 255; + while (o > 0) { + bytes.unshift(o); + x = x >> 8; + o = x & 255; + ++n; + } + if (right) { + bytes.push(n); + } else { + bytes.unshift(n); + } + this.update(bytes); + return bytes.length; + }; + + Keccak.prototype.encodeString = function (str) { + var result = formatMessage(str); + str = result[0]; + var isString = result[1]; + var bytes = 0, length = str.length; + if (isString) { + for (var i = 0; i < str.length; ++i) { + var code = str.charCodeAt(i); + if (code < 0x80) { + bytes += 1; + } else if (code < 0x800) { + bytes += 2; + } else if (code < 0xd800 || code >= 0xe000) { + bytes += 3; + } else { + code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff)); + bytes += 4; + } + } + } else { + bytes = length; + } + bytes += this.encode(bytes * 8); + this.update(str); + return bytes; + }; + + Keccak.prototype.bytepad = function (strs, w) { + var bytes = this.encode(w); + for (var i = 0; i < strs.length; ++i) { + bytes += this.encodeString(strs[i]); + } + var paddingBytes = (w - bytes % w) % w; + var zeros = []; + zeros.length = paddingBytes; + this.update(zeros); + return this; + }; + + Keccak.prototype.finalize = function () { + if (this.finalized) { + return; + } + this.finalized = true; + var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s; + blocks[i >> 2] |= this.padding[i & 3]; + if (this.lastByteIndex === this.byteCount) { + blocks[0] = blocks[blockCount]; + for (i = 1; i < blockCount + 1; ++i) { + blocks[i] = 0; + } + } + blocks[blockCount - 1] |= 0x80000000; + for (i = 0; i < blockCount; ++i) { + s[i] ^= blocks[i]; + } + f(s); + }; + + Keccak.prototype.toString = Keccak.prototype.hex = function () { + this.finalize(); + + var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, + extraBytes = this.extraBytes, i = 0, j = 0; + var hex = '', block; + while (j < outputBlocks) { + for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) { + block = s[i]; + hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] + + HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] + + HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] + + HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F]; + } + if (j % blockCount === 0) { + f(s); + i = 0; + } + } + if (extraBytes) { + block = s[i]; + hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F]; + if (extraBytes > 1) { + hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F]; + } + if (extraBytes > 2) { + hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F]; + } + } + return hex; + }; + + Keccak.prototype.arrayBuffer = function () { + this.finalize(); + + var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, + extraBytes = this.extraBytes, i = 0, j = 0; + var bytes = this.outputBits >> 3; + var buffer; + if (extraBytes) { + buffer = new ArrayBuffer((outputBlocks + 1) << 2); + } else { + buffer = new ArrayBuffer(bytes); + } + var array = new Uint32Array(buffer); + while (j < outputBlocks) { + for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) { + array[j] = s[i]; + } + if (j % blockCount === 0) { + f(s); + } + } + if (extraBytes) { + array[i] = s[i]; + buffer = buffer.slice(0, bytes); + } + return buffer; + }; + + Keccak.prototype.buffer = Keccak.prototype.arrayBuffer; + + Keccak.prototype.digest = Keccak.prototype.array = function () { + this.finalize(); + + var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, + extraBytes = this.extraBytes, i = 0, j = 0; + var array = [], offset, block; + while (j < outputBlocks) { + for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) { + offset = j << 2; + block = s[i]; + array[offset] = block & 0xFF; + array[offset + 1] = (block >> 8) & 0xFF; + array[offset + 2] = (block >> 16) & 0xFF; + array[offset + 3] = (block >> 24) & 0xFF; + } + if (j % blockCount === 0) { + f(s); + } + } + if (extraBytes) { + offset = j << 2; + block = s[i]; + array[offset] = block & 0xFF; + if (extraBytes > 1) { + array[offset + 1] = (block >> 8) & 0xFF; + } + if (extraBytes > 2) { + array[offset + 2] = (block >> 16) & 0xFF; + } + } + return array; + }; + + function Kmac(bits, padding, outputBits) { + Keccak.call(this, bits, padding, outputBits); + } + + Kmac.prototype = new Keccak(); + + Kmac.prototype.finalize = function () { + this.encode(this.outputBits, true); + return Keccak.prototype.finalize.call(this); + }; + + var f = function (s) { + var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, + b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, + b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, + b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49; + for (n = 0; n < 48; n += 2) { + c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]; + c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]; + c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]; + c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]; + c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]; + c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]; + c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]; + c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]; + c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]; + c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]; + + h = c8 ^ ((c2 << 1) | (c3 >>> 31)); + l = c9 ^ ((c3 << 1) | (c2 >>> 31)); + s[0] ^= h; + s[1] ^= l; + s[10] ^= h; + s[11] ^= l; + s[20] ^= h; + s[21] ^= l; + s[30] ^= h; + s[31] ^= l; + s[40] ^= h; + s[41] ^= l; + h = c0 ^ ((c4 << 1) | (c5 >>> 31)); + l = c1 ^ ((c5 << 1) | (c4 >>> 31)); + s[2] ^= h; + s[3] ^= l; + s[12] ^= h; + s[13] ^= l; + s[22] ^= h; + s[23] ^= l; + s[32] ^= h; + s[33] ^= l; + s[42] ^= h; + s[43] ^= l; + h = c2 ^ ((c6 << 1) | (c7 >>> 31)); + l = c3 ^ ((c7 << 1) | (c6 >>> 31)); + s[4] ^= h; + s[5] ^= l; + s[14] ^= h; + s[15] ^= l; + s[24] ^= h; + s[25] ^= l; + s[34] ^= h; + s[35] ^= l; + s[44] ^= h; + s[45] ^= l; + h = c4 ^ ((c8 << 1) | (c9 >>> 31)); + l = c5 ^ ((c9 << 1) | (c8 >>> 31)); + s[6] ^= h; + s[7] ^= l; + s[16] ^= h; + s[17] ^= l; + s[26] ^= h; + s[27] ^= l; + s[36] ^= h; + s[37] ^= l; + s[46] ^= h; + s[47] ^= l; + h = c6 ^ ((c0 << 1) | (c1 >>> 31)); + l = c7 ^ ((c1 << 1) | (c0 >>> 31)); + s[8] ^= h; + s[9] ^= l; + s[18] ^= h; + s[19] ^= l; + s[28] ^= h; + s[29] ^= l; + s[38] ^= h; + s[39] ^= l; + s[48] ^= h; + s[49] ^= l; + + b0 = s[0]; + b1 = s[1]; + b32 = (s[11] << 4) | (s[10] >>> 28); + b33 = (s[10] << 4) | (s[11] >>> 28); + b14 = (s[20] << 3) | (s[21] >>> 29); + b15 = (s[21] << 3) | (s[20] >>> 29); + b46 = (s[31] << 9) | (s[30] >>> 23); + b47 = (s[30] << 9) | (s[31] >>> 23); + b28 = (s[40] << 18) | (s[41] >>> 14); + b29 = (s[41] << 18) | (s[40] >>> 14); + b20 = (s[2] << 1) | (s[3] >>> 31); + b21 = (s[3] << 1) | (s[2] >>> 31); + b2 = (s[13] << 12) | (s[12] >>> 20); + b3 = (s[12] << 12) | (s[13] >>> 20); + b34 = (s[22] << 10) | (s[23] >>> 22); + b35 = (s[23] << 10) | (s[22] >>> 22); + b16 = (s[33] << 13) | (s[32] >>> 19); + b17 = (s[32] << 13) | (s[33] >>> 19); + b48 = (s[42] << 2) | (s[43] >>> 30); + b49 = (s[43] << 2) | (s[42] >>> 30); + b40 = (s[5] << 30) | (s[4] >>> 2); + b41 = (s[4] << 30) | (s[5] >>> 2); + b22 = (s[14] << 6) | (s[15] >>> 26); + b23 = (s[15] << 6) | (s[14] >>> 26); + b4 = (s[25] << 11) | (s[24] >>> 21); + b5 = (s[24] << 11) | (s[25] >>> 21); + b36 = (s[34] << 15) | (s[35] >>> 17); + b37 = (s[35] << 15) | (s[34] >>> 17); + b18 = (s[45] << 29) | (s[44] >>> 3); + b19 = (s[44] << 29) | (s[45] >>> 3); + b10 = (s[6] << 28) | (s[7] >>> 4); + b11 = (s[7] << 28) | (s[6] >>> 4); + b42 = (s[17] << 23) | (s[16] >>> 9); + b43 = (s[16] << 23) | (s[17] >>> 9); + b24 = (s[26] << 25) | (s[27] >>> 7); + b25 = (s[27] << 25) | (s[26] >>> 7); + b6 = (s[36] << 21) | (s[37] >>> 11); + b7 = (s[37] << 21) | (s[36] >>> 11); + b38 = (s[47] << 24) | (s[46] >>> 8); + b39 = (s[46] << 24) | (s[47] >>> 8); + b30 = (s[8] << 27) | (s[9] >>> 5); + b31 = (s[9] << 27) | (s[8] >>> 5); + b12 = (s[18] << 20) | (s[19] >>> 12); + b13 = (s[19] << 20) | (s[18] >>> 12); + b44 = (s[29] << 7) | (s[28] >>> 25); + b45 = (s[28] << 7) | (s[29] >>> 25); + b26 = (s[38] << 8) | (s[39] >>> 24); + b27 = (s[39] << 8) | (s[38] >>> 24); + b8 = (s[48] << 14) | (s[49] >>> 18); + b9 = (s[49] << 14) | (s[48] >>> 18); + + s[0] = b0 ^ (~b2 & b4); + s[1] = b1 ^ (~b3 & b5); + s[10] = b10 ^ (~b12 & b14); + s[11] = b11 ^ (~b13 & b15); + s[20] = b20 ^ (~b22 & b24); + s[21] = b21 ^ (~b23 & b25); + s[30] = b30 ^ (~b32 & b34); + s[31] = b31 ^ (~b33 & b35); + s[40] = b40 ^ (~b42 & b44); + s[41] = b41 ^ (~b43 & b45); + s[2] = b2 ^ (~b4 & b6); + s[3] = b3 ^ (~b5 & b7); + s[12] = b12 ^ (~b14 & b16); + s[13] = b13 ^ (~b15 & b17); + s[22] = b22 ^ (~b24 & b26); + s[23] = b23 ^ (~b25 & b27); + s[32] = b32 ^ (~b34 & b36); + s[33] = b33 ^ (~b35 & b37); + s[42] = b42 ^ (~b44 & b46); + s[43] = b43 ^ (~b45 & b47); + s[4] = b4 ^ (~b6 & b8); + s[5] = b5 ^ (~b7 & b9); + s[14] = b14 ^ (~b16 & b18); + s[15] = b15 ^ (~b17 & b19); + s[24] = b24 ^ (~b26 & b28); + s[25] = b25 ^ (~b27 & b29); + s[34] = b34 ^ (~b36 & b38); + s[35] = b35 ^ (~b37 & b39); + s[44] = b44 ^ (~b46 & b48); + s[45] = b45 ^ (~b47 & b49); + s[6] = b6 ^ (~b8 & b0); + s[7] = b7 ^ (~b9 & b1); + s[16] = b16 ^ (~b18 & b10); + s[17] = b17 ^ (~b19 & b11); + s[26] = b26 ^ (~b28 & b20); + s[27] = b27 ^ (~b29 & b21); + s[36] = b36 ^ (~b38 & b30); + s[37] = b37 ^ (~b39 & b31); + s[46] = b46 ^ (~b48 & b40); + s[47] = b47 ^ (~b49 & b41); + s[8] = b8 ^ (~b0 & b2); + s[9] = b9 ^ (~b1 & b3); + s[18] = b18 ^ (~b10 & b12); + s[19] = b19 ^ (~b11 & b13); + s[28] = b28 ^ (~b20 & b22); + s[29] = b29 ^ (~b21 & b23); + s[38] = b38 ^ (~b30 & b32); + s[39] = b39 ^ (~b31 & b33); + s[48] = b48 ^ (~b40 & b42); + s[49] = b49 ^ (~b41 & b43); + + s[0] ^= RC[n]; + s[1] ^= RC[n + 1]; + } + }; + + function extractLast20Bytes(hexString, addPrefix) { + // Ensure the input hexString has '0x' prefix + if (!hexString.startsWith('0x')) { + hexString = '0x' + hexString; + } + + // Remove '0x' prefix and parse the hex string to a BigInt + var bigIntValue = BigInt(hexString); + + // Extract the last 20 bytes (160 bits) from the BigInt + var last20Bytes = bigIntValue & BigInt('0x' + 'f'.repeat(40)); // 0xf is 4 bits in hexadecimal, repeated 40 times for 160 bits + + // Convert the result back to a hexadecimal string + var result = last20Bytes.toString(16).padStart(40, '0'); // 40 characters for 160 bits + + // Add '0x' prefix if addPrefix is truthy + if (addPrefix) { + result = '0x' + result; + } + + return result; + } + + if (typeof root.keccak === 'object') { + Object.assign(root.keccak, methods); + } + + if (COMMON_JS) { + module.exports = methods; + } else { + for (i = 0; i < methodNames.length; ++i) { + root[methodNames[i]] = methods[methodNames[i]]; + } + if (AMD) { + define(function () { + return methods; + }); + } + } + })(); \ No newline at end of file diff --git a/scripts/qrcode-scanner.min.js b/scripts/qrcode-scanner.min.js index b275c07..f72a8b6 100644 --- a/scripts/qrcode-scanner.min.js +++ b/scripts/qrcode-scanner.min.js @@ -1,7 +1,8 @@ + function getLazarSoftScanner(){var e={};function t(e,t){this.count=e,this.dataCodewords=t,this.__defineGetter__("Count",function(){return this.count}),this.__defineGetter__("DataCodewords",function(){return this.dataCodewords})}function n(e,t,n){this.ecCodewordsPerBlock=e,this.ecBlocks=n?new Array(t,n):new Array(t),this.__defineGetter__("ECCodewordsPerBlock",function(){return this.ecCodewordsPerBlock}),this.__defineGetter__("TotalECCodewords",function(){return this.ecCodewordsPerBlock*this.NumBlocks}),this.__defineGetter__("NumBlocks",function(){for(var e=0,t=0;t6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},this.getECBlocksForLevel=function(e){return this.ecBlocks[e.ordinal()]}}function i(e,t,n,r,a,o,s,h,w){this.a11=e,this.a12=r,this.a13=s,this.a21=t,this.a22=a,this.a23=h,this.a31=n,this.a32=o,this.a33=w,this.transformPoints1=function(e){for(var t=e.length,n=this.a11,r=this.a12,i=this.a13,a=this.a21,o=this.a22,s=this.a23,h=this.a31,w=this.a32,f=this.a33,u=0;uMath.abs(n-e);if(i){var a=e;e=t,t=a,a=n,n=r,r=a}for(var o=Math.abs(n-e),s=Math.abs(r-t),h=-o>>1,w=t0){if(l==r)break;l+=w,h-=o}}var b=n-e,y=r-t;return Math.sqrt(b*b+y*y)},this.sizeOfBlackWhiteBlackRunBothWays=function(e,t,n,r){var i=this.sizeOfBlackWhiteBlackRun(e,t,n,r),a=1,o=e-(n-e);o<0?(a=e/(e-o),o=0):o>=A.width&&(a=(A.width-1-e)/(o-e),o=A.width-1);var s=Math.floor(t-(r-t)*a);return a=1,s<0?(a=t/(t-s),s=0):s>=A.height&&(a=(A.height-1-t)/(s-t),s=A.height-1),o=Math.floor(e+(o-e)*a),(i+=this.sizeOfBlackWhiteBlackRun(e,t,o,s))-1},this.calculateModuleSizeOneWay=function(e,t){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.X),Math.floor(e.Y),Math.floor(t.X),Math.floor(t.Y)),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.X),Math.floor(t.Y),Math.floor(e.X),Math.floor(e.Y));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14},this.calculateModuleSize=function(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2},this.distance=function(e,t){var n=e.X-t.X,r=e.Y-t.Y;return Math.sqrt(n*n+r*r)},this.computeDimension=function(e,t,n,r){var i=7+(Math.round(this.distance(e,t)/r)+Math.round(this.distance(e,n)/r)>>1);switch(3&i){case 0:i++;break;case 2:i--;break;case 3:throw"Error"}return i},this.findAlignmentInRegion=function(e,t,n,r){var i=Math.floor(r*e),a=Math.max(0,t-i),o=Math.min(A.width-1,t+i);if(o-a<3*e)throw"Error";var s=Math.max(0,n-i),h=Math.min(A.height-1,n+i);return new F(this.image,a,s,o-a,h-s,e,this.resultPointCallback).find()},this.createTransform=function(e,t,n,r,a){var o,s,h,w,f=a-3.5;return null!=r?(o=r.X,s=r.Y,h=w=f-3):(o=t.X-e.X+n.X,s=t.Y-e.Y+n.Y,h=w=f),i.quadrilateralToQuadrilateral(3.5,3.5,f,3.5,h,w,3.5,f,e.X,e.Y,t.X,t.Y,o,s,n.X,n.Y)},this.sampleGrid=function(t,n,r){return e.sampleGrid3(t,r,n)},this.processFinderPatternInfo=function(e){var t=e.TopLeft,n=e.TopRight,i=e.BottomLeft,o=this.calculateModuleSize(t,n,i);if(o<1)throw"Error";var s=this.computeDimension(t,n,i,o),h=r.getProvisionalVersionForDimension(s),w=h.DimensionForVersion-7,f=null;if(h.AlignmentPatternCenters.length>0)for(var u=n.X-t.X+i.X,d=n.Y-t.Y+i.Y,l=1-3/w,c=Math.floor(t.X+l*(u-t.X)),g=Math.floor(t.Y+l*(d-t.Y)),v=4;v<=16;v<<=1){f=this.findAlignmentInRegion(o,c,g,v);break}var m=this.createTransform(t,n,i,f,s);return new a(this.sampleGrid(this.image,m,s),null==f?new Array(i,t,n):new Array(i,t,n,f))},this.detect=function(){var e=(new D).findFinderPattern(this.image);return this.processFinderPatternInfo(e)}}e.checkAndNudgePoints=function(e,t){for(var n=A.width,r=A.height,i=!0,a=0;an||s<-1||s>r)throw"Error.checkAndNudgePoints ";i=!1,-1==o?(t[a]=0,i=!0):o==n&&(t[a]=n-1,i=!0),-1==s?(t[a+1]=0,i=!0):s==r&&(t[a+1]=r-1,i=!0)}i=!0;for(a=t.length-2;a>=0&&i;a-=2){o=Math.floor(t[a]),s=Math.floor(t[a+1]);if(o<-1||o>n||s<-1||s>r)throw"Error.checkAndNudgePoints ";i=!1,-1==o?(t[a]=0,i=!0):o==n&&(t[a]=n-1,i=!0),-1==s?(t[a+1]=0,i=!0):s==r&&(t[a+1]=r-1,i=!0)}},e.sampleGrid3=function(t,n,r){for(var i=new v(n),a=new Array(n<<1),o=0;o>1),a[w+1]=h;r.transformPoints1(a),e.checkAndNudgePoints(t,a);try{for(w=0;w>1,o)}}catch(e){throw"Error.checkAndNudgePoints"}}return i},e.sampleGridx=function(t,n,r,a,o,s,h,w,f,u,d,l,c,g,v,m,b,y){var C=i.quadrilateralToQuadrilateral(r,a,o,s,h,w,f,u,d,l,c,g,v,m,b,y);return e.sampleGrid3(t,n,C)},r.VERSION_DECODE_INFO=new Array(31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017),r.VERSIONS=new Array(new r(1,new Array,new n(7,new t(1,19)),new n(10,new t(1,16)),new n(13,new t(1,13)),new n(17,new t(1,9))),new r(2,new Array(6,18),new n(10,new t(1,34)),new n(16,new t(1,28)),new n(22,new t(1,22)),new n(28,new t(1,16))),new r(3,new Array(6,22),new n(15,new t(1,55)),new n(26,new t(1,44)),new n(18,new t(2,17)),new n(22,new t(2,13))),new r(4,new Array(6,26),new n(20,new t(1,80)),new n(18,new t(2,32)),new n(26,new t(2,24)),new n(16,new t(4,9))),new r(5,new Array(6,30),new n(26,new t(1,108)),new n(24,new t(2,43)),new n(18,new t(2,15),new t(2,16)),new n(22,new t(2,11),new t(2,12))),new r(6,new Array(6,34),new n(18,new t(2,68)),new n(16,new t(4,27)),new n(24,new t(4,19)),new n(28,new t(4,15))),new r(7,new Array(6,22,38),new n(20,new t(2,78)),new n(18,new t(4,31)),new n(18,new t(2,14),new t(4,15)),new n(26,new t(4,13),new t(1,14))),new r(8,new Array(6,24,42),new n(24,new t(2,97)),new n(22,new t(2,38),new t(2,39)),new n(22,new t(4,18),new t(2,19)),new n(26,new t(4,14),new t(2,15))),new r(9,new Array(6,26,46),new n(30,new t(2,116)),new n(22,new t(3,36),new t(2,37)),new n(20,new t(4,16),new t(4,17)),new n(24,new t(4,12),new t(4,13))),new r(10,new Array(6,28,50),new n(18,new t(2,68),new t(2,69)),new n(26,new t(4,43),new t(1,44)),new n(24,new t(6,19),new t(2,20)),new n(28,new t(6,15),new t(2,16))),new r(11,new Array(6,30,54),new n(20,new t(4,81)),new n(30,new t(1,50),new t(4,51)),new n(28,new t(4,22),new t(4,23)),new n(24,new t(3,12),new t(8,13))),new r(12,new Array(6,32,58),new n(24,new t(2,92),new t(2,93)),new n(22,new t(6,36),new t(2,37)),new n(26,new t(4,20),new t(6,21)),new n(28,new t(7,14),new t(4,15))),new r(13,new Array(6,34,62),new n(26,new t(4,107)),new n(22,new t(8,37),new t(1,38)),new n(24,new t(8,20),new t(4,21)),new n(22,new t(12,11),new t(4,12))),new r(14,new Array(6,26,46,66),new n(30,new t(3,115),new t(1,116)),new n(24,new t(4,40),new t(5,41)),new n(20,new t(11,16),new t(5,17)),new n(24,new t(11,12),new t(5,13))),new r(15,new Array(6,26,48,70),new n(22,new t(5,87),new t(1,88)),new n(24,new t(5,41),new t(5,42)),new n(30,new t(5,24),new t(7,25)),new n(24,new t(11,12),new t(7,13))),new r(16,new Array(6,26,50,74),new n(24,new t(5,98),new t(1,99)),new n(28,new t(7,45),new t(3,46)),new n(24,new t(15,19),new t(2,20)),new n(30,new t(3,15),new t(13,16))),new r(17,new Array(6,30,54,78),new n(28,new t(1,107),new t(5,108)),new n(28,new t(10,46),new t(1,47)),new n(28,new t(1,22),new t(15,23)),new n(28,new t(2,14),new t(17,15))),new r(18,new Array(6,30,56,82),new n(30,new t(5,120),new t(1,121)),new n(26,new t(9,43),new t(4,44)),new n(28,new t(17,22),new t(1,23)),new n(28,new t(2,14),new t(19,15))),new r(19,new Array(6,30,58,86),new n(28,new t(3,113),new t(4,114)),new n(26,new t(3,44),new t(11,45)),new n(26,new t(17,21),new t(4,22)),new n(26,new t(9,13),new t(16,14))),new r(20,new Array(6,34,62,90),new n(28,new t(3,107),new t(5,108)),new n(26,new t(3,41),new t(13,42)),new n(30,new t(15,24),new t(5,25)),new n(28,new t(15,15),new t(10,16))),new r(21,new Array(6,28,50,72,94),new n(28,new t(4,116),new t(4,117)),new n(26,new t(17,42)),new n(28,new t(17,22),new t(6,23)),new n(30,new t(19,16),new t(6,17))),new r(22,new Array(6,26,50,74,98),new n(28,new t(2,111),new t(7,112)),new n(28,new t(17,46)),new n(30,new t(7,24),new t(16,25)),new n(24,new t(34,13))),new r(23,new Array(6,30,54,74,102),new n(30,new t(4,121),new t(5,122)),new n(28,new t(4,47),new t(14,48)),new n(30,new t(11,24),new t(14,25)),new n(30,new t(16,15),new t(14,16))),new r(24,new Array(6,28,54,80,106),new n(30,new t(6,117),new t(4,118)),new n(28,new t(6,45),new t(14,46)),new n(30,new t(11,24),new t(16,25)),new n(30,new t(30,16),new t(2,17))),new r(25,new Array(6,32,58,84,110),new n(26,new t(8,106),new t(4,107)),new n(28,new t(8,47),new t(13,48)),new n(30,new t(7,24),new t(22,25)),new n(30,new t(22,15),new t(13,16))),new r(26,new Array(6,30,58,86,114),new n(28,new t(10,114),new t(2,115)),new n(28,new t(19,46),new t(4,47)),new n(28,new t(28,22),new t(6,23)),new n(30,new t(33,16),new t(4,17))),new r(27,new Array(6,34,62,90,118),new n(30,new t(8,122),new t(4,123)),new n(28,new t(22,45),new t(3,46)),new n(30,new t(8,23),new t(26,24)),new n(30,new t(12,15),new t(28,16))),new r(28,new Array(6,26,50,74,98,122),new n(30,new t(3,117),new t(10,118)),new n(28,new t(3,45),new t(23,46)),new n(30,new t(4,24),new t(31,25)),new n(30,new t(11,15),new t(31,16))),new r(29,new Array(6,30,54,78,102,126),new n(30,new t(7,116),new t(7,117)),new n(28,new t(21,45),new t(7,46)),new n(30,new t(1,23),new t(37,24)),new n(30,new t(19,15),new t(26,16))),new r(30,new Array(6,26,52,78,104,130),new n(30,new t(5,115),new t(10,116)),new n(28,new t(19,47),new t(10,48)),new n(30,new t(15,24),new t(25,25)),new n(30,new t(23,15),new t(25,16))),new r(31,new Array(6,30,56,82,108,134),new n(30,new t(13,115),new t(3,116)),new n(28,new t(2,46),new t(29,47)),new n(30,new t(42,24),new t(1,25)),new n(30,new t(23,15),new t(28,16))),new r(32,new Array(6,34,60,86,112,138),new n(30,new t(17,115)),new n(28,new t(10,46),new t(23,47)),new n(30,new t(10,24),new t(35,25)),new n(30,new t(19,15),new t(35,16))),new r(33,new Array(6,30,58,86,114,142),new n(30,new t(17,115),new t(1,116)),new n(28,new t(14,46),new t(21,47)),new n(30,new t(29,24),new t(19,25)),new n(30,new t(11,15),new t(46,16))),new r(34,new Array(6,34,62,90,118,146),new n(30,new t(13,115),new t(6,116)),new n(28,new t(14,46),new t(23,47)),new n(30,new t(44,24),new t(7,25)),new n(30,new t(59,16),new t(1,17))),new r(35,new Array(6,30,54,78,102,126,150),new n(30,new t(12,121),new t(7,122)),new n(28,new t(12,47),new t(26,48)),new n(30,new t(39,24),new t(14,25)),new n(30,new t(22,15),new t(41,16))),new r(36,new Array(6,24,50,76,102,128,154),new n(30,new t(6,121),new t(14,122)),new n(28,new t(6,47),new t(34,48)),new n(30,new t(46,24),new t(10,25)),new n(30,new t(2,15),new t(64,16))),new r(37,new Array(6,28,54,80,106,132,158),new n(30,new t(17,122),new t(4,123)),new n(28,new t(29,46),new t(14,47)),new n(30,new t(49,24),new t(10,25)),new n(30,new t(24,15),new t(46,16))),new r(38,new Array(6,32,58,84,110,136,162),new n(30,new t(4,122),new t(18,123)),new n(28,new t(13,46),new t(32,47)),new n(30,new t(48,24),new t(14,25)),new n(30,new t(42,15),new t(32,16))),new r(39,new Array(6,26,54,82,110,138,166),new n(30,new t(20,117),new t(4,118)),new n(28,new t(40,47),new t(7,48)),new n(30,new t(43,24),new t(22,25)),new n(30,new t(10,15),new t(67,16))),new r(40,new Array(6,30,58,86,114,142,170),new n(30,new t(19,118),new t(6,119)),new n(28,new t(18,47),new t(31,48)),new n(30,new t(34,24),new t(34,25)),new n(30,new t(20,15),new t(61,16)))),r.getVersionForNumber=function(e){if(e<1||e>40)throw"ArgumentException";return r.VERSIONS[e-1]},r.getProvisionalVersionForDimension=function(e){if(e%4!=1)throw"Error getProvisionalVersionForDimension";try{return r.getVersionForNumber(e-17>>2)}catch(e){throw"Error getVersionForNumber"}},r.decodeVersionInformation=function(e){for(var t=4294967295,n=0,i=0;i>3&3),this.dataMask=7&e,this.__defineGetter__("ErrorCorrectionLevel",function(){return this.errorCorrectionLevel}),this.__defineGetter__("DataMask",function(){return this.dataMask}),this.GetHashCode=function(){return this.errorCorrectionLevel.ordinal()<<3|this.dataMask},this.Equals=function(e){var t=e;return this.errorCorrectionLevel==t.errorCorrectionLevel&&this.dataMask==t.dataMask}}function f(e,t,n){this.ordinal_Renamed_Field=e,this.bits=t,this.name=n,this.__defineGetter__("Bits",function(){return this.bits}),this.__defineGetter__("Name",function(){return this.name}),this.ordinal=function(){return this.ordinal_Renamed_Field}}w.numBitsDiffering=function(e,t){return h[15&(e^=t)]+h[15&M(e,4)]+h[15&M(e,8)]+h[15&M(e,12)]+h[15&M(e,16)]+h[15&M(e,20)]+h[15&M(e,24)]+h[15&M(e,28)]},w.decodeFormatInformation=function(e){var t=w.doDecodeFormatInformation(e);return null!=t?t:w.doDecodeFormatInformation(21522^e)},w.doDecodeFormatInformation=function(e){for(var t=4294967295,n=0,r=0;r=g.length)throw"ArgumentException";return g[e]};var u=new f(0,1,"L"),d=new f(1,0,"M"),l=new f(2,3,"Q"),c=new f(3,2,"H"),g=new Array(d,u,c,l);function v(e,t){if(t||(t=e),e<1||t<1)throw"Both dimensions must be greater than 0";this.width=e,this.height=t;var n=e>>5;0!=(31&e)&&n++,this.rowSize=n,this.bits=new Array(n*t);for(var r=0;r>5);return 0!=(1&M(this.bits[n],31&e))},this.set_Renamed=function(e,t){var n=t*this.rowSize+(e>>5);this.bits[n]|=1<<(31&e)},this.flip=function(e,t){var n=t*this.rowSize+(e>>5);this.bits[n]^=1<<(31&e)},this.clear=function(){for(var e=this.bits.length,t=0;tthis.height||i>this.width)throw"The region must fit inside the matrix";for(var o=t;o>5)]|=1<<(31&h)}}function m(e,t){this.numDataCodewords=e,this.codewords=t,this.__defineGetter__("NumDataCodewords",function(){return this.numDataCodewords}),this.__defineGetter__("Codewords",function(){return this.codewords})}function b(e){var t=e.Dimension;if(t<21||1!=(3&t))throw"Error BitMatrixParser";this.bitMatrix=e,this.parsedVersion=null,this.parsedFormatInfo=null,this.copyBit=function(e,t,n){return this.bitMatrix.get_Renamed(e,t)?n<<1|1:n<<1},this.readFormatInformation=function(){if(null!=this.parsedFormatInfo)return this.parsedFormatInfo;for(var e=0,t=0;t<6;t++)e=this.copyBit(t,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var n=5;n>=0;n--)e=this.copyBit(8,n,e);if(this.parsedFormatInfo=w.decodeFormatInformation(e),null!=this.parsedFormatInfo)return this.parsedFormatInfo;var r=this.bitMatrix.Dimension;e=0;var i=r-8;for(t=r-1;t>=i;t--)e=this.copyBit(t,8,e);for(n=r-7;n>2;if(t<=6)return r.getVersionForNumber(t);for(var n=0,i=e-11,a=5;a>=0;a--)for(var o=e-9;o>=i;o--)n=this.copyBit(o,a,n);if(this.parsedVersion=r.decodeVersionInformation(n),null!=this.parsedVersion&&this.parsedVersion.DimensionForVersion==e)return this.parsedVersion;n=0;for(o=5;o>=0;o--)for(a=e-9;a>=i;a--)n=this.copyBit(o,a,n);if(this.parsedVersion=r.decodeVersionInformation(n),null!=this.parsedVersion&&this.parsedVersion.DimensionForVersion==e)return this.parsedVersion;throw"Error readVersion"},this.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),n=y.forReference(e.DataMask),r=this.bitMatrix.Dimension;n.unmaskBitMatrix(this.bitMatrix,r);for(var i=t.buildFunctionPattern(),a=!0,o=new Array(t.TotalCodewords),s=0,h=0,w=0,f=r-1;f>0;f-=2){6==f&&f--;for(var u=0;u=0;){if(s[c].codewords.length==l)break;c--}c++;var g=l-r.ECCodewordsPerBlock,v=0;for(o=0;o1&&0==t[0]){for(var r=1;rr.length){var i=n;n=r,r=i}for(var a=new Array(r.length),o=r.length-n.length,s=0;s=e.Degree&&!n.Zero;){var a=n.Degree-e.Degree,o=this.field.multiply(n.getCoefficient(n.Degree),i),s=e.multiplyByMonomial(a,o),h=this.field.buildMonomial(a,o);t=t.addOrSubtract(h),n=n.addOrSubtract(s)}return new Array(t,n)}}function _(e){this.expTable=new Array(256),this.logTable=new Array(256);for(var t=1,n=0;n<256;n++)this.expTable[n]=t,(t<<=1)>=256&&(t^=e);for(n=0;n<255;n++)this.logTable[this.expTable[n]]=n;var r=new Array(1);r[0]=0,this.zero=new C(this,new Array(r));var i=new Array(1);i[0]=1,this.one=new C(this,new Array(i)),this.__defineGetter__("Zero",function(){return this.zero}),this.__defineGetter__("One",function(){return this.one}),this.buildMonomial=function(e,t){if(e<0)throw"System.ArgumentException";if(0==t)return this.zero;for(var n=new Array(e+1),r=0;r7)throw"System.ArgumentException";return y.DATA_MASKS[e]},y.DATA_MASKS=new Array(new function(){this.unmaskBitMatrix=function(e,t){for(var n=0;n=Math.floor(n/2);){var f=i,u=o,d=h;if(o=s,h=w,(i=a).Zero)throw"r_{i-1} was zero";a=f;for(var l=this.field.Zero,c=i.getCoefficient(i.Degree),g=this.field.inverse(c);a.Degree>=i.Degree&&!a.Zero;){var v=a.Degree-i.Degree,m=this.field.multiply(a.getCoefficient(a.Degree),g);l=l.addOrSubtract(this.field.buildMonomial(v,m)),a=a.addOrSubtract(i.multiplyByMonomial(v,m))}s=l.multiply1(o).addOrSubtract(u),w=l.multiply1(h).addOrSubtract(d)}var b=w.getCoefficient(0);if(0==b)throw"ReedSolomonException sigmaTilde(0) was zero";var y=this.field.inverse(b),C=w.multiply2(y),_=a.multiply2(y);return new Array(C,_)},this.findErrorLocations=function(e){var t=e.Degree;if(1==t)return new Array(e.getCoefficient(1));for(var n=new Array(t),r=0,i=1;i<256&&r=0?e>>t:(e>>t)+(2<<~t)}A.imagedata=null,A.width=0,A.height=0,A.qrCodeSymbol=null,A.debug=!1,A.maxImgSize=1048576,A.sizeOfDataLengthInfo=[[10,9,8,8],[12,11,16,10],[14,13,16,12]],A.callback=null,A.vidSuccess=function(e){A.localstream=e,A.webkit?A.video.src=window.webkitURL.createObjectURL(e):A.moz?(A.video.mozSrcObject=e,A.video.play()):A.video.src=e,A.gUM=!0,A.canvas_qr2=document.createElement("canvas"),A.canvas_qr2.id="qr-canvas",A.qrcontext2=A.canvas_qr2.getContext("2d"),A.canvas_qr2.width=A.video.videoWidth,A.canvas_qr2.height=A.video.videoHeight,setTimeout(A.captureToCanvas,500)},A.vidError=function(e){A.gUM=!1},A.captureToCanvas=function(){if(A.gUM)try{if(0==A.video.videoWidth)return void setTimeout(A.captureToCanvas,500);A.canvas_qr2.width=A.video.videoWidth,A.canvas_qr2.height=A.video.videoHeight,A.qrcontext2.drawImage(A.video,0,0);try{A.decode()}catch(e){console.log(e),setTimeout(A.captureToCanvas,500)}}catch(e){console.log(e),setTimeout(A.captureToCanvas,500)}},A.setWebcam=function(e){var t=navigator;A.video=document.getElementById(e);var n=!0;if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)try{navigator.mediaDevices.enumerateDevices().then(function(e){e.forEach(function(e){console.log("deb1"),"videoinput"===e.kind&&e.label.toLowerCase().search("back")>-1&&(n=[{sourceId:e.deviceId}]),console.log(e.kind+": "+e.label+" id = "+e.deviceId)})})}catch(e){console.log(e)}else console.log("no navigator.mediaDevices.enumerateDevices");t.getUserMedia?t.getUserMedia({video:n,audio:!1},A.vidSuccess,A.vidError):t.webkitGetUserMedia?(A.webkit=!0,t.webkitGetUserMedia({video:n,audio:!1},A.vidSuccess,A.vidError)):t.mozGetUserMedia&&(A.moz=!0,t.mozGetUserMedia({video:n,audio:!1},A.vidSuccess,A.vidError))},A.decode=function(e){if(0==arguments.length){if(A.canvas_qr2)var t=A.canvas_qr2,n=A.qrcontext2;else n=(t=document.getElementById("qr-canvas")).getContext("2d");return A.width=t.width,A.height=t.height,A.imagedata=n.getImageData(0,0,A.width,A.height),A.result=A.process(n),null!=A.callback&&A.callback(A.result),A.result}var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){var e=document.getElementById("out-canvas");if(null!=e){var t=e.getContext("2d");t.clearRect(0,0,320,240),t.drawImage(r,0,0,320,240)}var n=document.createElement("canvas"),i=n.getContext("2d"),a=r.height,o=r.width;if(r.width*r.height>A.maxImgSize){var s=r.width/r.height;o=s*(a=Math.sqrt(A.maxImgSize/s))}n.width=o,n.height=a,i.drawImage(r,0,0,n.width,n.height),A.width=n.width,A.height=n.height;try{A.imagedata=i.getImageData(0,0,n.width,n.height)}catch(e){return A.result="Cross domain image reading not supported in your browser! Save it to your computer then drag and drop the file!",void(null!=A.callback&&A.callback(A.result))}try{A.result=A.process(i)}catch(e){console.log(e),A.result="error decoding QR Code"}null!=A.callback&&A.callback(A.result)},r.onerror=function(){null!=A.callback&&A.callback("Failed to load the image")},r.src=e},A.isUrl=function(e){return/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(e)},A.decode_url=function(e){var t="";try{t=escape(e)}catch(n){console.log(n),t=e}var n="";try{n=decodeURIComponent(t)}catch(e){console.log(e),n=t}return n},A.decode_utf8=function(e){return A.isUrl(e)?A.decode_url(e):e},A.process=function(e){var t=(new Date).getTime(),n=A.grayScaleToBitmap(A.grayscale());if(A.debug){for(var r=0;rr[s][o][1]&&(r[s][o][1]=f)}}for(var u=new Array(4),d=0;d<4;d++)u[d]=new Array(4);for(o=0;o<4;o++)for(s=0;s<4;s++)u[s][o]=Math.floor((r[s][o][0]+r[s][o][1])/2);return u},A.grayScaleToBitmap=function(e){for(var t=A.getMiddleBrightnessPerArea(e),n=t.length,r=Math.floor(A.width/n),i=Math.floor(A.height/n),a=new ArrayBuffer(A.width*A.height),o=new Uint8Array(a),s=0;s=0&&i[t+s*A.width];)o[2]++,s--;if(s<0)return NaN;for(;s>=0&&!i[t+s*A.width]&&o[1]<=n;)o[1]++,s--;if(s<0||o[1]>n)return NaN;for(;s>=0&&i[t+s*A.width]&&o[0]<=n;)o[0]++,s--;if(o[0]>n)return NaN;for(s=e+1;s=n)return NaN;for(;s=n)return NaN;var h=o[0]+o[1]+o[2]+o[3]+o[4];return 5*Math.abs(h-r)>=2*r?NaN:this.foundPatternCross(o)?this.centerFromEnd(o,s):NaN},this.crossCheckHorizontal=function(e,t,n,r){for(var i=this.image,a=A.width,o=this.CrossCheckStateCount,s=e;s>=0&&i[s+t*A.width];)o[2]++,s--;if(s<0)return NaN;for(;s>=0&&!i[s+t*A.width]&&o[1]<=n;)o[1]++,s--;if(s<0||o[1]>n)return NaN;for(;s>=0&&i[s+t*A.width]&&o[0]<=n;)o[0]++,s--;if(o[0]>n)return NaN;for(s=e+1;s=n)return NaN;for(;s=n)return NaN;var h=o[0]+o[1]+o[2]+o[3]+o[4];return 5*Math.abs(h-r)>=r?NaN:this.foundPatternCross(o)?this.centerFromEnd(o,s):NaN},this.handlePossibleCenter=function(e,t,n){var r=e[0]+e[1]+e[2]+e[3]+e[4],i=this.centerFromEnd(e,n),a=this.crossCheckVertical(t,Math.floor(i),e[2],r);if(!isNaN(a)&&(i=this.crossCheckHorizontal(Math.floor(i),Math.floor(a),e[2],r),!isNaN(i))){for(var o=r/7,s=!1,h=this.possibleCenters.length,w=0;w3){for(var t=0,n=0,r=0;r=0;r--){var h=this.possibleCenters[r];Math.abs(h.EstimatedModuleSize-a)>s&&this.possibleCenters.splice(r,1)}}return this.possibleCenters.length>3&&this.possibleCenters.sort(function(e,t){return e.count>t.count?-1:e.count=B){if(null!=t)return this.hasSkipped=!0,Math.floor((Math.abs(t.X-r.X)-Math.abs(t.Y-r.Y))/2);t=r}}return 0},this.haveMultiplyConfirmedCenters=function(){for(var e=0,t=0,n=this.possibleCenters.length,r=0;r=B&&(e++,t+=i.EstimatedModuleSize)}if(e<3)return!1;var a=t/n,o=0;for(r=0;ra[2]&&(o+=w-a[2]-r,h=n-1)}else{do{h++}while(h=n)return!1;return!0},this.crossCheckVertical=function(e,t,n,r){var i=this.image,a=A.height,o=this.crossCheckStateCount;o[0]=0,o[1]=0,o[2]=0;for(var s=e;s>=0&&i[t+s*A.width]&&o[1]<=n;)o[1]++,s--;if(s<0||o[1]>n)return NaN;for(;s>=0&&!i[t+s*A.width]&&o[0]<=n;)o[0]++,s--;if(o[0]>n)return NaN;for(s=e+1;sn)return NaN;for(;sn)return NaN;var h=o[0]+o[1]+o[2];return 5*Math.abs(h-r)>=2*r?NaN:this.foundPatternCross(o)?this.centerFromEnd(o,s):NaN},this.handlePossibleCenter=function(e,t,n){var r=e[0]+e[1]+e[2],i=this.centerFromEnd(e,n),a=this.crossCheckVertical(t,Math.floor(i),2*e[1],r);if(!isNaN(a)){for(var o=(e[0]+e[1]+e[2])/3,s=this.possibleCenters.length,h=0;h>1),s=new Array(0,0,0),h=0;h>1:-(h+1>>1));s[0]=0,s[1]=0,s[2]=0;for(var f=t;f=10&&t<=26?this.dataLengthMode=1:t>=27&&t<=40&&(this.dataLengthMode=2),this.getNextBits=function(e){var t=0;if(e>this.bitPointer-e+1,this.bitPointer-=e,t}if(e>8-(e-(this.bitPointer+1)),this.bitPointer=this.bitPointer-e%8,this.bitPointer<0&&(this.bitPointer=8+this.bitPointer),t}if(e>8-(e-(this.bitPointer+1+8))),this.bitPointer=this.bitPointer-(e-8)%8,this.bitPointer<0&&(this.bitPointer=8+this.bitPointer),t}return 0},this.NextMode=function(){return this.blockPointer>this.blocks.length-this.numErrorCorrectionCode-2?0:this.getNextBits(4)},this.getDataLength=function(e){for(var t=0;e>>t!=1;)t++;return this.getNextBits(A.sizeOfDataLengthInfo[this.dataLengthMode][t])},this.getRomanAndFigureString=function(e){var t=e,n=0,r="",i=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":");do{if(t>1){var a=(n=this.getNextBits(11))%45;r+=i[Math.floor(n/45)],r+=i[a],t-=2}else 1==t&&(r+=i[n=this.getNextBits(6)],t-=1)}while(t>0);return r},this.getFigureString=function(e){var t=e,n=0,r="";do{t>=3?((n=this.getNextBits(10))<100&&(r+="0"),n<10&&(r+="0"),t-=3):2==t?((n=this.getNextBits(7))<10&&(r+="0"),t-=2):1==t&&(n=this.getNextBits(4),t-=1),r+=n}while(t>0);return r},this.get8bitByteArray=function(e){var t=e,n=0,r=new Array;do{n=this.getNextBits(8),r.push(n),t--}while(t>0);return r},this.getKanjiString=function(e){var t=e,n=0,r="";do{var i=((n=this.getNextBits(13))/192<<8)+n%192,a=0;a=i+33088<=40956?i+33088:i+49472,r+=String.fromCharCode(a),t--}while(t>0);return r},this.parseECIValue=function(){var e=0,t=this.getNextBits(8);(0==(128&t)&&(e=127&t),128==(192&t))&&(e=(63&t)<<8|this.getNextBits(8));192==(224&t)&&(e=(31&t)<<16|this.getNextBits(8));return e},this.__defineGetter__("DataByte",function(){for(var e=new Array;;){var t=this.NextMode();if(0==t){if(e.length>0)break;throw"Empty data block"}if(1!=t&&2!=t&&4!=t&&8!=t&&7!=t)throw"Invalid mode: "+t+" in (block:"+this.blockPointer+" bit:"+this.bitPointer+")";if(7==t)var n=this.parseECIValue();else{var r=this.getDataLength(t);if(r<1)throw"Invalid data length: "+r;switch(t){case 1:for(var i=this.getFigureString(r),a=new Array(i.length),o=0;o=a&&o>=s?(r=e[0],n=e[1],i=e[2]):s>=o&&s>=a?(r=e[1],n=e[0],i=e[2]):(r=e[2],n=e[0],i=e[1]),function(e,t,n){var r=t.x,i=t.y;return(n.x-r)*(e.y-i)-(n.y-i)*(e.x-r)}(n,r,i)<0){var h=n;n=i,i=h}e[0]=n,e[1]=r,e[2]=i},A} /** Html5Qrcode From here */ "use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;dk)throw"'config.qrbox' should not be greater than the width of the HTML element."}var m=function(a,b){var c=h.qrbox;c>b&&console.warn("[Html5Qrcode] config.qrboxsize is greater than video height. Shading will be ignored");var d=i&&c<=b,e=d?f._getShadedRegionBounds(a,b,c):{x:0,y:0,width:a,height:b},k=f._createCanvasElement(e.width,e.height),l=k.getContext("2d");l.canvas.width=e.width,l.canvas.height=e.height,j.append(k),d&&f._possiblyInsertShadingElement(j,b,e),g._qrRegion=e,g._context=l,g._canvasElement=k},n=function(){try{return g.qrcode.decode(),f._possiblyUpdateShaders(!0),!0}catch(a){return f._possiblyUpdateShaders(!1),e("QR code parse error, error = ".concat(a)),!1}},o=function b(){if(g._shouldScan){if(g._localMediaStream){var c=g._videoElement,d=c.videoWidth/c.clientWidth,e=c.videoHeight/c.clientHeight,i=g._qrRegion.width*d,j=g._qrRegion.height*e,k=g._qrRegion.x*d,l=g._qrRegion.y*e;g._context.drawImage(g._videoElement,k,l,i,j,0,0,g._qrRegion.width,g._qrRegion.height),n()||!0===h.disableFlip||(f._context.translate(f._context.canvas.width,0),f._context.scale(-1,1),n())}g._foreverScanTimeout=setTimeout(b,a._getTimeoutFps(h.fps))}},p=function(a){return new Promise(function(b,c){var d=function(){var d=f._createVideoElement(k);g._element.append(d),d.onabort=c,d.onerror=c,d.onplaying=function(){var a=d.clientWidth,c=d.clientHeight;m(a,c),o(),b()},d.srcObject=a,d.play(),g._videoElement=d};if(g._localMediaStream=a,!h.aspectRatio)d();else{var e={aspectRatio:h.aspectRatio},i=a.getVideoTracks()[0];i.applyConstraints(e).then(function(){return d()})["catch"](function(a){console.log("[Warning] [Html5Qrcode] Constriants could not be satisfied, ignoring constraints",a),d()})}})};return new Promise(function(a,c){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){var d=g._createVideoConstraints(b);navigator.mediaDevices.getUserMedia({audio:!1,video:d}).then(function(b){p(b).then(function(){g._isScanning=!0,a()})["catch"](c)})["catch"](function(a){c("Error getting userMedia, error = ".concat(a))})}else if(navigator.getUserMedia){if("string"!=typeof b)throw"The device doesn't support navigator.mediaDevices, only supported cameraIdOrConfig in this case is deviceId parameter (string).";navigator.getUserMedia({video:{optional:[{sourceId:b}]}},function(b){p(b).then(function(){g._isScanning=!0,a()})["catch"](c)},function(a){c("Error getting userMedia, error = ".concat(a))})}else c("Web camera streaming not supported by the browser.")})}},{key:"stop",value:function(){this._shouldScan=!1,clearTimeout(this._foreverScanTimeout);var b=this;return new Promise(function(c){b.qrcode.callback=null;var d=b._localMediaStream.getVideoTracks().length,e=0,f=function(){for(;b._element.getElementsByClassName(a.SHADED_REGION_CLASSNAME).length;){var c=b._element.getElementsByClassName(a.SHADED_REGION_CLASSNAME)[0];b._element.removeChild(c)}},g=function(){b._localMediaStream=null,b._element.removeChild(b._videoElement),b._element.removeChild(b._canvasElement),f(),b._isScanning=!1,b._qrRegion&&(b._qrRegion=null),b._context&&(b._context=null),c(!0)};b._localMediaStream.getVideoTracks().forEach(function(a){a.stop(),++e,e>=d&&g()})})}},{key:"scanFile",value:function(b,c){var d=this;if(!b||!(b instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'";if(c=void 0===c||c,d._isScanning)throw"Close ongoing scan before scanning a file.";var e=function b(c,d,e,f){if(c<=e&&d<=f){var g=(e-c)/2,h=(f-d)/2;return{x:g,y:h,width:c,height:d}}var i=c,j=d;return c>e&&(d=e/c*d,c=e),d>f&&(c=f/d*c,d=f),a._log("Image downsampled from "+"".concat(i,"X").concat(j)+" to ".concat(c,"X").concat(d,".")),b(c,d,e,f)};return new Promise(function(f,g){d._possiblyCloseLastScanImageFile(),d._clearElement(),d._lastScanImageFile=b;var h=new Image;h.onload=function(){var b=Math.max,i=h.width,j=h.height,k=document.getElementById(d._elementId),l=k.clientWidth?k.clientWidth:a.DEFAULT_WIDTH,m=b(k.clientHeight?k.clientHeight:j,a.FILE_SCAN_MIN_HEIGHT),n=e(i,j,l,m);if(c){var o=d._createCanvasElement(l,m,"qr-canvas-visible");o.style.display="inline-block",k.appendChild(o);var p=o.getContext("2d");p.canvas.width=l,p.canvas.height=m,p.drawImage(h,0,0,i,j,n.x,n.y,n.width,n.height)}var q=d._createCanvasElement(n.width,n.height);k.appendChild(q);var r=q.getContext("2d");r.canvas.width=n.width,r.canvas.height=n.height,r.drawImage(h,0,0,i,j,0,0,n.width,n.height);try{f(d.qrcode.decode())}catch(a){g("QR code parse error, error = ".concat(a))}},h.onerror=g,h.onabort=g,h.onstalled=g,h.onsuspend=g,h.src=URL.createObjectURL(b)})}},{key:"clear",value:function(){this._clearElement()}},{key:"_clearElement",value:function(){if(this._isScanning)throw"Cannot clear while scan is ongoing, close it first.";var a=document.getElementById(this._elementId);a.innerHTML=""}},{key:"_createCanvasElement",value:function(a,b,c){var d=document.createElement("canvas");return d.style.width="".concat(a,"px"),d.style.height="".concat(b,"px"),d.style.display="none",d.id=null==c?"qr-canvas":c,d}},{key:"_createVideoElement",value:function(a){var b=document.createElement("video");return b.style.width="".concat(a,"px"),b.muted=!0,b.playsInline=!0,b}},{key:"_getShadedRegionBounds",value:function(a,b,c){if(c>a||c>b)throw"'config.qrbox' should not be greater than the width and height of the HTML element.";return{x:(a-c)/2,y:(b-c)/2,width:c,height:c}}},{key:"_possiblyInsertShadingElement",value:function(b,c,d){var e=this;if(0!=d.x||0!=d.y){var f={};f[a.SHADED_LEFT]=this._createShadedElement(c,d,a.SHADED_LEFT),f[a.SHADED_RIGHT]=this._createShadedElement(c,d,a.SHADED_RIGHT),f[a.SHADED_TOP]=this._createShadedElement(c,d,a.SHADED_TOP),f[a.SHADED_BOTTOM]=this._createShadedElement(c,d,a.SHADED_BOTTOM),Object.keys(f).forEach(function(a){return b.append(f[a])}),10>d.x||10>d.y?this.hasBorderShaders=!1:(Object.keys(f).forEach(function(a){return e._insertShaderBorders(f[a],d,a)}),this.hasBorderShaders=!0)}}},{key:"_createShadedElement",value:function(b,c,d){var e=document.createElement("div");switch(e.style.position="absolute",e.style.height="".concat(b,"px"),e.className=a.SHADED_REGION_CLASSNAME,e.id="".concat(a.SHADED_REGION_CLASSNAME,"_").concat(d),e.style.background="#0000007a",d){case a.SHADED_LEFT:e.style.top="0px",e.style.left="0px",e.style.width="".concat(c.x,"px"),e.style.height="".concat(b,"px");break;case a.SHADED_RIGHT:e.style.top="0px",e.style.right="0px",e.style.width="".concat(c.x,"px"),e.style.height="".concat(b,"px");break;case a.SHADED_TOP:e.style.top="0px",e.style.left="".concat(c.x,"px"),e.style.width="".concat(c.width,"px"),e.style.height="".concat(c.y,"px");break;case a.SHADED_BOTTOM:var f=c.y+c.height;e.style.top="".concat(f,"px"),e.style.left="".concat(c.x,"px"),e.style.width="".concat(c.width,"px"),e.style.height="".concat(c.y,"px");break;default:throw"Unsupported shadingPosition";}return e}},{key:"_insertShaderBorders",value:function(b,c,d){d=parseInt(d);var e=this,f=5,g=5,h=40,i=function(){var b=document.createElement("div");switch(b.style.position="absolute",b.style.backgroundColor=a.BORDER_SHADER_DEFAULT_COLOR,d){case a.SHADED_LEFT:case a.SHADED_RIGHT:b.style.width="".concat(g,"px"),b.style.height="".concat(h+f,"px");break;case a.SHADED_TOP:case a.SHADED_BOTTOM:b.style.width="".concat(h+f,"px"),b.style.height="".concat(g,"px");break;default:throw"Unsupported shadingPosition";}return b},j=function(a,c){if(null===a||null===c)throw"Shaders should have defined positions";var d=i();d.style.top="".concat(a,"px"),d.style.left="".concat(c,"px"),b.appendChild(d),e.borderShaders||(e.borderShaders=[]),e.borderShaders.push(d)},k=null,l=null,m=null,n=null;switch(d){case a.SHADED_LEFT:k=c.y-f,l=c.x-g,m=c.y+c.height-h,n=l;break;case a.SHADED_RIGHT:k=c.y-f,l=0,m=c.y+c.height-h,n=l;break;case a.SHADED_TOP:k=c.y-f,l=-g,m=k,n=c.width-h;break;case a.SHADED_BOTTOM:k=0,l=-g,m=k,n=c.width-h;break;default:throw"Unsupported shadingPosition";}j(k,l),j(m,n)}},{key:"_possiblyUpdateShaders",value:function(b){this.qrMatch===b||(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(c){c.style.backgroundColor=b?a.BORDER_SHADER_MATCH_COLOR:a.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=b)}},{key:"_possiblyCloseLastScanImageFile",value:function(){this._lastScanImageFile&&(URL.revokeObjectURL(this._lastScanImageFile),this._lastScanImageFile=null)}},{key:"_createVideoConstraints",value:function(a){if("string"==typeof a)return{deviceId:{exact:a}};if("object"==_typeof(a)){var b={user:!0,environment:!0},c=function(a){if(a in b)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(a,"'")},d=Object.keys(a);if(1!=d.length)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(d.length," keys");var e=Object.keys(a)[0];if("facingMode"!=e&&"deviceId"!=e)throw"Only '".concat("facingMode","' and '").concat("deviceId","' ")+" are supported for 'cameraIdOrConfig'";if("facingMode"==e){var f=a[e];if("string"==typeof f){if(c(f))return{facingMode:f};}else if("object"!=_typeof(f)){var g=_typeof(f);throw"Invalid type of 'facingMode' = ".concat(g)}else if(!("exact"in f))throw"'facingMode' should be string or object with"+" ".concat("exact"," as key.");else if(c(f.exact))return{facingMode:{exact:f.exact}}}else{var h=a[e];if("string"==typeof h)return{deviceId:h};if("object"==_typeof(h)){if("exact"in h)return{deviceId:{exact:h.exact}};throw"'deviceId' should be string or object with"+" ".concat("exact"," as key.")}else{var i=_typeof(h);throw"Invalid type of 'deviceId' = ".concat(i)}}}else{var j=_typeof(a);throw"Invalid type of 'cameraIdOrConfig' = ".concat(j)}}}],[{key:"getCameras",value:function(){var a=this;return new Promise(function(b,c){if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices&&navigator.mediaDevices.getUserMedia)a._log("navigator.mediaDevices used"),navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(d){d.oninactive=function(){return a._log("All streams closed")};var e=function(a){for(var b,c=a.getVideoTracks(),d=0;d",c.appendChild(b.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity=.3,this.cameraScanImage.src=a.ASSET_CAMERA_SCAN)}},{key:"__insertFileScanImageToScanRegion",value:function(){var b=this,c=document.getElementById(this.__getScanRegionId());return this.fileScanImage?(c.innerHTML="
",void c.appendChild(this.fileScanImage)):void(this.fileScanImage=new Image,this.fileScanImage.onload=function(){c.innerHTML="
",c.appendChild(b.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity=.3,this.fileScanImage.src=a.ASSET_FILE_SCAN)}},{key:"__clearScanRegion",value:function(){var a=document.getElementById(this.__getScanRegionId());a.innerHTML=""}},{key:"__getDashboardSectionId",value:function(){return"".concat(this.elementId,"__dashboard_section")}},{key:"__getDashboardSectionCameraScanRegionId",value:function(){return"".concat(this.elementId,"__dashboard_section_csr")}},{key:"__getDashboardSectionFileScanRegionId",value:function(){return"".concat(this.elementId,"__dashboard_section_fsr")}},{key:"__getDashboardSectionSwapLinkId",value:function(){return"".concat(this.elementId,"__dashboard_section_swaplink")}},{key:"__getScanRegionId",value:function(){return"".concat(this.elementId,"__scan_region")}},{key:"__getDashboardId",value:function(){return"".concat(this.elementId,"__dashboard")}},{key:"__getFileScanInputId",value:function(){return"".concat(this.elementId,"__filescan_input")}},{key:"__getStatusSpanId",value:function(){return"".concat(this.elementId,"__status_span")}},{key:"__getHeaderMessageContainerId",value:function(){return"".concat(this.elementId,"__header_message")}},{key:"__getCameraSelectionId",value:function(){return"".concat(this.elementId,"__camera_selection")}},{key:"__getCameraScanRegion",value:function(){return document.getElementById(this.__getDashboardSectionCameraScanRegionId())}},{key:"__getFileScanRegion",value:function(){return document.getElementById(this.__getDashboardSectionFileScanRegionId())}},{key:"__getFileScanInput",value:function(){return document.getElementById(this.__getFileScanInputId())}},{key:"__getDashboardSectionSwapLink",value:function(){return document.getElementById(this.__getDashboardSectionSwapLinkId())}}]),a}();_defineProperty(Html5QrcodeScanner,"SCAN_TYPE_CAMERA","SCAN_TYPE_CAMERA"),_defineProperty(Html5QrcodeScanner,"SCAN_TYPE_FILE","SCAN_TYPE_FILE"),_defineProperty(Html5QrcodeScanner,"STATUS_SUCCESS","STATUS_SUCCESS"),_defineProperty(Html5QrcodeScanner,"STATUS_WARNING","STATUS_WARNING"),_defineProperty(Html5QrcodeScanner,"STATUS_DEFAULT","STATUS_DEFAULT"),_defineProperty(Html5QrcodeScanner,"ASSET_FILE_SCAN","https://raw.githubusercontent.com/mebjas/html5-qrcode/master/assets/file-scan.gif"),_defineProperty(Html5QrcodeScanner,"ASSET_CAMERA_SCAN","https://raw.githubusercontent.com/mebjas/html5-qrcode/master/assets/camera-scan.gif"); \ No newline at end of file +"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d",c.appendChild(b.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity=.3,this.cameraScanImage.src=a.ASSET_CAMERA_SCAN)}},{key:"__insertFileScanImageToScanRegion",value:function(){var b=this,c=document.getElementById(this.__getScanRegionId());return this.fileScanImage?(c.innerHTML="
",void c.appendChild(this.fileScanImage)):void(this.fileScanImage=new Image,this.fileScanImage.onload=function(){c.innerHTML="
",c.appendChild(b.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity=.3,this.fileScanImage.src=a.ASSET_FILE_SCAN)}},{key:"__clearScanRegion",value:function(){var a=document.getElementById(this.__getScanRegionId());a.innerHTML=""}},{key:"__getDashboardSectionId",value:function(){return"".concat(this.elementId,"__dashboard_section")}},{key:"__getDashboardSectionCameraScanRegionId",value:function(){return"".concat(this.elementId,"__dashboard_section_csr")}},{key:"__getDashboardSectionFileScanRegionId",value:function(){return"".concat(this.elementId,"__dashboard_section_fsr")}},{key:"__getDashboardSectionSwapLinkId",value:function(){return"".concat(this.elementId,"__dashboard_section_swaplink")}},{key:"__getScanRegionId",value:function(){return"".concat(this.elementId,"__scan_region")}},{key:"__getDashboardId",value:function(){return"".concat(this.elementId,"__dashboard")}},{key:"__getFileScanInputId",value:function(){return"".concat(this.elementId,"__filescan_input")}},{key:"__getStatusSpanId",value:function(){return"".concat(this.elementId,"__status_span")}},{key:"__getHeaderMessageContainerId",value:function(){return"".concat(this.elementId,"__header_message")}},{key:"__getCameraSelectionId",value:function(){return"".concat(this.elementId,"__camera_selection")}},{key:"__getCameraScanRegion",value:function(){return document.getElementById(this.__getDashboardSectionCameraScanRegionId())}},{key:"__getFileScanRegion",value:function(){return document.getElementById(this.__getDashboardSectionFileScanRegionId())}},{key:"__getFileScanInput",value:function(){return document.getElementById(this.__getFileScanInputId())}},{key:"__getDashboardSectionSwapLink",value:function(){return document.getElementById(this.__getDashboardSectionSwapLinkId())}}]),a}();_defineProperty(Html5QrcodeScanner,"SCAN_TYPE_CAMERA","SCAN_TYPE_CAMERA"),_defineProperty(Html5QrcodeScanner,"SCAN_TYPE_FILE","SCAN_TYPE_FILE"),_defineProperty(Html5QrcodeScanner,"STATUS_SUCCESS","STATUS_SUCCESS"),_defineProperty(Html5QrcodeScanner,"STATUS_WARNING","STATUS_WARNING"),_defineProperty(Html5QrcodeScanner,"STATUS_DEFAULT","STATUS_DEFAULT"),_defineProperty(Html5QrcodeScanner,"ASSET_FILE_SCAN","https://raw.githubusercontent.com/mebjas/html5-qrcode/master/assets/file-scan.gif"),_defineProperty(Html5QrcodeScanner,"ASSET_CAMERA_SCAN","https://raw.githubusercontent.com/mebjas/html5-qrcode/master/assets/camera-scan.gif"); diff --git a/scripts/qrcode.min.js b/scripts/qrcode.min.js index 430cafc..2d405c6 100644 --- a/scripts/qrcode.min.js +++ b/scripts/qrcode.min.js @@ -1,2 +1,3 @@ + /** https://github.com/datalog/qrcode-svg under MIT license */ -'use strict';function QRCode(r){var n,t,o,e,a=[],f=[],i=Math.max,u=Math.min,h=Math.abs,v=Math.ceil,c=/^[0-9]*$/,s=/^[A-Z0-9 $%*+.\/:-]*$/,l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",g=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],d=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],m={L:[0,1],M:[1,0],Q:[2,3],H:[3,2]},p=function(r,n){for(var t=0,o=8;o--;)t=t<<1^285*(t>>>7)^(n>>>o&1)*r;return t},C=function(r,n){for(var t=[],o=r.length,e=o;e;)for(var a=r[o-e--]^t.shift(),f=n.length;f--;)t[f]^=p(n[f],a);return t},w=function(r){for(var n=[function(){return 0==(t+o)%2},function(){return 0==t%2},function(){return 0==o%3},function(){return 0==(t+o)%3},function(){return 0==((t/2|0)+(o/3|0))%2},function(){return 0==t*o%2+t*o%3},function(){return 0==(t*o%2+t*o%3)%2},function(){return 0==((t+o)%2+t*o%3)%2}][r],t=e;t--;)for(var o=e;o--;)f[t][o]||(a[t][o]^=n())},b=function(){for(var r=function(r,n){n[6]||(r+=e),n.shift(),n.push(r)},n=function(n,o,a){return n&&(r(o,a),o=0),r(o+=e,a),t(a)},t=function(r){var n=r[5],t=n>0&&r[4]==n&&r[3]==3*n&&r[2]==n&&r[1]==n;return(t&&r[6]>=4*n&&r[0]>=n?1:0)+(t&&r[0]>=4*n&&r[6]>=n?1:0)},o=0,f=e*e,i=0,u=e;u--;){for(var c=[0,0,0,0,0,0,0],s=[0,0,0,0,0,0,0],l=!1,g=!1,d=0,m=0,p=e;p--;){a[u][p]==l?5==++d?o+=3:d>5&&o++:(r(d,c),o+=40*t(c),d=1,l=a[u][p]),a[p][u]==g?5==++m?o+=3:m>5&&o++:(r(m,s),o+=40*t(s),m=1,g=a[p][u]);var C=a[u][p];C&&i++,p&&u&&C==a[u][p-1]&&C==a[u-1][p]&&C==a[u-1][p-1]&&(o+=3)}o+=40*n(l,d,c)+40*n(g,m,s)}return o+=10*(v(h(20*i-10*f)/f)-1)},A=function(r,n,t){for(;n--;)t.push(r>>>n&1)},M=function(r,n){return r.numBitsCharCount[(n+7)/17|0]},B=function(r,n){return 0!=(r>>>n&1)},x=function(r,n){for(var t=0,o=r.length;o--;){var e=r[o],a=M(e,n);if(1<40)throw"Version number out of range";var n=(16*r+128)*r+64;if(r>=2){var t=r/7|2;n-=(25*t-10)*t-55,r>=7&&(n-=36)}return n},I=function(r,n){for(var t=2;-2<=t;t--)for(var o=2;-2<=o;o--)E(r+o,n+t,1!=i(h(o),h(t)))},H=function(r,n){for(var t=4;-4<=t;t--)for(var o=4;-4<=o;o--){var a=i(h(o),h(t)),f=r+o,u=n+t;0<=f&&f>>9);var f=21522^(n<<10|o);if(f>>>15!=0)throw"Assertion error";for(a=0;a<=5;a++)E(8,a,B(f,a));E(8,7,B(f,6)),E(8,8,B(f,7)),E(7,8,B(f,8));for(a=9;a<15;a++)E(14-a,8,B(f,a));for(a=0;a<8;a++)E(e-1-a,8,B(f,a));for(a=8;a<15;a++)E(8,e-15+a,B(f,a));E(8,e-8,1)},O=function(){for(var r=e;r--;)E(6,r,0==r%2),E(r,6,0==r%2);for(var t=function(){var r=[];if(n>1)for(var t=2+(n/7|0),o=32==n?26:2*v((e-13)/(2*t-2));t--;)r[t]=t*o+6;return r}(),o=r=t.length;o--;)for(var a=r;a--;)0==a&&0==o||0==a&&o==r-1||a==r-1&&0==o||I(t[a],t[o]);H(3,3),H(e-4,3),H(3,e-4),$(0),function(){if(!(7>n)){for(var r=n,t=12;t--;)r=r<<1^7973*(r>>>11);var o=n<<12|r;if(t=18,o>>>18!=0)throw"Assertion error";for(;t--;){var a=e-11+t%3,f=t/3|0,i=B(o,t);E(a,f,i),E(f,a,i)}}}()},Q=function(r){if(r.length!=V(n,t))throw"Invalid argument";for(var o=d[t[0]][n],e=g[t[0]][n],a=D(n)/8|0,f=o-a%o,i=a/o|0,u=[],h=function(r){var n=1,t=[];t[r-1]=1;for(var o=0;o=f)&&m.push(u[w][v]);return m},S=function(r){for(var n=[],t=(r=encodeURI(r),0);t0;i-=2){6==i&&--i;for(var u=0>(t=-t)?o:0,h=0;hi-2;--v)f[u][v]||(a[u][v]=B(r[n>>>3],7-(7&n)),++n);u+=t}}}(Q(u)),0>o){var c=1e9;for(v=8;v--;){w(v),$(v);var s=b();c>s&&(c=s,o=v),w(v)}}w(o),$(o),f=[]},U=function(r,n,t,o,e,a){if(void 0===e&&(e=1),void 0===a&&(a=40),void 0===o&&(o=-1),void 0===t&&(t=!0),!(1<=e&&e<=a&&a<=40)||o<-1||o>7)throw"Invalid value";for(var f=[],i=236,h=[],v=e;;){var c=x(r,v);if(c<=8*V(v,n))break;if(v>=a)throw"Data too long";v++}if(t)for(var s=(l=[m.H,m.Q,m.M]).length;s--;)c<=8*V(v,l[s])&&(n=l[s]);for(var l=0;lC)throw"Assertion error";if(A(0,u(4,C-f.length),f),A(0,(8-f.length%8)%8,f),f.length%8!=0)throw"Assertion error";for(;f.length>>3]|=f[s]<<7-(7&s);return N(v,n,h,o)};return function(){function n(r){return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(r)}function t(r,n){for(var t in r=document.createElementNS(s,r),n||{})r.setAttribute(t,n[t]);return r}var o,f,i,u,v,c,s="http://www.w3.org/2000/svg",l="",g="string"==typeof r?{msg:r}:r||{},d=g.pal||["#000"],p=h(g.dim)||256,C=[1,0,0,1,c=(c=h(g.pad))>-1?c:4,c],w=n(w=d[0])?w:"#000",b=n(b=d[1])?b:0,A=g.vrb?0:1;for(L(g.msg||"",m[g.ecl]||m.M,0==g.ecb?0:1,g.mtx),v=e+2*c,i=e;i--;)for(u=0,f=e;f--;)a[i][f]&&(A?(u++,a[i][f-1]||(l+="M"+f+","+i+"h"+u+"v1h-"+u+"v-1z",u=0)):l+="M"+f+","+i+"h1v1h-1v-1z");return o=t("svg",{viewBox:[0,0,v,v].join(" "),width:p,height:p,fill:w,"shape-rendering":"crispEdges",xmlns:s,version:"1.1"}),b&&o.appendChild(t("path",{fill:b,d:"M0,0V"+v+"H"+v+"V0H0Z"})),o.appendChild(t("path",{transform:"matrix("+C+")",d:l})),o}()} \ No newline at end of file +'use strict';function QRCode(r){var n,t,o,e,a=[],f=[],i=Math.max,u=Math.min,h=Math.abs,v=Math.ceil,c=/^[0-9]*$/,s=/^[A-Z0-9 $%*+.\/:-]*$/,l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",g=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],d=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],m={L:[0,1],M:[1,0],Q:[2,3],H:[3,2]},p=function(r,n){for(var t=0,o=8;o--;)t=t<<1^285*(t>>>7)^(n>>>o&1)*r;return t},C=function(r,n){for(var t=[],o=r.length,e=o;e;)for(var a=r[o-e--]^t.shift(),f=n.length;f--;)t[f]^=p(n[f],a);return t},w=function(r){for(var n=[function(){return 0==(t+o)%2},function(){return 0==t%2},function(){return 0==o%3},function(){return 0==(t+o)%3},function(){return 0==((t/2|0)+(o/3|0))%2},function(){return 0==t*o%2+t*o%3},function(){return 0==(t*o%2+t*o%3)%2},function(){return 0==((t+o)%2+t*o%3)%2}][r],t=e;t--;)for(var o=e;o--;)f[t][o]||(a[t][o]^=n())},b=function(){for(var r=function(r,n){n[6]||(r+=e),n.shift(),n.push(r)},n=function(n,o,a){return n&&(r(o,a),o=0),r(o+=e,a),t(a)},t=function(r){var n=r[5],t=n>0&&r[4]==n&&r[3]==3*n&&r[2]==n&&r[1]==n;return(t&&r[6]>=4*n&&r[0]>=n?1:0)+(t&&r[0]>=4*n&&r[6]>=n?1:0)},o=0,f=e*e,i=0,u=e;u--;){for(var c=[0,0,0,0,0,0,0],s=[0,0,0,0,0,0,0],l=!1,g=!1,d=0,m=0,p=e;p--;){a[u][p]==l?5==++d?o+=3:d>5&&o++:(r(d,c),o+=40*t(c),d=1,l=a[u][p]),a[p][u]==g?5==++m?o+=3:m>5&&o++:(r(m,s),o+=40*t(s),m=1,g=a[p][u]);var C=a[u][p];C&&i++,p&&u&&C==a[u][p-1]&&C==a[u-1][p]&&C==a[u-1][p-1]&&(o+=3)}o+=40*n(l,d,c)+40*n(g,m,s)}return o+=10*(v(h(20*i-10*f)/f)-1)},A=function(r,n,t){for(;n--;)t.push(r>>>n&1)},M=function(r,n){return r.numBitsCharCount[(n+7)/17|0]},B=function(r,n){return 0!=(r>>>n&1)},x=function(r,n){for(var t=0,o=r.length;o--;){var e=r[o],a=M(e,n);if(1<40)throw"Version number out of range";var n=(16*r+128)*r+64;if(r>=2){var t=r/7|2;n-=(25*t-10)*t-55,r>=7&&(n-=36)}return n},I=function(r,n){for(var t=2;-2<=t;t--)for(var o=2;-2<=o;o--)E(r+o,n+t,1!=i(h(o),h(t)))},H=function(r,n){for(var t=4;-4<=t;t--)for(var o=4;-4<=o;o--){var a=i(h(o),h(t)),f=r+o,u=n+t;0<=f&&f>>9);var f=21522^(n<<10|o);if(f>>>15!=0)throw"Assertion error";for(a=0;a<=5;a++)E(8,a,B(f,a));E(8,7,B(f,6)),E(8,8,B(f,7)),E(7,8,B(f,8));for(a=9;a<15;a++)E(14-a,8,B(f,a));for(a=0;a<8;a++)E(e-1-a,8,B(f,a));for(a=8;a<15;a++)E(8,e-15+a,B(f,a));E(8,e-8,1)},O=function(){for(var r=e;r--;)E(6,r,0==r%2),E(r,6,0==r%2);for(var t=function(){var r=[];if(n>1)for(var t=2+(n/7|0),o=32==n?26:2*v((e-13)/(2*t-2));t--;)r[t]=t*o+6;return r}(),o=r=t.length;o--;)for(var a=r;a--;)0==a&&0==o||0==a&&o==r-1||a==r-1&&0==o||I(t[a],t[o]);H(3,3),H(e-4,3),H(3,e-4),$(0),function(){if(!(7>n)){for(var r=n,t=12;t--;)r=r<<1^7973*(r>>>11);var o=n<<12|r;if(t=18,o>>>18!=0)throw"Assertion error";for(;t--;){var a=e-11+t%3,f=t/3|0,i=B(o,t);E(a,f,i),E(f,a,i)}}}()},Q=function(r){if(r.length!=V(n,t))throw"Invalid argument";for(var o=d[t[0]][n],e=g[t[0]][n],a=D(n)/8|0,f=o-a%o,i=a/o|0,u=[],h=function(r){var n=1,t=[];t[r-1]=1;for(var o=0;o=f)&&m.push(u[w][v]);return m},S=function(r){for(var n=[],t=(r=encodeURI(r),0);t0;i-=2){6==i&&--i;for(var u=0>(t=-t)?o:0,h=0;hi-2;--v)f[u][v]||(a[u][v]=B(r[n>>>3],7-(7&n)),++n);u+=t}}}(Q(u)),0>o){var c=1e9;for(v=8;v--;){w(v),$(v);var s=b();c>s&&(c=s,o=v),w(v)}}w(o),$(o),f=[]},U=function(r,n,t,o,e,a){if(void 0===e&&(e=1),void 0===a&&(a=40),void 0===o&&(o=-1),void 0===t&&(t=!0),!(1<=e&&e<=a&&a<=40)||o<-1||o>7)throw"Invalid value";for(var f=[],i=236,h=[],v=e;;){var c=x(r,v);if(c<=8*V(v,n))break;if(v>=a)throw"Data too long";v++}if(t)for(var s=(l=[m.H,m.Q,m.M]).length;s--;)c<=8*V(v,l[s])&&(n=l[s]);for(var l=0;lC)throw"Assertion error";if(A(0,u(4,C-f.length),f),A(0,(8-f.length%8)%8,f),f.length%8!=0)throw"Assertion error";for(;f.length>>3]|=f[s]<<7-(7&s);return N(v,n,h,o)};return function(){function n(r){return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(r)}function t(r,n){for(var t in r=document.createElementNS(s,r),n||{})r.setAttribute(t,n[t]);return r}var o,f,i,u,v,c,s="http://www.w3.org/2000/svg",l="",g="string"==typeof r?{msg:r}:r||{},d=g.pal||["#000"],p=h(g.dim)||256,C=[1,0,0,1,c=(c=h(g.pad))>-1?c:4,c],w=n(w=d[0])?w:"#000",b=n(b=d[1])?b:0,A=g.vrb?0:1;for(L(g.msg||"",m[g.ecl]||m.M,0==g.ecb?0:1,g.mtx),v=e+2*c,i=e;i--;)for(u=0,f=e;f--;)a[i][f]&&(A?(u++,a[i][f-1]||(l+="M"+f+","+i+"h"+u+"v1h-"+u+"v-1z",u=0)):l+="M"+f+","+i+"h1v1h-1v-1z");return o=t("svg",{viewBox:[0,0,v,v].join(" "),width:p,height:p,fill:w,"shape-rendering":"crispEdges",xmlns:s,version:"1.1"}),b&&o.appendChild(t("path",{fill:b,d:"M0,0V"+v+"H"+v+"V0H0Z"})),o.appendChild(t("path",{transform:"matrix("+C+")",d:l})),o}()}