From fd962e21e1e155252f66ce58af0da3d28e623905 Mon Sep 17 00:00:00 2001 From: Peter White Date: Mon, 9 Dec 2024 16:38:36 -0700 Subject: [PATCH 01/25] feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning --- Cargo.lock | 1020 +++++----------------- Cargo.toml | 4 + crates/pop-cli/Cargo.toml | 5 + crates/pop-cli/src/main.rs | 1 + crates/pop-cli/src/wallet_integration.rs | 537 ++++++++++++ 5 files changed, 768 insertions(+), 799 deletions(-) create mode 100644 crates/pop-cli/src/wallet_integration.rs diff --git a/Cargo.lock b/Cargo.lock index 74d393d5d..901e0e10f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -817,7 +817,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] @@ -846,7 +846,7 @@ dependencies = [ "async-task", "blocking", "cfg-if", - "event-listener 5.3.1", + "event-listener", "futures-lite", "rustix 0.38.42", "tracing", @@ -938,6 +938,61 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.5.1", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "tokio", + "tower 0.5.1", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "backoff" version = "0.4.0" @@ -1015,15 +1070,6 @@ dependencies = [ "serde", ] -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - [[package]] name = "binary-merkle-tree" version = "15.0.1" @@ -2022,8 +2068,8 @@ dependencies = [ "serde_json", "sp-core 32.0.0", "sp-runtime 35.0.0", - "sp-weights 31.0.0", - "subxt 0.38.0", + "sp-weights", + "subxt", "tokio", "tracing", "url", @@ -3354,16 +3400,6 @@ dependencies = [ "uint 0.9.5", ] -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "5.3.1" @@ -3381,7 +3417,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ - "event-listener 5.3.1", + "event-listener", "pin-project-lite", ] @@ -3493,16 +3529,6 @@ dependencies = [ "scale-info", ] -[[package]] -name = "finito" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2384245d85162258a14b43567a9ee3598f5ae746a1581fb5d3d2cb780f0dbf95" -dependencies = [ - "futures-timer", - "pin-project", -] - [[package]] name = "fixed-hash" version = "0.8.0" @@ -3647,7 +3673,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-npos-elections", "sp-runtime 39.0.2", @@ -3672,17 +3698,6 @@ dependencies = [ "sp-tracing 17.0.1", ] -[[package]] -name = "frame-metadata" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" -dependencies = [ - "cfg-if", - "parity-scale-codec", - "scale-info", -] - [[package]] name = "frame-metadata" version = "16.0.0" @@ -3747,7 +3762,7 @@ dependencies = [ "serde_json", "smallvec", "sp-api", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-crypto-hashing-proc-macro", "sp-debug-derive", @@ -3760,7 +3775,7 @@ dependencies = [ "sp-state-machine 0.43.0", "sp-std", "sp-tracing 17.0.1", - "sp-weights 31.0.0", + "sp-weights", "static_assertions", "tt-call", ] @@ -3827,7 +3842,7 @@ dependencies = [ "sp-runtime 39.0.2", "sp-std", "sp-version", - "sp-weights 31.0.0", + "sp-weights", ] [[package]] @@ -4376,6 +4391,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +[[package]] +name = "http-range-header" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" + [[package]] name = "httparse" version = "1.9.5" @@ -5050,15 +5071,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -5143,83 +5155,16 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "jsonrpsee" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdb12a2381ea5b2e68c3469ec604a007b367778cdb14d09612c8069ebd616ad" -dependencies = [ - "jsonrpsee-client-transport 0.22.5", - "jsonrpsee-core 0.22.5", - "jsonrpsee-http-client", - "jsonrpsee-types 0.22.5", -] - -[[package]] -name = "jsonrpsee" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" -dependencies = [ - "jsonrpsee-core 0.23.2", - "jsonrpsee-types 0.23.2", - "jsonrpsee-ws-client 0.23.2", -] - [[package]] name = "jsonrpsee" version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5c71d8c1a731cc4227c2f698d377e7848ca12c8a48866fc5e6951c43a4db843" dependencies = [ - "jsonrpsee-client-transport 0.24.7", - "jsonrpsee-core 0.24.7", - "jsonrpsee-types 0.24.7", - "jsonrpsee-ws-client 0.24.7", -] - -[[package]] -name = "jsonrpsee-client-transport" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4978087a58c3ab02efc5b07c5e5e2803024536106fd5506f558db172c889b3aa" -dependencies = [ - "futures-util", - "http 0.2.12", - "jsonrpsee-core 0.22.5", - "pin-project", - "rustls-native-certs 0.7.3", - "rustls-pki-types", - "soketto 0.7.1", - "thiserror 1.0.69", - "tokio", - "tokio-rustls 0.25.0", - "tokio-util", - "tracing", - "url", -] - -[[package]] -name = "jsonrpsee-client-transport" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" -dependencies = [ - "base64 0.22.1", - "futures-util", - "http 1.2.0", - "jsonrpsee-core 0.23.2", - "pin-project", - "rustls 0.23.19", - "rustls-pki-types", - "rustls-platform-verifier", - "soketto 0.8.1", - "thiserror 1.0.69", - "tokio", - "tokio-rustls 0.26.1", - "tokio-util", - "tracing", - "url", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", + "jsonrpsee-ws-client", ] [[package]] @@ -5231,12 +5176,12 @@ dependencies = [ "base64 0.22.1", "futures-util", "http 1.2.0", - "jsonrpsee-core 0.24.7", + "jsonrpsee-core", "pin-project", "rustls 0.23.19", "rustls-pki-types", "rustls-platform-verifier", - "soketto 0.8.1", + "soketto", "thiserror 1.0.69", "tokio", "tokio-rustls 0.26.1", @@ -5245,51 +5190,6 @@ dependencies = [ "url", ] -[[package]] -name = "jsonrpsee-core" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b257e1ec385e07b0255dde0b933f948b5c8b8c28d42afda9587c3a967b896d" -dependencies = [ - "anyhow", - "async-trait", - "beef", - "futures-timer", - "futures-util", - "hyper 0.14.31", - "jsonrpsee-types 0.22.5", - "pin-project", - "rustc-hash 1.1.0", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", -] - -[[package]] -name = "jsonrpsee-core" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" -dependencies = [ - "anyhow", - "async-trait", - "beef", - "futures-timer", - "futures-util", - "jsonrpsee-types 0.23.2", - "pin-project", - "rustc-hash 1.1.0", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tracing", -] - [[package]] name = "jsonrpsee-core" version = "0.24.7" @@ -5299,7 +5199,7 @@ dependencies = [ "async-trait", "futures-timer", "futures-util", - "jsonrpsee-types 0.24.7", + "jsonrpsee-types", "pin-project", "rustc-hash 2.1.0", "serde", @@ -5310,52 +5210,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "jsonrpsee-http-client" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ccf93fc4a0bfe05d851d37d7c32b7f370fe94336b52a2f0efc5f1981895c2e5" -dependencies = [ - "async-trait", - "hyper 0.14.31", - "hyper-rustls 0.24.2", - "jsonrpsee-core 0.22.5", - "jsonrpsee-types 0.22.5", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tower", - "tracing", - "url", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "150d6168405890a7a3231a3c74843f58b8959471f6df76078db2619ddee1d07d" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" -dependencies = [ - "beef", - "http 1.2.0", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "jsonrpsee-types" version = "0.24.7" @@ -5368,19 +5222,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "jsonrpsee-ws-client" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" -dependencies = [ - "http 1.2.0", - "jsonrpsee-client-transport 0.23.2", - "jsonrpsee-core 0.23.2", - "jsonrpsee-types 0.23.2", - "url", -] - [[package]] name = "jsonrpsee-ws-client" version = "0.24.7" @@ -5388,9 +5229,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fe322e0896d0955a3ebdd5bf813571c53fea29edd713bc315b76620b327e86d" dependencies = [ "http 1.2.0", - "jsonrpsee-client-transport 0.24.7", - "jsonrpsee-core 0.24.7", - "jsonrpsee-types 0.24.7", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", "url", ] @@ -5486,8 +5327,8 @@ dependencies = [ "tokio", "tokio-tungstenite", "tokio-util", - "tower", - "tower-http", + "tower 0.4.13", + "tower-http 0.4.4", "tracing", ] @@ -5936,6 +5777,12 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "matrixmultiply" version = "0.3.9" @@ -6161,12 +6008,6 @@ dependencies = [ "libc", ] -[[package]] -name = "no-std-net" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" - [[package]] name = "nodrop" version = "0.1.14" @@ -6480,7 +6321,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", @@ -6499,7 +6340,7 @@ dependencies = [ "pallet-asset-conversion", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", @@ -6855,7 +6696,7 @@ dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-runtime 39.0.2", "sp-std", ] @@ -6874,7 +6715,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-runtime 39.0.2", ] @@ -6980,7 +6821,7 @@ dependencies = [ "staging-xcm 14.2.0", "staging-xcm-builder", "wasm-instrument", - "wasmi 0.32.3", + "wasmi", ] [[package]] @@ -7097,7 +6938,7 @@ dependencies = [ "pallet-ranked-collective", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", @@ -7168,7 +7009,7 @@ dependencies = [ "parity-scale-codec", "rand", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-npos-elections", @@ -7382,11 +7223,11 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", ] [[package]] @@ -7421,7 +7262,7 @@ dependencies = [ "scale-info", "serde", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-io 38.0.0", "sp-mixnet", "sp-runtime 39.0.2", @@ -7518,7 +7359,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-runtime 39.0.2", ] @@ -7712,7 +7553,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", @@ -7746,7 +7587,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-io 38.0.0", "sp-runtime 39.0.2", ] @@ -7919,7 +7760,7 @@ dependencies = [ "pallet-utility", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-runtime 39.0.2", ] @@ -7936,7 +7777,7 @@ dependencies = [ "pallet-ranked-collective", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", @@ -7957,7 +7798,7 @@ dependencies = [ "scale-info", "sp-io 38.0.0", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", ] [[package]] @@ -8039,7 +7880,7 @@ dependencies = [ "parity-scale-codec", "rand_chacha", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-io 38.0.0", "sp-runtime 39.0.2", ] @@ -8073,7 +7914,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "988a7ebeacc84d4bdb0b12409681e956ffe35438447d8f8bc78db547cffb6ebc" dependencies = [ "log", - "sp-arithmetic 26.0.0", + "sp-arithmetic", ] [[package]] @@ -8203,7 +8044,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", ] [[package]] @@ -8767,7 +8608,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", ] [[package]] @@ -8786,7 +8627,7 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-authority-discovery", "sp-consensus-slots", "sp-core 34.0.0", @@ -8813,7 +8654,7 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-authority-discovery", "sp-consensus-slots", "sp-core 34.0.0", @@ -8923,7 +8764,7 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-inherents", "sp-io 38.0.0", @@ -9118,7 +8959,7 @@ dependencies = [ "sp-api", "sp-api-proc-macro", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-authority-discovery", "sp-block-builder", "sp-consensus-aura", @@ -9158,7 +8999,7 @@ dependencies = [ "sp-trie 37.0.0", "sp-version", "sp-wasm-interface 21.0.1", - "sp-weights 31.0.0", + "sp-weights", "staging-parachain-info", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -9186,7 +9027,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", "sp-consensus-grandpa", @@ -9477,6 +9318,7 @@ version = "0.5.0" dependencies = [ "anyhow", "assert_cmd", + "axum", "clap", "cliclack", "console", @@ -9491,13 +9333,15 @@ dependencies = [ "pop-telemetry", "predicates", "reqwest 0.12.9", + "serde", "serde_json", - "sp-core 31.0.0", - "sp-weights 30.0.0", + "sp-core 32.0.0", + "sp-weights", "strum 0.26.3", "strum_macros 0.26.4", "tempfile", "tokio", + "tower-http 0.6.2", "url", ] @@ -9522,8 +9366,8 @@ dependencies = [ "serde_json", "strum 0.26.3", "strum_macros 0.26.4", - "subxt 0.37.0", - "subxt-signer 0.37.0", + "subxt", + "subxt-signer", "tar", "tempfile", "thiserror 1.0.69", @@ -9550,8 +9394,8 @@ dependencies = [ "pop-common", "reqwest 0.12.9", "scale-info", - "sp-core 31.0.0", - "sp-weights 30.0.0", + "sp-core 32.0.0", + "sp-weights", "strum 0.26.3", "strum_macros 0.26.4", "tar", @@ -9578,11 +9422,11 @@ dependencies = [ "pop-common", "reqwest 0.12.9", "scale-info", - "scale-value 0.16.3", + "scale-value", "serde_json", "strum 0.26.3", "strum_macros 0.26.4", - "subxt 0.37.0", + "subxt", "symlink", "tar", "tempfile", @@ -9934,22 +9778,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "reconnecting-jsonrpsee-ws-client" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06fa4f17e09edfc3131636082faaec633c7baa269396b4004040bc6c52f49f65" -dependencies = [ - "cfg_aliases", - "finito", - "futures", - "jsonrpsee 0.23.2", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tracing", -] - [[package]] name = "redox_syscall" version = "0.5.7" @@ -10233,7 +10061,7 @@ dependencies = [ "smallvec", "sp-core 34.0.0", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", "staging-xcm 14.2.0", "staging-xcm-builder", ] @@ -10374,20 +10202,6 @@ dependencies = [ "sct", ] -[[package]] -name = "rustls" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" -dependencies = [ - "log", - "ring", - "rustls-pki-types", - "rustls-webpki 0.102.8", - "subtle", - "zeroize", -] - [[package]] name = "rustls" version = "0.23.19" @@ -10518,17 +10332,6 @@ dependencies = [ "wait-timeout", ] -[[package]] -name = "ruzstd" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" -dependencies = [ - "byteorder", - "derive_more 0.99.18", - "twox-hash", -] - [[package]] name = "ruzstd" version = "0.6.0" @@ -10709,21 +10512,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "scale-decode" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" -dependencies = [ - "derive_more 0.99.18", - "parity-scale-codec", - "primitive-types 0.12.2", - "scale-bits 0.6.0", - "scale-decode-derive 0.13.1", - "scale-type-resolver 0.2.0", - "smallvec", -] - [[package]] name = "scale-decode" version = "0.14.0" @@ -10751,18 +10539,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-decode-derive" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb22f574168103cdd3133b19281639ca65ad985e24612728f727339dcaf4021" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "scale-decode-derive" version = "0.14.0" @@ -10788,21 +10564,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "scale-encode" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528464e6ae6c8f98e2b79633bf79ef939552e795e316579dab09c61670d56602" -dependencies = [ - "derive_more 0.99.18", - "parity-scale-codec", - "primitive-types 0.12.2", - "scale-bits 0.6.0", - "scale-encode-derive 0.7.2", - "scale-type-resolver 0.2.0", - "smallvec", -] - [[package]] name = "scale-encode" version = "0.8.0" @@ -10831,19 +10592,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-encode-derive" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef2618f123c88da9cd8853b69d766068f1eddc7692146d7dfe9b89e25ce2efd" -dependencies = [ - "darling 0.20.10", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "scale-encode-derive" version = "0.8.0" @@ -10903,19 +10651,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "scale-typegen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498d1aecf2ea61325d4511787c115791639c0fd21ef4f8e11e49dd09eff2bbac" -dependencies = [ - "proc-macro2", - "quote", - "scale-info", - "syn 2.0.90", - "thiserror 1.0.69", -] - [[package]] name = "scale-typegen" version = "0.9.0" @@ -10929,27 +10664,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "scale-value" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6ab090d823e75cfdb258aad5fe92e13f2af7d04b43a55d607d25fcc38c811" -dependencies = [ - "base58", - "blake2", - "derive_more 0.99.18", - "either", - "frame-metadata 15.1.0", - "parity-scale-codec", - "scale-bits 0.6.0", - "scale-decode 0.13.1", - "scale-encode 0.7.2", - "scale-info", - "scale-type-resolver 0.2.0", - "serde", - "yap", -] - [[package]] name = "scale-value" version = "0.17.0" @@ -11292,6 +11006,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.19" @@ -11364,19 +11088,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "sha1" version = "0.10.6" @@ -11586,61 +11297,6 @@ dependencies = [ "futures-lite", ] -[[package]] -name = "smoldot" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d1eaa97d77be4d026a1e7ffad1bb3b78448763b357ea6f8188d3e6f736a9b9" -dependencies = [ - "arrayvec 0.7.6", - "async-lock", - "atomic-take", - "base64 0.21.7", - "bip39", - "blake2-rfc", - "bs58", - "chacha20", - "crossbeam-queue", - "derive_more 0.99.18", - "ed25519-zebra 4.0.3", - "either", - "event-listener 4.0.3", - "fnv", - "futures-lite", - "futures-util", - "hashbrown 0.14.5", - "hex", - "hmac 0.12.1", - "itertools 0.12.1", - "libm", - "libsecp256k1", - "merlin", - "no-std-net", - "nom", - "num-bigint", - "num-rational", - "num-traits", - "pbkdf2", - "pin-project", - "poly1305", - "rand", - "rand_chacha", - "ruzstd 0.5.0", - "schnorrkel", - "serde", - "serde_json", - "sha2 0.10.8", - "sha3", - "siphasher", - "slab", - "smallvec", - "soketto 0.7.1", - "twox-hash", - "wasmi 0.31.2", - "x25519-dalek", - "zeroize", -] - [[package]] name = "smoldot" version = "0.18.0" @@ -11659,7 +11315,7 @@ dependencies = [ "derive_more 0.99.18", "ed25519-zebra 4.0.3", "either", - "event-listener 5.3.1", + "event-listener", "fnv", "futures-lite", "futures-util", @@ -11679,7 +11335,7 @@ dependencies = [ "poly1305", "rand", "rand_chacha", - "ruzstd 0.6.0", + "ruzstd", "schnorrkel", "serde", "serde_json", @@ -11688,49 +11344,13 @@ dependencies = [ "siphasher", "slab", "smallvec", - "soketto 0.8.1", + "soketto", "twox-hash", - "wasmi 0.32.3", + "wasmi", "x25519-dalek", "zeroize", ] -[[package]] -name = "smoldot-light" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5496f2d116b7019a526b1039ec2247dd172b8670633b1a64a614c9ea12c9d8c7" -dependencies = [ - "async-channel", - "async-lock", - "base64 0.21.7", - "blake2-rfc", - "derive_more 0.99.18", - "either", - "event-listener 4.0.3", - "fnv", - "futures-channel", - "futures-lite", - "futures-util", - "hashbrown 0.14.5", - "hex", - "itertools 0.12.1", - "log", - "lru 0.12.5", - "no-std-net", - "parking_lot", - "pin-project", - "rand", - "rand_chacha", - "serde", - "serde_json", - "siphasher", - "slab", - "smol", - "smoldot 0.16.0", - "zeroize", -] - [[package]] name = "smoldot-light" version = "0.16.2" @@ -11744,7 +11364,7 @@ dependencies = [ "bs58", "derive_more 0.99.18", "either", - "event-listener 5.3.1", + "event-listener", "fnv", "futures-channel", "futures-lite", @@ -11763,7 +11383,7 @@ dependencies = [ "siphasher", "slab", "smol", - "smoldot 0.18.0", + "smoldot", "zeroize", ] @@ -11815,7 +11435,7 @@ dependencies = [ "scale-info", "serde", "snowbridge-beacon-primitives", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", @@ -11981,7 +11601,7 @@ dependencies = [ "serde", "snowbridge-core", "snowbridge-outbound-queue-merkle-tree", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", @@ -12039,7 +11659,7 @@ dependencies = [ "log", "parity-scale-codec", "snowbridge-core", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -12101,21 +11721,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "soketto" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" -dependencies = [ - "base64 0.13.1", - "bytes", - "futures", - "httparse", - "log", - "rand", - "sha-1", -] - [[package]] name = "soketto" version = "0.8.1" @@ -12196,21 +11801,6 @@ dependencies = [ "sp-io 38.0.0", ] -[[package]] -name = "sp-arithmetic" -version = "25.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910c07fa263b20bf7271fdd4adcb5d3217dfdac14270592e0780223542e7e114" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std", - "static_assertions", -] - [[package]] name = "sp-arithmetic" version = "26.0.0" @@ -12305,7 +11895,7 @@ dependencies = [ "sp-keystore 0.40.0", "sp-mmr-primitives", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", "strum 0.26.3", ] @@ -12768,7 +12358,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-runtime 39.0.2", ] @@ -12813,11 +12403,11 @@ dependencies = [ "serde", "simple-mermaid", "sp-application-crypto 34.0.0", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 32.0.0", "sp-io 34.0.0", "sp-std", - "sp-weights 31.0.0", + "sp-weights", ] [[package]] @@ -12839,11 +12429,11 @@ dependencies = [ "serde", "simple-mermaid", "sp-application-crypto 38.0.0", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-std", - "sp-weights 31.0.0", + "sp-weights", "tracing", ] @@ -13232,22 +12822,6 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "sp-weights" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9af6c661fe3066b29f9e1d258000f402ff5cc2529a9191972d214e5871d0ba87" -dependencies = [ - "bounded-collections", - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic 25.0.0", - "sp-debug-derive", - "sp-std", -] - [[package]] name = "sp-weights" version = "31.0.0" @@ -13259,7 +12833,7 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-debug-derive", ] @@ -13352,7 +12926,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights 31.0.0", + "sp-weights", "xcm-procedural 8.0.0", ] @@ -13372,7 +12946,7 @@ dependencies = [ "scale-info", "serde", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", "xcm-procedural 10.1.0", ] @@ -13391,10 +12965,10 @@ dependencies = [ "parity-scale-codec", "polkadot-parachain-primitives", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-io 38.0.0", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", "staging-xcm 14.2.0", "staging-xcm-executor", ] @@ -13411,11 +12985,11 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", "staging-xcm 14.2.0", "tracing", ] @@ -13543,42 +13117,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "subxt" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a160cba1edbf3ec4fbbeaea3f1a185f70448116a6bccc8276bb39adb3b3053bd" -dependencies = [ - "async-trait", - "derive-where", - "either", - "frame-metadata 16.0.0", - "futures", - "hex", - "impl-serde 0.4.0", - "instant", - "jsonrpsee 0.22.5", - "parity-scale-codec", - "primitive-types 0.12.2", - "reconnecting-jsonrpsee-ws-client", - "scale-bits 0.6.0", - "scale-decode 0.13.1", - "scale-encode 0.7.2", - "scale-info", - "scale-value 0.16.3", - "serde", - "serde_json", - "sp-crypto-hashing", - "subxt-core 0.37.1", - "subxt-lightclient 0.37.0", - "subxt-macro 0.37.0", - "subxt-metadata 0.37.0", - "thiserror 1.0.69", - "tokio-util", - "tracing", - "url", -] - [[package]] name = "subxt" version = "0.38.0" @@ -13592,7 +13130,7 @@ dependencies = [ "futures", "hex", "impl-serde 0.5.0", - "jsonrpsee 0.24.7", + "jsonrpsee", "parity-scale-codec", "polkadot-sdk", "primitive-types 0.13.1", @@ -13600,13 +13138,13 @@ dependencies = [ "scale-decode 0.14.0", "scale-encode 0.8.0", "scale-info", - "scale-value 0.17.0", + "scale-value", "serde", "serde_json", - "subxt-core 0.38.0", - "subxt-lightclient 0.38.0", - "subxt-macro 0.38.0", - "subxt-metadata 0.38.0", + "subxt-core", + "subxt-lightclient", + "subxt-macro", + "subxt-metadata", "thiserror 1.0.69", "tokio", "tokio-util", @@ -13616,27 +13154,6 @@ dependencies = [ "web-time", ] -[[package]] -name = "subxt-codegen" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d703dca0905cc5272d7cc27a4ac5f37dcaae7671acc7fef0200057cc8c317786" -dependencies = [ - "frame-metadata 16.0.0", - "heck 0.5.0", - "hex", - "jsonrpsee 0.22.5", - "parity-scale-codec", - "proc-macro2", - "quote", - "scale-info", - "scale-typegen 0.8.0", - "subxt-metadata 0.37.0", - "syn 2.0.90", - "thiserror 1.0.69", - "tokio", -] - [[package]] name = "subxt-codegen" version = "0.38.0" @@ -13648,39 +13165,12 @@ dependencies = [ "proc-macro2", "quote", "scale-info", - "scale-typegen 0.9.0", - "subxt-metadata 0.38.0", + "scale-typegen", + "subxt-metadata", "syn 2.0.90", "thiserror 1.0.69", ] -[[package]] -name = "subxt-core" -version = "0.37.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3af3b36405538a36b424d229dc908d1396ceb0994c90825ce928709eac1a159a" -dependencies = [ - "base58", - "blake2", - "derive-where", - "frame-metadata 16.0.0", - "hashbrown 0.14.5", - "hex", - "impl-serde 0.4.0", - "parity-scale-codec", - "primitive-types 0.12.2", - "scale-bits 0.6.0", - "scale-decode 0.13.1", - "scale-encode 0.7.2", - "scale-info", - "scale-value 0.16.3", - "serde", - "serde_json", - "sp-crypto-hashing", - "subxt-metadata 0.37.0", - "tracing", -] - [[package]] name = "subxt-core" version = "0.38.0" @@ -13703,27 +13193,10 @@ dependencies = [ "scale-decode 0.14.0", "scale-encode 0.8.0", "scale-info", - "scale-value 0.17.0", + "scale-value", "serde", "serde_json", - "subxt-metadata 0.38.0", - "tracing", -] - -[[package]] -name = "subxt-lightclient" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9406fbdb9548c110803cb8afa750f8b911d51eefdf95474b11319591d225d9" -dependencies = [ - "futures", - "futures-util", - "serde", - "serde_json", - "smoldot-light 0.14.0", - "thiserror 1.0.69", - "tokio", - "tokio-stream", + "subxt-metadata", "tracing", ] @@ -13737,28 +13210,13 @@ dependencies = [ "futures-util", "serde", "serde_json", - "smoldot-light 0.16.2", + "smoldot-light", "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", ] -[[package]] -name = "subxt-macro" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c195f803d70687e409aba9be6c87115b5da8952cd83c4d13f2e043239818fcd" -dependencies = [ - "darling 0.20.10", - "parity-scale-codec", - "proc-macro-error", - "quote", - "scale-typegen 0.8.0", - "subxt-codegen 0.37.0", - "syn 2.0.90", -] - [[package]] name = "subxt-macro" version = "0.38.0" @@ -13769,25 +13227,12 @@ dependencies = [ "parity-scale-codec", "proc-macro-error2", "quote", - "scale-typegen 0.9.0", - "subxt-codegen 0.38.0", + "scale-typegen", + "subxt-codegen", "subxt-utils-fetchmetadata", "syn 2.0.90", ] -[[package]] -name = "subxt-metadata" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738be5890fdeff899bbffff4d9c0f244fe2a952fb861301b937e3aa40ebb55da" -dependencies = [ - "frame-metadata 16.0.0", - "hashbrown 0.14.5", - "parity-scale-codec", - "scale-info", - "sp-crypto-hashing", -] - [[package]] name = "subxt-metadata" version = "0.38.0" @@ -13802,28 +13247,6 @@ dependencies = [ "scale-info", ] -[[package]] -name = "subxt-signer" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49888ae6ae90fe01b471193528eea5bd4ed52d8eecd2d13f4a2333b87388850" -dependencies = [ - "bip39", - "cfg-if", - "hex", - "hmac 0.12.1", - "parity-scale-codec", - "pbkdf2", - "regex", - "schnorrkel", - "secp256k1 0.28.2", - "secrecy 0.8.0", - "sha2 0.10.8", - "sp-crypto-hashing", - "subxt-core 0.37.1", - "zeroize", -] - [[package]] name = "subxt-signer" version = "0.38.0" @@ -13847,7 +13270,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "subxt-core 0.38.0", + "subxt-core", "zeroize", ] @@ -14244,17 +13667,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" -dependencies = [ - "rustls 0.22.4", - "rustls-pki-types", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.1" @@ -14401,6 +13813,22 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-http" version = "0.4.4" @@ -14414,7 +13842,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "http-range-header", + "http-range-header 0.3.1", "mime", "pin-project-lite", "tower-layer", @@ -14422,6 +13850,31 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" +dependencies = [ + "bitflags 2.6.0", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "http-range-header 0.4.2", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -15007,19 +14460,6 @@ dependencies = [ "cxx-build", ] -[[package]] -name = "wasmi" -version = "0.31.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" -dependencies = [ - "smallvec", - "spin", - "wasmi_arena", - "wasmi_core 0.13.0", - "wasmparser-nostd", -] - [[package]] name = "wasmi" version = "0.32.3" @@ -15033,16 +14473,10 @@ dependencies = [ "smallvec", "spin", "wasmi_collections", - "wasmi_core 0.32.3", + "wasmi_core", "wasmparser-nostd", ] -[[package]] -name = "wasmi_arena" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" - [[package]] name = "wasmi_collections" version = "0.32.3" @@ -15054,18 +14488,6 @@ dependencies = [ "string-interner", ] -[[package]] -name = "wasmi_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" -dependencies = [ - "downcast-rs", - "libm", - "num-traits", - "paste", -] - [[package]] name = "wasmi_core" version = "0.32.3" @@ -15347,7 +14769,7 @@ dependencies = [ "smallvec", "sp-core 34.0.0", "sp-runtime 39.0.2", - "sp-weights 31.0.0", + "sp-weights", "staging-xcm 14.2.0", "staging-xcm-builder", ] @@ -15770,7 +15192,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-weights 31.0.0", + "sp-weights", "staging-xcm 14.2.0", "staging-xcm-executor", ] @@ -15974,8 +15396,8 @@ dependencies = [ "serde_json", "sha2 0.10.8", "sp-core 31.0.0", - "subxt 0.38.0", - "subxt-signer 0.38.0", + "subxt", + "subxt-signer", "thiserror 1.0.69", "tokio", "tracing", @@ -16037,8 +15459,8 @@ dependencies = [ "async-trait", "futures", "lazy_static", - "subxt 0.38.0", - "subxt-signer 0.38.0", + "subxt", + "subxt-signer", "tokio", "zombienet-configuration", "zombienet-orchestrator", diff --git a/Cargo.toml b/Cargo.toml index c31416f12..c84ce914d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,3 +76,7 @@ console = "0.15" os_info = { version = "3", default-features = false } strum = "0.26" strum_macros = "0.26" + +# wallet-integration +axum = "0.7.9" +tower-http = "0.6.2" diff --git a/crates/pop-cli/Cargo.toml b/crates/pop-cli/Cargo.toml index c9761b642..4f3ab59ab 100644 --- a/crates/pop-cli/Cargo.toml +++ b/crates/pop-cli/Cargo.toml @@ -18,6 +18,7 @@ duct.workspace = true env_logger.workspace = true os_info.workspace = true reqwest.workspace = true +serde = { workspace = true, version = "1.0", features = ["derive"] } serde_json.workspace = true tempfile.workspace = true tokio.workspace = true @@ -46,6 +47,10 @@ pop-telemetry = { path = "../pop-telemetry", version = "0.5.0", optional = true # common pop-common = { path = "../pop-common", version = "0.5.0" } +# wallet-integration +axum.workspace = true +tower-http = { workspace = true, features = ["fs"] } + [dev-dependencies] assert_cmd.workspace = true predicates.workspace = true diff --git a/crates/pop-cli/src/main.rs b/crates/pop-cli/src/main.rs index 9a41fd7c1..f8e3504e5 100644 --- a/crates/pop-cli/src/main.rs +++ b/crates/pop-cli/src/main.rs @@ -19,6 +19,7 @@ mod cli; mod commands; mod common; mod style; +mod wallet_integration; #[tokio::main] async fn main() -> Result<()> { diff --git a/crates/pop-cli/src/wallet_integration.rs b/crates/pop-cli/src/wallet_integration.rs new file mode 100644 index 000000000..2d7c4cdf4 --- /dev/null +++ b/crates/pop-cli/src/wallet_integration.rs @@ -0,0 +1,537 @@ +use axum::{ + response::Html, + routing::{get, post}, + Router, +}; +use serde::Serialize; +use std::{path::PathBuf, sync::Arc}; +use tokio::{ + sync::{oneshot, Mutex}, + task::JoinHandle, +}; +use tower_http::services::ServeDir; + +/// Make frontend sourcing more flexible by allowing a custom route +/// to be defined. +pub trait Frontend { + fn serve_content(&self) -> Router; +} + +/// Transaction payload to be sent to frontend for signing. +#[derive(Serialize, Debug)] +#[cfg_attr(test, derive(serde::Deserialize, Clone))] +pub struct TransactionData { + chain_rpc: String, + call_data: Vec, +} + +impl TransactionData { + pub fn new(chain_rpc: String, call_data: Vec) -> Self { + Self { chain_rpc, call_data } + } +} + +/// Shared state between routes. Serves two purposes: +/// - Maintains a channel to signal shutdown to the main app. +/// - Stores the signed payload received from the wallet. +#[derive(Default)] +pub struct StateHandler { + /// Channel to signal shutdown to the main app. + shutdown_tx: Option>, + /// Received from UI. + pub signed_payload: Option, + /// Holds a single error message. + /// Only method for consuming error removes (takes) it from state. + error: Option, +} + +/// Manages the wallet integration for secure signing of transactions. +pub struct WalletIntegrationManager { + /// Shared state between routes. + pub state: Arc>, + /// Node rpc address. + pub rpc_url: String, + /// Web server task handle. + pub task_handle: JoinHandle>, +} + +impl WalletIntegrationManager { + /// Launches a server for hosting the wallet integration. Server launched in separate task. + /// Uses default address of 127.0.0.1:9090. + /// # Arguments + /// * `frontend`: A frontend with custom route to serve content. + /// * `payload`: Payload to be sent to the frontend for signing. + /// + /// # Returns + /// A `WalletIntegrationManager` instance, with access to the state and task handle for the + /// server. + pub fn new(frontend: F, payload: TransactionData) -> Self { + Self::new_with_address(frontend, payload, "127.0.0.1:9090") + } + + /// Same as `new`, but allows specifying the address to bind to. + pub fn new_with_address(frontend: F, payload: TransactionData, rpc: &str) -> Self { + // Channel to signal shutdown. + let (tx, rx) = oneshot::channel(); + + let state = Arc::new(Mutex::new(StateHandler { + shutdown_tx: Some(tx), + signed_payload: None, + error: None, + })); + + let payload = Arc::new(payload); + + let app = Router::new() + .route("/payload", get(routes::get_payload_handler).with_state(payload)) + .route("/submit", post(routes::submit_handler).with_state(state.clone())) + .route("/error", post(routes::error_handler).with_state(state.clone())) + .route("/terminate", post(routes::terminate_handler).with_state(state.clone())) + .merge(frontend.serve_content()); // Custom route for serving frontend. + + let rpc_owned = rpc.to_string(); + + // Will shut down when the signed payload is received. + let task_handle = tokio::spawn(async move { + let listener = tokio::net::TcpListener::bind(&rpc_owned) + .await + .map_err(|e| anyhow::anyhow!("Failed to bind to {}: {}", rpc_owned, e))?; + + axum::serve(listener, app) + .with_graceful_shutdown(async move { + let _ = rx.await.ok(); + }) + .await + .map_err(|e| anyhow::anyhow!("Server encountered an error: {}", e))?; + Ok(()) + }); + + Self { state, rpc_url: rpc.to_string(), task_handle } + } + + /// Signals the wallet integration server to shut down. + pub async fn terminate(&mut self) -> anyhow::Result<()> { + terminate_helper(&self.state).await + } + + /// Checks if the server task is still running. + pub fn is_running(&self) -> bool { + !self.task_handle.is_finished() + } + + /// Takes the error from the state if it exists. + pub async fn take_error(&mut self) -> Option { + self.state.lock().await.error.take() + } +} + +mod routes { + use super::{terminate_helper, Arc, Mutex, StateHandler, TransactionData}; + use anyhow::Error; + use axum::{ + extract::State, + http::StatusCode, + response::{IntoResponse, Response}, + Json, + }; + use serde_json::json; + + pub(super) struct ApiError(Error); + + impl From for ApiError { + fn from(err: Error) -> Self { + ApiError(err) + } + } + + // Implementing IntoResponse for ApiError allows us to return it directly from a route handler. + impl IntoResponse for ApiError { + fn into_response(self) -> Response { + let body = json!({ + "error": self.0.to_string(), + }); + (StatusCode::INTERNAL_SERVER_ERROR, Json(body)).into_response() + } + } + + /// Responds with the serialized JSON data for signing. + pub(super) async fn get_payload_handler( + State(payload): State>, + ) -> Result, ApiError> { + // Error should never occur. + let json_payload = serde_json::to_value(&*payload) + .map_err(|e| anyhow::anyhow!("Failed to serialize payload: {}", e))?; + Ok(Json(json_payload)) + } + + /// Receives the signed payload from the wallet. + /// Will signal for shutdown on success. + pub(super) async fn submit_handler( + State(state): State>>, + Json(payload): Json, + ) -> Result, ApiError> { + // Signal shutdown. + let res = terminate_helper(&state).await; + + let mut state_locked = state.lock().await; + state_locked.signed_payload = Some(payload); + + res?; + + // Graceful shutdown ensures response is sent before shutdown. + Ok(Json(json!({"status": "success"}))) + } + + /// Receives an error message from the wallet. + pub(super) async fn error_handler( + State(state): State>>, + Json(error): Json, + ) { + let mut state = state.lock().await; + state.error = Some(error); + } + + /// Allows the server to be terminated from the frontend. + pub(super) async fn terminate_handler( + State(state): State>>, + ) -> Result<(), ApiError> { + Ok(terminate_helper(&state).await?) + } +} + +async fn terminate_helper(handle: &Arc>) -> anyhow::Result<()> { + if let Some(shutdown_tx) = handle.lock().await.shutdown_tx.take() { + shutdown_tx + .send(()) + .map_err(|_| anyhow::anyhow!("Failed to send shutdown signal"))?; + } + Ok(()) +} + +/// Serves static files from a directory. +pub struct FrontendFromDir { + content: PathBuf, +} +impl FrontendFromDir { + pub fn new(content: PathBuf) -> Self { + Self { content } + } +} + +impl Frontend for FrontendFromDir { + fn serve_content(&self) -> Router { + Router::new().nest_service("/", ServeDir::new(self.content.clone())) + } +} + +/// Serves a hard-coded HTML string as the frontend. +pub struct FrontendFromString { + content: String, +} + +impl FrontendFromString { + pub fn new(content: String) -> Self { + Self { content } + } +} + +impl Frontend for FrontendFromString { + fn serve_content(&self) -> Router { + let content = self.content.clone(); + Router::new().route("/", get(move || async { Html(content) })) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use serde_json::json; + + const TEST_HTML: &str = "Hello, world!"; + + // Wait for server to launch. + async fn wait() { + tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; + } + + fn default_payload() -> TransactionData { + TransactionData { chain_rpc: "localhost:9944".to_string(), call_data: vec![1, 2, 3] } + } + + #[tokio::test] + async fn new_works() { + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + let mut wim = WalletIntegrationManager::new(frontend, default_payload()); + + assert_eq!(wim.rpc_url, "127.0.0.1:9090"); + assert_eq!(wim.is_running(), true); + assert!(wim.state.lock().await.shutdown_tx.is_some()); + assert!(wim.state.lock().await.signed_payload.is_none()); + + // Terminate the server and make sure result is ok. + wim.terminate().await.expect("Termination should not fail."); + assert!(wim.task_handle.await.is_ok()); + } + + #[test] + fn new_transaction_data_works() { + let chain_rpc = "localhost:9944".to_string(); + let call_data = vec![1, 2, 3]; + let transaction_data = TransactionData::new(chain_rpc.clone(), call_data.clone()); + + assert_eq!(transaction_data.chain_rpc, chain_rpc); + assert_eq!(transaction_data.call_data, call_data); + } + + #[tokio::test] + async fn take_error_works() { + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + let mut wim = WalletIntegrationManager::new(frontend, default_payload()); + + assert_eq!(wim.take_error().await, None); + + let error = "An error occurred".to_string(); + wim.state.lock().await.error = Some(error.clone()); + + let taken_error = wim.take_error().await; + assert_eq!(taken_error, Some(error)); + } + + #[tokio::test] + async fn payload_handler_works() { + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9091"; + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + + let expected_payload = + TransactionData { chain_rpc: "localhost:9944".to_string(), call_data: vec![1, 2, 3] }; + let mut wim = + WalletIntegrationManager::new_with_address(frontend, expected_payload.clone(), addr); + wait().await; + + let addr = format!("http://{}", wim.rpc_url); + let actual_payload = reqwest::get(&format!("{}/payload", addr)) + .await + .expect("Failed to get payload") + .json::() + .await + .expect("Failed to parse payload"); + + assert_eq!(actual_payload.chain_rpc, expected_payload.chain_rpc); + assert_eq!(actual_payload.call_data, expected_payload.call_data); + + wim.terminate().await.expect("Termination should not fail"); + assert!(wim.task_handle.await.is_ok()); + } + + #[tokio::test] + async fn submit_handler_works() { + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9092"; + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + + let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + wait().await; + + let addr = format!("http://{}", wim.rpc_url); + let response = reqwest::Client::new() + .post(&format!("{}/submit", addr)) + .json(&"0xDEADBEEF") + .send() + .await + .expect("Failed to submit payload") + .json::() + .await + .expect("Failed to parse JSON response"); + + assert_eq!(response, json!({"status": "success"})); + assert_eq!(wim.state.lock().await.signed_payload, Some("0xDEADBEEF".to_string())); + assert_eq!(wim.is_running(), false); + + wim.terminate().await.expect("Termination should not fail"); + assert!(wim.task_handle.await.is_ok()); + } + + #[tokio::test] + async fn error_handler_works() { + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9093"; + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + + let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + wait().await; + + let addr = format!("http://{}", wim.rpc_url); + let response = reqwest::Client::new() + .post(&format!("{}/error", addr)) + .json(&"an error occurred") + .send() + .await + .expect("Failed to submit error") + .text() + .await + .expect("Failed to parse response"); + + // no response expected + assert_eq!(response.len(), 0); + assert_eq!(wim.state.lock().await.error, Some("an error occurred".to_string())); + assert_eq!(wim.is_running(), true); + + wim.terminate().await.expect("Termination should not fail"); + assert!(wim.task_handle.await.is_ok()); + } + + #[tokio::test] + async fn terminate_handler_works() { + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9094"; + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + + let wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + wait().await; + + let addr = format!("http://{}", wim.rpc_url); + let response = reqwest::Client::new() + .post(&format!("{}/terminate", addr)) + .send() + .await + .expect("Failed to terminate") + .text() + .await + .expect("Failed to parse response"); + + // No response expected. + assert_eq!(response.len(), 0); + assert_eq!(wim.is_running(), false); + + assert!(wim.task_handle.await.is_ok()); + } + + #[tokio::test] + async fn wallet_terminate_works() { + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9095"; + + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + + let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + + assert_eq!(wim.is_running(), true); + wim.terminate().await.expect("Termination should not fail"); + wait().await; + assert_eq!(wim.is_running(), false); + + wim.terminate().await.expect("Termination should not fail"); + assert!(wim.task_handle.await.is_ok()); + } + + #[tokio::test] + async fn frontend_from_string_works() { + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9096"; + + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + wait().await; + + let actual_content = reqwest::get(&format!("http://{}", addr)) + .await + .expect("Failed to get web page") + .text() + .await + .expect("Failed to parse page"); + + assert_eq!(actual_content, TEST_HTML); + + wim.terminate().await.expect("Termination should not fail"); + assert!(wim.task_handle.await.is_ok()); + } + + #[tokio::test] + async fn frontend_from_dir_works() { + use std::fs; + use tempfile::tempdir; + + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9097"; + + let temp_dir = tempdir().expect("Failed to create temp directory"); + let index_file_path = temp_dir.path().join("index.html"); + + let test_html = "Hello, world from Directory!"; + fs::write(&index_file_path, test_html).expect("Failed to write index.html"); + + let frontend = FrontendFromDir::new(temp_dir.path().to_path_buf()); + let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + wait().await; + + let actual_content = reqwest::get(&format!("http://{}", addr)) + .await + .expect("Failed to get web page") + .text() + .await + .expect("Failed to parse page"); + + assert_eq!(actual_content, test_html); + + wim.terminate().await.expect("Termination should not fail"); + assert!(wim.task_handle.await.is_ok()); + } + + #[tokio::test] + async fn large_payload_works() { + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9098"; + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + + let call_data_5mb = vec![99u8; 5 * 1024 * 1024]; + + let expected_payload = TransactionData { + chain_rpc: "localhost:9944".to_string(), + call_data: call_data_5mb.clone(), + }; + let mut wim = + WalletIntegrationManager::new_with_address(frontend, expected_payload.clone(), addr); + wait().await; + + let addr = format!("http://{}", wim.rpc_url); + let actual_payload = reqwest::get(&format!("{}/payload", addr)) + .await + .expect("Failed to get payload") + .json::() + .await + .expect("Failed to parse payload"); + + assert_eq!(actual_payload.chain_rpc, expected_payload.chain_rpc); + assert_eq!(actual_payload.call_data, call_data_5mb); + + wim.terminate().await.expect("Termination should not fail."); + assert!(wim.task_handle.await.is_ok()); + } + + #[tokio::test] + async fn new_with_conflicting_address_fails() { + // offset port per test to avoid conflicts + let addr = "127.0.0.1:9099"; + + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + let wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + wait().await; + + assert_eq!(wim.is_running(), true); + + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + let wim_conflict = + WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + wait().await; + + assert_eq!(wim_conflict.is_running(), false); + let task_result = wim_conflict.task_handle.await.unwrap(); + match task_result { + Err(e) => assert!(e + .to_string() + .starts_with(&format!("Failed to bind to {}: Address already in use", addr))), + Ok(_) => panic!("Expected error, but task succeeded"), + } + } +} From a0a8397db3e4a773ffa9fa4dde429cef1ed8fb03 Mon Sep 17 00:00:00 2001 From: Peter White Date: Sun, 15 Dec 2024 19:27:16 -0700 Subject: [PATCH 02/25] feat(wallet integration): pop up contract (#365) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * fix: minor fixes after rebase * fix(up-contract): test compilation after rebase * feat(up-contract): suri and use-wallet can't be used together * refactor: wait for finalization * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements (#380) * docs: add function comments --- Cargo.lock | 24 +- Cargo.toml | 10 +- crates/pop-cli/Cargo.toml | 4 +- crates/pop-cli/src/assets/index.html | 134 +++++++++ crates/pop-cli/src/commands/up/contract.rs | 306 ++++++++++++++++++--- crates/pop-cli/src/wallet_integration.rs | 24 +- crates/pop-contracts/Cargo.toml | 4 +- crates/pop-contracts/src/lib.rs | 6 +- crates/pop-contracts/src/up.rs | 210 +++++++++++++- 9 files changed, 645 insertions(+), 77 deletions(-) create mode 100644 crates/pop-cli/src/assets/index.html diff --git a/Cargo.lock b/Cargo.lock index 901e0e10f..9887bd521 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -966,7 +966,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.2", "tokio", - "tower 0.5.1", + "tower 0.5.2", "tower-layer", "tower-service", "tracing", @@ -2004,8 +2004,7 @@ checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" [[package]] name = "contract-build" version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "857769855bf40d230e41baf6575cc44bd5e6869f69f88f45f6791da793f49a0c" +source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" dependencies = [ "anyhow", "blake2", @@ -2045,8 +2044,7 @@ dependencies = [ [[package]] name = "contract-extrinsics" version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77ad38bef6454f97ca33481e960e9b105cb97f3794656071cbf50229445a89d" +source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" dependencies = [ "anyhow", "blake2", @@ -2078,8 +2076,7 @@ dependencies = [ [[package]] name = "contract-metadata" version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733a6624ea05dd71050641c3cd9baff7a1445032a0082f0e55c800c078716424" +source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" dependencies = [ "anyhow", "impl-serde 0.5.0", @@ -2092,8 +2089,7 @@ dependencies = [ [[package]] name = "contract-transcode" version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9131028be7b8eefdd9151a0a682ed428c1418d5d1ec142c35d2dbe6b9653c6" +source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" dependencies = [ "anyhow", "base58", @@ -9339,6 +9335,8 @@ dependencies = [ "sp-weights", "strum 0.26.3", "strum_macros 0.26.4", + "subxt", + "subxt-signer", "tempfile", "tokio", "tower-http 0.6.2", @@ -9398,6 +9396,8 @@ dependencies = [ "sp-weights", "strum 0.26.3", "strum_macros 0.26.4", + "subxt", + "subxt-signer", "tar", "tempfile", "thiserror 1.0.69", @@ -13815,14 +13815,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.2", "tokio", "tower-layer", "tower-service", diff --git a/Cargo.toml b/Cargo.toml index c84ce914d..3effb7c2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,11 +49,15 @@ subxt = "0.38.0" ink_env = "5.0.0" sp-core = "32.0.0" sp-weights = "31.0.0" -contract-build = "5.0.0" -contract-extrinsics = "5.0.0" -contract-transcode = "5.0.0" scale-info = { version = "2.11.4", default-features = false, features = ["derive"] } scale-value = { version = "0.17.0", default-features = false, features = ["from-string", "parser-ss58"] } +# TODO: git deps +#contract-build = "5.0.0-alpha" +contract-build = { git = "https://github.com/use-ink/cargo-contract", branch = "peter/chore-make-types-pub" } +#contract-extrinsics = "5.0.0-alpha" +contract-extrinsics = { git = "https://github.com/use-ink/cargo-contract", branch = "peter/chore-make-types-pub" } +#contract-transcode = "5.0.0" +contract-transcode = { git = "https://github.com/use-ink/cargo-contract", branch = "peter/chore-make-types-pub" } heck = "0.5.0" hex = { version = "0.4.3", default-features = false } diff --git a/crates/pop-cli/Cargo.toml b/crates/pop-cli/Cargo.toml index 4f3ab59ab..6d2d6ef42 100644 --- a/crates/pop-cli/Cargo.toml +++ b/crates/pop-cli/Cargo.toml @@ -49,11 +49,13 @@ pop-common = { path = "../pop-common", version = "0.5.0" } # wallet-integration axum.workspace = true -tower-http = { workspace = true, features = ["fs"] } +tower-http = { workspace = true, features = ["fs", "cors"] } [dev-dependencies] assert_cmd.workspace = true predicates.workspace = true +subxt.workspace = true +subxt-signer.workspace = true [features] default = ["contract", "parachain", "telemetry"] diff --git a/crates/pop-cli/src/assets/index.html b/crates/pop-cli/src/assets/index.html new file mode 100644 index 000000000..d5659fbd8 --- /dev/null +++ b/crates/pop-cli/src/assets/index.html @@ -0,0 +1,134 @@ + + + + + + + + Pop CLI Signing Portal + + + + + +
+ + + diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index 964237642..dfb95380e 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -4,14 +4,17 @@ use crate::{ cli::{traits::Cli as _, Cli}, common::contracts::{check_contracts_node_and_prompt, has_contract_been_built}, style::style, + wallet_integration::{FrontendFromString, TransactionData, WalletIntegrationManager}, }; use clap::Args; -use cliclack::{confirm, log, log::error, spinner}; +use cliclack::{confirm, log, log::error, spinner, ProgressBar}; use console::{Emoji, Style}; use pop_contracts::{ build_smart_contract, dry_run_gas_estimate_instantiate, dry_run_upload, - instantiate_smart_contract, is_chain_alive, parse_hex_bytes, run_contracts_node, - set_up_deployment, set_up_upload, upload_smart_contract, UpOpts, Verbosity, + get_code_hash_from_event, get_contract_code, get_instantiate_payload, get_upload_payload, + instantiate_contract_signed, instantiate_smart_contract, is_chain_alive, parse_hex_bytes, + run_contracts_node, set_up_deployment, set_up_upload, upload_contract_signed, + upload_smart_contract, UpOpts, Verbosity, }; use sp_core::Bytes; use sp_weights::Weight; @@ -64,6 +67,15 @@ pub struct UpContractCommand { /// - with a password "//Alice///SECRET_PASSWORD" #[clap(name = "suri", long, short, default_value = "//Alice")] suri: String, + /// Use your browser wallet to sign a transaction. + #[clap( + name = "use-wallet", + long, + default_value = "false", + short('w'), + conflicts_with = "suri" + )] + use_wallet: bool, /// Perform a dry-run via RPC to estimate the gas usage. This does not submit a transaction. #[clap(long)] dry_run: bool, @@ -164,6 +176,76 @@ impl UpContractCommand { None }; + // Run steps for signing with wallet integration. Returns early. + if self.use_wallet { + let (call_data, hash) = match self.get_contract_data().await { + Ok(data) => data, + Err(e) => { + error(format!("An error occurred getting the call data: {e}"))?; + Self::terminate_node(process)?; + Cli.outro_cancel(FAILED)?; + return Ok(()); + }, + }; + + let maybe_payload = self.wait_for_signature(call_data).await?; + if let Some(payload) = maybe_payload { + log::success("Signed payload received.")?; + let spinner = spinner(); + spinner.start("Uploading contract..."); + + if self.upload_only { + let result = upload_contract_signed(self.url.as_str(), payload).await; + // TODO: dry (see else below) + if let Err(e) = result { + spinner.error(format!("An error occurred uploading your contract: {e}")); + Self::terminate_node(process)?; + Cli.outro_cancel(FAILED)?; + return Ok(()); + } + let upload_result = result.expect("Error check above."); + + match get_code_hash_from_event(&upload_result, hash) { + Ok(r) => { + spinner.stop(format!("Contract uploaded: The code hash is {:?}", r)); + }, + Err(e) => { + spinner + .error(format!("An error occurred uploading your contract: {e}")); + }, + }; + } else { + let result = instantiate_contract_signed(self.url.as_str(), payload).await; + if let Err(e) = result { + spinner.error(format!("An error occurred uploading your contract: {e}")); + Self::terminate_node(process)?; + Cli.outro_cancel(FAILED)?; + return Ok(()); + } + + let contract_info = result.unwrap(); + let hash = contract_info.code_hash.map(|code_hash| format!("{:?}", code_hash)); + display_contract_info( + &spinner, + contract_info.contract_address.to_string(), + hash, + ); + }; + + if self.upload_only { + log::warning("NOTE: The contract has not been instantiated.")?; + } + } else { + Cli.outro_cancel("Signed payload doesn't exist.")?; + Self::terminate_node(process)?; + return Ok(()); + } + + Self::terminate_node(process)?; + Cli.outro(COMPLETE)?; + return Ok(()) + } + // Check for upload only. if self.upload_only { let result = self.upload_contract().await; @@ -180,19 +262,7 @@ impl UpContractCommand { } // Otherwise instantiate. - let instantiate_exec = match set_up_deployment(UpOpts { - path: self.path.clone(), - constructor: self.constructor.clone(), - args: self.args.clone(), - value: self.value.clone(), - gas_limit: self.gas_limit, - proof_size: self.proof_size, - salt: self.salt.clone(), - url: self.url.clone(), - suri: self.suri.clone(), - }) - .await - { + let instantiate_exec = match set_up_deployment(self.clone().into()).await { Ok(i) => i, Err(e) => { error(format!("An error occurred instantiating the contract: {e}"))?; @@ -226,29 +296,12 @@ impl UpContractCommand { let spinner = spinner(); spinner.start("Uploading and instantiating the contract..."); let contract_info = instantiate_smart_contract(instantiate_exec, weight_limit).await?; - spinner.stop(format!( - "Contract deployed and instantiated:\n{}", - style(format!( - "{}\n{}", - style(format!( - "{} The contract address is {:?}", - console::Emoji("●", ">"), - contract_info.address - )) - .dim(), - contract_info - .code_hash - .map(|hash| style(format!( - "{} The contract code hash is {:?}", - console::Emoji("●", ">"), - hash - )) - .dim() - .to_string()) - .unwrap_or_default(), - )) - .dim() - )); + display_contract_info( + &spinner, + contract_info.address.to_string(), + contract_info.code_hash, + ); + Self::terminate_node(process)?; Cli.outro(COMPLETE)?; } @@ -313,6 +366,54 @@ impl UpContractCommand { Ok(()) } + + // get the call data and contract code hash + async fn get_contract_data(&self) -> anyhow::Result<(Vec, [u8; 32])> { + let contract_code = get_contract_code(self.path.as_ref()).await?; + let hash = contract_code.code_hash(); + if self.upload_only { + let call_data = get_upload_payload(contract_code, self.url.as_str()).await?; + Ok((call_data, hash)) + } else { + let instantiate_exec = set_up_deployment(self.clone().into()).await?; + + let weight_limit = if self.gas_limit.is_some() && self.proof_size.is_some() { + Weight::from_parts(self.gas_limit.unwrap(), self.proof_size.unwrap()) + } else { + // Frontend will do dry run and update call data. + Weight::from_parts(0, 0) + }; + let call_data = get_instantiate_payload(instantiate_exec, weight_limit).await?; + Ok((call_data, hash)) + } + } + + async fn wait_for_signature(&self, call_data: Vec) -> anyhow::Result> { + let ui = FrontendFromString::new(include_str!("../../assets/index.html").to_string()); + + let transaction_data = TransactionData::new(self.url.to_string(), call_data); + // starts server + let mut wallet = WalletIntegrationManager::new(ui, transaction_data); + log::step(format!("Wallet signing portal started at http://{}", wallet.rpc_url))?; + + log::step("Waiting for signature... Press Ctrl+C to terminate early.")?; + loop { + // Display error, if any. + if let Some(error) = wallet.take_error().await { + log::error(format!("Signing portal error: {error}"))?; + } + + let state = wallet.state.lock().await; + // If the payload is submitted we terminate the frontend. + if !wallet.is_running() || state.signed_payload.is_some() { + wallet.task_handle.await??; + break; + } + } + + let signed_payload = wallet.state.lock().await.signed_payload.clone(); + Ok(signed_payload) + } } impl From for UpOpts { @@ -331,14 +432,37 @@ impl From for UpOpts { } } +fn display_contract_info(spinner: &ProgressBar, address: String, code_hash: Option) { + spinner.stop(format!( + "Contract deployed and instantiated:\n{}", + style(format!( + "{}\n{}", + style(format!("{} The contract address is {:?}", console::Emoji("●", ">"), address)) + .dim(), + code_hash + .map(|hash| style(format!( + "{} The contract code hash is {:?}", + console::Emoji("●", ">"), + hash + )) + .dim() + .to_string()) + .unwrap_or_default(), + )) + .dim() + )); +} + #[cfg(test)] mod tests { use super::*; + use duct::cmd; + use std::fs::{self, File}; + use subxt::{client::OfflineClientT, utils::to_hex}; use url::Url; - #[test] - fn conversion_up_contract_command_to_up_opts_works() -> anyhow::Result<()> { - let command = UpContractCommand { + fn default_up_contract_command() -> UpContractCommand { + UpContractCommand { path: None, constructor: "new".to_string(), args: vec![], @@ -346,12 +470,18 @@ mod tests { gas_limit: None, proof_size: None, salt: None, - url: Url::parse("ws://localhost:9944")?, + url: Url::parse("ws://localhost:9944").expect("default url is valid"), suri: "//Alice".to_string(), dry_run: false, upload_only: false, skip_confirm: false, - }; + use_wallet: false, + } + } + + #[test] + fn conversion_up_contract_command_to_up_opts_works() -> anyhow::Result<()> { + let command = default_up_contract_command(); let opts: UpOpts = command.into(); assert_eq!( opts, @@ -369,4 +499,92 @@ mod tests { ); Ok(()) } + + #[test] + fn has_contract_been_built_works() -> anyhow::Result<()> { + let temp_dir = tempfile::tempdir()?; + let path = temp_dir.path(); + + // Standard rust project + let name = "hello_world"; + cmd("cargo", ["new", name]).dir(&path).run()?; + let contract_path = path.join(name); + assert!(!has_contract_been_built(Some(&contract_path))); + + cmd("cargo", ["build"]).dir(&contract_path).run()?; + // Mock build directory + fs::create_dir(&contract_path.join("target/ink"))?; + assert!(!has_contract_been_built(Some(&path.join(name)))); + // Create a mocked .contract file inside the target directory + File::create(contract_path.join(format!("target/ink/{}.contract", name)))?; + assert!(has_contract_been_built(Some(&path.join(name)))); + Ok(()) + } + + // TODO: delete this test. + // This is a helper test for an actual running pop CLI. + // It can serve as the "frontend" to query the payload, sign it + // and submit back to the CLI. + #[tokio::test] + async fn sign_call_data() -> anyhow::Result<()> { + use subxt::{config::DefaultExtrinsicParamsBuilder as Params, tx::Payload}; + // This struct implements the [`Payload`] trait and is used to submit + // pre-encoded SCALE call data directly, without the dynamic construction of transactions. + struct CallData(Vec); + + impl Payload for CallData { + fn encode_call_data_to( + &self, + _: &subxt::Metadata, + out: &mut Vec, + ) -> Result<(), subxt::ext::subxt_core::Error> { + out.extend_from_slice(&self.0); + Ok(()) + } + } + + use subxt_signer::sr25519::dev; + let payload = reqwest::get(&format!("{}/payload", "http://127.0.0.1:9090")) + .await + .expect("Failed to get payload") + .json::() + .await + .expect("Failed to parse payload"); + + let url = "ws://localhost:9944"; + let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; + let client = + subxt::OnlineClient::::from_rpc_client(rpc_client).await?; + + let signer = dev::alice(); + + let payload = CallData(payload.call_data()); + let ext_params = Params::new().build(); + let signed = client.tx().create_signed(&payload, &signer, ext_params).await?; + + let response = reqwest::Client::new() + .post(&format!("{}/submit", "http://localhost:9090")) + .json(&to_hex(signed.encoded())) + .send() + .await + .expect("Failed to submit payload") + .text() + .await + .expect("Failed to parse JSON response"); + + Ok(()) + } + + #[tokio::test] + async fn get_upload_call_data_works() -> anyhow::Result<()> { + todo!() + } + + async fn get_instantiate_call_data_works() -> anyhow::Result<()> { + todo!() + } + + async fn wait_for_signature_works() -> anyhow::Result<()> { + todo!() + } } diff --git a/crates/pop-cli/src/wallet_integration.rs b/crates/pop-cli/src/wallet_integration.rs index 2d7c4cdf4..57b2924e5 100644 --- a/crates/pop-cli/src/wallet_integration.rs +++ b/crates/pop-cli/src/wallet_integration.rs @@ -1,4 +1,5 @@ use axum::{ + http::HeaderValue, response::Html, routing::{get, post}, Router, @@ -9,7 +10,7 @@ use tokio::{ sync::{oneshot, Mutex}, task::JoinHandle, }; -use tower_http::services::ServeDir; +use tower_http::{cors::Any, services::ServeDir}; /// Make frontend sourcing more flexible by allowing a custom route /// to be defined. @@ -29,6 +30,10 @@ impl TransactionData { pub fn new(chain_rpc: String, call_data: Vec) -> Self { Self { chain_rpc, call_data } } + #[allow(dead_code)] + pub fn call_data(&self) -> Vec { + self.call_data.clone() + } } /// Shared state between routes. Serves two purposes: @@ -82,12 +87,20 @@ impl WalletIntegrationManager { let payload = Arc::new(payload); + // TODO: temporary until we host from here. + let cors = tower_http::cors::CorsLayer::new() + .allow_origin("http://localhost:9090".parse::().unwrap()) + .allow_origin("http://127.0.0.1:9090".parse::().unwrap()) + .allow_methods(Any) // Allow any HTTP method + .allow_headers(Any); // Allow any headers (like 'Content-Type') + let app = Router::new() .route("/payload", get(routes::get_payload_handler).with_state(payload)) .route("/submit", post(routes::submit_handler).with_state(state.clone())) .route("/error", post(routes::error_handler).with_state(state.clone())) .route("/terminate", post(routes::terminate_handler).with_state(state.clone())) - .merge(frontend.serve_content()); // Custom route for serving frontend. + .merge(frontend.serve_content()) // Custom route for serving frontend. + .layer(cors); let rpc_owned = rpc.to_string(); @@ -110,6 +123,7 @@ impl WalletIntegrationManager { } /// Signals the wallet integration server to shut down. + #[allow(dead_code)] pub async fn terminate(&mut self) -> anyhow::Result<()> { terminate_helper(&self.state).await } @@ -212,6 +226,7 @@ async fn terminate_helper(handle: &Arc>) -> anyhow::Result<( pub struct FrontendFromDir { content: PathBuf, } +#[allow(dead_code)] impl FrontendFromDir { pub fn new(content: PathBuf) -> Self { Self { content } @@ -229,6 +244,7 @@ pub struct FrontendFromString { content: String, } +#[allow(dead_code)] impl FrontendFromString { pub fn new(content: String) -> Self { Self { content } @@ -340,9 +356,9 @@ mod tests { .send() .await .expect("Failed to submit payload") - .json::() + .text() .await - .expect("Failed to parse JSON response"); + .expect("Failed to parse response"); assert_eq!(response, json!({"status": "success"})); assert_eq!(wim.state.lock().await.signed_payload, Some("0xDEADBEEF".to_string())); diff --git a/crates/pop-contracts/Cargo.toml b/crates/pop-contracts/Cargo.toml index b3ab82cb8..94a2c6e72 100644 --- a/crates/pop-contracts/Cargo.toml +++ b/crates/pop-contracts/Cargo.toml @@ -27,11 +27,13 @@ sp-core.workspace = true sp-weights.workspace = true strum.workspace = true strum_macros.workspace = true +subxt-signer.workspace = true +subxt.workspace = true # cargo-contracts contract-build.workspace = true contract-extrinsics.workspace = true -contract-transcode.workspace = true +contract-transcode.workspace = true scale-info.workspace = true # pop pop-common = { path = "../pop-common", version = "0.5.0" } diff --git a/crates/pop-contracts/src/lib.rs b/crates/pop-contracts/src/lib.rs index c5e76e2f1..69897be33 100644 --- a/crates/pop-contracts/src/lib.rs +++ b/crates/pop-contracts/src/lib.rs @@ -22,8 +22,10 @@ pub use templates::{Contract, ContractType}; pub use test::{test_e2e_smart_contract, test_smart_contract}; pub use testing::{mock_build_process, new_environment}; pub use up::{ - dry_run_gas_estimate_instantiate, dry_run_upload, instantiate_smart_contract, - set_up_deployment, set_up_upload, upload_smart_contract, UpOpts, + dry_run_gas_estimate_instantiate, dry_run_upload, get_code_hash_from_event, get_contract_code, + get_instantiate_payload, get_upload_payload, instantiate_contract_signed, + instantiate_smart_contract, set_up_deployment, set_up_upload, submit_signed_payload, + upload_contract_signed, upload_smart_contract, ContractInfo, UpOpts, }; pub use utils::{ metadata::{get_messages, ContractFunction}, diff --git a/crates/pop-contracts/src/up.rs b/crates/pop-contracts/src/up.rs index bed7dfa45..8ae38e405 100644 --- a/crates/pop-contracts/src/up.rs +++ b/crates/pop-contracts/src/up.rs @@ -8,17 +8,27 @@ use crate::{ }, }; use contract_extrinsics::{ + events::{CodeStored, ContractInstantiated}, + extrinsic_calls::{Instantiate, InstantiateWithCode}, BalanceVariant, ErrorVariant, ExtrinsicOptsBuilder, InstantiateCommandBuilder, InstantiateExec, - TokenMetadata, UploadCommandBuilder, UploadExec, + InstantiateExecResult, TokenMetadata, UploadCommandBuilder, UploadExec, UploadResult, WasmCode, }; use ink_env::{DefaultEnvironment, Environment}; use pop_common::{create_signer, DefaultConfig, Keypair}; -use sp_core::Bytes; +use sp_core::{bytes::from_hex, Bytes}; use sp_weights::Weight; -use std::{fmt::Write, path::PathBuf}; +use std::{ + fmt::Write, + path::{Path, PathBuf}, +}; +use subxt::{ + blocks::ExtrinsicEvents, + tx::{Payload, SubmittableExtrinsic}, + Config, SubstrateConfig, +}; /// Attributes for the `up` command -#[derive(Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub struct UpOpts { /// Path to the contract build directory. pub path: Option, @@ -103,6 +113,174 @@ pub async fn set_up_upload( Ok(upload_exec) } +/// Gets the encoded payload call data for contract upload (not instantiate). +/// +/// # Arguments +/// * `code` - contract code to upload. +/// * `url` - the rpc of the chain node. +pub async fn get_upload_payload(code: WasmCode, url: &str) -> anyhow::Result> { + let storage_deposit_limit: Option = None; + let upload_code = contract_extrinsics::extrinsic_calls::UploadCode::new( + code, + storage_deposit_limit, + contract_extrinsics::upload::Determinism::Enforced, + ); + + // TODO: review placement + let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; + let client = subxt::OnlineClient::::from_rpc_client(rpc_client).await?; + + let call_data = upload_code.build(); + let mut encoded_data = Vec::::new(); + call_data.encode_call_data_to(&client.metadata(), &mut encoded_data)?; + Ok(encoded_data) +} +/// Gets the encoded payload call data for a contract instantiation. +/// +/// # Arguments +/// * `instantiate_exec` - arguments for contract instantiate. +/// * `gas_limit` - max amount of gas to be used for instantiation. +pub async fn get_instantiate_payload( + instantiate_exec: InstantiateExec, + gas_limit: Weight, +) -> anyhow::Result> { + let storage_deposit_limit: Option = None; + let mut encoded_data = Vec::::new(); + match instantiate_exec.args().code() { + contract_extrinsics::Code::Upload(code) => InstantiateWithCode::new( + instantiate_exec.args().value(), + gas_limit, + storage_deposit_limit, + code.clone(), + instantiate_exec.args().data().into(), + instantiate_exec.args().salt().into(), + ) + .build() + .encode_call_data_to(&instantiate_exec.client().metadata(), &mut encoded_data), + contract_extrinsics::Code::Existing(hash) => Instantiate::new( + instantiate_exec.args().value(), + gas_limit, + storage_deposit_limit, + hash, + instantiate_exec.args().data().into(), + instantiate_exec.args().salt().into(), + ) + .build() + .encode_call_data_to(&instantiate_exec.client().metadata(), &mut encoded_data), + }?; + + Ok(encoded_data) +} + +/// Reads the contract code from contract file. +/// +/// # Arguments +/// * `path` - path to the contract file. +pub async fn get_contract_code( + path: Option<&PathBuf>, +) -> anyhow::Result { + let manifest_path = get_manifest_path(path.map(|p| p as &Path))?; + + // signer does not matter for this + let signer = create_signer("//Alice")?; + let extrinsic_opts = + ExtrinsicOptsBuilder::::new(signer) + .manifest_path(Some(manifest_path)) + .done(); + let artifacts = extrinsic_opts.contract_artifacts()?; + + let artifacts_path = artifacts.artifact_path().to_path_buf(); + let code = artifacts.code.ok_or_else(|| { + Error::UploadContractError(format!( + "Contract code not found from artifact file {}", + artifacts_path.display() + )) + })?; + Ok(code) +} + +/// Submit a pre-signed payload for uploading a contract. +/// +/// # Arguments +/// * `url` - rpc for chain. +/// * `payload` - the signed payload to submit (encoded call data). +pub async fn upload_contract_signed( + url: &str, + payload: String, +) -> anyhow::Result> { + let events = submit_signed_payload(url, payload).await?; + + let code_stored = events.find_first::>()?; + + Ok(UploadResult { code_stored, events }) +} + +/// Submit a pre-signed payload for instantiating a contract. +/// +/// # Arguments +/// * `url` - rpc for chain. +/// * `payload` - the signed payload to submit (encoded call data). +pub async fn instantiate_contract_signed( + url: &str, + payload: String, +) -> anyhow::Result> { + let events = submit_signed_payload(url, payload).await?; + + // The CodeStored event is only raised if the contract has not already been + // uploaded. + let code_hash = events + .find_first::>()? + .map(|code_stored| code_stored.code_hash); + + let instantiated = events + .find_first::>()? + .ok_or_else(|| { + Error::InstantiateContractError("Failed to find Instantiated event".to_string()) + })?; + + Ok(InstantiateExecResult { events, code_hash, contract_address: instantiated.contract }) +} + +/// Submit a pre-signed payload. +/// +/// # Arguments +/// * `url` - rpc for chain. +/// * `payload` - the signed payload to submit (encoded call data). +pub async fn submit_signed_payload( + url: &str, + payload: String, +) -> anyhow::Result> { + let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; + let client = subxt::OnlineClient::::from_rpc_client(rpc_client).await?; + + let hex_encoded = from_hex(&payload)?; + + let extrinsic = SubmittableExtrinsic::from_bytes(client, hex_encoded); + + // src: https://github.com/use-ink/cargo-contract/blob/68691b9b6cdb7c6ec52ea441b3dc31fcb1ce08e0/crates/extrinsics/src/lib.rs#L143 + + use subxt::{ + error::{RpcError, TransactionError}, + tx::TxStatus, + }; + + let mut tx = extrinsic.submit_and_watch().await?; + + while let Some(status) = tx.next().await { + match status? { + TxStatus::InFinalizedBlock(tx_in_block) => { + let events = tx_in_block.wait_for_success().await?; + return Ok(events) + }, + TxStatus::Error { message } => return Err(TransactionError::Error(message).into()), + TxStatus::Invalid { message } => return Err(TransactionError::Invalid(message).into()), + TxStatus::Dropped { message } => return Err(TransactionError::Dropped(message).into()), + _ => continue, + } + } + Err(RpcError::SubscriptionDropped.into()) +} + /// Estimate the gas required for instantiating a contract without modifying the state of the /// blockchain. /// @@ -204,14 +382,26 @@ pub async fn upload_smart_contract( .upload_code() .await .map_err(|error_variant| Error::UploadContractError(format!("{:?}", error_variant)))?; - if let Some(code_stored) = upload_result.code_stored { + get_code_hash_from_event(&upload_result, upload_exec.code().code_hash()) +} + +/// Get the code hash of a contract from the upload event. +/// +/// # Arguments +/// * `upload_result` - the result of uploading the contract. +/// * `metadata_code_hash` - the code hash from the metadata Used only for error reporting. +pub fn get_code_hash_from_event( + upload_result: &UploadResult, + // used for error reporting + metadata_code_hash: [u8; 32], +) -> Result { + if let Some(code_stored) = upload_result.code_stored.as_ref() { Ok(format!("{:?}", code_stored.code_hash)) } else { - let code_hash: String = - upload_exec.code().code_hash().iter().fold(String::new(), |mut output, b| { - write!(output, "{:02x}", b).expect("expected to write to string"); - output - }); + let code_hash: String = metadata_code_hash.iter().fold(String::new(), |mut output, b| { + write!(output, "{:02x}", b).expect("expected to write to string"); + output + }); Err(Error::UploadContractError(format!( "This contract has already been uploaded with code hash: 0x{code_hash}" ))) From 074e2f91dd8adf0f61f8e07a7af992864b1b6299 Mon Sep 17 00:00:00 2001 From: Alex Bean Date: Mon, 16 Dec 2024 07:26:25 +0100 Subject: [PATCH 03/25] feat: wallet integration pop call chain (#379) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * fix: minor fixes after rebase * fix(up-contract): test compilation after rebase * feat(up-contract): suri and use-wallet can't be used together * refactor: wait for finalization * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements (#380) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Co-authored-by: Daanvdplas * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * feat: secure signing logic for pop call chain * test: unit tests in pop-cli * feat: secure signing for call from call_data * refactor: docs and remove unneded functions * refactor: replace hex library * fix: rebase issues * fix: rebase * refactor: small changes * refactor: renaming * feat: wallet integration call contract (#378) * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * feat(up-contract): run server and pass call_data for signing -- PoC * feat(up-contract): submit signed payload to node * fix(up-contract): update to FrontendFromDir type * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(pop-up-contract): better error handling and prompt displays * chore(up-contract): outdated field name and clippy allow * feat(up-contract): handle subxt events better, various improvements * feat(up-contract): custom errors in contracts crate * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * fix: build spec experience (#331) * fix: add chain to specify the chain specification * fix: default_bootnode by default to true * chore: fmt * chore: deprecate flag --release in build specs * fix: clean output (#334) * fix: undo deprecation of --release flag * refactor: small fix * style: remove extra space * fix(spec): better handling of spinner * style: use spinner instead of multispinner * docs: help message to include build * feat: reuse existing chain spec * refactor: remove clone * refactor: opt in to edit provided chain spec * docs: improve * refactor: flow flag input * fix: prepare_output_path * refactor: resolve small improvements * fix: protocol id prompt * fix: spinner * fix: docs * test: test cli * chore: refactor * chore: amend test * feat: production profile * refactor: improve profile experience * chore: feedback and rebase * chore: add profile tests * fix(test): parachain_lifecycle * style: fmt * fix: clippy * fix: cli required changes introduced by PR * fix: test * fix: clippy * docs: deprecation message --------- Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Co-authored-by: Daanvdplas * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Co-authored-by: Daanvdplas * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * chore: deny.toml license * feat: secure signing logic for pop call contract * feat: integrate secure signing with pop call contract * test: adapt pop-cli ui tests * refactor: clean code * docs: improve docs functions * test: ignore failing test (fixed in another PR), and remove println * fix: import removed by mistake * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * feat(up-contract): get call data for instantiate and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Co-authored-by: Daanvdplas * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * refactor: reuse pop up logic * chore: rebase fixes * refactor: clean after rebase * fix: cargo.lock after rebase * refactor: move terminate node into common::contracts * fix: sp-core not only for contracts * feat(up-contract): serve HTML from string, fix deployment message on error, cors, and other misc. improvements * fix: rebase * feat: secure signing logic for pop call chain * test: unit tests in pop-cli * feat: secure signing for call from call_data * refactor: docs and remove unneded functions * refactor: replace hex library * fix: rebase issues * fix: merge issues * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: add TransactionData::new * refactor(wallet-integration: shutdown channel error handling, terminate helper, take_error and TranscationData::new tests * chore: clippy warning * feat(up-contract): get call data for upload-only and pass to wallet integration -- PoC * refactor(pop-up): create functions for wallet integration, plus general cleanup * chore: use git branch for cargo contract * feat(up-contract): handle subxt events better, various improvements * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refactor(wallet-integration): move to module with pop-cli crate * feat(wallet-integration): server-side error handling, update port to 9090 * refactor(wallet-integration): restructure server for easier use in thread * fix(wallet-integration): remove invalid fn `finish` * docs(wallet-integration): inline comments * test(wallet-integration): unit tests for wallet-integration server. Add new frontend type * feat(wallet-integration): two new routes: error and terminate * refactor(wallet-integration): consistent comments, remove unnecessary code in tests * feat: guide user to call a contract (#306) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * test: fix unit test * feat: allow users to specify custom contract metadata files (#347) * chore: allow the user specify the metadata file to call a contract * test: unit test to parse metadata from a file * docs: fix docs * refactor: ensure_contract_built after user input path * fix: call contract when metadata file * fix: remove default_input in contract address * docs: rename metadata with artifact * fix: panic at has_contract_been_built * fix: clippy * refactor: keep ensure_contract_built as a CallContractCommand function * fix: ensure_contract_built * docs: improve comments * fix: feedback and include wasm file for testing * fix: clippy * chore: after build contract prompt the user if the contract is already deployed * refactor: ensure_contract_built * refactor: has_contract_been_built function * docs: fix comments and messages * refactor: get_messages and get_constructors * test: fix unit tests call ui --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * fix: support new substrate-contracts-node structure and stabilize integration tests (#360) * fix: parse new structure substrate-contracts-node * fix: paseo+coretime integration test * fix: sourcing latest version substrate-contracts-node * refactor: set_executable_permission function * fix: clippy * chore: CI configuration * test: specify port in run_contracts_node * fix: use random ports instead of hardcoded ones * feat: guide user to call a parachain (#316) * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * fix: parse user inputs for Option arguments (#332) * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * fix: logo doesn't show in README --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * refactor: separate structs * fmt * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: solve conflicts and unit tests (#359) * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * fix: conflicts and unit tests * test: remove test and improve test * feat: guide user for calling a contract * feat: get metadata contract from the contract path * refactor: refactor test and validate address input * fix: apply feedback * feat: prompt to have another call and skip questions for queries * refactor: use Cli module instead of cliclack * test: unit test pop-cli crate * test: unit contracts crate * chore: format * test: refactor and improve test cases * fix: fix todos and refactor * test: fix unit test * feat: parse types of parameters and display it to the user in the placeholder * refactor: error handling for pop call * refactor: display call to be executed after guide and reorder * refactor: when repeat call use same contract values and dont clean screen * test: add dry-run test * test: refactor and add more test coverage * test: more coverage * fix: unit test * feat: dev mode to skip certain user prompts * refactor: test functions, renaming and fix clippy * refactor: improve devex of pop call contract * test: adjust tests to refactor * chore: reset_for_new_call fields * fix: build contract if has not been built * refactor: use command state (#338) Merged set_up_call_config and guide_user_to_call_contract into a single function. Also adds short symbols for arguments. * fix: automatically add some or none to Option argument * test: refactor and tests * refactor: improve code and comments * fix: renaming and clean code * chore: option params not mandatory * fix: parse user inputs for Option arguments in constructor (#335) * fix: automatically add some or none to Option argument * fix: tests * refactor: process_function_args * test: update tests accordingly last changes * fix: issue with delimiter * test: fix unit test * refactor: renaming and fix comments * refactor: format types (#339) Shows the full type representation, making it easier to see the entry format of parameter values. * feat: pop call parachain prototype * feat: dispaly arguments of extrinsic * refactor: structure similar to pop call contract * feat: parse all values for extrinsic/storage * refactor: signer in common * refactor: improve messages * feat: call parachain ui * fix: calls working * refactor: remove unused code * refactor: remove unused code * refactor: various fixes * refactor: various fixes * feat: add option to include params from command line * refactor: clean docs and refactor code * fix: tests * refactor: parse all the metadata again * refactor: reorganize and clean metadata functions * feat: display specific use cases to the user * refactor: predefined actions * fix: various fixes * fix: error message not supported for complex types * refactor: parse all metadata, including parameters at once * refactor: clean docs and move code * fix: format_type * test: fix unit test * refactor: clean the way to parse and prompt parameters * feat: add Purchase on-demand coretime use cases * test: add skip_confirm, move when prompt for the signer and create the integration test * test: call parachain ui unit test * test: pop-cli unit testing * test: pop-common unit tests * test: parse metadata unit tests * test: refactor and test processing parameters * test: comments and unit test in call functions * fix: clippy warnings * chore: fmt * feat: repeat call only if using guide UI * fix: clippy * refactor: various improvements * chore: parser for pallet and extrinsic input names * refactor: only move to pop_common the needed functions * refactor: improve test, docs and errors * test: fix unit tests * fix: reset_for_new_call when extrinisc is not supported * fix: build with parachain features * test: wait before call parachain in integration test * docs: minor improvements * test: migrate find_free_port to pop_common * test: fix increase waiting time * test: remove unnecesary test case * refactor: rename api with client * refactor: naming and docs * docs: improve docs and missing comments * test: remove unnecesary verbose * test: find_free_port * docs: improve parameter documentation * test: add missing test to sign_and_submit_extrinsic * fix: apply feedback from auxiliar PRs, remove unnecesary clones * docs: public modules * refactor: clean unused params * fix: mark all extrinsics that uses calls as parameter as unsupported * test: fix expect_select * docs: improve documentation * feat: submit extrinsic from call_data (#348) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * test: unit test for send_extrinsic_from_call_data * fix: CallData struct * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * chore: fmt * refactor: minor doc and naming changes * refactor: remove unnecesary clones and return early when submit_extrinsic_from_call_data * chore: fmt * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * feat: parse files when the argument values are very big (#363) * feat: parse files when the argument values are very big * test: unit test * chore: fmt * feat: file logic using the command line * fix: sequence arguments * test: fix unit test * refactor: remove prompting the user if input is file or value * refactor: parse_extrinsic_arguments * fix: CI deny * refactor: reorder Param derive macros * test: fix decode_call_data_works unit test * refactor: use Default derive macro and define constants for test values (#366) * feat: parse files when the argument values are very big * chore: fmt * feat: file logic using the command line * fix: sequence arguments * refactor: parse_extrinsic_arguments * refactor: use Default in pop_parachain structs * refactor: use Default in CallParachainCommand struct * refactor: use constant in tests * chore: fmt and small refactor * feat: flag sudo to wrap extrinsic (#349) * feat: submit extrinsic from call_data * test: unit test for initialize_api_client * feat: wrap call into a sudo call * test: add unit test to the new logic * fix: skip_confirm for send_extrinsic_from_call_data * chore: clippy * docs: renaming and improve docs * test: use force_transfer for testing * fix: check if sudo exist before prompt the user * chore: fmt * chore: fmt * test: fix wrong assert * docs: improve comments and output messages * refactor: split decode_call_data logic outside sign_and_submit_extrinsic_with_call_data * fix: test construct_sudo_extrinsic_works and formatting * refactor: various fixes and improvements (#367) * refactor: sort pallets/dispatchables * refactor: remove unnecessary async * fix: resolve issue after rebase * fix: more async issues after rebase * refactor: use single constant * refactor: terminology (#368) * refactor: terminology * refactor: simply pallet/function relationship * fix: amend call_data conflicts after refactor * refactor: improvements (#370) * fix: add missing short arg option * refactor: note that extrinsic wait includes finalization * refactor: remove clones * style: formatting * refactor: make file prompt more generic * refactor: add missing license headers * style: formatting * docs: comments * docs: comments * docs: comments * refactor: reuse existing metadata * refactor: minimise clones * docs: comments * refactor: naming * docs: fix parameter doc comments * refactor: address clippy warnings * refactor: rename parachain with chain as the primary command and retain parachain as an alias (#373) * refactor: rename parachain with chain in visible messages * refactor: rename parachain with chain internal code * chore: solve fmt after rebase * refactor: small fix, use alias instead aliases * refactor: rename CallParachain struct into Call --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Co-authored-by: Daanvdplas * feat(wallet-integration): server and API (#362) * feat(wallet-integration): implement server and API * feat(wallet-integration): add a few tests to server. Needs more * refactor(wallet-integration): just use call_data, remove data types * feat(wallet-integration): add frontend type for flexible serving * feat(wallet-integration): StateHandler in WalletIntegrationManager. Add terminate method * refacto… --------- Co-authored-by: Peter White Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> Co-authored-by: Daanvdplas --- Cargo.lock | 462 +++++++++--------- Cargo.toml | 1 - crates/pop-cli/Cargo.toml | 4 +- crates/pop-cli/src/cli.rs | 1 - crates/pop-cli/src/commands/call/chain.rs | 129 ++++- crates/pop-cli/src/commands/call/contract.rs | 171 +++++-- crates/pop-cli/src/commands/up/contract.rs | 164 +------ crates/pop-cli/src/common/contracts.rs | 29 +- crates/pop-cli/src/common/mod.rs | 1 + crates/pop-cli/src/common/wallet.rs | 91 ++++ crates/pop-contracts/src/call.rs | 54 +- crates/pop-contracts/src/lib.rs | 8 +- crates/pop-contracts/src/up.rs | 1 - crates/pop-contracts/src/utils/metadata.rs | 2 +- crates/pop-parachains/Cargo.toml | 2 +- .../pop-parachains/src/call/metadata/mod.rs | 7 +- crates/pop-parachains/src/call/mod.rs | 31 +- crates/pop-parachains/src/lib.rs | 7 +- 18 files changed, 709 insertions(+), 456 deletions(-) create mode 100644 crates/pop-cli/src/common/wallet.rs diff --git a/Cargo.lock b/Cargo.lock index 9887bd521..ba7959cd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -724,7 +724,7 @@ dependencies = [ "parachains-runtimes-test-utils", "parity-scale-codec", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-parachain-info", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -749,7 +749,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -1326,7 +1326,7 @@ dependencies = [ "serde", "sp-consensus-grandpa", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -1361,7 +1361,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -1394,7 +1394,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -1413,7 +1413,7 @@ dependencies = [ "pallet-utility", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -1434,7 +1434,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-state-machine 0.43.0", "sp-std", "sp-trie 37.0.0", @@ -1457,7 +1457,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-consensus-grandpa", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-trie 37.0.0", ] @@ -1489,7 +1489,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", ] @@ -1506,7 +1506,7 @@ dependencies = [ "scale-info", "snowbridge-core", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", ] @@ -1548,7 +1548,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keyring", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -1580,7 +1580,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-trie 37.0.0", "staging-xcm 14.2.0", @@ -1607,9 +1607,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" +checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" dependencies = [ "memchr", "regex-automata 0.4.9", @@ -1703,7 +1703,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "thiserror 1.0.69", @@ -1717,7 +1717,7 @@ checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "thiserror 2.0.6", @@ -1735,9 +1735,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.3" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" dependencies = [ "jobserver", "libc", @@ -2021,7 +2021,7 @@ dependencies = [ "parity-scale-codec", "regex", "rustc_version 0.4.1", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "strum 0.26.3", @@ -2080,7 +2080,7 @@ source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make- dependencies = [ "anyhow", "impl-serde 0.5.0", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "url", @@ -2406,7 +2406,7 @@ dependencies = [ "scale-info", "sp-application-crypto 38.0.0", "sp-consensus-aura", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2423,7 +2423,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", ] @@ -2454,7 +2454,7 @@ dependencies = [ "sp-externalities 0.29.0", "sp-inherents", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-state-machine 0.43.0", "sp-std", "sp-trie 37.0.0", @@ -2487,7 +2487,7 @@ dependencies = [ "frame-system", "pallet-session", "parity-scale-codec", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2503,7 +2503,7 @@ dependencies = [ "parity-scale-codec", "polkadot-primitives 16.0.0", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2518,7 +2518,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", ] @@ -2542,7 +2542,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -2560,7 +2560,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", ] @@ -2575,7 +2575,7 @@ dependencies = [ "polkadot-primitives 15.0.0", "sp-api", "sp-consensus-aura", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2590,7 +2590,7 @@ dependencies = [ "polkadot-primitives 16.0.0", "scale-info", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-trie 37.0.0", "staging-xcm 14.2.0", ] @@ -2635,7 +2635,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2661,7 +2661,7 @@ dependencies = [ "pallet-asset-conversion", "parity-scale-codec", "polkadot-runtime-common", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -2676,7 +2676,7 @@ dependencies = [ "cumulus-primitives-core", "parity-scale-codec", "polkadot-primitives 16.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-state-machine 0.43.0", "sp-trie 37.0.0", ] @@ -2723,9 +2723,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e1ec88093d2abd9cf1b09ffd979136b8e922bf31cad966a8fe0d73233112ef" +checksum = "a5a32d755fe20281b46118ee4b507233311fb7a48a0cfd42f554b93640521a2f" dependencies = [ "cc", "cxxbridge-cmd", @@ -2737,9 +2737,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afa390d956ee7ccb41aeed7ed7856ab3ffb4fc587e7216be7e0f83e949b4e6c" +checksum = "11645536ada5d1c8804312cbffc9ab950f2216154de431de930da47ca6955199" dependencies = [ "cc", "codespan-reporting", @@ -2751,9 +2751,9 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c23bfff654d6227cbc83de8e059d2f8678ede5fc3a6c5a35d5c379983cc61e6" +checksum = "ebcc9c78e3c7289665aab921a2b394eaffe8bdb369aa18d81ffc0f534fd49385" dependencies = [ "clap", "codespan-reporting", @@ -2764,15 +2764,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c01b36e22051bc6928a78583f1621abaaf7621561c2ada1b00f7878fbe2caa" +checksum = "3a22a87bd9e78d7204d793261470a4c9d585154fddd251828d8aefbb5f74c3bf" [[package]] name = "cxxbridge-macro" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e14013136fac689345d17b9a6df55977251f11d333c0a571e8d963b55e1f95" +checksum = "1dfdb020ff8787c5daf6e0dca743005cc8782868faeadfbabb8824ede5cb1c72" dependencies = [ "proc-macro2", "quote", @@ -3611,7 +3611,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "sp-storage 21.0.0", "static_assertions", @@ -3629,7 +3629,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -3672,7 +3672,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -3690,7 +3690,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", ] @@ -3731,7 +3731,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -3766,7 +3766,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-metadata-ir", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", "sp-state-machine 0.43.0", "sp-std", @@ -3835,7 +3835,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-version", "sp-weights", @@ -3853,7 +3853,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -3876,7 +3876,7 @@ dependencies = [ "frame-support", "parity-scale-codec", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -4506,7 +4506,7 @@ dependencies = [ "http 1.2.0", "hyper 1.5.1", "hyper-util", - "rustls 0.23.19", + "rustls 0.23.20", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", @@ -5174,7 +5174,7 @@ dependencies = [ "http 1.2.0", "jsonrpsee-core", "pin-project", - "rustls 0.23.19", + "rustls 0.23.20", "rustls-pki-types", "rustls-platform-verifier", "soketto", @@ -6301,7 +6301,7 @@ dependencies = [ "sp-core 34.0.0", "sp-crypto-hashing", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6320,7 +6320,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6339,7 +6339,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6354,7 +6354,7 @@ dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6369,7 +6369,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6387,7 +6387,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6404,7 +6404,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6420,7 +6420,7 @@ dependencies = [ "pallet-assets", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6435,7 +6435,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6452,7 +6452,7 @@ dependencies = [ "scale-info", "sp-application-crypto 38.0.0", "sp-consensus-aura", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6468,7 +6468,7 @@ dependencies = [ "scale-info", "sp-application-crypto 38.0.0", "sp-authority-discovery", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6482,7 +6482,7 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6504,7 +6504,7 @@ dependencies = [ "sp-consensus-babe", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", ] @@ -6527,7 +6527,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", ] @@ -6544,7 +6544,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6562,7 +6562,7 @@ dependencies = [ "scale-info", "serde", "sp-consensus-beefy", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", ] @@ -6589,7 +6589,7 @@ dependencies = [ "sp-consensus-beefy", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-state-machine 0.43.0", ] @@ -6608,7 +6608,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6627,7 +6627,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-consensus-grandpa", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -6646,7 +6646,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-trie 37.0.0", ] @@ -6668,7 +6668,7 @@ dependencies = [ "pallet-bridge-grandpa", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -6693,7 +6693,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-arithmetic", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -6713,7 +6713,7 @@ dependencies = [ "sp-api", "sp-arithmetic", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6732,7 +6732,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6751,7 +6751,7 @@ dependencies = [ "parity-scale-codec", "rand", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -6769,7 +6769,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6784,7 +6784,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6812,7 +6812,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -6848,7 +6848,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -6918,7 +6918,7 @@ dependencies = [ "scale-info", "serde", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6937,7 +6937,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6952,7 +6952,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -6971,7 +6971,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6987,7 +6987,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7009,7 +7009,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "strum 0.26.3", ] @@ -7024,7 +7024,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7042,7 +7042,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7061,7 +7061,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7081,7 +7081,7 @@ dependencies = [ "sp-core 34.0.0", "sp-inherents", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7102,7 +7102,7 @@ dependencies = [ "sp-consensus-grandpa", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", ] @@ -7121,7 +7121,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7140,7 +7140,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7158,7 +7158,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keyring", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7172,7 +7172,7 @@ dependencies = [ "parity-scale-codec", "safe-mix", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7186,7 +7186,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7203,7 +7203,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7222,7 +7222,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", ] @@ -7241,7 +7241,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7261,7 +7261,7 @@ dependencies = [ "sp-arithmetic", "sp-io 38.0.0", "sp-mixnet", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7279,7 +7279,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-mmr-primitives", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7295,7 +7295,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7312,7 +7312,7 @@ dependencies = [ "pallet-nfts", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7330,7 +7330,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7357,7 +7357,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7373,7 +7373,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7390,7 +7390,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", "sp-tracing 17.0.1", ] @@ -7411,7 +7411,7 @@ dependencies = [ "pallet-staking", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "sp-staking 36.0.0", ] @@ -7440,7 +7440,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7464,7 +7464,7 @@ dependencies = [ "pallet-staking", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7483,7 +7483,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-metadata-ir", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7501,7 +7501,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7518,7 +7518,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7533,7 +7533,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7552,7 +7552,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7567,7 +7567,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7585,7 +7585,7 @@ dependencies = [ "serde", "sp-arithmetic", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7602,7 +7602,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7630,7 +7630,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -7646,7 +7646,7 @@ dependencies = [ "frame-system", "parity-wasm", "polkavm-linker 0.10.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "tempfile", "toml 0.8.19", ] @@ -7678,7 +7678,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -7722,7 +7722,7 @@ dependencies = [ "pallet-staking", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7738,7 +7738,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7757,7 +7757,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-arithmetic", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7776,7 +7776,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7793,7 +7793,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", ] @@ -7808,7 +7808,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7826,7 +7826,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", "sp-state-machine 0.43.0", @@ -7846,7 +7846,7 @@ dependencies = [ "pallet-staking", "parity-scale-codec", "rand", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", ] @@ -7860,7 +7860,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7878,7 +7878,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7899,7 +7899,7 @@ dependencies = [ "serde", "sp-application-crypto 38.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7938,7 +7938,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7955,7 +7955,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-statement-store", ] @@ -7972,7 +7972,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7990,7 +7990,7 @@ dependencies = [ "scale-info", "sp-inherents", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-storage 21.0.0", "sp-timestamp", ] @@ -8011,7 +8011,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8027,7 +8027,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8039,7 +8039,7 @@ dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", ] @@ -8059,7 +8059,7 @@ dependencies = [ "serde", "sp-inherents", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-transaction-storage-proof", ] @@ -8079,7 +8079,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8097,7 +8097,7 @@ dependencies = [ "pallet-utility", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8112,7 +8112,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8128,7 +8128,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8143,7 +8143,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8158,7 +8158,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8178,7 +8178,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -8199,7 +8199,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -8221,7 +8221,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -8242,7 +8242,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -8272,7 +8272,7 @@ dependencies = [ "sp-consensus-aura", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-parachain-info", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -8302,7 +8302,7 @@ dependencies = [ "sp-consensus-aura", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", "staging-parachain-info", "staging-xcm 14.2.0", @@ -8587,7 +8587,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8603,7 +8603,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", ] @@ -8630,7 +8630,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 34.0.0", ] @@ -8657,7 +8657,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -8702,7 +8702,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", "staging-xcm 14.2.0", @@ -8765,7 +8765,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", "sp-std", @@ -8980,7 +8980,7 @@ dependencies = [ "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "sp-session", "sp-staking 36.0.0", @@ -9031,7 +9031,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-offchain", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-storage 21.0.0", "sp-transaction-pool", @@ -9416,7 +9416,6 @@ dependencies = [ "duct", "flate2", "glob", - "hex", "indexmap 2.7.0", "mockito", "pop-common", @@ -9424,6 +9423,7 @@ dependencies = [ "scale-info", "scale-value", "serde_json", + "sp-core 32.0.0", "strum 0.26.3", "strum_macros 0.26.4", "subxt", @@ -9780,9 +9780,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -10060,7 +10060,7 @@ dependencies = [ "polkadot-runtime-common", "smallvec", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -10160,7 +10160,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.24", ] [[package]] @@ -10204,9 +10204,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "log", "once_cell", @@ -10262,9 +10262,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-platform-verifier" @@ -10277,7 +10277,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.19", + "rustls 0.23.20", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -10912,9 +10912,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] @@ -11265,7 +11265,7 @@ dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11414,7 +11414,7 @@ dependencies = [ "snowbridge-milagro-bls", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "ssz_rs", "ssz_rs_derive", @@ -11438,7 +11438,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -11461,7 +11461,7 @@ dependencies = [ "serde", "serde-big-array", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -11489,7 +11489,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11526,7 +11526,7 @@ dependencies = [ "snowbridge-pallet-ethereum-client-fixtures", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "static_assertions", ] @@ -11566,7 +11566,7 @@ dependencies = [ "snowbridge-router-primitives", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -11604,7 +11604,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -11623,7 +11623,7 @@ dependencies = [ "snowbridge-core", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -11643,7 +11643,7 @@ dependencies = [ "snowbridge-core", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -11692,7 +11692,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keyring", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-parachain-info", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -11751,7 +11751,7 @@ dependencies = [ "sp-core 34.0.0", "sp-externalities 0.29.0", "sp-metadata-ir", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "sp-state-machine 0.43.0", "sp-trie 37.0.0", @@ -11827,7 +11827,7 @@ dependencies = [ "scale-info", "sp-api", "sp-application-crypto 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11838,7 +11838,7 @@ checksum = "74738809461e3d4bd707b5b94e0e0c064a623a74a6a8fe5c98514417a02858dd" dependencies = [ "sp-api", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11854,7 +11854,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-consensus-slots", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-timestamp", ] @@ -11873,7 +11873,7 @@ dependencies = [ "sp-consensus-slots", "sp-core 34.0.0", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-timestamp", ] @@ -11894,7 +11894,7 @@ dependencies = [ "sp-io 38.0.0", "sp-keystore 0.40.0", "sp-mmr-primitives", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "strum 0.26.3", ] @@ -11914,7 +11914,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-core 34.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11926,7 +11926,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12192,7 +12192,7 @@ dependencies = [ "scale-info", "serde_json", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12205,7 +12205,7 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "thiserror 1.0.69", ] @@ -12270,7 +12270,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c0e20624277f578b27f44ecfbe2ebc2e908488511ee2c900c5281599f700ab3" dependencies = [ "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "strum 0.26.3", ] @@ -12345,7 +12345,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-debug-derive", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "thiserror 1.0.69", ] @@ -12360,7 +12360,7 @@ dependencies = [ "serde", "sp-arithmetic", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12371,7 +12371,7 @@ checksum = "2d9de237d72ecffd07f90826eef18360208b16d8de939d54e61591fac0fcbf99" dependencies = [ "sp-api", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12412,9 +12412,9 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "39.0.2" +version = "39.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658f23be7c79a85581029676a73265c107c5469157e3444c8c640fdbaa8bfed0" +checksum = "ef567865c042b9002dfa44b8fc850fe611038acdf1e382e539495015f60f692f" dependencies = [ "docify", "either", @@ -12522,7 +12522,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -12537,7 +12537,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12551,7 +12551,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12615,7 +12615,7 @@ dependencies = [ "sp-core 34.0.0", "sp-crypto-hashing", "sp-externalities 0.29.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "thiserror 1.0.69", "x25519-dalek", @@ -12663,7 +12663,7 @@ dependencies = [ "async-trait", "parity-scale-codec", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "thiserror 1.0.69", ] @@ -12699,7 +12699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc4bf251059485a7dd38fe4afeda8792983511cc47f342ff4695e2dcae6b5247" dependencies = [ "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12713,7 +12713,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-trie 37.0.0", ] @@ -12777,7 +12777,7 @@ dependencies = [ "scale-info", "serde", "sp-crypto-hashing-proc-macro", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-version-proc-macro", "thiserror 1.0.69", @@ -12908,7 +12908,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12945,7 +12945,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "xcm-procedural 10.1.0", ] @@ -12967,7 +12967,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -12988,7 +12988,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "staging-xcm 14.2.0", "tracing", @@ -13477,7 +13477,7 @@ dependencies = [ "polkadot-core-primitives", "rococo-runtime-constants", "smallvec", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "westend-runtime-constants", ] @@ -13673,7 +13673,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.19", + "rustls 0.23.20", "tokio", ] @@ -14520,7 +14520,7 @@ dependencies = [ "bitflags 2.6.0", "hashbrown 0.14.5", "indexmap 2.7.0", - "semver 1.0.23", + "semver 1.0.24", "serde", ] @@ -14768,7 +14768,7 @@ dependencies = [ "polkadot-runtime-common", "smallvec", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -15213,7 +15213,7 @@ dependencies = [ "polkadot-runtime-parachains", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -15357,9 +15357,9 @@ dependencies = [ [[package]] name = "zombienet-configuration" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22860eef7e651d6e0aa7e37fc3bcba3c2c8b7bd1c140d7ea929caacf2b7fc726" +checksum = "d716b3ff8112d98ced15f53b0c72454f8cde533fe2b68bb04379228961efbd80" dependencies = [ "anyhow", "lazy_static", @@ -15377,9 +15377,9 @@ dependencies = [ [[package]] name = "zombienet-orchestrator" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19b1b2fd2db3153155f21cb84cdd8e5d6faefc3043353b8c90661c44f4660da" +checksum = "4098a7d33b729b59e32c41a87aa4d484bd1b8771a059bbd4edfb4d430b3b2d74" dependencies = [ "anyhow", "async-trait", @@ -15410,9 +15410,9 @@ dependencies = [ [[package]] name = "zombienet-prom-metrics-parser" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61ce9c6b2d43be864ad34328d05794079381807f5d77c737a062486966347f" +checksum = "961e30be45b34f6ebeabf29ee2f47b0cd191ea62e40c064752572207509a6f5c" dependencies = [ "pest", "pest_derive", @@ -15421,9 +15421,9 @@ dependencies = [ [[package]] name = "zombienet-provider" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99cc7c143f1145bda2b2f5a945b8040a898a85fc029dba51f220395a7188d9d" +checksum = "ab0f7f01780b7c99a6c40539d195d979f234305f32808d547438b50829d44262" dependencies = [ "anyhow", "async-trait", @@ -15452,9 +15452,9 @@ dependencies = [ [[package]] name = "zombienet-sdk" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e5abdad4ad32c1c06cb8fdc4507db026f65987cb5c46ae4224118cc496097b" +checksum = "99a3c5f2d657235b3ab7dc384677e63cde21983029e99106766ecd49e9f8d7f3" dependencies = [ "async-trait", "futures", @@ -15470,9 +15470,9 @@ dependencies = [ [[package]] name = "zombienet-support" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e3310631948f8bb4d394c160c4b063889a4e0c6beadd6b95f9b62d1616ab93c" +checksum = "296f887ea88e07edd771f8e1d0dec5297a58b422f4b884a6292a21ebe03277cb" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 3effb7c2e..c96a1bfe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,7 +59,6 @@ contract-extrinsics = { git = "https://github.com/use-ink/cargo-contract", branc #contract-transcode = "5.0.0" contract-transcode = { git = "https://github.com/use-ink/cargo-contract", branch = "peter/chore-make-types-pub" } heck = "0.5.0" -hex = { version = "0.4.3", default-features = false } # parachains askama = "0.12" diff --git a/crates/pop-cli/Cargo.toml b/crates/pop-cli/Cargo.toml index 6d2d6ef42..2d511c77b 100644 --- a/crates/pop-cli/Cargo.toml +++ b/crates/pop-cli/Cargo.toml @@ -28,12 +28,12 @@ url.workspace = true clap.workspace = true cliclack.workspace = true console.workspace = true +sp-core.workspace = true strum.workspace = true strum_macros.workspace = true # contracts pop-contracts = { path = "../pop-contracts", version = "0.5.0", optional = true } -sp-core = { workspace = true, optional = true } sp-weights = { workspace = true, optional = true } # parachains @@ -59,6 +59,6 @@ subxt-signer.workspace = true [features] default = ["contract", "parachain", "telemetry"] -contract = ["dep:pop-contracts", "dep:sp-core", "dep:sp-weights", "dep:dirs"] +contract = ["dep:pop-contracts", "dep:sp-weights", "dep:dirs"] parachain = ["dep:pop-parachains", "dep:dirs"] telemetry = ["dep:pop-telemetry"] diff --git a/crates/pop-cli/src/cli.rs b/crates/pop-cli/src/cli.rs index 6c6bb3bce..f98c934e9 100644 --- a/crates/pop-cli/src/cli.rs +++ b/crates/pop-cli/src/cli.rs @@ -150,7 +150,6 @@ impl traits::Confirm for Confirm { /// A input prompt using cliclack. struct Input(cliclack::Input); - impl traits::Input for Input { /// Sets the default value for the input. fn default_input(mut self, value: &str) -> Self { diff --git a/crates/pop-cli/src/commands/call/chain.rs b/crates/pop-cli/src/commands/call/chain.rs index 9751b7dd9..9f769af5e 100644 --- a/crates/pop-cli/src/commands/call/chain.rs +++ b/crates/pop-cli/src/commands/call/chain.rs @@ -2,14 +2,17 @@ use std::path::Path; -use crate::cli::{self, traits::*}; +use crate::{ + cli::{self, traits::*}, + common::wallet::wait_for_signature, +}; use anyhow::{anyhow, Result}; use clap::Args; use pop_parachains::{ construct_extrinsic, construct_sudo_extrinsic, decode_call_data, encode_call_data, find_dispatchable_by_name, find_pallet_by_name, parse_chain_metadata, set_up_client, - sign_and_submit_extrinsic, supported_actions, Action, CallData, DynamicPayload, Function, - OnlineClient, Pallet, Param, SubstrateConfig, + sign_and_submit_extrinsic, submit_signed_extrinsic, supported_actions, Action, CallData, + DynamicPayload, Function, OnlineClient, Pallet, Param, Payload, SubstrateConfig, }; use url::Url; @@ -40,6 +43,9 @@ pub struct CallChainCommand { /// - with a password "//Alice///SECRET_PASSWORD" #[arg(short, long)] suri: Option, + /// Use your browser wallet to sign the extrinsic. + #[arg(name = "use-wallet", short('w'), long, default_value = "false", conflicts_with = "suri")] + use_wallet: bool, /// SCALE encoded bytes representing the call data of the extrinsic. #[arg(name = "call", short, long, conflicts_with_all = ["pallet", "function", "args"])] call_data: Option, @@ -95,7 +101,14 @@ impl CallChainCommand { }; // Sign and submit the extrinsic. - if let Err(e) = call.submit_extrinsic(&chain.client, &chain.url, xt, &mut cli).await { + let result = if self.use_wallet { + let call_data = xt.encode_call_data(&chain.client.metadata())?; + submit_extrinsic_with_wallet(&chain.client, &chain.url, call_data, &mut cli).await + } else { + call.submit_extrinsic(&chain.client, &chain.url, xt, &mut cli).await + }; + + if let Err(e) = result { display_message(&e.to_string(), false, &mut cli)?; break; } @@ -197,11 +210,25 @@ impl CallChainCommand { // sudo. self.configure_sudo(chain, cli)?; - // Resolve who is signing the extrinsic. + // Resolve who is signing the extrinsic. If a `suri` was provided via the command line, + // skip the prompt. let suri = match self.suri.as_ref() { Some(suri) => suri.clone(), - None => - cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()?, + None => { + if !self.use_wallet { + if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") + .initial_value(true) + .interact()? { + self.use_wallet = true; + DEFAULT_URI.to_string() // Default value because the user is using the browser wallet. + } + else { + cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()? + } + } else { + DEFAULT_URI.to_string() // Default value because the user is using the browser wallet. + } + }, }; return Ok(Call { @@ -210,6 +237,7 @@ impl CallChainCommand { suri, skip_confirm: self.skip_confirm, sudo: self.sudo, + use_wallet: self.use_wallet, }); } } @@ -222,11 +250,36 @@ impl CallChainCommand { call_data: &str, cli: &mut impl Cli, ) -> Result<()> { - // Resolve who is signing the extrinsic. + // Resolve who is signing the extrinsic. If a `suri` was provided via the command line, + // skip the prompt. + let mut use_wallet = self.use_wallet; let suri = match self.suri.as_ref() { - Some(suri) => suri, - None => &cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()?, + Some(suri) => suri.clone(), + None => + if !self.use_wallet { + if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") + .initial_value(true) + .interact()? { + use_wallet = true; + DEFAULT_URI.to_string() + } + else { + cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()? + } + } else { + DEFAULT_URI.to_string() + }, }; + // Perform signing steps with wallet integration and return early. + if use_wallet { + let call_data_bytes = + decode_call_data(call_data).map_err(|err| anyhow!("{}", format!("{err:?}")))?; + submit_extrinsic_with_wallet(client, &url, call_data_bytes, cli) + .await + .map_err(|err| anyhow!("{}", format!("{err:?}")))?; + display_message("Call complete.", true, cli)?; + return Ok(()); + } cli.info(format!("Encoded call data: {}", call_data))?; if !self.skip_confirm && !cli.confirm("Do you want to submit the extrinsic?") @@ -244,7 +297,7 @@ impl CallChainCommand { spinner.start("Signing and submitting the extrinsic and then waiting for finalization, please be patient..."); let call_data_bytes = decode_call_data(call_data).map_err(|err| anyhow!("{}", format!("{err:?}")))?; - let result = sign_and_submit_extrinsic(client, url, CallData::new(call_data_bytes), suri) + let result = sign_and_submit_extrinsic(client, url, CallData::new(call_data_bytes), &suri) .await .map_err(|err| anyhow!("{}", format!("{err:?}")))?; @@ -283,6 +336,7 @@ impl CallChainCommand { self.function = None; self.args.clear(); self.sudo = false; + self.use_wallet = false; } // Function to check if all required fields are specified. @@ -334,6 +388,8 @@ struct Call { /// - for a dev account "//Alice" /// - with a password "//Alice///SECRET_PASSWORD" suri: String, + /// Whether to use your browser wallet to sign the extrinsic. + use_wallet: bool, /// Whether to automatically sign and submit the extrinsic without prompting for confirmation. skip_confirm: bool, /// Whether to dispatch the function call with `Root` origin. @@ -411,7 +467,12 @@ impl Call { .collect(); full_message.push_str(&format!(" --args {}", args.join(" "))); } - full_message.push_str(&format!(" --url {} --suri {}", chain.url, self.suri)); + full_message.push_str(&format!(" --url {}", chain.url)); + if self.use_wallet { + full_message.push_str(" --use-wallet"); + } else { + full_message.push_str(&format!(" --suri {}", self.suri)); + } if self.sudo { full_message.push_str(" --sudo"); } @@ -419,6 +480,32 @@ impl Call { } } +// Sign and submit an extrinsic using wallet integration. +async fn submit_extrinsic_with_wallet( + client: &OnlineClient, + url: &Url, + call_data: Vec, + cli: &mut impl Cli, +) -> Result<()> { + let maybe_payload = wait_for_signature(call_data, url.to_string()).await?; + if let Some(payload) = maybe_payload { + cli.success("Signed payload received.")?; + let spinner = cliclack::spinner(); + spinner.start( + "Submitting the extrinsic and then waiting for finalization, please be patient...", + ); + + let result = submit_signed_extrinsic(client.clone(), payload) + .await + .map_err(|err| anyhow!("{}", format!("{err:?}")))?; + + spinner.stop(format!("Extrinsic submitted with hash: {:?}", result)); + } else { + display_message("No signed payload received.", false, cli)?; + } + Ok(()) +} + // Displays a message to the user, with formatting based on the success status. fn display_message(message: &str, success: bool, cli: &mut impl Cli) -> Result<()> { if success { @@ -642,7 +729,7 @@ mod tests { ) .expect_input("The value for `remark` might be too large to enter. You may enter the path to a file instead.", "0x11".into()) .expect_confirm("Would you like to dispatch this function call with `Root` origin?", true) - .expect_input("Signer of the extrinsic:", "//Bob".into()); + .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", true); let chain = call_config.configure_chain(&mut cli).await?; assert_eq!(chain.url, Url::parse(POP_NETWORK_TESTNET_URL)?); @@ -651,9 +738,10 @@ mod tests { assert_eq!(call_chain.function.pallet, "System"); assert_eq!(call_chain.function.name, "remark"); assert_eq!(call_chain.args, ["0x11".to_string()].to_vec()); - assert_eq!(call_chain.suri, "//Bob"); + assert_eq!(call_chain.suri, "//Alice"); // Default value + assert!(call_chain.use_wallet); assert!(call_chain.sudo); - assert_eq!(call_chain.display(&chain), "pop call chain --pallet System --function remark --args \"0x11\" --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Bob --sudo"); + assert_eq!(call_chain.display(&chain), "pop call chain --pallet System --function remark --args \"0x11\" --url wss://rpc1.paseo.popnetwork.xyz/ --use-wallet --sudo"); cli.verify() } @@ -714,6 +802,7 @@ mod tests { }, args: vec!["0x11".to_string()].to_vec(), suri: DEFAULT_URI.to_string(), + use_wallet: false, skip_confirm: false, sudo: false, }; @@ -753,6 +842,7 @@ mod tests { function: find_dispatchable_by_name(&pallets, "System", "remark")?.clone(), args: vec!["0x11".to_string()].to_vec(), suri: DEFAULT_URI.to_string(), + use_wallet: false, skip_confirm: false, sudo: false, }; @@ -776,11 +866,13 @@ mod tests { args: vec![].to_vec(), url: Some(Url::parse(POP_NETWORK_TESTNET_URL)?), suri: None, + use_wallet: false, skip_confirm: false, call_data: Some("0x00000411".to_string()), sudo: false, }; let mut cli = MockCli::new() + .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", false) .expect_input("Signer of the extrinsic:", "//Bob".into()) .expect_confirm("Do you want to submit the extrinsic?", false) .expect_outro_cancel("Extrinsic with call data 0x00000411 was not submitted."); @@ -803,8 +895,9 @@ mod tests { pallet: None, function: None, args: vec![].to_vec(), - url: Some(Url::parse("wss://polkadot-rpc.publicnode.com")?), + url: Some(Url::parse(POLKADOT_NETWORK_URL)?), suri: Some("//Alice".to_string()), + use_wallet: false, skip_confirm: false, call_data: Some("0x00000411".to_string()), sudo: true, @@ -836,6 +929,7 @@ mod tests { function: Some("remark".to_string()), args: vec!["0x11".to_string()].to_vec(), url: Some(Url::parse(POP_NETWORK_TESTNET_URL)?), + use_wallet: true, suri: Some(DEFAULT_URI.to_string()), skip_confirm: false, call_data: None, @@ -846,6 +940,7 @@ mod tests { assert_eq!(call_config.function, None); assert_eq!(call_config.args.len(), 0); assert!(!call_config.sudo); + assert!(!call_config.use_wallet); Ok(()) } @@ -857,6 +952,7 @@ mod tests { args: vec!["0x11".to_string()].to_vec(), url: Some(Url::parse(POP_NETWORK_TESTNET_URL)?), suri: Some(DEFAULT_URI.to_string()), + use_wallet: false, skip_confirm: false, call_data: None, sudo: false, @@ -875,6 +971,7 @@ mod tests { args: vec!["2000".to_string(), "0x1".to_string(), "0x12".to_string()].to_vec(), url: Some(Url::parse(POP_NETWORK_TESTNET_URL)?), suri: Some(DEFAULT_URI.to_string()), + use_wallet: false, call_data: None, skip_confirm: false, sudo: false, diff --git a/crates/pop-cli/src/commands/call/contract.rs b/crates/pop-cli/src/commands/call/contract.rs index 0b2815a85..c81c86c2d 100644 --- a/crates/pop-cli/src/commands/call/contract.rs +++ b/crates/pop-cli/src/commands/call/contract.rs @@ -2,17 +2,19 @@ use crate::{ cli::{self, traits::*}, - common::contracts::has_contract_been_built, + common::{contracts::has_contract_been_built, wallet::wait_for_signature}, }; use anyhow::{anyhow, Result}; use clap::Args; use cliclack::spinner; +use pop_common::{DefaultConfig, Keypair}; use pop_contracts::{ - build_smart_contract, call_smart_contract, dry_run_call, dry_run_gas_estimate_call, - get_messages, parse_account, set_up_call, CallOpts, Verbosity, + build_smart_contract, call_smart_contract, call_smart_contract_from_signed_payload, + dry_run_call, dry_run_gas_estimate_call, get_call_payload, get_message, get_messages, + parse_account, set_up_call, CallExec, CallOpts, DefaultEnvironment, Verbosity, }; use sp_weights::Weight; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; const DEFAULT_URL: &str = "ws://localhost:9944/"; const DEFAULT_URI: &str = "//Alice"; @@ -54,6 +56,9 @@ pub struct CallContractCommand { /// - with a password "//Alice///SECRET_PASSWORD" #[arg(name = "suri", long, short, default_value = DEFAULT_URI)] suri: String, + /// Use your browser wallet to sign a transaction. + #[arg(name = "use-wallet", long, short('w'), default_value = "false", conflicts_with = "suri")] + use_wallet: bool, /// Submit an extrinsic for on-chain execution. #[arg(short('x'), long)] execute: bool, @@ -115,14 +120,19 @@ impl CallContractCommand { full_message.push_str(&format!(" --gas {}", gas_limit)); } if let Some(proof_size) = self.proof_size { - full_message.push_str(&format!(" --proof_size {}", proof_size)); + full_message.push_str(&format!(" --proof-size {}", proof_size)); + } + full_message.push_str(&format!(" --url {}", self.url)); + if self.use_wallet { + full_message.push_str(" --use-wallet"); + } else { + full_message.push_str(&format!(" --suri {}", self.suri)); } - full_message.push_str(&format!(" --url {} --suri {}", self.url, self.suri)); if self.execute { full_message.push_str(" --execute"); } if self.dry_run { - full_message.push_str(" --dry_run"); + full_message.push_str(" --dry-run"); } full_message } @@ -165,7 +175,7 @@ impl CallContractCommand { fn is_contract_build_required(&self) -> bool { self.path .as_ref() - .map(|p| p.is_dir() && !has_contract_been_built(Some(&p))) + .map(|p| p.is_dir() && !has_contract_been_built(Some(p))) .unwrap_or_default() } @@ -303,18 +313,25 @@ impl CallContractCommand { self.proof_size = proof_size_input.parse::().ok(); // If blank or bad input, estimate it. } - // Resolve who is calling the contract. - if self.suri == DEFAULT_URI { - // Prompt for uri. - self.suri = cli - .input("Signer calling the contract:") - .placeholder("//Alice") - .default_input("//Alice") - .interact()?; - }; + // Resolve who is calling the contract. If a `suri` was provided via the command line, skip + // the prompt. + if self.suri == DEFAULT_URI && !self.use_wallet && message.mutates { + if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") + .initial_value(true) + .interact()? { + self.use_wallet = true; + } + else{ + self.suri = cli + .input("Signer calling the contract:") + .placeholder("//Alice") + .default_input("//Alice") + .interact()?; + }; + } // Finally prompt for confirmation. - let is_call_confirmed = if message.mutates && !self.dev_mode { + let is_call_confirmed = if message.mutates && !self.dev_mode && !self.use_wallet { cli.confirm("Do you want to execute the call? (Selecting 'No' will perform a dry run)") .initial_value(true) .interact()? @@ -340,6 +357,14 @@ impl CallContractCommand { return Err(anyhow!("Please specify the message to call.")); }, }; + // Disable wallet signing and display warning if the call is read-only. + let message_metadata = + get_message(self.path.as_deref().unwrap_or_else(|| Path::new("./")), &message)?; + if !message_metadata.mutates && self.use_wallet { + cli.warning("NOTE: Signing is not required for this read-only call. The '--use-wallet' flag will be ignored.")?; + self.use_wallet = false; + } + let contract = match &self.contract { Some(contract) => contract.to_string(), None => { @@ -366,6 +391,12 @@ impl CallContractCommand { }, }; + // Perform signing steps with wallet integration, skipping secure signing for query-only + // operations. + if self.use_wallet { + self.execute_with_secure_signing(call_exec, cli).await?; + return self.finalize_execute_call(cli, prompt_to_repeat_call).await; + } if self.dry_run { let spinner = spinner(); spinner.start("Doing a dry run to estimate the gas..."); @@ -414,7 +445,15 @@ impl CallContractCommand { cli.info(call_result)?; } + self.finalize_execute_call(cli, prompt_to_repeat_call).await + } + /// Finalize the current call, prompting the user to repeat or conclude the process. + async fn finalize_execute_call( + &mut self, + cli: &mut impl Cli, + prompt_to_repeat_call: bool, + ) -> Result<()> { // Prompt for any additional calls. if !prompt_to_repeat_call { display_message("Call completed successfully!", true, cli)?; @@ -435,12 +474,55 @@ impl CallContractCommand { } } + /// Execute the smart contract call using wallet integration. + async fn execute_with_secure_signing( + &self, + call_exec: CallExec, + cli: &mut impl Cli, + ) -> Result<()> { + let call_data = self.get_contract_data(&call_exec).map_err(|err| { + anyhow!("An error occurred getting the call data: {}", err.to_string()) + })?; + + let maybe_payload = wait_for_signature(call_data, self.url.to_string()).await?; + if let Some(payload) = maybe_payload { + cli.success("Signed payload received.")?; + let spinner = spinner(); + spinner.start("Calling the contract..."); + + let call_result = + call_smart_contract_from_signed_payload(call_exec, payload, &self.url) + .await + .map_err(|err| anyhow!("{} {}", "ERROR:", format!("{err:?}")))?; + + cli.info(call_result)?; + } else { + display_message("No signed payload received.", false, cli)?; + } + Ok(()) + } + + // Get the call data. + fn get_contract_data( + &self, + call_exec: &CallExec, + ) -> anyhow::Result> { + let weight_limit = if self.gas_limit.is_some() && self.proof_size.is_some() { + Weight::from_parts(self.gas_limit.unwrap(), self.proof_size.unwrap()) + } else { + Weight::from_parts(0, 0) + }; + let call_data = get_call_payload(call_exec, weight_limit)?; + Ok(call_data) + } + /// Resets message specific fields to default values for a new call. fn reset_for_new_call(&mut self) { self.message = None; self.value = DEFAULT_PAYABLE_VALUE.to_string(); self.gas_limit = None; self.proof_size = None; + self.use_wallet = false; } } @@ -482,6 +564,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -517,13 +600,14 @@ mod tests { proof_size: Some(10), url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: true, execute: false, dev_mode: false, }; call_config.configure(&mut cli, false).await?; assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof_size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry_run", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof-size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry-run", temp_dir.path().join("testing").display().to_string(), )); // Contract deployed on Pop Network testnet, test dry-run @@ -553,13 +637,14 @@ mod tests { proof_size: Some(10), url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: true, execute: false, dev_mode: false, }; call_config.configure(&mut cli, false).await?; assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof_size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry_run", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof-size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry-run", current_dir.join("pop-contracts/tests/files/testing.contract").display().to_string(), )); // Contract deployed on Pop Network testnet, test dry-run @@ -569,7 +654,7 @@ mod tests { call_config.path = Some(current_dir.join("pop-contracts/tests/files/testing.json")); call_config.configure(&mut cli, false).await?; assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof_size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry_run", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof-size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry-run", current_dir.join("pop-contracts/tests/files/testing.json").display().to_string(), )); @@ -577,7 +662,7 @@ mod tests { call_config.path = Some(current_dir.join("pop-contracts/tests/files/testing.wasm")); call_config.configure(&mut cli, false).await?; assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof_size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry_run", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof-size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry-run", current_dir.join("pop-contracts/tests/files/testing.wasm").display().to_string(), )); // Contract deployed on Pop Network testnet, test dry-run @@ -608,10 +693,6 @@ mod tests { "Do you want to perform another call using the existing smart contract?", true, ) - .expect_confirm( - "Do you want to perform another call using the existing smart contract?", - false, - ) .expect_select( "Select the message to call:", Some(false), @@ -619,12 +700,16 @@ mod tests { Some(items), 1, // "get" message ) - .expect_input("Signer calling the contract:", "//Alice".into()) .expect_info(format!( "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message get --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice", temp_dir.path().join("testing").display().to_string(), )) + .expect_warning("NOTE: Signing is not required for this read-only call. The '--use-wallet' flag will be ignored.") .expect_warning("Your call has not been executed.") + .expect_confirm( + "Do you want to perform another call using the existing smart contract?", + false, + ) .expect_outro("Contract calling complete."); // Contract deployed on Pop Network testnet, test get @@ -638,6 +723,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: true, dry_run: false, execute: false, dev_mode: false, @@ -688,7 +774,6 @@ mod tests { "Provide the on-chain contract address:", "15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm".into(), ) - .expect_input("Signer calling the contract:", "//Alice".into()) .expect_info(format!( "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message get --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice", temp_dir.path().join("testing").display().to_string(), @@ -704,6 +789,7 @@ mod tests { proof_size: None, url: Url::parse(DEFAULT_URL)?, suri: DEFAULT_URI.to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -750,14 +836,6 @@ mod tests { ]; // The inputs are processed in reverse order. let mut cli = MockCli::new() - .expect_confirm("Do you want to execute the call? (Selecting 'No' will perform a dry run)", true) - .expect_select( - "Select the message to call:", - Some(false), - true, - Some(items), - 2, // "specific_flip" message - ) .expect_input( "Where is your project or contract artifact located?", temp_dir.path().join("testing").display().to_string(), @@ -770,14 +848,21 @@ mod tests { "Provide the on-chain contract address:", "15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm".into(), ) + .expect_select( + "Select the message to call:", + Some(false), + true, + Some(items), + 2, // "specific_flip" message + ) .expect_input("Enter the value for the parameter: new_value", "true".into()) // Args for specific_flip .expect_input("Enter the value for the parameter: number", "2".into()) // Args for specific_flip .expect_input("Value to transfer to the call:", "50".into()) // Only if payable .expect_input("Enter the gas limit:", "".into()) // Only if call .expect_input("Enter the proof size limit:", "".into()) // Only if call - .expect_input("Signer calling the contract:", "//Alice".into()) + .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", true) .expect_info(format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --execute", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --use-wallet --execute", temp_dir.path().join("testing").display().to_string(), )); @@ -791,6 +876,7 @@ mod tests { proof_size: None, url: Url::parse(DEFAULT_URL)?, suri: DEFAULT_URI.to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -809,10 +895,11 @@ mod tests { assert_eq!(call_config.proof_size, None); assert_eq!(call_config.url.to_string(), "wss://rpc1.paseo.popnetwork.xyz/"); assert_eq!(call_config.suri, "//Alice"); + assert!(call_config.use_wallet); assert!(call_config.execute); assert!(!call_config.dry_run); assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --execute", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --use-wallet --execute", temp_dir.path().join("testing").display().to_string(), )); @@ -877,6 +964,7 @@ mod tests { proof_size: None, url: Url::parse(DEFAULT_URL)?, suri: DEFAULT_URI.to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: true, @@ -935,6 +1023,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -984,6 +1073,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -1002,6 +1092,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -1025,6 +1116,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -1055,6 +1147,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index dfb95380e..f2c26076f 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -2,9 +2,11 @@ use crate::{ cli::{traits::Cli as _, Cli}, - common::contracts::{check_contracts_node_and_prompt, has_contract_been_built}, + common::{ + contracts::{check_contracts_node_and_prompt, has_contract_been_built, terminate_node}, + wallet::wait_for_signature, + }, style::style, - wallet_integration::{FrontendFromString, TransactionData, WalletIntegrationManager}, }; use clap::Args; use cliclack::{confirm, log, log::error, spinner, ProgressBar}; @@ -18,10 +20,7 @@ use pop_contracts::{ }; use sp_core::Bytes; use sp_weights::Weight; -use std::{ - path::PathBuf, - process::{Child, Command}, -}; +use std::path::PathBuf; use tempfile::NamedTempFile; use url::Url; @@ -182,13 +181,13 @@ impl UpContractCommand { Ok(data) => data, Err(e) => { error(format!("An error occurred getting the call data: {e}"))?; - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, }; - let maybe_payload = self.wait_for_signature(call_data).await?; + let maybe_payload = wait_for_signature(call_data, self.url.to_string()).await?; if let Some(payload) = maybe_payload { log::success("Signed payload received.")?; let spinner = spinner(); @@ -196,10 +195,9 @@ impl UpContractCommand { if self.upload_only { let result = upload_contract_signed(self.url.as_str(), payload).await; - // TODO: dry (see else below) if let Err(e) = result { spinner.error(format!("An error occurred uploading your contract: {e}")); - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); } @@ -218,7 +216,7 @@ impl UpContractCommand { let result = instantiate_contract_signed(self.url.as_str(), payload).await; if let Err(e) = result { spinner.error(format!("An error occurred uploading your contract: {e}")); - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); } @@ -237,19 +235,19 @@ impl UpContractCommand { } } else { Cli.outro_cancel("Signed payload doesn't exist.")?; - Self::terminate_node(process)?; + terminate_node(process)?; return Ok(()); } - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro(COMPLETE)?; - return Ok(()) + return Ok(()); } // Check for upload only. if self.upload_only { let result = self.upload_contract().await; - Self::terminate_node(process)?; + terminate_node(process)?; match result { Ok(_) => { Cli.outro(COMPLETE)?; @@ -266,7 +264,7 @@ impl UpContractCommand { Ok(i) => i, Err(e) => { error(format!("An error occurred instantiating the contract: {e}"))?; - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -284,7 +282,7 @@ impl UpContractCommand { }, Err(e) => { spinner.error(format!("{e}")); - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -302,7 +300,7 @@ impl UpContractCommand { contract_info.code_hash, ); - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro(COMPLETE)?; } @@ -344,29 +342,6 @@ impl UpContractCommand { Ok(()) } - /// Handles the optional termination of a local running node. - fn terminate_node(process: Option<(Child, NamedTempFile)>) -> anyhow::Result<()> { - // Prompt to close any launched node - let Some((process, log)) = process else { - return Ok(()); - }; - if confirm("Would you like to terminate the local node?") - .initial_value(true) - .interact()? - { - // Stop the process contracts-node - Command::new("kill") - .args(["-s", "TERM", &process.id().to_string()]) - .spawn()? - .wait()?; - } else { - log.keep()?; - log::warning(format!("NOTE: The node is running in the background with process ID {}. Please terminate it manually when done.", process.id()))?; - } - - Ok(()) - } - // get the call data and contract code hash async fn get_contract_data(&self) -> anyhow::Result<(Vec, [u8; 32])> { let contract_code = get_contract_code(self.path.as_ref()).await?; @@ -380,40 +355,12 @@ impl UpContractCommand { let weight_limit = if self.gas_limit.is_some() && self.proof_size.is_some() { Weight::from_parts(self.gas_limit.unwrap(), self.proof_size.unwrap()) } else { - // Frontend will do dry run and update call data. Weight::from_parts(0, 0) }; let call_data = get_instantiate_payload(instantiate_exec, weight_limit).await?; Ok((call_data, hash)) } } - - async fn wait_for_signature(&self, call_data: Vec) -> anyhow::Result> { - let ui = FrontendFromString::new(include_str!("../../assets/index.html").to_string()); - - let transaction_data = TransactionData::new(self.url.to_string(), call_data); - // starts server - let mut wallet = WalletIntegrationManager::new(ui, transaction_data); - log::step(format!("Wallet signing portal started at http://{}", wallet.rpc_url))?; - - log::step("Waiting for signature... Press Ctrl+C to terminate early.")?; - loop { - // Display error, if any. - if let Some(error) = wallet.take_error().await { - log::error(format!("Signing portal error: {error}"))?; - } - - let state = wallet.state.lock().await; - // If the payload is submitted we terminate the frontend. - if !wallet.is_running() || state.signed_payload.is_some() { - wallet.task_handle.await??; - break; - } - } - - let signed_payload = wallet.state.lock().await.signed_payload.clone(); - Ok(signed_payload) - } } impl From for UpOpts { @@ -456,9 +403,6 @@ fn display_contract_info(spinner: &ProgressBar, address: String, code_hash: Opti #[cfg(test)] mod tests { use super::*; - use duct::cmd; - use std::fs::{self, File}; - use subxt::{client::OfflineClientT, utils::to_hex}; use url::Url; fn default_up_contract_command() -> UpContractCommand { @@ -500,82 +444,6 @@ mod tests { Ok(()) } - #[test] - fn has_contract_been_built_works() -> anyhow::Result<()> { - let temp_dir = tempfile::tempdir()?; - let path = temp_dir.path(); - - // Standard rust project - let name = "hello_world"; - cmd("cargo", ["new", name]).dir(&path).run()?; - let contract_path = path.join(name); - assert!(!has_contract_been_built(Some(&contract_path))); - - cmd("cargo", ["build"]).dir(&contract_path).run()?; - // Mock build directory - fs::create_dir(&contract_path.join("target/ink"))?; - assert!(!has_contract_been_built(Some(&path.join(name)))); - // Create a mocked .contract file inside the target directory - File::create(contract_path.join(format!("target/ink/{}.contract", name)))?; - assert!(has_contract_been_built(Some(&path.join(name)))); - Ok(()) - } - - // TODO: delete this test. - // This is a helper test for an actual running pop CLI. - // It can serve as the "frontend" to query the payload, sign it - // and submit back to the CLI. - #[tokio::test] - async fn sign_call_data() -> anyhow::Result<()> { - use subxt::{config::DefaultExtrinsicParamsBuilder as Params, tx::Payload}; - // This struct implements the [`Payload`] trait and is used to submit - // pre-encoded SCALE call data directly, without the dynamic construction of transactions. - struct CallData(Vec); - - impl Payload for CallData { - fn encode_call_data_to( - &self, - _: &subxt::Metadata, - out: &mut Vec, - ) -> Result<(), subxt::ext::subxt_core::Error> { - out.extend_from_slice(&self.0); - Ok(()) - } - } - - use subxt_signer::sr25519::dev; - let payload = reqwest::get(&format!("{}/payload", "http://127.0.0.1:9090")) - .await - .expect("Failed to get payload") - .json::() - .await - .expect("Failed to parse payload"); - - let url = "ws://localhost:9944"; - let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; - let client = - subxt::OnlineClient::::from_rpc_client(rpc_client).await?; - - let signer = dev::alice(); - - let payload = CallData(payload.call_data()); - let ext_params = Params::new().build(); - let signed = client.tx().create_signed(&payload, &signer, ext_params).await?; - - let response = reqwest::Client::new() - .post(&format!("{}/submit", "http://localhost:9090")) - .json(&to_hex(signed.encoded())) - .send() - .await - .expect("Failed to submit payload") - .text() - .await - .expect("Failed to parse JSON response"); - - Ok(()) - } - - #[tokio::test] async fn get_upload_call_data_works() -> anyhow::Result<()> { todo!() } diff --git a/crates/pop-cli/src/common/contracts.rs b/crates/pop-cli/src/common/contracts.rs index 3d0be11f6..c353d196e 100644 --- a/crates/pop-cli/src/common/contracts.rs +++ b/crates/pop-cli/src/common/contracts.rs @@ -3,7 +3,11 @@ use cliclack::{confirm, log::warning, spinner}; use pop_common::{manifest::from_path, sourcing::set_executable_permission}; use pop_contracts::contracts_node_generator; -use std::path::{Path, PathBuf}; +use std::{ + path::{Path, PathBuf}, + process::{Child, Command}, +}; +use tempfile::NamedTempFile; /// Checks the status of the `substrate-contracts-node` binary, sources it if necessary, and /// prompts the user to update it if the existing binary is not the latest version. @@ -68,6 +72,29 @@ pub async fn check_contracts_node_and_prompt(skip_confirm: bool) -> anyhow::Resu Ok(node_path) } +/// Handles the optional termination of a local running node. +pub fn terminate_node(process: Option<(Child, NamedTempFile)>) -> anyhow::Result<()> { + // Prompt to close any launched node + let Some((process, log)) = process else { + return Ok(()); + }; + if confirm("Would you like to terminate the local node?") + .initial_value(true) + .interact()? + { + // Stop the process contracts-node + Command::new("kill") + .args(["-s", "TERM", &process.id().to_string()]) + .spawn()? + .wait()?; + } else { + log.keep()?; + warning(format!("NOTE: The node is running in the background with process ID {}. Please terminate it manually when done.", process.id()))?; + } + + Ok(()) +} + /// Checks if a contract has been built by verifying the existence of the build directory and the /// .contract file. /// diff --git a/crates/pop-cli/src/common/mod.rs b/crates/pop-cli/src/common/mod.rs index 1cb3ee579..4a89036e5 100644 --- a/crates/pop-cli/src/common/mod.rs +++ b/crates/pop-cli/src/common/mod.rs @@ -3,3 +3,4 @@ #[cfg(feature = "contract")] pub mod contracts; pub mod helpers; +pub mod wallet; diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs new file mode 100644 index 000000000..4bfffa6dc --- /dev/null +++ b/crates/pop-cli/src/common/wallet.rs @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-3.0 + +use crate::wallet_integration::{FrontendFromString, TransactionData, WalletIntegrationManager}; +use cliclack::log; + +pub async fn wait_for_signature(call_data: Vec, url: String) -> anyhow::Result> { + let ui = FrontendFromString::new(include_str!("../assets/index.html").to_string()); + + let transaction_data = TransactionData::new(url, call_data); + // starts server + let mut wallet = WalletIntegrationManager::new(ui, transaction_data); + log::step(format!("Wallet signing portal started at http://{}", wallet.rpc_url))?; + + log::step("Waiting for signature... Press Ctrl+C to terminate early.")?; + loop { + // Display error, if any. + if let Some(error) = wallet.take_error().await { + log::error(format!("Signing portal error: {error}"))?; + } + + let state = wallet.state.lock().await; + // If the payload is submitted we terminate the frontend. + if !wallet.is_running() || state.signed_payload.is_some() { + wallet.task_handle.await??; + break; + } + } + + let signed_payload = wallet.state.lock().await.signed_payload.clone(); + Ok(signed_payload) +} + +#[cfg(test)] +mod tests { + use super::*; + use subxt::utils::to_hex; + + // TODO: delete this test. + // This is a helper test for an actual running pop CLI. + // It can serve as the "frontend" to query the payload, sign it + // and submit back to the CLI. + #[tokio::test] + async fn sign_call_data() -> anyhow::Result<()> { + use subxt::{config::DefaultExtrinsicParamsBuilder as Params, tx::Payload}; + // This struct implements the [`Payload`] trait and is used to submit + // pre-encoded SCALE call data directly, without the dynamic construction of transactions. + struct CallData(Vec); + + impl Payload for CallData { + fn encode_call_data_to( + &self, + _: &subxt::Metadata, + out: &mut Vec, + ) -> Result<(), subxt::ext::subxt_core::Error> { + out.extend_from_slice(&self.0); + Ok(()) + } + } + + use subxt_signer::sr25519::dev; + let payload = reqwest::get(&format!("{}/payload", "http://127.0.0.1:9090")) + .await + .expect("Failed to get payload") + .json::() + .await + .expect("Failed to parse payload"); + + let url = "ws://localhost:9944"; + let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; + let client = + subxt::OnlineClient::::from_rpc_client(rpc_client).await?; + + let signer = dev::alice(); + + let payload = CallData(payload.call_data()); + let ext_params = Params::new().build(); + let signed = client.tx().create_signed(&payload, &signer, ext_params).await?; + + let _response = reqwest::Client::new() + .post(&format!("{}/submit", "http://localhost:9090")) + .json(&to_hex(signed.encoded())) + .send() + .await + .expect("Failed to submit payload") + .text() + .await + .expect("Failed to parse JSON response"); + + Ok(()) + } +} diff --git a/crates/pop-contracts/src/call.rs b/crates/pop-contracts/src/call.rs index 03effcb0a..ed948c38b 100644 --- a/crates/pop-contracts/src/call.rs +++ b/crates/pop-contracts/src/call.rs @@ -2,6 +2,7 @@ use crate::{ errors::Error, + submit_signed_payload, utils::{ get_manifest_path, metadata::{process_function_args, FunctionType}, @@ -11,16 +12,18 @@ use crate::{ use anyhow::Context; use contract_build::Verbosity; use contract_extrinsics::{ - BalanceVariant, CallCommandBuilder, CallExec, ContractArtifacts, DisplayEvents, ErrorVariant, - ExtrinsicOptsBuilder, TokenMetadata, + extrinsic_calls::Call, BalanceVariant, CallCommandBuilder, CallExec, ContractArtifacts, + DisplayEvents, ErrorVariant, ExtrinsicOptsBuilder, TokenMetadata, }; use ink_env::{DefaultEnvironment, Environment}; use pop_common::{create_signer, Config, DefaultConfig, Keypair}; use sp_weights::Weight; use std::path::PathBuf; +use subxt::{tx::Payload, SubstrateConfig}; use url::Url; /// Attributes for the `call` command. +#[derive(Clone, Debug, PartialEq)] pub struct CallOpts { /// Path to the contract build directory. pub path: Option, @@ -173,6 +176,53 @@ pub async fn call_smart_contract( Ok(output) } +/// Executes a smart contract call using a signed payload. +/// +/// # Arguments +/// +/// * `call_exec` - A struct containing the details of the contract call. +/// * `payload` - The signed payload string to be submitted for executing the call. +/// * `url` - The endpoint of the node where the call is executed. +pub async fn call_smart_contract_from_signed_payload( + call_exec: CallExec, + payload: String, + url: &Url, +) -> anyhow::Result { + let token_metadata = TokenMetadata::query::(url).await?; + let metadata = call_exec.client().metadata(); + let events = submit_signed_payload(url.as_str(), payload).await?; + let display_events = DisplayEvents::from_events::( + &events, None, &metadata, + )?; + + let output = + display_events.display_events::(Verbosity::Default, &token_metadata)?; + Ok(output) +} + +/// Generates the payload for executing a smart contract call. +/// +/// # Arguments +/// * `call_exec` - A struct containing the details of the contract call. +/// * `gas_limit` - The maximum amount of gas allocated for executing the contract call. +pub fn get_call_payload( + call_exec: &CallExec, + gas_limit: Weight, +) -> anyhow::Result> { + let storage_deposit_limit: Option = call_exec.opts().storage_deposit_limit(); + let mut encoded_data = Vec::::new(); + Call::new( + call_exec.contract().into(), + call_exec.value(), + gas_limit, + storage_deposit_limit.as_ref(), + call_exec.call_data().clone(), + ) + .build() + .encode_call_data_to(&call_exec.client().metadata(), &mut encoded_data)?; + Ok(encoded_data) +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/pop-contracts/src/lib.rs b/crates/pop-contracts/src/lib.rs index 69897be33..6dded2fe0 100644 --- a/crates/pop-contracts/src/lib.rs +++ b/crates/pop-contracts/src/lib.rs @@ -14,7 +14,8 @@ mod utils; pub use build::{build_smart_contract, is_supported, Verbosity}; pub use call::{ - call_smart_contract, dry_run_call, dry_run_gas_estimate_call, set_up_call, CallOpts, + call_smart_contract, call_smart_contract_from_signed_payload, dry_run_call, + dry_run_gas_estimate_call, get_call_payload, set_up_call, CallOpts, }; pub use new::{create_smart_contract, is_valid_contract_name}; pub use node::{contracts_node_generator, is_chain_alive, run_contracts_node}; @@ -28,6 +29,9 @@ pub use up::{ upload_contract_signed, upload_smart_contract, ContractInfo, UpOpts, }; pub use utils::{ - metadata::{get_messages, ContractFunction}, + metadata::{get_message, get_messages, ContractFunction}, parse_account, parse_hex_bytes, }; +// External exports +pub use contract_extrinsics::CallExec; +pub use ink_env::DefaultEnvironment; diff --git a/crates/pop-contracts/src/up.rs b/crates/pop-contracts/src/up.rs index 8ae38e405..d31d0c7f1 100644 --- a/crates/pop-contracts/src/up.rs +++ b/crates/pop-contracts/src/up.rs @@ -126,7 +126,6 @@ pub async fn get_upload_payload(code: WasmCode, url: &str) -> anyhow::Result::from_rpc_client(rpc_client).await?; diff --git a/crates/pop-contracts/src/utils/metadata.rs b/crates/pop-contracts/src/utils/metadata.rs index 111468f0e..0c2d26d6d 100644 --- a/crates/pop-contracts/src/utils/metadata.rs +++ b/crates/pop-contracts/src/utils/metadata.rs @@ -117,7 +117,7 @@ fn get_contract_functions( /// # Arguments /// * `path` - Location path of the project or contract artifact. /// * `message` - The label of the contract message. -fn get_message

(path: P, message: &str) -> Result +pub fn get_message

(path: P, message: &str) -> Result where P: AsRef, { diff --git a/crates/pop-parachains/Cargo.toml b/crates/pop-parachains/Cargo.toml index 64bef2d67..6380fbd10 100644 --- a/crates/pop-parachains/Cargo.toml +++ b/crates/pop-parachains/Cargo.toml @@ -24,11 +24,11 @@ tokio.workspace = true url.workspace = true askama.workspace = true -hex.workspace = true indexmap.workspace = true reqwest.workspace = true scale-info.workspace = true scale-value.workspace = true +sp-core.workspace = true subxt.workspace = true symlink.workspace = true toml_edit.workspace = true diff --git a/crates/pop-parachains/src/call/metadata/mod.rs b/crates/pop-parachains/src/call/metadata/mod.rs index 1f53f523c..5a9a9a2cb 100644 --- a/crates/pop-parachains/src/call/metadata/mod.rs +++ b/crates/pop-parachains/src/call/metadata/mod.rs @@ -4,7 +4,7 @@ use crate::errors::Error; use params::Param; use scale_value::stringify::custom_parsers; use std::fmt::{Display, Formatter}; -use subxt::{dynamic::Value, Metadata, OnlineClient, SubstrateConfig}; +use subxt::{dynamic::Value, utils::to_hex, Metadata, OnlineClient, SubstrateConfig}; pub mod action; pub mod params; @@ -179,7 +179,7 @@ pub fn parse_dispatchable_arguments( .map(|(param, raw_param)| { // Convert sequence parameters to hex if is_sequence let processed_param = if param.is_sequence && !raw_param.starts_with("0x") { - format!("0x{}", hex::encode(raw_param)) + to_hex(&raw_param) } else { raw_param }; @@ -199,6 +199,7 @@ mod tests { use crate::{call::tests::POP_NETWORK_TESTNET_URL, set_up_client}; use anyhow::Result; + use sp_core::bytes::from_hex; use subxt::ext::scale_bits; #[tokio::test] @@ -283,7 +284,7 @@ mod tests { ] .to_vec(); let addr: Vec<_> = - hex::decode("8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48") + from_hex("8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48") .unwrap() .into_iter() .map(|b| Value::u128(b as u128)) diff --git a/crates/pop-parachains/src/call/mod.rs b/crates/pop-parachains/src/call/mod.rs index 1f7e61b22..f5bb05b71 100644 --- a/crates/pop-parachains/src/call/mod.rs +++ b/crates/pop-parachains/src/call/mod.rs @@ -5,12 +5,12 @@ use pop_common::{ call::{DefaultEnvironment, DisplayEvents, TokenMetadata, Verbosity}, create_signer, }; +use sp_core::bytes::{from_hex, to_hex}; use subxt::{ dynamic::Value, - tx::{DynamicPayload, Payload}, + tx::{DynamicPayload, Payload, SubmittableExtrinsic}, OnlineClient, SubstrateConfig, }; - pub mod metadata; /// Sets up an [OnlineClient] instance for connecting to a blockchain. @@ -82,6 +82,28 @@ pub async fn sign_and_submit_extrinsic( Ok(format!("Extrinsic Submitted with hash: {:?}\n\n{}", result.extrinsic_hash(), events)) } +/// Submits a signed extrinsic. +/// +/// # Arguments +/// * `client` - The client used to interact with the chain. +/// * `payload` - The signed payload string to be submitted. +pub async fn submit_signed_extrinsic( + client: OnlineClient, + payload: String, +) -> Result { + let hex_encoded = + from_hex(&payload).map_err(|e| Error::CallDataDecodingError(e.to_string()))?; + let extrinsic = SubmittableExtrinsic::from_bytes(client, hex_encoded); + let result = extrinsic + .submit_and_watch() + .await + .map_err(|e| Error::ExtrinsicSubmissionError(format!("{:?}", e)))? + .wait_for_finalized_success() + .await + .map_err(|e| Error::ExtrinsicSubmissionError(format!("{:?}", e)))?; + Ok(format!("{:?}", result.extrinsic_hash())) +} + /// Encodes the call data for a given extrinsic into a hexadecimal string. /// /// # Arguments @@ -94,7 +116,7 @@ pub fn encode_call_data( let call_data = xt .encode_call_data(&client.metadata()) .map_err(|e| Error::CallDataEncodingError(e.to_string()))?; - Ok(format!("0x{}", hex::encode(call_data))) + Ok(to_hex(&call_data, false)) } /// Decodes a hex-encoded string into a vector of bytes representing the call data. @@ -102,8 +124,7 @@ pub fn encode_call_data( /// # Arguments /// * `call_data` - The hex-encoded string representing call data. pub fn decode_call_data(call_data: &str) -> Result, Error> { - hex::decode(call_data.trim_start_matches("0x")) - .map_err(|e| Error::CallDataDecodingError(e.to_string())) + from_hex(call_data).map_err(|e| Error::CallDataDecodingError(e.to_string())) } /// This struct implements the [`Payload`] trait and is used to submit diff --git a/crates/pop-parachains/src/lib.rs b/crates/pop-parachains/src/lib.rs index 5bba81542..7e70c2149 100644 --- a/crates/pop-parachains/src/lib.rs +++ b/crates/pop-parachains/src/lib.rs @@ -24,14 +24,17 @@ pub use call::{ params::Param, parse_chain_metadata, Function, Pallet, }, - set_up_client, sign_and_submit_extrinsic, CallData, + set_up_client, sign_and_submit_extrinsic, submit_signed_extrinsic, CallData, }; pub use errors::Error; pub use indexmap::IndexSet; pub use new_pallet::{create_pallet_template, new_pallet_options::*, TemplatePalletConfig}; pub use new_parachain::instantiate_template_dir; // External export from subxt. -pub use subxt::{tx::DynamicPayload, OnlineClient, SubstrateConfig}; +pub use subxt::{ + tx::{DynamicPayload, Payload}, + OnlineClient, SubstrateConfig, +}; pub use templates::{Config, Parachain, Provider}; pub use up::Zombienet; pub use utils::helpers::is_initial_endowment_valid; From 6b1313406c8dee19f10d42d0767474860c69aab1 Mon Sep 17 00:00:00 2001 From: Peter White Date: Sun, 15 Dec 2024 23:47:21 -0700 Subject: [PATCH 04/25] Test wallet integration (#383) * chore: get_payload_works * test(wallet-integration): up contract get payload works * get paylaod from server works * test(wallet-integration): retrieve upload call data works * test(wallet-integration): retrieve instantiate call data works * style: better comments * test: try higher wait times in CI * test(wallet-integration): bump sleep time * test(wallet-integration): even more sleep time * test(wallet-integration): maybe a port problem ? * revert 0075e94 * test(wallet-integration): better unit tests * test(wallet-integration): wait for wallet signature * test(wallet-integration): assert on received payload * test(wallet-integration): use tokio spawn * test(wallet-integration): add some waiting time * test(wallet-integration): use cargo run * style: nightly fmt * test(wallet-integration): 500s sleep time * test(wallet-integration): ignore some tests * test(wallet-integration): get instantiate call data * test(wallet-integration): integration tests improvements * test(wallet-integration): bump sleep time * test(wallet-integration): merge integration tests * test(wallet-integration): remove sign_call_data test * test(wallet-integration): use random free port * test(wallet-integration): define gas_limit & proof_size * fix: merge issues --------- Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com> --- Cargo.lock | 12 +- crates/pop-cli/Cargo.toml | 2 + crates/pop-cli/src/commands/up/contract.rs | 134 +++++++++++++++++- crates/pop-cli/src/wallet_integration.rs | 2 +- crates/pop-cli/tests/contract.rs | 115 ++++++++++++++- crates/pop-contracts/Cargo.toml | 1 + crates/pop-contracts/src/up.rs | 41 ++++++ crates/pop-contracts/tests/files/testing.wasm | Bin 3710 -> 0 bytes 8 files changed, 290 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba7959cd6..41b45ce71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -2004,7 +2004,7 @@ checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" [[package]] name = "contract-build" version = "5.0.1" -source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" +source = "git+https://github.com/use-ink/cargo-contract?branch=peter%2Fchore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" dependencies = [ "anyhow", "blake2", @@ -2044,7 +2044,7 @@ dependencies = [ [[package]] name = "contract-extrinsics" version = "5.0.1" -source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" +source = "git+https://github.com/use-ink/cargo-contract?branch=peter%2Fchore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" dependencies = [ "anyhow", "blake2", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "contract-metadata" version = "5.0.1" -source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" +source = "git+https://github.com/use-ink/cargo-contract?branch=peter%2Fchore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" dependencies = [ "anyhow", "impl-serde 0.5.0", @@ -2089,7 +2089,7 @@ dependencies = [ [[package]] name = "contract-transcode" version = "5.0.1" -source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" +source = "git+https://github.com/use-ink/cargo-contract?branch=peter%2Fchore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" dependencies = [ "anyhow", "base58", @@ -9318,6 +9318,7 @@ dependencies = [ "clap", "cliclack", "console", + "contract-extrinsics", "dirs", "duct", "env_logger 0.11.5", @@ -9387,6 +9388,7 @@ dependencies = [ "duct", "flate2", "heck 0.5.0", + "hex", "ink_env", "mockito", "pop-common", diff --git a/crates/pop-cli/Cargo.toml b/crates/pop-cli/Cargo.toml index 2d511c77b..90ed64ca7 100644 --- a/crates/pop-cli/Cargo.toml +++ b/crates/pop-cli/Cargo.toml @@ -53,9 +53,11 @@ tower-http = { workspace = true, features = ["fs", "cors"] } [dev-dependencies] assert_cmd.workspace = true +contract-extrinsics.workspace = true predicates.workspace = true subxt.workspace = true subxt-signer.workspace = true +sp-weights.workspace = true [features] default = ["contract", "parachain", "telemetry"] diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index f2c26076f..34a06e6e4 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -355,6 +355,7 @@ impl UpContractCommand { let weight_limit = if self.gas_limit.is_some() && self.proof_size.is_some() { Weight::from_parts(self.gas_limit.unwrap(), self.proof_size.unwrap()) } else { + // Frontend will do dry run and update call data. Weight::from_parts(0, 0) }; let call_data = get_instantiate_payload(instantiate_exec, weight_limit).await?; @@ -403,6 +404,16 @@ fn display_contract_info(spinner: &ProgressBar, address: String, code_hash: Opti #[cfg(test)] mod tests { use super::*; + use pop_common::{find_free_port, set_executable_permission}; + use pop_contracts::{contracts_node_generator, mock_build_process, new_environment}; + use std::{ + env, + process::{Child, Command}, + time::Duration, + }; + use subxt::{tx::Payload, SubstrateConfig}; + use tempfile::TempDir; + use tokio::time::sleep; use url::Url; fn default_up_contract_command() -> UpContractCommand { @@ -423,6 +434,28 @@ mod tests { } } + async fn start_test_environment() -> anyhow::Result<(Child, u16, TempDir)> { + let random_port = find_free_port(); + let temp_dir = new_environment("testing")?; + let current_dir = env::current_dir().expect("Failed to get current directory"); + mock_build_process( + temp_dir.path().join("testing"), + current_dir.join("../pop-contracts/tests/files/testing.contract"), + current_dir.join("../pop-contracts/tests/files/testing.json"), + )?; + let cache = temp_dir.path().join(""); + let binary = contracts_node_generator(cache.clone(), None).await?; + binary.source(false, &(), true).await?; + set_executable_permission(binary.path())?; + let process = run_contracts_node(binary.path(), None, random_port).await?; + Ok((process, random_port, temp_dir)) + } + + fn stop_test_environment(id: &str) -> anyhow::Result<()> { + Command::new("kill").args(["-s", "TERM", id]).spawn()?.wait()?; + Ok(()) + } + #[test] fn conversion_up_contract_command_to_up_opts_works() -> anyhow::Result<()> { let command = default_up_contract_command(); @@ -444,15 +477,106 @@ mod tests { Ok(()) } + #[tokio::test] async fn get_upload_call_data_works() -> anyhow::Result<()> { - todo!() + let (contracts_node_process, port, temp_dir) = start_test_environment().await?; + let localhost_url = format!("ws://127.0.0.1:{}", port); + sleep(Duration::from_secs(20)).await; + + let up_contract_opts = UpContractCommand { + path: Some(temp_dir.path().join("testing")), + constructor: "new".to_string(), + args: vec![], + value: "0".to_string(), + gas_limit: None, + proof_size: None, + salt: None, + url: Url::parse(&localhost_url).expect("given url is valid"), + suri: "//Alice".to_string(), + dry_run: false, + upload_only: true, + skip_confirm: true, + use_wallet: true, + }; + + let rpc_client = subxt::backend::rpc::RpcClient::from_url(&up_contract_opts.url).await?; + let client = subxt::OnlineClient::::from_rpc_client(rpc_client).await?; + + // Retrieve call data based on the above command options. + let (retrieved_call_data, _) = match up_contract_opts.get_contract_data().await { + Ok(data) => data, + Err(e) => { + error(format!("An error occurred getting the call data: {e}"))?; + return Err(e); + }, + }; + // We have retrieved some payload. + assert!(!retrieved_call_data.is_empty()); + + // Craft encoded call data for an upload code call. + let contract_code = get_contract_code(up_contract_opts.path.as_ref()).await?; + let storage_deposit_limit: Option = None; + let upload_code = contract_extrinsics::extrinsic_calls::UploadCode::new( + contract_code, + storage_deposit_limit, + contract_extrinsics::upload::Determinism::Enforced, + ); + let expected_call_data = upload_code.build(); + let mut encoded_expected_call_data = Vec::::new(); + expected_call_data + .encode_call_data_to(&client.metadata(), &mut encoded_expected_call_data)?; + + // Retrieved call data and calculated match. + assert_eq!(retrieved_call_data, encoded_expected_call_data); + + // Stop running contracts-node + stop_test_environment(&contracts_node_process.id().to_string())?; + Ok(()) } + #[tokio::test] async fn get_instantiate_call_data_works() -> anyhow::Result<()> { - todo!() - } + let (contracts_node_process, port, temp_dir) = start_test_environment().await?; + let localhost_url = format!("ws://127.0.0.1:{}", port); + sleep(Duration::from_secs(20)).await; + + let up_contract_opts = UpContractCommand { + path: Some(temp_dir.path().join("testing")), + constructor: "new".to_string(), + args: vec!["false".to_string()], + value: "0".to_string(), + gas_limit: Some(200_000_000), + proof_size: Some(30_000), + salt: None, + url: Url::parse(&localhost_url).expect("given url is valid"), + suri: "//Alice".to_string(), + dry_run: false, + upload_only: false, + skip_confirm: true, + use_wallet: true, + }; - async fn wait_for_signature_works() -> anyhow::Result<()> { - todo!() + // Retrieve call data based on the above command options. + let (retrieved_call_data, _) = match up_contract_opts.get_contract_data().await { + Ok(data) => data, + Err(e) => { + error(format!("An error occurred getting the call data: {e}"))?; + return Err(e); + }, + }; + // We have retrieved some payload. + assert!(!retrieved_call_data.is_empty()); + + // Craft instantiate call data. + let weight = Weight::from_parts(200_000_000, 30_000); + let expected_call_data = + get_instantiate_payload(set_up_deployment(up_contract_opts.into()).await?, weight) + .await?; + // Retrieved call data matches the one crafted above. + assert_eq!(retrieved_call_data, expected_call_data); + + // Stop running contracts-node + stop_test_environment(&contracts_node_process.id().to_string())?; + Ok(()) } } diff --git a/crates/pop-cli/src/wallet_integration.rs b/crates/pop-cli/src/wallet_integration.rs index 57b2924e5..b179f21ce 100644 --- a/crates/pop-cli/src/wallet_integration.rs +++ b/crates/pop-cli/src/wallet_integration.rs @@ -360,7 +360,7 @@ mod tests { .await .expect("Failed to parse response"); - assert_eq!(response, json!({"status": "success"})); + assert_eq!(response, json!({"status": "success"}).to_string()); assert_eq!(wim.state.lock().await.signed_payload, Some("0xDEADBEEF".to_string())); assert_eq!(wim.is_running(), false); diff --git a/crates/pop-cli/tests/contract.rs b/crates/pop-cli/tests/contract.rs index 77c8dba5d..6effb4d25 100644 --- a/crates/pop-cli/tests/contract.rs +++ b/crates/pop-cli/tests/contract.rs @@ -2,19 +2,57 @@ use anyhow::Result; use assert_cmd::Command; -use pop_common::{set_executable_permission, templates::Template}; +use pop_common::{find_free_port, set_executable_permission, templates::Template}; use pop_contracts::{ contracts_node_generator, dry_run_gas_estimate_instantiate, instantiate_smart_contract, run_contracts_node, set_up_deployment, Contract, UpOpts, }; -use std::{path::Path, process::Command as Cmd}; +use serde::{Deserialize, Serialize}; +use std::{path::Path, process::Command as Cmd, time::Duration}; use strum::VariantArray; +use subxt::{config::DefaultExtrinsicParamsBuilder as Params, tx::Payload, utils::to_hex}; +use subxt_signer::sr25519::dev; +use tokio::time::sleep; use url::Url; +// This struct implements the [`Payload`] trait and is used to submit +// pre-encoded SCALE call data directly, without the dynamic construction of transactions. +struct CallData(Vec); +impl Payload for CallData { + fn encode_call_data_to( + &self, + _: &subxt::Metadata, + out: &mut Vec, + ) -> Result<(), subxt::ext::subxt_core::Error> { + out.extend_from_slice(&self.0); + Ok(()) + } +} + +// TransactionData has been copied from wallet_integration.rs +/// Transaction payload to be sent to frontend for signing. +#[derive(Serialize, Debug)] +#[cfg_attr(test, derive(Deserialize, Clone))] +pub struct TransactionData { + chain_rpc: String, + call_data: Vec, +} +impl TransactionData { + pub fn new(chain_rpc: String, call_data: Vec) -> Self { + Self { chain_rpc, call_data } + } + pub fn call_data(&self) -> Vec { + self.call_data.clone() + } +} + /// Test the contract lifecycle: new, build, up, call #[tokio::test] async fn contract_lifecycle() -> Result<()> { - const DEFAULT_PORT: u16 = 9944; + const WALLET_INT_URI: &str = "http://127.0.0.1:9090"; + const WAIT_SECS: u64 = 240; + let endpoint_port = find_free_port(); + let default_endpoint: &str = &format!("ws://127.0.0.1:{}", endpoint_port); let temp = tempfile::tempdir().unwrap(); let temp_dir = temp.path(); //let temp_dir = Path::new("./"); //For testing locally @@ -46,14 +84,15 @@ async fn contract_lifecycle() -> Result<()> { let binary = contracts_node_generator(temp_dir.to_path_buf().clone(), None).await?; binary.source(false, &(), true).await?; set_executable_permission(binary.path())?; - let process = run_contracts_node(binary.path(), None, DEFAULT_PORT).await?; + let process = run_contracts_node(binary.path(), None, endpoint_port).await?; + sleep(Duration::from_secs(5)).await; // Only upload the contract // pop up contract --upload-only Command::cargo_bin("pop") .unwrap() .current_dir(&temp_dir.join("test_contract")) - .args(&["up", "contract", "--upload-only"]) + .args(&["up", "contract", "--upload-only", "--url", default_endpoint]) .assert() .success(); // Instantiate contract, only dry-run @@ -70,6 +109,8 @@ async fn contract_lifecycle() -> Result<()> { "--suri", "//Alice", "--dry-run", + "--url", + default_endpoint, ]) .assert() .success(); @@ -83,7 +124,7 @@ async fn contract_lifecycle() -> Result<()> { gas_limit: None, proof_size: None, salt: None, - url: Url::parse("ws://127.0.0.1:9944")?, + url: Url::parse(default_endpoint)?, suri: "//Alice".to_string(), }) .await?; @@ -103,6 +144,8 @@ async fn contract_lifecycle() -> Result<()> { "get", "--suri", "//Alice", + "--url", + default_endpoint, ]) .assert() .success(); @@ -122,10 +165,70 @@ async fn contract_lifecycle() -> Result<()> { "--suri", "//Alice", "-x", + "--url", + default_endpoint, ]) .assert() .success(); + // pop up contract --upload-only --use-wallet + // Will run http server for wallet integration. + // Using `cargo run --` as means for the CI to pass. + // Possibly there's room for improvement here. + let _ = tokio::process::Command::new("cargo") + .args(&[ + "run", + "--", + "up", + "contract", + "--upload-only", + "--use-wallet", + "--skip-confirm", + "--dry-run", + "-p", + temp_dir.join("test_contract").to_str().expect("to_str"), + "--url", + default_endpoint, + ]) + .spawn()?; + // Wait a moment for node and server to be up. + sleep(Duration::from_secs(WAIT_SECS)).await; + + // Request payload from server. + let response = reqwest::get(&format!("{}/payload", WALLET_INT_URI)) + .await + .expect("Failed to get payload") + .json::() + .await + .expect("Failed to parse payload"); + // We have received some payload. + assert!(!response.call_data().is_empty()); + + let rpc_client = subxt::backend::rpc::RpcClient::from_url(default_endpoint).await?; + let client = subxt::OnlineClient::::from_rpc_client(rpc_client).await?; + + // Sign payload. + let signer = dev::alice(); + let payload = CallData(response.call_data()); + let ext_params = Params::new().build(); + let signed = client.tx().create_signed(&payload, &signer, ext_params).await?; + + // Submit signed payload. This kills the wallet integration server. + let _ = reqwest::Client::new() + .post(&format!("{}/submit", WALLET_INT_URI)) + .json(&to_hex(signed.encoded())) + .send() + .await + .expect("Failed to submit payload") + .text() + .await + .expect("Failed to parse JSON response"); + + // Request payload from server after signed payload has been sent. + // Server should not be running! + let response = reqwest::get(&format!("{}/payload", WALLET_INT_URI)).await; + assert!(response.is_err()); + // Stop the process contracts-node Cmd::new("kill") .args(["-s", "TERM", &process.id().to_string()]) diff --git a/crates/pop-contracts/Cargo.toml b/crates/pop-contracts/Cargo.toml index 94a2c6e72..898b09489 100644 --- a/crates/pop-contracts/Cargo.toml +++ b/crates/pop-contracts/Cargo.toml @@ -42,3 +42,4 @@ pop-common = { path = "../pop-common", version = "0.5.0" } dirs.workspace = true mockito.workspace = true tokio-test.workspace = true +hex = "0.4.3" \ No newline at end of file diff --git a/crates/pop-contracts/src/up.rs b/crates/pop-contracts/src/up.rs index d31d0c7f1..3c73d2328 100644 --- a/crates/pop-contracts/src/up.rs +++ b/crates/pop-contracts/src/up.rs @@ -110,6 +110,7 @@ pub async fn set_up_upload( let upload_exec: UploadExec = UploadCommandBuilder::new(extrinsic_opts).done().await?; + Ok(upload_exec) } @@ -415,8 +416,13 @@ mod tests { run_contracts_node, }; use anyhow::Result; + use hex::FromHex; use pop_common::{find_free_port, set_executable_permission}; use std::{env, process::Command, time::Duration}; + use subxt::{ + config::{substrate::BlakeTwo256, Hasher}, + utils::H256, + }; use tokio::time::sleep; use url::Url; @@ -470,6 +476,41 @@ mod tests { Ok(()) } + #[tokio::test] + async fn get_payload_works() -> Result<()> { + let temp_dir = new_environment("testing")?; + let current_dir = env::current_dir().expect("Failed to get current directory"); + mock_build_process( + temp_dir.path().join("testing"), + current_dir.join("./tests/files/testing.contract"), + current_dir.join("./tests/files/testing.json"), + )?; + let up_opts = UpOpts { + path: Some(temp_dir.path().join("testing")), + constructor: "new".to_string(), + args: ["false".to_string()].to_vec(), + value: "1000".to_string(), + gas_limit: None, + proof_size: None, + salt: None, + url: Url::parse(CONTRACTS_NETWORK_URL)?, + suri: "//Alice".to_string(), + }; + let contract_code = get_contract_code(up_opts.path.as_ref()).await?; + let call_data = get_upload_payload(contract_code, CONTRACTS_NETWORK_URL).await?; + let payload_hash = BlakeTwo256::hash(&call_data); + // We know that for the above opts the payload hash should be: + // 0x98c24584107b3a01d12e8e02c0bb634d15dc86123c44d186206813ede42f478d + let expected_hash: H256 = H256::from( + <[u8; 32]>::from_hex( + "98c24584107b3a01d12e8e02c0bb634d15dc86123c44d186206813ede42f478d", + ) + .expect("Invalid hex string"), + ); + assert_eq!(expected_hash, payload_hash); + Ok(()) + } + #[tokio::test] async fn dry_run_gas_estimate_instantiate_works() -> Result<()> { let temp_dir = new_environment("testing")?; diff --git a/crates/pop-contracts/tests/files/testing.wasm b/crates/pop-contracts/tests/files/testing.wasm index 430888669464e770d310139f29e8af1ebf865ba4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 3710 zcmb_fO>ZPu6}|7Hx~pC8aXC1S84uE{iiI30?T;bxhzSyYkzz9%A+uqL>>j(uxZBen zSNAv>DN1{y2#GCQ#0H5i8-4|1#S$U0VGA2J2nk5ed9T|aN+LFl<*Daa@1A?_x#!;3 zE#2WWB_isb)`1?6<-m-`V>LbyIj~r9$(_kxa-hOX?BcK*>ro>aR^8Lh?6?~34@YNp z_qY-h_BN7}!Sfd*k?`03Z2099*z2C|*VX7nJrEnM<}bRZFRJ}f-5m^{R&`w+iI{3| z(RfxpJF8!6rE~MfVxsU*8i-r0G*gWXMC-<)87qHzX|u8Tf4@rjxcoH9n)BKoc27^` zn~kID`RUn9xjXaUrN!69DQ9-iF>FHZX2 zoR>+jFisVgZwwAP!(-anj>tn1XT9p-t>%NKnKQ28l0E=GJ}*;j0$#bKS0;e_0Jce? zBG3=pKyzwU%a%rT-u4QF$cLE~1m_Y$*tietQQ7oM=S2&#HTzsOorQ5>r*N=#*0nAI zW@%k>RDTU}1F;kc(;+~lt6c+01Q;9BQP zJgAPeA85lN+6ms3h;YK42}eV!npF4877Hr2Db zo1sVqd%(S+6dZ{Xi7JaWKpB-nVI%>cE9+891aw{lswp5C9Yw7emt0J>a*ge>9z@cj zRuWVRe?gRi06;+FfnDStV+^_9(9IMFNhU!hR7ew%LA;<2+=j*qX$FO$nQk`~_=L+q zAOduHLf{NG0m>?slmMGb2c>}f|JhX3Rhh-6g7pXu2A)#HWkXXXE}J%0fQwC)UNu$n zwM}(J6awT7LDNqe+G~@s8|1L5Ch3J%Z)RTUu^yXk1foA^tGm!0l!j3SPS{I)U*7pqR3A@Pcalxt>?~of6Z>3xev%T=q~D zUvjcc{Quy}|HOVv&+6@9Ka1wd?*zH5>e(nGAUK)9ct_o%b`_XbX5B9xmfqyPQZ}u9mW9#KT5f2sSZ%Fn% zW{TMk3i+;ps?gQoUWcPBpZ`zT*BPgR(<~@br|~at$=d1nFE7;toq|O`fqOO#+PSp( zyxyi%)3U+GY#G=L+J#yWBq+iFN3VcH#*YSN?Ub`QB?f?K2SA{(00|3>VnD*09Z7|g ze%6NW(I`f;G$fxdX20fj0=74%Y$Mbyy%J7}U%_X9TE;Wxrm8s z#1kk+nYtwZ29+1i8^3f>pzVErftnbfUK9=XI1HD1_&8ufn;XBr3k&1_D)IR@*+p&s zsdj5jZwvxIw~Ji3_||S+w=L34^BKBWMM#(tK>}|Rw<9a~G=kPw{*OS3<_`fB?SBKz zw!x@Tv%GQrpVais&*&{4`m^8=Mr~}k>u`A=gv6H+{{rI2^$_oPM6!fwh2f?c)dEtJ zSoYN^M=Kl{q*S45A#$|is(!oFY$2>x7(Oz?t&yMx=qimL=!DZPo!Gse;VlgqpFk1T<3Se(<8FPCwND(&g%kyOvL!IYK=m*JP zmn?rRu%GO+T7t~3Wx7;Cb352U zVE2gGk%gcx0Q?1J5#YDif+qqbh$}I~I=K&n)}dPr8cqZo|G0B3lr{xdIV0 z)*uXc#b5}-hXn@X=lNp3FeRT=fVksU_Ni86)@J`w>pvb=^>Dp=T7C4S>JHY|4!ia7 z*?L_apA1L!%k^P>xPCG?syR+XyDr;P_-vt)C6{4}aP{8LU5f@f6>v*6N{%lIJ4w6a3!6@BhXB^KN}Idf6G` hi&oV+JUglmJKtH`THCxIVhI~`eF@)v`23K*zW{;(I0gU! From 7227abc01f0cf71f512c5ec122c2c212131d5855 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez <11448715+al3mart@users.noreply.github.com> Date: Tue, 17 Dec 2024 01:09:20 +0100 Subject: [PATCH 05/25] test(wallet-integration): remove sign_call_data test (#384) --- crates/pop-cli/src/common/wallet.rs | 60 ----------------------------- 1 file changed, 60 deletions(-) diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs index 4bfffa6dc..b00658385 100644 --- a/crates/pop-cli/src/common/wallet.rs +++ b/crates/pop-cli/src/common/wallet.rs @@ -29,63 +29,3 @@ pub async fn wait_for_signature(call_data: Vec, url: String) -> anyhow::Resu let signed_payload = wallet.state.lock().await.signed_payload.clone(); Ok(signed_payload) } - -#[cfg(test)] -mod tests { - use super::*; - use subxt::utils::to_hex; - - // TODO: delete this test. - // This is a helper test for an actual running pop CLI. - // It can serve as the "frontend" to query the payload, sign it - // and submit back to the CLI. - #[tokio::test] - async fn sign_call_data() -> anyhow::Result<()> { - use subxt::{config::DefaultExtrinsicParamsBuilder as Params, tx::Payload}; - // This struct implements the [`Payload`] trait and is used to submit - // pre-encoded SCALE call data directly, without the dynamic construction of transactions. - struct CallData(Vec); - - impl Payload for CallData { - fn encode_call_data_to( - &self, - _: &subxt::Metadata, - out: &mut Vec, - ) -> Result<(), subxt::ext::subxt_core::Error> { - out.extend_from_slice(&self.0); - Ok(()) - } - } - - use subxt_signer::sr25519::dev; - let payload = reqwest::get(&format!("{}/payload", "http://127.0.0.1:9090")) - .await - .expect("Failed to get payload") - .json::() - .await - .expect("Failed to parse payload"); - - let url = "ws://localhost:9944"; - let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; - let client = - subxt::OnlineClient::::from_rpc_client(rpc_client).await?; - - let signer = dev::alice(); - - let payload = CallData(payload.call_data()); - let ext_params = Params::new().build(); - let signed = client.tx().create_signed(&payload, &signer, ext_params).await?; - - let _response = reqwest::Client::new() - .post(&format!("{}/submit", "http://localhost:9090")) - .json(&to_hex(signed.encoded())) - .send() - .await - .expect("Failed to submit payload") - .text() - .await - .expect("Failed to parse JSON response"); - - Ok(()) - } -} From 89df5f6fedd9fe606352d19b4c156ff3aa8b3349 Mon Sep 17 00:00:00 2001 From: Peter White Date: Mon, 16 Dec 2024 17:27:09 -0700 Subject: [PATCH 06/25] chore: remove hex crate and use alternate means with test --- Cargo.lock | 1 - crates/pop-contracts/Cargo.toml | 3 +-- crates/pop-contracts/src/up.rs | 15 ++++++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41b45ce71..1a17950f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9388,7 +9388,6 @@ dependencies = [ "duct", "flate2", "heck 0.5.0", - "hex", "ink_env", "mockito", "pop-common", diff --git a/crates/pop-contracts/Cargo.toml b/crates/pop-contracts/Cargo.toml index 898b09489..f44332299 100644 --- a/crates/pop-contracts/Cargo.toml +++ b/crates/pop-contracts/Cargo.toml @@ -41,5 +41,4 @@ pop-common = { path = "../pop-common", version = "0.5.0" } [dev-dependencies] dirs.workspace = true mockito.workspace = true -tokio-test.workspace = true -hex = "0.4.3" \ No newline at end of file +tokio-test.workspace = true \ No newline at end of file diff --git a/crates/pop-contracts/src/up.rs b/crates/pop-contracts/src/up.rs index 3c73d2328..4e663a2aa 100644 --- a/crates/pop-contracts/src/up.rs +++ b/crates/pop-contracts/src/up.rs @@ -416,7 +416,6 @@ mod tests { run_contracts_node, }; use anyhow::Result; - use hex::FromHex; use pop_common::{find_free_port, set_executable_permission}; use std::{env, process::Command, time::Duration}; use subxt::{ @@ -501,12 +500,14 @@ mod tests { let payload_hash = BlakeTwo256::hash(&call_data); // We know that for the above opts the payload hash should be: // 0x98c24584107b3a01d12e8e02c0bb634d15dc86123c44d186206813ede42f478d - let expected_hash: H256 = H256::from( - <[u8; 32]>::from_hex( - "98c24584107b3a01d12e8e02c0bb634d15dc86123c44d186206813ede42f478d", - ) - .expect("Invalid hex string"), - ); + let hex_bytes = + from_hex("98c24584107b3a01d12e8e02c0bb634d15dc86123c44d186206813ede42f478d") + .expect("Invalid hex string"); + + let hex_array: [u8; 32] = hex_bytes.try_into().expect("Expected 32-byte array"); + + // Create `H256` from the `[u8; 32]` array + let expected_hash = H256::from(hex_array); assert_eq!(expected_hash, payload_hash); Ok(()) } From ddb8ba6db338bfe3e1c6d091c726e65afdea9f09 Mon Sep 17 00:00:00 2001 From: Peter White Date: Mon, 16 Dec 2024 18:03:46 -0700 Subject: [PATCH 07/25] chore: minor changes to comments, spinners, and deps --- crates/pop-cli/Cargo.toml | 2 +- crates/pop-cli/src/commands/call/chain.rs | 8 ++++---- crates/pop-cli/src/commands/call/contract.rs | 9 +++++---- crates/pop-cli/src/commands/up/contract.rs | 6 +++--- crates/pop-cli/src/common/wallet.rs | 15 ++++++++++++--- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/crates/pop-cli/Cargo.toml b/crates/pop-cli/Cargo.toml index 90ed64ca7..695cf231b 100644 --- a/crates/pop-cli/Cargo.toml +++ b/crates/pop-cli/Cargo.toml @@ -18,7 +18,7 @@ duct.workspace = true env_logger.workspace = true os_info.workspace = true reqwest.workspace = true -serde = { workspace = true, version = "1.0", features = ["derive"] } +serde = { workspace = true, features = ["derive"] } serde_json.workspace = true tempfile.workspace = true tokio.workspace = true diff --git a/crates/pop-cli/src/commands/call/chain.rs b/crates/pop-cli/src/commands/call/chain.rs index 9f769af5e..ba09f9f20 100644 --- a/crates/pop-cli/src/commands/call/chain.rs +++ b/crates/pop-cli/src/commands/call/chain.rs @@ -4,7 +4,7 @@ use std::path::Path; use crate::{ cli::{self, traits::*}, - common::wallet::wait_for_signature, + common::wallet::request_signature, }; use anyhow::{anyhow, Result}; use clap::Args; @@ -43,7 +43,7 @@ pub struct CallChainCommand { /// - with a password "//Alice///SECRET_PASSWORD" #[arg(short, long)] suri: Option, - /// Use your browser wallet to sign the extrinsic. + /// Use a browser extension wallet to sign the extrinsic. #[arg(name = "use-wallet", short('w'), long, default_value = "false", conflicts_with = "suri")] use_wallet: bool, /// SCALE encoded bytes representing the call data of the extrinsic. @@ -274,7 +274,7 @@ impl CallChainCommand { if use_wallet { let call_data_bytes = decode_call_data(call_data).map_err(|err| anyhow!("{}", format!("{err:?}")))?; - submit_extrinsic_with_wallet(client, &url, call_data_bytes, cli) + submit_extrinsic_with_wallet(client, url, call_data_bytes, cli) .await .map_err(|err| anyhow!("{}", format!("{err:?}")))?; display_message("Call complete.", true, cli)?; @@ -487,7 +487,7 @@ async fn submit_extrinsic_with_wallet( call_data: Vec, cli: &mut impl Cli, ) -> Result<()> { - let maybe_payload = wait_for_signature(call_data, url.to_string()).await?; + let maybe_payload = request_signature(call_data, url.to_string()).await?; if let Some(payload) = maybe_payload { cli.success("Signed payload received.")?; let spinner = cliclack::spinner(); diff --git a/crates/pop-cli/src/commands/call/contract.rs b/crates/pop-cli/src/commands/call/contract.rs index c81c86c2d..42c7ff830 100644 --- a/crates/pop-cli/src/commands/call/contract.rs +++ b/crates/pop-cli/src/commands/call/contract.rs @@ -2,7 +2,7 @@ use crate::{ cli::{self, traits::*}, - common::{contracts::has_contract_been_built, wallet::wait_for_signature}, + common::{contracts::has_contract_been_built, wallet::request_signature}, }; use anyhow::{anyhow, Result}; use clap::Args; @@ -56,7 +56,7 @@ pub struct CallContractCommand { /// - with a password "//Alice///SECRET_PASSWORD" #[arg(name = "suri", long, short, default_value = DEFAULT_URI)] suri: String, - /// Use your browser wallet to sign a transaction. + /// Use a browser extension wallet to sign the extrinsic. #[arg(name = "use-wallet", long, short('w'), default_value = "false", conflicts_with = "suri")] use_wallet: bool, /// Submit an extrinsic for on-chain execution. @@ -417,6 +417,7 @@ impl CallContractCommand { let spinner = spinner(); spinner.start("Calling the contract..."); let call_dry_run_result = dry_run_call(&call_exec).await?; + spinner.stop(""); cli.info(format!("Result: {}", call_dry_run_result))?; cli.warning("Your call has not been executed.")?; } else { @@ -484,7 +485,7 @@ impl CallContractCommand { anyhow!("An error occurred getting the call data: {}", err.to_string()) })?; - let maybe_payload = wait_for_signature(call_data, self.url.to_string()).await?; + let maybe_payload = request_signature(call_data, self.url.to_string()).await?; if let Some(payload) = maybe_payload { cli.success("Signed payload received.")?; let spinner = spinner(); @@ -510,7 +511,7 @@ impl CallContractCommand { let weight_limit = if self.gas_limit.is_some() && self.proof_size.is_some() { Weight::from_parts(self.gas_limit.unwrap(), self.proof_size.unwrap()) } else { - Weight::from_parts(0, 0) + Weight::zero() }; let call_data = get_call_payload(call_exec, weight_limit)?; Ok(call_data) diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index 34a06e6e4..24bbe4bda 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -4,7 +4,7 @@ use crate::{ cli::{traits::Cli as _, Cli}, common::{ contracts::{check_contracts_node_and_prompt, has_contract_been_built, terminate_node}, - wallet::wait_for_signature, + wallet::request_signature, }, style::style, }; @@ -187,7 +187,7 @@ impl UpContractCommand { }, }; - let maybe_payload = wait_for_signature(call_data, self.url.to_string()).await?; + let maybe_payload = request_signature(call_data, self.url.to_string()).await?; if let Some(payload) = maybe_payload { log::success("Signed payload received.")?; let spinner = spinner(); @@ -356,7 +356,7 @@ impl UpContractCommand { Weight::from_parts(self.gas_limit.unwrap(), self.proof_size.unwrap()) } else { // Frontend will do dry run and update call data. - Weight::from_parts(0, 0) + Weight::zero() }; let call_data = get_instantiate_payload(instantiate_exec, weight_limit).await?; Ok((call_data, hash)) diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs index b00658385..bdde336fc 100644 --- a/crates/pop-cli/src/common/wallet.rs +++ b/crates/pop-cli/src/common/wallet.rs @@ -1,9 +1,16 @@ // SPDX-License-Identifier: GPL-3.0 use crate::wallet_integration::{FrontendFromString, TransactionData, WalletIntegrationManager}; -use cliclack::log; +use cliclack::{log, spinner}; -pub async fn wait_for_signature(call_data: Vec, url: String) -> anyhow::Result> { +/// Launches the wallet integration for in-browser signing. Blocks until the signature is received. +/// +/// # Arguments +/// * `call_data` - The call data to be signed. +/// * `url` - Chain rpc. +/// # Returns +/// * The signed payload, if it exists. +pub async fn request_signature(call_data: Vec, url: String) -> anyhow::Result> { let ui = FrontendFromString::new(include_str!("../assets/index.html").to_string()); let transaction_data = TransactionData::new(url, call_data); @@ -11,7 +18,8 @@ pub async fn wait_for_signature(call_data: Vec, url: String) -> anyhow::Resu let mut wallet = WalletIntegrationManager::new(ui, transaction_data); log::step(format!("Wallet signing portal started at http://{}", wallet.rpc_url))?; - log::step("Waiting for signature... Press Ctrl+C to terminate early.")?; + let spinner = spinner(); + spinner.start("Waiting for signature... Press Ctrl+C to terminate early.")?; loop { // Display error, if any. if let Some(error) = wallet.take_error().await { @@ -25,6 +33,7 @@ pub async fn wait_for_signature(call_data: Vec, url: String) -> anyhow::Resu break; } } + spinner.stop(""); let signed_payload = wallet.state.lock().await.signed_payload.clone(); Ok(signed_payload) From 6035fd86b7ca679127b5cd34765a51dca6a66f13 Mon Sep 17 00:00:00 2001 From: Peter White Date: Mon, 16 Dec 2024 18:29:05 -0700 Subject: [PATCH 08/25] refactor: shared prompt, determine_signing_method --- crates/pop-cli/src/commands/call/chain.rs | 78 +++++++++----------- crates/pop-cli/src/commands/call/contract.rs | 29 ++++---- crates/pop-cli/src/common/wallet.rs | 25 ++++++- 3 files changed, 72 insertions(+), 60 deletions(-) diff --git a/crates/pop-cli/src/commands/call/chain.rs b/crates/pop-cli/src/commands/call/chain.rs index ba09f9f20..b9d00d319 100644 --- a/crates/pop-cli/src/commands/call/chain.rs +++ b/crates/pop-cli/src/commands/call/chain.rs @@ -4,7 +4,10 @@ use std::path::Path; use crate::{ cli::{self, traits::*}, - common::wallet::request_signature, + common::{ + wallet, + wallet::{prompt_to_use_wallet, request_signature}, + }, }; use anyhow::{anyhow, Result}; use clap::Args; @@ -210,26 +213,8 @@ impl CallChainCommand { // sudo. self.configure_sudo(chain, cli)?; - // Resolve who is signing the extrinsic. If a `suri` was provided via the command line, - // skip the prompt. - let suri = match self.suri.as_ref() { - Some(suri) => suri.clone(), - None => { - if !self.use_wallet { - if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") - .initial_value(true) - .interact()? { - self.use_wallet = true; - DEFAULT_URI.to_string() // Default value because the user is using the browser wallet. - } - else { - cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()? - } - } else { - DEFAULT_URI.to_string() // Default value because the user is using the browser wallet. - } - }, - }; + let (use_wallet, suri) = self.determine_signing_method(cli)?; + self.use_wallet = use_wallet; return Ok(Call { function: function.clone(), @@ -250,26 +235,8 @@ impl CallChainCommand { call_data: &str, cli: &mut impl Cli, ) -> Result<()> { - // Resolve who is signing the extrinsic. If a `suri` was provided via the command line, - // skip the prompt. - let mut use_wallet = self.use_wallet; - let suri = match self.suri.as_ref() { - Some(suri) => suri.clone(), - None => - if !self.use_wallet { - if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") - .initial_value(true) - .interact()? { - use_wallet = true; - DEFAULT_URI.to_string() - } - else { - cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()? - } - } else { - DEFAULT_URI.to_string() - }, - }; + let (use_wallet, suri) = self.determine_signing_method(cli)?; + // Perform signing steps with wallet integration and return early. if use_wallet { let call_data_bytes = @@ -306,6 +273,29 @@ impl CallChainCommand { Ok(()) } + // Resolve who is signing the extrinsic. If a `suri` was provided via the command line, + // skip the prompt. + fn determine_signing_method(&self, cli: &mut impl Cli) -> Result<(bool, String)> { + let mut use_wallet = self.use_wallet; + let suri = match self.suri.as_ref() { + Some(suri) => suri.clone(), + None => + if !self.use_wallet { + if prompt_to_use_wallet(cli)? { + use_wallet = true; + DEFAULT_URI.to_string() + } else { + cli.input("Signer of the extrinsic:") + .default_input(DEFAULT_URI) + .interact()? + } + } else { + DEFAULT_URI.to_string() + }, + }; + Ok((use_wallet, suri)) + } + // Checks if the chain has the Sudo pallet and prompts the user to confirm if they want to // execute the call via `sudo`. fn configure_sudo(&mut self, chain: &Chain, cli: &mut impl Cli) -> Result<()> { @@ -676,7 +666,7 @@ fn parse_function_name(name: &str) -> Result { #[cfg(test)] mod tests { use super::*; - use crate::cli::MockCli; + use crate::{cli::MockCli, common::wallet::USE_WALLET_PROMPT}; use tempfile::tempdir; use url::Url; @@ -729,7 +719,7 @@ mod tests { ) .expect_input("The value for `remark` might be too large to enter. You may enter the path to a file instead.", "0x11".into()) .expect_confirm("Would you like to dispatch this function call with `Root` origin?", true) - .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", true); + .expect_confirm(USE_WALLET_PROMPT, true); let chain = call_config.configure_chain(&mut cli).await?; assert_eq!(chain.url, Url::parse(POP_NETWORK_TESTNET_URL)?); @@ -872,7 +862,7 @@ mod tests { sudo: false, }; let mut cli = MockCli::new() - .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", false) + .expect_confirm(USE_WALLET_PROMPT, false) .expect_input("Signer of the extrinsic:", "//Bob".into()) .expect_confirm("Do you want to submit the extrinsic?", false) .expect_outro_cancel("Extrinsic with call data 0x00000411 was not submitted."); diff --git a/crates/pop-cli/src/commands/call/contract.rs b/crates/pop-cli/src/commands/call/contract.rs index 42c7ff830..e69ea5040 100644 --- a/crates/pop-cli/src/commands/call/contract.rs +++ b/crates/pop-cli/src/commands/call/contract.rs @@ -2,7 +2,11 @@ use crate::{ cli::{self, traits::*}, - common::{contracts::has_contract_been_built, wallet::request_signature}, + common::{ + contracts::has_contract_been_built, + wallet, + wallet::{prompt_to_use_wallet, request_signature}, + }, }; use anyhow::{anyhow, Result}; use clap::Args; @@ -316,18 +320,15 @@ impl CallContractCommand { // Resolve who is calling the contract. If a `suri` was provided via the command line, skip // the prompt. if self.suri == DEFAULT_URI && !self.use_wallet && message.mutates { - if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") - .initial_value(true) - .interact()? { + if prompt_to_use_wallet(cli)? { self.use_wallet = true; - } - else{ - self.suri = cli - .input("Signer calling the contract:") - .placeholder("//Alice") - .default_input("//Alice") - .interact()?; - }; + } else { + self.suri = cli + .input("Signer calling the contract:") + .placeholder("//Alice") + .default_input("//Alice") + .interact()?; + }; } // Finally prompt for confirmation. @@ -539,7 +540,7 @@ fn display_message(message: &str, success: bool, cli: &mut impl Cli) -> Result<( #[cfg(test)] mod tests { use super::*; - use crate::cli::MockCli; + use crate::{cli::MockCli, common::wallet::USE_WALLET_PROMPT}; use pop_contracts::{mock_build_process, new_environment}; use std::{env, fs::write}; use url::Url; @@ -861,7 +862,7 @@ mod tests { .expect_input("Value to transfer to the call:", "50".into()) // Only if payable .expect_input("Enter the gas limit:", "".into()) // Only if call .expect_input("Enter the proof size limit:", "".into()) // Only if call - .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", true) + .expect_confirm(USE_WALLET_PROMPT, true) .expect_info(format!( "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --use-wallet --execute", temp_dir.path().join("testing").display().to_string(), diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs index bdde336fc..cd069935a 100644 --- a/crates/pop-cli/src/common/wallet.rs +++ b/crates/pop-cli/src/common/wallet.rs @@ -1,8 +1,14 @@ // SPDX-License-Identifier: GPL-3.0 -use crate::wallet_integration::{FrontendFromString, TransactionData, WalletIntegrationManager}; +use crate::{ + cli::traits::Cli, + wallet_integration::{FrontendFromString, TransactionData, WalletIntegrationManager}, +}; use cliclack::{log, spinner}; +/// The prompt to ask the user if they want to use the wallet for signing. +pub const USE_WALLET_PROMPT: &str = "Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')"; + /// Launches the wallet integration for in-browser signing. Blocks until the signature is received. /// /// # Arguments @@ -19,7 +25,7 @@ pub async fn request_signature(call_data: Vec, url: String) -> anyhow::Resul log::step(format!("Wallet signing portal started at http://{}", wallet.rpc_url))?; let spinner = spinner(); - spinner.start("Waiting for signature... Press Ctrl+C to terminate early.")?; + spinner.start("Waiting for signature... Press Ctrl+C to terminate early."); loop { // Display error, if any. if let Some(error) = wallet.take_error().await { @@ -38,3 +44,18 @@ pub async fn request_signature(call_data: Vec, url: String) -> anyhow::Resul let signed_payload = wallet.state.lock().await.signed_payload.clone(); Ok(signed_payload) } + +/// Prompts the user to use the wallet for signing. +/// # Arguments +/// * `cli` - The CLI instance. +/// # Returns +/// * `true` if the user wants to use the wallet, `false` otherwise. +pub fn prompt_to_use_wallet(cli: &mut impl Cli) -> anyhow::Result { + use crate::cli::traits::Confirm; + + if cli.confirm(USE_WALLET_PROMPT).initial_value(true).interact()? { + Ok(true) + } else { + Ok(false) + } +} From 58c7ca68d31d4331b23d7d93956aa1e14d667fed Mon Sep 17 00:00:00 2001 From: Peter White Date: Mon, 16 Dec 2024 18:34:55 -0700 Subject: [PATCH 09/25] refactor: use extrinsic instead of transaction --- crates/pop-cli/src/common/wallet.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs index cd069935a..f084cc6f9 100644 --- a/crates/pop-cli/src/common/wallet.rs +++ b/crates/pop-cli/src/common/wallet.rs @@ -7,7 +7,7 @@ use crate::{ use cliclack::{log, spinner}; /// The prompt to ask the user if they want to use the wallet for signing. -pub const USE_WALLET_PROMPT: &str = "Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')"; +pub const USE_WALLET_PROMPT: &str = "Do you want to use your browser wallet to sign the extrinsic? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')"; /// Launches the wallet integration for in-browser signing. Blocks until the signature is received. /// From 30e5c82140cffd27acbd5008df04f485be74b502 Mon Sep 17 00:00:00 2001 From: Peter White Date: Mon, 16 Dec 2024 23:31:15 -0700 Subject: [PATCH 10/25] chore: latest frontend --- crates/pop-cli/src/assets/index.html | 1126 ++++++++++++++++-- crates/pop-cli/src/commands/call/chain.rs | 5 +- crates/pop-cli/src/commands/call/contract.rs | 1 - 3 files changed, 1009 insertions(+), 123 deletions(-) diff --git a/crates/pop-cli/src/assets/index.html b/crates/pop-cli/src/assets/index.html index d5659fbd8..d1d355b01 100644 --- a/crates/pop-cli/src/assets/index.html +++ b/crates/pop-cli/src/assets/index.html @@ -7,124 +7,1014 @@ href="data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_873_174)'%3E%3Crect width='512' height='512' rx='256' fill='%231C0533'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint0_radial_873_174)' fill-opacity='0.8'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint1_radial_873_174)' fill-opacity='0.6'/%3E%3Cmask id='mask0_873_174' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='-429' y='-502' width='1428' height='1351'%3E%3Cpath d='M127.637 -501.289L998.911 322.903L984.661 336.383L113.388 -487.809L127.637 -501.289Z' fill='%23D9D9D9'/%3E%3Cpath d='M88.9594 -464.701L960.232 359.491L945.983 372.971L74.7096 -451.221L88.9594 -464.701Z' fill='%23D9D9D9'/%3E%3Cpath d='M50.2814 -428.113L921.554 396.079L907.305 409.559L36.0316 -414.633L50.2814 -428.113Z' fill='%23D9D9D9'/%3E%3Cpath d='M11.6034 -391.525L882.876 432.667L868.627 446.147L-2.64642 -378.045L11.6034 -391.525Z' fill='%23D9D9D9'/%3E%3Cpath d='M-27.0746 -354.937L844.198 469.255L829.949 482.735L-41.3244 -341.457L-27.0746 -354.937Z' fill='%23D9D9D9'/%3E%3Cpath d='M-65.7526 -318.349L805.52 505.843L791.271 519.323L-80.0024 -304.869L-65.7526 -318.349Z' fill='%23D9D9D9'/%3E%3Cpath d='M-104.431 -281.761L766.842 542.431L752.593 555.911L-118.68 -268.281L-104.431 -281.761Z' fill='%23D9D9D9'/%3E%3Cpath d='M-143.109 -245.173L728.164 579.019L713.915 592.499L-157.358 -231.693L-143.109 -245.173Z' fill='%23D9D9D9'/%3E%3Cpath d='M-181.787 -208.585L689.486 615.607L675.237 629.087L-196.036 -195.105L-181.787 -208.585Z' fill='%23D9D9D9'/%3E%3Cpath d='M-220.465 -171.997L650.808 652.195L636.559 665.675L-234.714 -158.517L-220.465 -171.997Z' fill='%23D9D9D9'/%3E%3Cpath d='M-259.143 -135.409L612.13 688.783L597.881 702.263L-273.392 -121.929L-259.143 -135.409Z' fill='%23D9D9D9'/%3E%3Cpath d='M-297.821 -98.8211L573.452 725.371L559.203 738.851L-312.07 -85.3413L-297.821 -98.8211Z' fill='%23D9D9D9'/%3E%3Cpath d='M-336.499 -62.2331L534.774 761.959L520.525 775.439L-350.748 -48.7533L-336.499 -62.2331Z' fill='%23D9D9D9'/%3E%3Cpath d='M-375.177 -25.6452L496.096 798.547L481.847 812.026L-389.426 -12.1654L-375.177 -25.6452Z' fill='%23D9D9D9'/%3E%3Cpath d='M-413.855 10.9428L457.418 835.135L443.169 848.615L-428.104 24.4225L-413.855 10.9428Z' fill='%23D9D9D9'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_873_174)'%3E%3Cpath d='M511.169 254.929C511.169 396.905 396.739 512 255.584 512C114.428 512 -0.000976562 396.905 -0.000976562 254.929C-0.000976562 112.953 114.428 -2.14209 255.584 -2.14209C396.739 -2.14209 511.169 112.953 511.169 254.929Z' fill='%23E6007A'/%3E%3C/g%3E%3Cpath d='M183.804 160.44C171.052 151.144 156.458 147.168 141.864 147.168H52.2334L5.63086 367.567H122.684L132.083 322.765C141.879 321.622 151.384 318.84 160.403 314.394C161.8 313.705 163.178 312.986 164.536 312.239C168.249 321.014 173.177 329.173 179.315 336.581C187.573 346.548 197.657 354.366 209.117 360.016L209.12 360.018L209.517 360.213L209.917 360.399C222.605 366.289 236.098 368.784 249.63 368.784C263.218 368.784 276.507 366.489 289.292 361.868C295.36 359.675 301.212 357.046 306.832 353.988L303.961 367.567H421.013L430.413 322.765C440.209 321.622 449.714 318.84 458.733 314.394C469.61 309.03 479.317 301.877 487.672 293.046L487.682 293.035L487.841 292.867L487.995 292.7L487.998 292.697C496.09 283.931 502.611 273.995 507.338 262.975C512.203 251.631 514.88 239.536 514.88 226.953C514.88 214.447 512.231 202.327 507.001 190.977C501.508 178.753 493.141 168.335 482.134 160.44C469.382 151.144 454.788 147.168 440.194 147.168H350.563L345.323 171.949C338.297 165.041 330.227 159.445 321.314 155.191C308.55 148.958 294.91 146.357 281.28 146.357C267.691 146.357 254.402 148.652 241.618 153.273C229.473 157.663 218.174 163.78 207.814 171.541C205.377 173.358 203.011 175.252 200.715 177.221C196.062 170.823 190.408 165.177 183.804 160.44Z' fill='%232B0532'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M229.569 331.163L229.632 331.194L229.696 331.224C237.592 334.889 246.407 336.65 256.019 336.65C265.979 336.65 275.609 334.978 284.877 331.628C294.055 328.31 302.528 323.689 310.277 317.771C317.967 311.898 324.68 305.15 330.397 297.531L330.413 297.509L330.429 297.487C336.137 289.737 340.585 281.451 343.748 272.638C347.074 263.611 348.753 254.388 348.753 244.999C348.753 236.541 347.45 228.398 344.825 220.6C342.311 212.598 338.452 205.423 333.24 199.132C327.963 192.763 321.484 187.769 313.875 184.16C306.078 180.325 297.295 178.491 287.67 178.491C277.709 178.491 268.079 180.164 258.812 183.513C249.647 186.826 241.125 191.437 233.261 197.332C225.542 203.084 218.751 209.844 212.899 217.597L212.889 217.611C207.16 225.246 202.642 233.54 199.345 242.478L199.33 242.518L199.316 242.559C196.135 251.575 194.532 260.778 194.532 270.142C194.532 278.624 195.843 286.844 198.472 294.776L198.477 294.792L198.482 294.808C201.135 302.663 205.057 309.744 210.248 316.009C215.517 322.37 221.981 327.422 229.569 331.163ZM287.732 276.015L287.742 276C290.74 271.657 292.939 267.045 294.364 262.148C295.831 257.108 296.54 252.276 296.54 247.635C296.54 243.3 295.843 239.458 294.528 236.043L294.487 235.934L294.449 235.824C293.328 232.545 291.583 230.131 289.252 228.349C287.226 226.801 284.199 225.736 279.606 225.736C274.271 225.736 269.81 226.979 266.027 229.305L265.974 229.337L265.921 229.368C261.869 231.746 258.495 234.905 255.765 238.909C252.893 243.123 250.673 247.698 249.104 252.654C247.65 257.67 246.947 262.48 246.947 267.101C246.947 271.459 247.585 275.422 248.809 279.033C250.055 282.339 251.89 284.885 254.293 286.836C256.34 288.379 259.301 289.405 263.68 289.405C269.175 289.405 273.697 288.15 277.46 285.837C281.567 283.313 284.975 280.058 287.722 276.029L287.732 276.015Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M171.542 186.53C164.879 181.64 157.017 179.302 148.254 179.302H84.4909L51.4775 335.434H103.163L112.436 291.23H128.094C136.792 291.23 145.029 289.337 152.73 285.54C160.225 281.844 166.856 276.954 172.594 270.888L172.619 270.861L172.644 270.834C178.339 264.665 182.824 257.798 186.062 250.247C189.323 242.645 190.992 234.866 190.992 226.953C190.992 219.052 189.327 211.496 186.009 204.348C182.762 197.062 177.927 191.083 171.542 186.53ZM135.575 242.131L135.598 242.101C136.363 241.1 137.06 239.71 137.567 237.773L137.604 237.631L137.648 237.49C138.222 235.663 138.577 233.269 138.577 230.197C138.577 227.864 138.266 226.771 138.111 226.428C138.024 226.235 137.948 226.093 137.889 225.994L137.862 225.949L137.849 225.939H126.349L122.444 244.594H132.693C132.756 244.581 132.999 244.516 133.45 244.244C133.961 243.935 134.685 243.325 135.553 242.16L135.575 242.131Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M469.872 186.53C463.209 181.64 455.347 179.302 446.583 179.302H382.821L349.807 335.434H401.493L410.766 291.23H426.424C435.122 291.23 443.359 289.337 451.06 285.54C458.555 281.844 465.186 276.954 470.923 270.888L470.949 270.861L470.973 270.834C476.669 264.665 481.153 257.798 484.392 250.247C487.652 242.645 489.322 234.866 489.322 226.953C489.322 219.052 487.657 211.496 484.339 204.348C481.092 197.062 476.257 191.083 469.872 186.53ZM433.905 242.131L433.928 242.101C434.693 241.1 435.39 239.71 435.896 237.773L435.934 237.631L435.978 237.49C436.552 235.663 436.907 233.269 436.907 230.197C436.907 227.864 436.596 226.771 436.441 226.428C436.354 226.235 436.278 226.093 436.219 225.994L436.192 225.949L436.178 225.939H424.678L420.774 244.594H431.023C431.086 244.581 431.329 244.516 431.779 244.244C432.29 243.935 433.014 243.325 433.883 242.16L433.905 242.131Z' fill='%23E6007A'/%3E%3Cmask id='path-6-outside-1_873_174' maskUnits='userSpaceOnUse' x='35.8232' y='166.788' width='435' height='156' fill='black'%3E%3Crect fill='white' x='35.8232' y='166.788' width='435' height='156'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z'/%3E%3C/mask%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' stroke='white' stroke-width='0.3' mask='url(%23path-6-outside-1_873_174)'/%3E%3C/g%3E%3Cdefs%3E%3CradialGradient id='paint0_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(-62.8 -86.4) rotate(70.436) scale(686.854 394.059)'%3E%3Cstop stop-color='%236335EC'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='paint1_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(640.4 677.6) rotate(-116.448) scale(1055.25 662.094)'%3E%3Cstop stop-color='%23E6007A'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CclipPath id='clip0_873_174'%3E%3Crect width='512' height='512' rx='256' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A" /> Pop CLI Signing Portal - - + + diff --git a/crates/pop-cli/src/commands/call/chain.rs b/crates/pop-cli/src/commands/call/chain.rs index b9d00d319..bdad7d868 100644 --- a/crates/pop-cli/src/commands/call/chain.rs +++ b/crates/pop-cli/src/commands/call/chain.rs @@ -4,10 +4,7 @@ use std::path::Path; use crate::{ cli::{self, traits::*}, - common::{ - wallet, - wallet::{prompt_to_use_wallet, request_signature}, - }, + common::wallet::{prompt_to_use_wallet, request_signature}, }; use anyhow::{anyhow, Result}; use clap::Args; diff --git a/crates/pop-cli/src/commands/call/contract.rs b/crates/pop-cli/src/commands/call/contract.rs index e69ea5040..17dec3196 100644 --- a/crates/pop-cli/src/commands/call/contract.rs +++ b/crates/pop-cli/src/commands/call/contract.rs @@ -4,7 +4,6 @@ use crate::{ cli::{self, traits::*}, common::{ contracts::has_contract_been_built, - wallet, wallet::{prompt_to_use_wallet, request_signature}, }, }; From b884f9d640352d807b7748f9bdfce6e4b9631415 Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 17 Dec 2024 08:59:07 -0700 Subject: [PATCH 11/25] feat: send remark on contracts-node launch --- crates/pop-contracts/src/node/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/pop-contracts/src/node/mod.rs b/crates/pop-contracts/src/node/mod.rs index be5680a04..60c25e867 100644 --- a/crates/pop-contracts/src/node/mod.rs +++ b/crates/pop-contracts/src/node/mod.rs @@ -19,6 +19,7 @@ use std::{ process::{Child, Command, Stdio}, time::Duration, }; +use subxt::{dynamic::Value, ext::scale_value::Composite, SubstrateConfig}; use tokio::time::sleep; const BIN_NAME: &str = "substrate-contracts-node"; @@ -133,6 +134,22 @@ pub async fn run_contracts_node( // Wait 5 secs until the node is ready sleep(Duration::from_millis(5000)).await; + + let data = Value::from_bytes(subxt::utils::to_hex("initialize contracts node")); + let payload = subxt::dynamic::tx("System", "remark", [data].to_vec()); + + let client = subxt::client::OnlineClient::::from_url(format!( + "ws://127.0.0.1:{}", + port + )) + .await + .map_err(|e| Error::AnyhowError(e.into()))?; + client + .tx() + .sign_and_submit_default(&payload, &subxt_signer::sr25519::dev::alice()) + .await + .map_err(|e| Error::AnyhowError(e.into()))?; + Ok(process) } From a4e9da222bdeea707dbc02796151b61655a901d8 Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 17 Dec 2024 09:02:20 -0700 Subject: [PATCH 12/25] chore: use cargo-contract crate release --- Cargo.lock | 20 ++++++++++++-------- Cargo.toml | 10 +++------- crates/pop-contracts/src/node/mod.rs | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1a17950f0..2a475b21f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2003,8 +2003,9 @@ checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" [[package]] name = "contract-build" -version = "5.0.1" -source = "git+https://github.com/use-ink/cargo-contract?branch=peter%2Fchore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" +version = "5.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b014fa89030235ecd8bdeb061ec97df326281b484f89ad3e17a79f08759c2f52" dependencies = [ "anyhow", "blake2", @@ -2043,8 +2044,9 @@ dependencies = [ [[package]] name = "contract-extrinsics" -version = "5.0.1" -source = "git+https://github.com/use-ink/cargo-contract?branch=peter%2Fchore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" +version = "5.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67d0c91349c31caec4d5e3c544b4bc4fcc7c0468dc49ee84a96a24f915464401" dependencies = [ "anyhow", "blake2", @@ -2075,8 +2077,9 @@ dependencies = [ [[package]] name = "contract-metadata" -version = "5.0.1" -source = "git+https://github.com/use-ink/cargo-contract?branch=peter%2Fchore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" +version = "5.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83ae8bcb5f7c5ea033d05fa0bbffa4e762a5b69c0ce96e4188fb15385a01998b" dependencies = [ "anyhow", "impl-serde 0.5.0", @@ -2088,8 +2091,9 @@ dependencies = [ [[package]] name = "contract-transcode" -version = "5.0.1" -source = "git+https://github.com/use-ink/cargo-contract?branch=peter%2Fchore-make-types-pub#7c8fc481912d7a6f416a0f72e37840123064f90d" +version = "5.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baca96dc859fd180eba5f15e468f59dc8c932a6b72f6b76f91b571b6743a9e7d" dependencies = [ "anyhow", "base58", diff --git a/Cargo.toml b/Cargo.toml index c96a1bfe6..2224587fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,13 +51,9 @@ sp-core = "32.0.0" sp-weights = "31.0.0" scale-info = { version = "2.11.4", default-features = false, features = ["derive"] } scale-value = { version = "0.17.0", default-features = false, features = ["from-string", "parser-ss58"] } -# TODO: git deps -#contract-build = "5.0.0-alpha" -contract-build = { git = "https://github.com/use-ink/cargo-contract", branch = "peter/chore-make-types-pub" } -#contract-extrinsics = "5.0.0-alpha" -contract-extrinsics = { git = "https://github.com/use-ink/cargo-contract", branch = "peter/chore-make-types-pub" } -#contract-transcode = "5.0.0" -contract-transcode = { git = "https://github.com/use-ink/cargo-contract", branch = "peter/chore-make-types-pub" } +contract-build = "5.0.2" +contract-extrinsics = "5.0.2" +contract-transcode = "5.0.2" heck = "0.5.0" # parachains diff --git a/crates/pop-contracts/src/node/mod.rs b/crates/pop-contracts/src/node/mod.rs index 60c25e867..a7d067b76 100644 --- a/crates/pop-contracts/src/node/mod.rs +++ b/crates/pop-contracts/src/node/mod.rs @@ -19,7 +19,7 @@ use std::{ process::{Child, Command, Stdio}, time::Duration, }; -use subxt::{dynamic::Value, ext::scale_value::Composite, SubstrateConfig}; +use subxt::{dynamic::Value, SubstrateConfig}; use tokio::time::sleep; const BIN_NAME: &str = "substrate-contracts-node"; From 0e19b8a6cc693a545ffa9cd62eaff9e744127fb6 Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 17 Dec 2024 10:31:40 -0700 Subject: [PATCH 13/25] feat(wallet): choose random port for server --- crates/pop-cli/src/common/wallet.rs | 6 +- crates/pop-cli/src/wallet_integration.rs | 128 +++++++++++++---------- 2 files changed, 73 insertions(+), 61 deletions(-) diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs index f084cc6f9..c29986ffa 100644 --- a/crates/pop-cli/src/common/wallet.rs +++ b/crates/pop-cli/src/common/wallet.rs @@ -20,9 +20,9 @@ pub async fn request_signature(call_data: Vec, url: String) -> anyhow::Resul let ui = FrontendFromString::new(include_str!("../assets/index.html").to_string()); let transaction_data = TransactionData::new(url, call_data); - // starts server - let mut wallet = WalletIntegrationManager::new(ui, transaction_data); - log::step(format!("Wallet signing portal started at http://{}", wallet.rpc_url))?; + // Starts server with random port. + let mut wallet = WalletIntegrationManager::new(ui, transaction_data, None); + log::step(format!("Wallet signing portal started at http://{}", wallet.server_url))?; let spinner = spinner(); spinner.start("Waiting for signature... Press Ctrl+C to terminate early."); diff --git a/crates/pop-cli/src/wallet_integration.rs b/crates/pop-cli/src/wallet_integration.rs index b179f21ce..bb55ffd9c 100644 --- a/crates/pop-cli/src/wallet_integration.rs +++ b/crates/pop-cli/src/wallet_integration.rs @@ -4,6 +4,7 @@ use axum::{ routing::{get, post}, Router, }; +use pop_common::find_free_port; use serde::Serialize; use std::{path::PathBuf, sync::Arc}; use tokio::{ @@ -52,30 +53,38 @@ pub struct StateHandler { /// Manages the wallet integration for secure signing of transactions. pub struct WalletIntegrationManager { + pub server_url: String, /// Shared state between routes. pub state: Arc>, - /// Node rpc address. - pub rpc_url: String, /// Web server task handle. pub task_handle: JoinHandle>, } impl WalletIntegrationManager { /// Launches a server for hosting the wallet integration. Server launched in separate task. - /// Uses default address of 127.0.0.1:9090. /// # Arguments /// * `frontend`: A frontend with custom route to serve content. /// * `payload`: Payload to be sent to the frontend for signing. + /// * `maybe_port`: Optional port for server to bind to. `None` will result in a random port. /// /// # Returns /// A `WalletIntegrationManager` instance, with access to the state and task handle for the /// server. - pub fn new(frontend: F, payload: TransactionData) -> Self { - Self::new_with_address(frontend, payload, "127.0.0.1:9090") + pub fn new( + frontend: F, + payload: TransactionData, + maybe_port: Option, + ) -> Self { + let port = if let Some(port) = maybe_port { port } else { find_free_port().to_string() }; + Self::new_with_address(frontend, payload, format!("127.0.0.1:{}", port)) } /// Same as `new`, but allows specifying the address to bind to. - pub fn new_with_address(frontend: F, payload: TransactionData, rpc: &str) -> Self { + pub fn new_with_address( + frontend: F, + payload: TransactionData, + server_url: String, + ) -> Self { // Channel to signal shutdown. let (tx, rx) = oneshot::channel(); @@ -87,10 +96,8 @@ impl WalletIntegrationManager { let payload = Arc::new(payload); - // TODO: temporary until we host from here. let cors = tower_http::cors::CorsLayer::new() - .allow_origin("http://localhost:9090".parse::().unwrap()) - .allow_origin("http://127.0.0.1:9090".parse::().unwrap()) + .allow_origin(server_url.parse::().unwrap()) .allow_methods(Any) // Allow any HTTP method .allow_headers(Any); // Allow any headers (like 'Content-Type') @@ -102,13 +109,13 @@ impl WalletIntegrationManager { .merge(frontend.serve_content()) // Custom route for serving frontend. .layer(cors); - let rpc_owned = rpc.to_string(); + let url_owned = server_url.to_string(); // Will shut down when the signed payload is received. let task_handle = tokio::spawn(async move { - let listener = tokio::net::TcpListener::bind(&rpc_owned) + let listener = tokio::net::TcpListener::bind(&url_owned) .await - .map_err(|e| anyhow::anyhow!("Failed to bind to {}: {}", rpc_owned, e))?; + .map_err(|e| anyhow::anyhow!("Failed to bind to {}: {}", url_owned, e))?; axum::serve(listener, app) .with_graceful_shutdown(async move { @@ -119,7 +126,7 @@ impl WalletIntegrationManager { Ok(()) }); - Self { state, rpc_url: rpc.to_string(), task_handle } + Self { state, server_url, task_handle } } /// Signals the wallet integration server to shut down. @@ -277,9 +284,10 @@ mod tests { #[tokio::test] async fn new_works() { let frontend = FrontendFromString::new(TEST_HTML.to_string()); - let mut wim = WalletIntegrationManager::new(frontend, default_payload()); + let mut wim = + WalletIntegrationManager::new(frontend, default_payload(), Some("9090".to_string())); - assert_eq!(wim.rpc_url, "127.0.0.1:9090"); + assert_eq!(wim.server_url, "127.0.0.1:9090"); assert_eq!(wim.is_running(), true); assert!(wim.state.lock().await.shutdown_tx.is_some()); assert!(wim.state.lock().await.signed_payload.is_none()); @@ -289,6 +297,33 @@ mod tests { assert!(wim.task_handle.await.is_ok()); } + #[tokio::test] + async fn new_with_random_port_works() { + let servers = (0..3) + .map(|_| { + let frontend = FrontendFromString::new(TEST_HTML.to_string()); + WalletIntegrationManager::new(frontend, default_payload(), None) + }) + .collect::>(); + + // Ensure all server URLs are unique + for i in 0..servers.len() { + for j in (i + 1)..servers.len() { + assert_ne!(servers[i].server_url, servers[j].server_url); + } + } + + assert!(servers.iter().all(|server| server.is_running())); + for mut server in servers.into_iter() { + assert!(server.state.lock().await.shutdown_tx.is_some()); + assert!(server.state.lock().await.signed_payload.is_none()); + server.terminate().await.expect("Server termination should not fail"); + + let task_result = server.task_handle.await; + assert!(task_result.is_ok()); + } + } + #[test] fn new_transaction_data_works() { let chain_rpc = "localhost:9944".to_string(); @@ -302,7 +337,7 @@ mod tests { #[tokio::test] async fn take_error_works() { let frontend = FrontendFromString::new(TEST_HTML.to_string()); - let mut wim = WalletIntegrationManager::new(frontend, default_payload()); + let mut wim = WalletIntegrationManager::new(frontend, default_payload(), None); assert_eq!(wim.take_error().await, None); @@ -316,16 +351,13 @@ mod tests { #[tokio::test] async fn payload_handler_works() { // offset port per test to avoid conflicts - let addr = "127.0.0.1:9091"; let frontend = FrontendFromString::new(TEST_HTML.to_string()); - let expected_payload = TransactionData { chain_rpc: "localhost:9944".to_string(), call_data: vec![1, 2, 3] }; - let mut wim = - WalletIntegrationManager::new_with_address(frontend, expected_payload.clone(), addr); + let mut wim = WalletIntegrationManager::new(frontend, expected_payload.clone(), None); wait().await; - let addr = format!("http://{}", wim.rpc_url); + let addr = format!("http://{}", wim.server_url); let actual_payload = reqwest::get(&format!("{}/payload", addr)) .await .expect("Failed to get payload") @@ -342,14 +374,11 @@ mod tests { #[tokio::test] async fn submit_handler_works() { - // offset port per test to avoid conflicts - let addr = "127.0.0.1:9092"; let frontend = FrontendFromString::new(TEST_HTML.to_string()); - - let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + let mut wim = WalletIntegrationManager::new(frontend, default_payload(), None); wait().await; - let addr = format!("http://{}", wim.rpc_url); + let addr = format!("http://{}", wim.server_url); let response = reqwest::Client::new() .post(&format!("{}/submit", addr)) .json(&"0xDEADBEEF") @@ -370,14 +399,11 @@ mod tests { #[tokio::test] async fn error_handler_works() { - // offset port per test to avoid conflicts - let addr = "127.0.0.1:9093"; let frontend = FrontendFromString::new(TEST_HTML.to_string()); - - let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + let mut wim = WalletIntegrationManager::new(frontend, default_payload(), None); wait().await; - let addr = format!("http://{}", wim.rpc_url); + let addr = format!("http://{}", wim.server_url); let response = reqwest::Client::new() .post(&format!("{}/error", addr)) .json(&"an error occurred") @@ -399,14 +425,12 @@ mod tests { #[tokio::test] async fn terminate_handler_works() { - // offset port per test to avoid conflicts - let addr = "127.0.0.1:9094"; let frontend = FrontendFromString::new(TEST_HTML.to_string()); - let wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + let wim = WalletIntegrationManager::new(frontend, default_payload(), None); wait().await; - let addr = format!("http://{}", wim.rpc_url); + let addr = format!("http://{}", wim.server_url); let response = reqwest::Client::new() .post(&format!("{}/terminate", addr)) .send() @@ -425,13 +449,9 @@ mod tests { #[tokio::test] async fn wallet_terminate_works() { - // offset port per test to avoid conflicts - let addr = "127.0.0.1:9095"; - let frontend = FrontendFromString::new(TEST_HTML.to_string()); - let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); - + let mut wim = WalletIntegrationManager::new(frontend, default_payload(), None); assert_eq!(wim.is_running(), true); wim.terminate().await.expect("Termination should not fail"); wait().await; @@ -443,14 +463,11 @@ mod tests { #[tokio::test] async fn frontend_from_string_works() { - // offset port per test to avoid conflicts - let addr = "127.0.0.1:9096"; - let frontend = FrontendFromString::new(TEST_HTML.to_string()); - let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + let mut wim = WalletIntegrationManager::new(frontend, default_payload(), None); wait().await; - let actual_content = reqwest::get(&format!("http://{}", addr)) + let actual_content = reqwest::get(&format!("http://{}", wim.server_url)) .await .expect("Failed to get web page") .text() @@ -468,9 +485,6 @@ mod tests { use std::fs; use tempfile::tempdir; - // offset port per test to avoid conflicts - let addr = "127.0.0.1:9097"; - let temp_dir = tempdir().expect("Failed to create temp directory"); let index_file_path = temp_dir.path().join("index.html"); @@ -478,10 +492,10 @@ mod tests { fs::write(&index_file_path, test_html).expect("Failed to write index.html"); let frontend = FrontendFromDir::new(temp_dir.path().to_path_buf()); - let mut wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + let mut wim = WalletIntegrationManager::new(frontend, default_payload(), None); wait().await; - let actual_content = reqwest::get(&format!("http://{}", addr)) + let actual_content = reqwest::get(&format!("http://{}", wim.server_url)) .await .expect("Failed to get web page") .text() @@ -496,8 +510,6 @@ mod tests { #[tokio::test] async fn large_payload_works() { - // offset port per test to avoid conflicts - let addr = "127.0.0.1:9098"; let frontend = FrontendFromString::new(TEST_HTML.to_string()); let call_data_5mb = vec![99u8; 5 * 1024 * 1024]; @@ -506,11 +518,10 @@ mod tests { chain_rpc: "localhost:9944".to_string(), call_data: call_data_5mb.clone(), }; - let mut wim = - WalletIntegrationManager::new_with_address(frontend, expected_payload.clone(), addr); + let mut wim = WalletIntegrationManager::new(frontend, expected_payload.clone(), None); wait().await; - let addr = format!("http://{}", wim.rpc_url); + let addr = format!("http://{}", wim.server_url); let actual_payload = reqwest::get(&format!("{}/payload", addr)) .await .expect("Failed to get payload") @@ -528,17 +539,18 @@ mod tests { #[tokio::test] async fn new_with_conflicting_address_fails() { // offset port per test to avoid conflicts - let addr = "127.0.0.1:9099"; + let addr = "127.0.0.1:9099".to_string(); let frontend = FrontendFromString::new(TEST_HTML.to_string()); - let wim = WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + let wim = + WalletIntegrationManager::new_with_address(frontend, default_payload(), addr.clone()); wait().await; assert_eq!(wim.is_running(), true); let frontend = FrontendFromString::new(TEST_HTML.to_string()); let wim_conflict = - WalletIntegrationManager::new_with_address(frontend, default_payload(), addr); + WalletIntegrationManager::new_with_address(frontend, default_payload(), addr.clone()); wait().await; assert_eq!(wim_conflict.is_running(), false); From b2a6dcb8b95d53317ed658ab2af6bde5edcffdde Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 17 Dec 2024 10:45:36 -0700 Subject: [PATCH 14/25] feat(wallet): auto-open browser --- Cargo.lock | 37 +++++ Cargo.toml | 1 + crates/pop-cli/Cargo.toml | 1 + crates/pop-cli/src/assets/index.html | 202 +++++++++++++-------------- crates/pop-cli/src/common/wallet.rs | 13 +- 5 files changed, 150 insertions(+), 104 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a475b21f..f581a91d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5036,6 +5036,15 @@ version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + [[package]] name = "is-terminal" version = "0.4.13" @@ -5047,6 +5056,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -6193,6 +6212,17 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "open" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ecd52f0b8d15c40ce4820aa251ed5de032e5d91fab27f7db2f40d42a8bdf69c" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + [[package]] name = "openssl" version = "0.10.68" @@ -8441,6 +8471,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + [[package]] name = "pbkdf2" version = "0.12.2" @@ -9327,6 +9363,7 @@ dependencies = [ "duct", "env_logger 0.11.5", "git2", + "open", "os_info", "pop-common", "pop-contracts", diff --git a/Cargo.toml b/Cargo.toml index 2224587fa..d1cfcb270 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,4 +78,5 @@ strum_macros = "0.26" # wallet-integration axum = "0.7.9" +open = "5.3.1" tower-http = "0.6.2" diff --git a/crates/pop-cli/Cargo.toml b/crates/pop-cli/Cargo.toml index 695cf231b..34e51111d 100644 --- a/crates/pop-cli/Cargo.toml +++ b/crates/pop-cli/Cargo.toml @@ -49,6 +49,7 @@ pop-common = { path = "../pop-common", version = "0.5.0" } # wallet-integration axum.workspace = true +open.workspace = true tower-http = { workspace = true, features = ["fs", "cors"] } [dev-dependencies] diff --git a/crates/pop-cli/src/assets/index.html b/crates/pop-cli/src/assets/index.html index d1d355b01..0ea7aa6af 100644 --- a/crates/pop-cli/src/assets/index.html +++ b/crates/pop-cli/src/assets/index.html @@ -7,7 +7,7 @@ href="data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_873_174)'%3E%3Crect width='512' height='512' rx='256' fill='%231C0533'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint0_radial_873_174)' fill-opacity='0.8'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint1_radial_873_174)' fill-opacity='0.6'/%3E%3Cmask id='mask0_873_174' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='-429' y='-502' width='1428' height='1351'%3E%3Cpath d='M127.637 -501.289L998.911 322.903L984.661 336.383L113.388 -487.809L127.637 -501.289Z' fill='%23D9D9D9'/%3E%3Cpath d='M88.9594 -464.701L960.232 359.491L945.983 372.971L74.7096 -451.221L88.9594 -464.701Z' fill='%23D9D9D9'/%3E%3Cpath d='M50.2814 -428.113L921.554 396.079L907.305 409.559L36.0316 -414.633L50.2814 -428.113Z' fill='%23D9D9D9'/%3E%3Cpath d='M11.6034 -391.525L882.876 432.667L868.627 446.147L-2.64642 -378.045L11.6034 -391.525Z' fill='%23D9D9D9'/%3E%3Cpath d='M-27.0746 -354.937L844.198 469.255L829.949 482.735L-41.3244 -341.457L-27.0746 -354.937Z' fill='%23D9D9D9'/%3E%3Cpath d='M-65.7526 -318.349L805.52 505.843L791.271 519.323L-80.0024 -304.869L-65.7526 -318.349Z' fill='%23D9D9D9'/%3E%3Cpath d='M-104.431 -281.761L766.842 542.431L752.593 555.911L-118.68 -268.281L-104.431 -281.761Z' fill='%23D9D9D9'/%3E%3Cpath d='M-143.109 -245.173L728.164 579.019L713.915 592.499L-157.358 -231.693L-143.109 -245.173Z' fill='%23D9D9D9'/%3E%3Cpath d='M-181.787 -208.585L689.486 615.607L675.237 629.087L-196.036 -195.105L-181.787 -208.585Z' fill='%23D9D9D9'/%3E%3Cpath d='M-220.465 -171.997L650.808 652.195L636.559 665.675L-234.714 -158.517L-220.465 -171.997Z' fill='%23D9D9D9'/%3E%3Cpath d='M-259.143 -135.409L612.13 688.783L597.881 702.263L-273.392 -121.929L-259.143 -135.409Z' fill='%23D9D9D9'/%3E%3Cpath d='M-297.821 -98.8211L573.452 725.371L559.203 738.851L-312.07 -85.3413L-297.821 -98.8211Z' fill='%23D9D9D9'/%3E%3Cpath d='M-336.499 -62.2331L534.774 761.959L520.525 775.439L-350.748 -48.7533L-336.499 -62.2331Z' fill='%23D9D9D9'/%3E%3Cpath d='M-375.177 -25.6452L496.096 798.547L481.847 812.026L-389.426 -12.1654L-375.177 -25.6452Z' fill='%23D9D9D9'/%3E%3Cpath d='M-413.855 10.9428L457.418 835.135L443.169 848.615L-428.104 24.4225L-413.855 10.9428Z' fill='%23D9D9D9'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_873_174)'%3E%3Cpath d='M511.169 254.929C511.169 396.905 396.739 512 255.584 512C114.428 512 -0.000976562 396.905 -0.000976562 254.929C-0.000976562 112.953 114.428 -2.14209 255.584 -2.14209C396.739 -2.14209 511.169 112.953 511.169 254.929Z' fill='%23E6007A'/%3E%3C/g%3E%3Cpath d='M183.804 160.44C171.052 151.144 156.458 147.168 141.864 147.168H52.2334L5.63086 367.567H122.684L132.083 322.765C141.879 321.622 151.384 318.84 160.403 314.394C161.8 313.705 163.178 312.986 164.536 312.239C168.249 321.014 173.177 329.173 179.315 336.581C187.573 346.548 197.657 354.366 209.117 360.016L209.12 360.018L209.517 360.213L209.917 360.399C222.605 366.289 236.098 368.784 249.63 368.784C263.218 368.784 276.507 366.489 289.292 361.868C295.36 359.675 301.212 357.046 306.832 353.988L303.961 367.567H421.013L430.413 322.765C440.209 321.622 449.714 318.84 458.733 314.394C469.61 309.03 479.317 301.877 487.672 293.046L487.682 293.035L487.841 292.867L487.995 292.7L487.998 292.697C496.09 283.931 502.611 273.995 507.338 262.975C512.203 251.631 514.88 239.536 514.88 226.953C514.88 214.447 512.231 202.327 507.001 190.977C501.508 178.753 493.141 168.335 482.134 160.44C469.382 151.144 454.788 147.168 440.194 147.168H350.563L345.323 171.949C338.297 165.041 330.227 159.445 321.314 155.191C308.55 148.958 294.91 146.357 281.28 146.357C267.691 146.357 254.402 148.652 241.618 153.273C229.473 157.663 218.174 163.78 207.814 171.541C205.377 173.358 203.011 175.252 200.715 177.221C196.062 170.823 190.408 165.177 183.804 160.44Z' fill='%232B0532'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M229.569 331.163L229.632 331.194L229.696 331.224C237.592 334.889 246.407 336.65 256.019 336.65C265.979 336.65 275.609 334.978 284.877 331.628C294.055 328.31 302.528 323.689 310.277 317.771C317.967 311.898 324.68 305.15 330.397 297.531L330.413 297.509L330.429 297.487C336.137 289.737 340.585 281.451 343.748 272.638C347.074 263.611 348.753 254.388 348.753 244.999C348.753 236.541 347.45 228.398 344.825 220.6C342.311 212.598 338.452 205.423 333.24 199.132C327.963 192.763 321.484 187.769 313.875 184.16C306.078 180.325 297.295 178.491 287.67 178.491C277.709 178.491 268.079 180.164 258.812 183.513C249.647 186.826 241.125 191.437 233.261 197.332C225.542 203.084 218.751 209.844 212.899 217.597L212.889 217.611C207.16 225.246 202.642 233.54 199.345 242.478L199.33 242.518L199.316 242.559C196.135 251.575 194.532 260.778 194.532 270.142C194.532 278.624 195.843 286.844 198.472 294.776L198.477 294.792L198.482 294.808C201.135 302.663 205.057 309.744 210.248 316.009C215.517 322.37 221.981 327.422 229.569 331.163ZM287.732 276.015L287.742 276C290.74 271.657 292.939 267.045 294.364 262.148C295.831 257.108 296.54 252.276 296.54 247.635C296.54 243.3 295.843 239.458 294.528 236.043L294.487 235.934L294.449 235.824C293.328 232.545 291.583 230.131 289.252 228.349C287.226 226.801 284.199 225.736 279.606 225.736C274.271 225.736 269.81 226.979 266.027 229.305L265.974 229.337L265.921 229.368C261.869 231.746 258.495 234.905 255.765 238.909C252.893 243.123 250.673 247.698 249.104 252.654C247.65 257.67 246.947 262.48 246.947 267.101C246.947 271.459 247.585 275.422 248.809 279.033C250.055 282.339 251.89 284.885 254.293 286.836C256.34 288.379 259.301 289.405 263.68 289.405C269.175 289.405 273.697 288.15 277.46 285.837C281.567 283.313 284.975 280.058 287.722 276.029L287.732 276.015Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M171.542 186.53C164.879 181.64 157.017 179.302 148.254 179.302H84.4909L51.4775 335.434H103.163L112.436 291.23H128.094C136.792 291.23 145.029 289.337 152.73 285.54C160.225 281.844 166.856 276.954 172.594 270.888L172.619 270.861L172.644 270.834C178.339 264.665 182.824 257.798 186.062 250.247C189.323 242.645 190.992 234.866 190.992 226.953C190.992 219.052 189.327 211.496 186.009 204.348C182.762 197.062 177.927 191.083 171.542 186.53ZM135.575 242.131L135.598 242.101C136.363 241.1 137.06 239.71 137.567 237.773L137.604 237.631L137.648 237.49C138.222 235.663 138.577 233.269 138.577 230.197C138.577 227.864 138.266 226.771 138.111 226.428C138.024 226.235 137.948 226.093 137.889 225.994L137.862 225.949L137.849 225.939H126.349L122.444 244.594H132.693C132.756 244.581 132.999 244.516 133.45 244.244C133.961 243.935 134.685 243.325 135.553 242.16L135.575 242.131Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M469.872 186.53C463.209 181.64 455.347 179.302 446.583 179.302H382.821L349.807 335.434H401.493L410.766 291.23H426.424C435.122 291.23 443.359 289.337 451.06 285.54C458.555 281.844 465.186 276.954 470.923 270.888L470.949 270.861L470.973 270.834C476.669 264.665 481.153 257.798 484.392 250.247C487.652 242.645 489.322 234.866 489.322 226.953C489.322 219.052 487.657 211.496 484.339 204.348C481.092 197.062 476.257 191.083 469.872 186.53ZM433.905 242.131L433.928 242.101C434.693 241.1 435.39 239.71 435.896 237.773L435.934 237.631L435.978 237.49C436.552 235.663 436.907 233.269 436.907 230.197C436.907 227.864 436.596 226.771 436.441 226.428C436.354 226.235 436.278 226.093 436.219 225.994L436.192 225.949L436.178 225.939H424.678L420.774 244.594H431.023C431.086 244.581 431.329 244.516 431.779 244.244C432.29 243.935 433.014 243.325 433.883 242.16L433.905 242.131Z' fill='%23E6007A'/%3E%3Cmask id='path-6-outside-1_873_174' maskUnits='userSpaceOnUse' x='35.8232' y='166.788' width='435' height='156' fill='black'%3E%3Crect fill='white' x='35.8232' y='166.788' width='435' height='156'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z'/%3E%3C/mask%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' stroke='white' stroke-width='0.3' mask='url(%23path-6-outside-1_873_174)'/%3E%3C/g%3E%3Cdefs%3E%3CradialGradient id='paint0_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(-62.8 -86.4) rotate(70.436) scale(686.854 394.059)'%3E%3Cstop stop-color='%236335EC'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='paint1_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(640.4 677.6) rotate(-116.448) scale(1055.25 662.094)'%3E%3Cstop stop-color='%23E6007A'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CclipPath id='clip0_873_174'%3E%3Crect width='512' height='512' rx='256' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A" /> Pop CLI Signing Portal - + `],K);s$=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}([NA("dc-connection-button")],s$);const a$={chains:{},wallets:[new class extends qE{constructor(e){super(),X(this,"options"),this.options=e}async getWallets(){return await sS,(()=>{const{injectedWeb3:e}=window;return e?Object.keys(e):[]})().map((e=>new iS(e,this.options)))}}]};function l$(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function c$(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function u$(...e){return t=>{let n=!1;const r=e.map((e=>{const r=c$(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t{const t=n.map((e=>qe.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return qe.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=qe.createContext(r),i=n.length;n=[...n,r];const s=t=>{var n;const{scope:r,children:s,...a}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[i])||o,c=qe.useMemo((()=>a),Object.values(a));return nt.jsx(l.Provider,{value:c,children:s})};return s.displayName=t+"Provider",[s,function(n,s){var a;const l=(null==(a=null==s?void 0:s[e])?void 0:a[i])||o,c=qe.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},p$(r,...t)]}function p$(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return qe.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function h$(e){const t=qe.useRef(e);return qe.useEffect((()=>{t.current=e})),qe.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function v$({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=qe.useState(e),[r]=n,o=qe.useRef(r),i=h$(t);return qe.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,a=h$(n);return[s,qe.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&a(n)}else o(t)}),[i,e,o,a])]}!function(e){xA.next(e.wallets)}({wallets:a$.wallets});var m$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e,o=qe.Children.toArray(n),i=o.find(b$);if(i){const e=i.props.children,n=o.map((t=>t===i?qe.Children.count(e)>1?qe.Children.only(null):qe.isValidElement(e)?e.props.children:null:t));return nt.jsx(g$,{...r,ref:t,children:qe.isValidElement(e)?qe.cloneElement(e,void 0,n):null})}return nt.jsx(g$,{...r,ref:t,children:n})}));m$.displayName="Slot";var g$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e;if(qe.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n);return qe.cloneElement(n,{...w$(r,n.props),ref:t?u$(t,e):e})}return qe.Children.count(n)>1?qe.Children.only(null):null}));g$.displayName="SlotClone";var y$=({children:e})=>nt.jsx(nt.Fragment,{children:e});function b$(e){return qe.isValidElement(e)&&e.type===y$}function w$(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var x$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=qe.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?m$:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),nt.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function k$(e,t){e&&df.flushSync((()=>e.dispatchEvent(t)))}function E$(e){const t=e+"CollectionProvider",[n,r]=f$(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,r=Ke.useRef(null),i=Ke.useRef(new Map).current;return nt.jsx(o,{scope:t,itemMap:i,collectionRef:r,children:n})};s.displayName=t;const a=e+"CollectionSlot",l=Ke.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=d$(t,i(a,n).collectionRef);return nt.jsx(m$,{ref:o,children:r})}));l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=Ke.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,s=Ke.useRef(null),a=d$(t,s),l=i(c,n);return Ke.useEffect((()=>(l.itemMap.set(s,{ref:s,...o}),()=>{l.itemMap.delete(s)}))),nt.jsx(m$,{[u]:"",ref:a,children:r})}));return d.displayName=c,[{Provider:s,Slot:l,ItemSlot:d},function(t){const n=i(e+"CollectionConsumer",t),r=Ke.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${u}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}var S$=qe.createContext(void 0);function C$(e){const t=qe.useContext(S$);return e||t||"ltr"}var _$,A$="dismissableLayer.update",N$="dismissableLayer.pointerDownOutside",P$="dismissableLayer.focusOutside",$$=qe.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),O$=qe.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=qe.useContext($$),[u,d]=qe.useState(null),f=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=qe.useState({}),h=d$(t,(e=>d(e))),v=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(m),y=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,w=y>=g,x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=h$(e),r=qe.useRef(!1),o=qe.useRef((()=>{}));return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){j$(N$,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));w&&!n&&(null==o||o(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f),k=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=h$(e),r=qe.useRef(!1);return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){j$(P$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=h$(e);qe.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{y===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&a&&(e.preventDefault(),a()))}),f),qe.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(_$=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),R$(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=_$)}}),[u,f,n,c]),qe.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),R$())}),[u,c]),qe.useEffect((()=>{const e=()=>p({});return document.addEventListener(A$,e),()=>document.removeEventListener(A$,e)}),[]),nt.jsx(x$.div,{...l,ref:h,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:l$(e.onFocusCapture,k.onFocusCapture),onBlurCapture:l$(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:l$(e.onPointerDownCapture,x.onPointerDownCapture)})}));O$.displayName="DismissableLayer";function R$(){const e=new CustomEvent(A$);document.dispatchEvent(e)}function j$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?k$(o,i):o.dispatchEvent(i)}qe.forwardRef(((e,t)=>{const n=qe.useContext($$),r=qe.useRef(null),o=d$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),nt.jsx(x$.div,{...e,ref:o})})).displayName="DismissableLayerBranch";var M$=0;function T$(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var L$="focusScope.autoFocusOnMount",z$="focusScope.autoFocusOnUnmount",I$={bubbles:!1,cancelable:!0},D$=qe.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=qe.useState(null),c=h$(o),u=h$(i),d=qe.useRef(null),f=d$(t,(e=>l(e))),p=qe.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;qe.useEffect((()=>{if(r){let e=function(e){if(p.paused||!a)return;const t=e.target;a.contains(t)?d.current=t:H$(d.current,{select:!0})},t=function(e){if(p.paused||!a)return;const t=e.relatedTarget;null!==t&&(a.contains(t)||H$(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&H$(a)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,a,p.paused]),qe.useEffect((()=>{if(a){V$.add(p);const t=document.activeElement;if(!a.contains(t)){const n=new CustomEvent(L$,I$);a.addEventListener(L$,c),a.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(H$(r,{select:t}),document.activeElement!==n)return}((e=B$(a),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&H$(a))}return()=>{a.removeEventListener(L$,c),setTimeout((()=>{const e=new CustomEvent(z$,I$);a.addEventListener(z$,u),a.dispatchEvent(e),e.defaultPrevented||H$(t??document.body,{select:!0}),a.removeEventListener(z$,u),V$.remove(p)}),0)}}var e}),[a,c,u,p]);const h=qe.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=B$(e),n=U$(t,e),r=U$(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&H$(i,{select:!0})):(e.preventDefault(),n&&H$(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return nt.jsx(x$.div,{tabIndex:-1,...s,ref:f,onKeyDown:h})}));function B$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function U$(e,t){for(const n of e)if(!F$(n,{upTo:t}))return n}function F$(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function H$(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}D$.displayName="FocusScope";var V$=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=W$(e,t),e.unshift(t)},remove(t){var n;e=W$(e,t),null==(n=e[0])||n.resume()}}}();function W$(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var q$=Boolean(null==globalThis?void 0:globalThis.document)?qe.useLayoutEffect:()=>{},K$=Qe["useId".toString()]||(()=>{}),Q$=0;function Y$(e){const[t,n]=qe.useState(K$());return q$((()=>{n((e=>e??String(Q$++)))}),[e]),t?`radix-${t}`:""}const G$=["top","right","bottom","left"],J$=Math.min,X$=Math.max,Z$=Math.round,eO=Math.floor,tO=e=>({x:e,y:e}),nO={left:"right",right:"left",bottom:"top",top:"bottom"},rO={start:"end",end:"start"};function oO(e,t,n){return X$(e,J$(t,n))}function iO(e,t){return"function"==typeof e?e(t):e}function sO(e){return e.split("-")[0]}function aO(e){return e.split("-")[1]}function lO(e){return"x"===e?"y":"x"}function cO(e){return"y"===e?"height":"width"}function uO(e){return["top","bottom"].includes(sO(e))?"y":"x"}function dO(e){return lO(uO(e))}function fO(e){return e.replace(/start|end/g,(e=>rO[e]))}function pO(e){return e.replace(/left|right|bottom|top/g,(e=>nO[e]))}function hO(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function vO(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function mO(e,t,n){let{reference:r,floating:o}=e;const i=uO(t),s=dO(t),a=cO(s),l=sO(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(aO(t)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1)}return p}async function gO(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=iO(t,e),h=hO(p),v=a[f?"floating"===d?"reference":"floating":d],m=vO(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=vO(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:l}):g);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}function yO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bO(e){return G$.some((t=>e[t]>=0))}function wO(){return"undefined"!=typeof window}function xO(e){return SO(e)?(e.nodeName||"").toLowerCase():"#document"}function kO(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function EO(e){var t;return null==(t=(SO(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function SO(e){return!!wO()&&(e instanceof Node||e instanceof kO(e).Node)}function CO(e){return!!wO()&&(e instanceof Element||e instanceof kO(e).Element)}function _O(e){return!!wO()&&(e instanceof HTMLElement||e instanceof kO(e).HTMLElement)}function AO(e){return!(!wO()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof kO(e).ShadowRoot)}function NO(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=MO(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function PO(e){return["table","td","th"].includes(xO(e))}function $O(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(n){return!1}}))}function OO(e){const t=RO(),n=CO(e)?MO(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function RO(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function jO(e){return["html","body","#document"].includes(xO(e))}function MO(e){return kO(e).getComputedStyle(e)}function TO(e){return CO(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function LO(e){if("html"===xO(e))return e;const t=e.assignedSlot||e.parentNode||AO(e)&&e.host||EO(e);return AO(t)?t.host:t}function zO(e){const t=LO(e);return jO(t)?e.ownerDocument?e.ownerDocument.body:e.body:_O(t)&&NO(t)?t:zO(t)}function IO(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=zO(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=kO(o);if(i){const e=DO(s);return t.concat(s,s.visualViewport||[],NO(o)?o:[],e&&n?IO(e):[])}return t.concat(o,IO(o,[],n))}function DO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function BO(e){const t=MO(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=_O(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Z$(n)!==i||Z$(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function UO(e){return CO(e)?e:e.contextElement}function FO(e){const t=UO(e);if(!_O(t))return tO(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=BO(t);let s=(i?Z$(n.width):n.width)/r,a=(i?Z$(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const HO=tO(0);function VO(e){const t=kO(e);return RO()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:HO}function WO(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=UO(e);let s=tO(1);t&&(r?CO(r)&&(s=FO(r)):s=FO(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==kO(e))&&t}(i,n,r)?VO(i):tO(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=kO(i),t=r&&CO(r)?kO(r):r;let n=e,o=DO(n);for(;o&&r&&t!==n;){const e=FO(o),t=o.getBoundingClientRect(),r=MO(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=kO(o),o=DO(n)}}return vO({width:u,height:d,x:l,y:c})}function qO(e,t){const n=TO(e).scrollLeft;return t?t.left+n:WO(EO(e)).left+n}function KO(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:qO(e,r)),y:r.top+t.scrollTop}}function QO(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=kO(e),r=EO(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=RO();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=EO(e),n=TO(e),r=e.ownerDocument.body,o=X$(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=X$(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+qO(e);const a=-n.scrollTop;return"rtl"===MO(r).direction&&(s+=X$(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(EO(e));else if(CO(t))r=function(e,t){const n=WO(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=_O(e)?FO(e):tO(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=VO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return vO(r)}function YO(e,t){const n=LO(e);return!(n===t||!CO(n)||jO(n))&&("fixed"===MO(n).position||YO(n,t))}function GO(e,t,n){const r=_O(t),o=EO(t),i="fixed"===n,s=WO(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=tO(0);if(r||!r&&!i)if(("body"!==xO(t)||NO(o))&&(a=TO(t)),r){const e=WO(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=qO(o));const c=!o||r||i?tO(0):KO(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function JO(e){return"static"===MO(e).position}function XO(e,t){if(!_O(e)||"fixed"===MO(e).position)return null;if(t)return t(e);let n=e.offsetParent;return EO(e)===n&&(n=n.ownerDocument.body),n}function ZO(e,t){const n=kO(e);if($O(e))return n;if(!_O(e)){let t=LO(e);for(;t&&!jO(t);){if(CO(t)&&!JO(t))return t;t=LO(t)}return n}let r=XO(e,t);for(;r&&PO(r)&&JO(r);)r=XO(r,t);return r&&jO(r)&&JO(r)&&!OO(r)?n:r||function(e){let t=LO(e);for(;_O(t)&&!jO(t);){if(OO(t))return t;if($O(t))return null;t=LO(t)}return null}(e)||n}const eR={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=EO(r),a=!!t&&$O(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=tO(1);const u=tO(0),d=_O(r);if((d||!d&&!i)&&(("body"!==xO(r)||NO(s))&&(l=TO(r)),_O(r))){const e=WO(r);c=FO(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!s||d||i?tO(0):KO(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:EO,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?$O(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=IO(e,[],!1).filter((e=>CO(e)&&"body"!==xO(e))),o=null;const i="fixed"===MO(e).position;let s=i?LO(e):e;for(;CO(s)&&!jO(s);){const t=MO(s),n=OO(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||NO(s)&&!n&&YO(e,s))?r=r.filter((e=>e!==s)):o=t,s=LO(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=QO(t,n,o);return e.top=X$(r.top,e.top),e.right=J$(r.right,e.right),e.bottom=J$(r.bottom,e.bottom),e.left=X$(r.left,e.left),e}),QO(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:ZO,getElementRects:async function(e){const t=this.getOffsetParent||ZO,n=this.getDimensions,r=await n(e.floating);return{reference:GO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=BO(e);return{width:t,height:n}},getScale:FO,isElement:CO,isRTL:function(e){return"rtl"===MO(e).direction}};function tR(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=UO(e),u=o||i?[...c?IO(c):[],...IO(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=EO(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const p={rootMargin:-eO(u)+"px "+-eO(o.clientWidth-(c+d))+"px "+-eO(o.clientHeight-(u+f))+"px "+-eO(c)+"px",threshold:X$(0,J$(1,l))||1};let h=!0;function v(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(m){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let v=l?WO(e):null;return l&&function t(){const r=WO(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const nR=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=sO(n),a=aO(n),l="y"===uO(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=iO(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},rR=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=iO(e,t),c={x:n,y:r},u=await gO(t,l),d=uO(sO(o)),f=lO(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=oO(p+u["y"===f?"top":"left"],p,p-u[e])}if(s){const e="y"===d?"bottom":"right";h=oO(h+u["y"===d?"top":"left"],h,h-u[e])}const v=a.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[d]:s}}}}}},oR=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...m}=iO(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=sO(o),y=uO(a),b=sO(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!v?[pO(a)]:function(e){const t=pO(e);return[fO(e),t,fO(t)]}(a)),k="none"!==h;!f&&k&&x.push(...function(e,t,n,r){const o=aO(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(sO(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(fO)))),i}(a,v,h,w));const E=[a,...x],S=await gO(t,m),C=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(S[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=aO(e),o=dO(e),i=cO(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=pO(s)),[s,pO(s)]}(o,s,w);C.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:o,overflows:C}],!C.every((e=>e<=0))){var A,N;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(N=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=_.filter((e=>{if(k){const t=uO(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},iR=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=iO(e,t),u=await gO(t,c),d=sO(o),f=aO(o),p="y"===uO(o),{width:h,height:v}=i.floating;let m,g;"top"===d||"bottom"===d?(m=d,g=f===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,m="end"===f?"top":"bottom");const y=v-u.top-u.bottom,b=h-u.left-u.right,w=J$(v-u[m],y),x=J$(h-u[g],b),k=!t.middlewareData.shift;let E=w,S=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),k&&!f){const e=X$(u.left,0),t=X$(u.right,0),n=X$(u.top,0),r=X$(u.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:X$(u.left,u.right)):E=v-2*(0!==n||0!==r?n+r:X$(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:E});const C=await s.getDimensions(a.floating);return h!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}},sR=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=iO(e,t);switch(r){case"referenceHidden":{const e=yO(await gO(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:bO(e)}}}case"escaped":{const e=yO(await gO(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:bO(e)}}}default:return{}}}}},aR=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=iO(e,t)||{};if(null==c)return{};const d=hO(u),f={x:n,y:r},p=dO(o),h=cO(p),v=await s.getDimensions(c),m="y"===p,g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-f[p]-i.floating[h],x=f[p]-i.reference[p],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=k?k[b]:0;E&&await(null==s.isElement?void 0:s.isElement(k))||(E=a.floating[b]||i.floating[h]);const S=w/2-x/2,C=E/2-v[h]/2-1,_=J$(d[g],C),A=J$(d[y],C),N=_,P=E-v[h]-A,$=E/2-v[h]/2+S,O=oO(N,$,P),R=!l.arrow&&null!=aO(o)&&$!==O&&i.reference[h]/2-($n&&(p=n)}if(c){var g,y;const e="y"===f?"width":"height",t=["top","left"].includes(sO(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=s.offset)?void 0:g[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);hr&&(h=r)}return{[f]:p,[d]:h}}}},cR=(e,t,n)=>{const r=new Map,o={platform:eR,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=mO(c,r,l),f=r,p={},h=0;for(let v=0;v{t.current=e})),t}const vR=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?aR({element:n.current,padding:r}).fn(t):{}:n?aR({element:n,padding:r}).fn(t):{};var o}}),mR=(e,t)=>({...nR(e),options:[e,t]}),gR=(e,t)=>({...rR(e),options:[e,t]}),yR=(e,t)=>({...lR(e),options:[e,t]}),bR=(e,t)=>({...oR(e),options:[e,t]}),wR=(e,t)=>({...iR(e),options:[e,t]}),xR=(e,t)=>({...sR(e),options:[e,t]}),kR=(e,t)=>({...vR(e),options:[e,t]});var ER=qe.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return nt.jsx(x$.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:nt.jsx("polygon",{points:"0,0 30,0 15,10"})})}));ER.displayName="Arrow";var SR=ER;var CR="Popper",[_R,AR]=f$(CR),[NR,PR]=_R(CR),$R=e=>{const{__scopePopper:t,children:n}=e,[r,o]=qe.useState(null);return nt.jsx(NR,{scope:t,anchor:r,onAnchorChange:o,children:n})};$R.displayName=CR;var OR="PopperAnchor",RR=qe.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=PR(OR,n),s=qe.useRef(null),a=d$(t,s);return qe.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:nt.jsx(x$.div,{...o,ref:a})}));RR.displayName=OR;var jR="PopperContent",[MR,TR]=_R(jR),LR=qe.forwardRef(((e,t)=>{var n,r,o,i,s,a;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:h=!0,collisionBoundary:v=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:w,...x}=e,k=PR(jR,l),[E,S]=qe.useState(null),C=d$(t,(e=>S(e))),[_,A]=qe.useState(null),N=function(e){const[t,n]=qe.useState(void 0);return q$((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(_),P=(null==N?void 0:N.width)??0,$=(null==N?void 0:N.height)??0,O=c+("center"!==d?"-"+d:""),R="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},j=Array.isArray(v)?v:[v],M=j.length>0,T={padding:R,boundary:j.filter(BR),altBoundary:M},{refs:L,floatingStyles:z,placement:I,isPositioned:D,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=qe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=qe.useState(r);dR(f,r)||p(r);const[h,v]=qe.useState(null),[m,g]=qe.useState(null),y=qe.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),b=qe.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),w=i||h,x=s||m,k=qe.useRef(null),E=qe.useRef(null),S=qe.useRef(u),C=null!=l,_=hR(l),A=hR(o),N=hR(c),P=qe.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:f};A.current&&(e.platform=A.current),cR(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};$.current&&!dR(S.current,t)&&(S.current=t,df.flushSync((()=>{d(t)})))}))}),[f,t,n,A,N]);uR((()=>{!1===c&&S.current.isPositioned&&(S.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const $=qe.useRef(!1);uR((()=>($.current=!0,()=>{$.current=!1})),[]),uR((()=>{if(w&&(k.current=w),x&&(E.current=x),w&&x){if(_.current)return _.current(w,x,P);P()}}),[w,x,P,_,C]);const O=qe.useMemo((()=>({reference:k,floating:E,setReference:y,setFloating:b})),[y,b]),R=qe.useMemo((()=>({reference:w,floating:x})),[w,x]),j=qe.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=pR(R.floating,u.x),r=pR(R.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...fR(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,R.floating,u.x,u.y]);return qe.useMemo((()=>({...u,update:P,refs:O,elements:R,floatingStyles:j})),[u,P,O,R,j])}({strategy:"fixed",placement:O,whileElementsMounted:(...e)=>tR(...e,{animationFrame:"always"===b}),elements:{reference:k.anchor},middleware:[mR({mainAxis:u+$,alignmentAxis:f}),h&&gR({mainAxis:!0,crossAxis:!1,limiter:"partial"===g?yR():void 0,...T}),h&&bR({...T}),wR({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),_&&kR({element:_,padding:p}),UR({arrowWidth:P,arrowHeight:$}),y&&xR({strategy:"referenceHidden",...T})]}),[U,F]=FR(I),H=h$(w);q$((()=>{D&&(null==H||H())}),[D,H]);const V=null==(n=B.arrow)?void 0:n.x,W=null==(r=B.arrow)?void 0:r.y,q=0!==(null==(o=B.arrow)?void 0:o.centerOffset),[K,Q]=qe.useState();return q$((()=>{E&&Q(window.getComputedStyle(E).zIndex)}),[E]),nt.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:D?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null==(i=B.transformOrigin)?void 0:i.x,null==(s=B.transformOrigin)?void 0:s.y].join(" "),...(null==(a=B.hide)?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:nt.jsx(MR,{scope:l,placedSide:U,onArrowChange:A,arrowX:V,arrowY:W,shouldHideArrow:q,children:nt.jsx(x$.div,{"data-side":U,"data-align":F,...x,ref:C,style:{...x.style,animation:D?void 0:"none"}})})})}));LR.displayName=jR;var zR="PopperArrow",IR={top:"bottom",right:"left",bottom:"top",left:"right"},DR=qe.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=TR(zR,n),i=IR[o.placedSide];return nt.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:nt.jsx(SR,{...r,ref:t,style:{...r.style,display:"block"}})})}));function BR(e){return null!==e}DR.displayName=zR;var UR=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:s,middlewareData:a}=t,l=0!==(null==(n=a.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,f]=FR(i),p={start:"0%",center:"50%",end:"100%"}[f],h=((null==(r=a.arrow)?void 0:r.x)??0)+c/2,v=((null==(o=a.arrow)?void 0:o.y)??0)+u/2;let m="",g="";return"bottom"===d?(m=l?p:`${h}px`,g=-u+"px"):"top"===d?(m=l?p:`${h}px`,g=`${s.floating.height+u}px`):"right"===d?(m=-u+"px",g=l?p:`${v}px`):"left"===d&&(m=`${s.floating.width+u}px`,g=l?p:`${v}px`),{data:{x:m,y:g}}}});function FR(e){const[t,n="center"]=e.split("-");return[t,n]}var HR=$R,VR=RR,WR=LR,qR=DR,KR=qe.forwardRef(((e,t)=>{var n;const{container:r,...o}=e,[i,s]=qe.useState(!1);q$((()=>s(!0)),[]);const a=r||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return a?ff.createPortal(nt.jsx(x$.div,{...o,ref:t}),a):null}));KR.displayName="Portal";var QR=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=qe.useState(),r=qe.useRef({}),o=qe.useRef(e),i=qe.useRef("none"),s=e?"mounted":"unmounted",[a,l]=function(e,t){return qe.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return qe.useEffect((()=>{const e=YR(r.current);i.current="mounted"===a?e:"none"}),[a]),q$((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,s=YR(t);if(e)l("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==s?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,l]),q$((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,s=i=>{const s=YR(r.current).includes(i.animationName);if(i.target===t&&s&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(i.current=YR(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:qe.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):qe.Children.only(n),i=d$(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?qe.cloneElement(o,{ref:i}):null};function YR(e){return(null==e?void 0:e.animationName)||"none"}QR.displayName="Presence";var GR="rovingFocusGroup.onEntryFocus",JR={bubbles:!1,cancelable:!0},XR="RovingFocusGroup",[ZR,ej,tj]=E$(XR),[nj,rj]=f$(XR,[tj]),[oj,ij]=nj(XR),sj=qe.forwardRef(((e,t)=>nt.jsx(ZR.Provider,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(ZR.Slot,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(aj,{...e,ref:t})})})));sj.displayName=XR;var aj=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=qe.useRef(null),p=d$(t,f),h=C$(i),[v=null,m]=v$({prop:s,defaultProp:a,onChange:l}),[g,y]=qe.useState(!1),b=h$(c),w=ej(n),x=qe.useRef(!1),[k,E]=qe.useState(0);return qe.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(GR,b),()=>e.removeEventListener(GR,b)}),[b]),nt.jsx(oj,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:v,onItemFocus:qe.useCallback((e=>m(e)),[m]),onItemShiftTab:qe.useCallback((()=>y(!0)),[]),onFocusableItemAdd:qe.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:qe.useCallback((()=>E((e=>e-1))),[]),children:nt.jsx(x$.div,{tabIndex:g||0===k?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:l$(e.onMouseDown,(()=>{x.current=!0})),onFocus:l$(e.onFocus,(e=>{const t=!x.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(GR,JR);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=w().filter((e=>e.focusable));dj([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}x.current=!1})),onBlur:l$(e.onBlur,(()=>y(!1)))})})})),lj="RovingFocusGroupItem",cj=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Y$(),l=i||a,c=ij(lj,n),u=c.currentTabStopId===l,d=ej(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return qe.useEffect((()=>{if(r)return f(),()=>p()}),[r,f,p]),nt.jsx(ZR.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:nt.jsx(x$.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:l$(e.onMouseDown,(e=>{r?c.onItemFocus(l):e.preventDefault()})),onFocus:l$(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:l$(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:uj[r]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=d().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=c.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>dj(o)))}var n,r}))})})}));cj.displayName=lj;var uj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dj(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var fj=sj,pj=cj,hj=new WeakMap,vj=new WeakMap,mj={},gj=0,yj=function(e){return e&&(e.host||yj(e.parentNode))},bj=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=yj(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);mj[n]||(mj[n]=new WeakMap);var i=mj[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(hj.get(e)||0)+1,c=(i.get(e)||0)+1;hj.set(e,l),i.set(e,c),s.push(e),1===l&&o&&vj.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",e,d)}}))};return u(t),a.clear(),gj++,function(){s.forEach((function(e){var t=hj.get(e)-1,o=i.get(e)-1;hj.set(e,t),i.set(e,o),t||(vj.has(e)||e.removeAttribute(r),vj.delete(e)),o||e.removeAttribute(n)})),--gj||(hj=new WeakMap,hj=new WeakMap,vj=new WeakMap,mj={})}},wj=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),bj(r,o,n,"aria-hidden")):function(){return null}},xj="right-scroll-bar-position",kj="width-before-scroll-bar";function Ej(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Sj="undefined"!=typeof window?qe.useLayoutEffect:qe.useEffect,Cj=new WeakMap;function _j(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach((function(e){return Ej(e,t)}))},(o=qe.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return Sj((function(){var t=Cj.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach((function(e){r.has(e)||Ej(e,null)})),r.forEach((function(e){n.has(e)||Ej(e,o)}))}Cj.set(i,e)}),[e]),i}function Aj(e){return e}var Nj=function(e){var t=e.sideCar,n=qy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return qe.createElement(r,Wy({},n))};Nj.isSideCarExport=!0;var Pj=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Aj);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=Wy({async:!0,ssr:!1},e),t}(),$j=function(){},Oj=qe.forwardRef((function(e,t){var n=qe.useRef(null),r=qe.useState({onScrollCapture:$j,onWheelCapture:$j,onTouchMoveCapture:$j}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,h=e.inert,v=e.allowPinchZoom,m=e.as,g=void 0===m?"div":m,y=e.gapMode,b=qy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,x=_j([n,t]),k=Wy(Wy({},b),o);return qe.createElement(qe.Fragment,null,u&&qe.createElement(w,{sideCar:Pj,removeScrollBar:c,shards:d,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:y}),s?qe.cloneElement(qe.Children.only(a),Wy(Wy({},k),{ref:x})):qe.createElement(g,Wy({},k,{className:l,ref:x}),a))}));Oj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Oj.classNames={fullWidth:kj,zeroRight:xj};function Rj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var jj=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=Rj())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Mj=function(){var e,t=(e=jj(),function(t,n){qe.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Tj={left:0,top:0,right:0,gap:0},Lj=function(e){return parseInt(e||"",10)||0},zj=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Tj;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Lj(n),Lj(r),Lj(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ij=Mj(),Dj="data-scroll-locked",Bj=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(Dj,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(xj," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(kj," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(xj," .").concat(xj," {\n right: 0 ").concat(r,";\n }\n \n .").concat(kj," .").concat(kj," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Dj,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},Uj=function(){var e=parseInt(document.body.getAttribute(Dj)||"0",10);return isFinite(e)?e:0},Fj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;qe.useEffect((function(){return document.body.setAttribute(Dj,(Uj()+1).toString()),function(){var e=Uj()-1;e<=0?document.body.removeAttribute(Dj):document.body.setAttribute(Dj,e.toString())}}),[]);var i=qe.useMemo((function(){return zj(o)}),[o]);return qe.createElement(Ij,{styles:Bj(i,!t,o,n?"":"!important")})},Hj=!1;if("undefined"!=typeof window)try{var Vj=Object.defineProperty({},"passive",{get:function(){return Hj=!0,!0}});window.addEventListener("test",Vj,Vj),window.removeEventListener("test",Vj,Vj)}catch(nz){Hj=!1}var Wj=!!Hj&&{passive:!1},qj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Kj=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Qj(e,r)){var o=Yj(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Qj=function(e,t){return"v"===e?function(e){return qj(e,"overflowY")}(t):function(e){return qj(e,"overflowX")}(t)},Yj=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Gj=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jj=function(e){return[e.deltaX,e.deltaY]},Xj=function(e){return e&&"current"in e?e.current:e},Zj=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},eM=0,tM=[];function nM(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rM=(oM=function(e){var t=qe.useRef([]),n=qe.useRef([0,0]),r=qe.useRef(),o=qe.useState(eM++)[0],i=qe.useState(Mj)[0],s=qe.useRef(e);qe.useEffect((function(){s.current=e}),[e]),qe.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Jy([e.lockRef.current],(e.shards||[]).map(Xj),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var a=qe.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,i=Gj(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Kj(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Kj(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=Yj(e,a),h=p[0],v=p[1]-p[2]-i*h;(h||v)&&Qj(e,a)&&(d+=v,f+=h),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(f)<1)&&o||(c=!0),c}(p,t,e,"h"===p?l:c,!0)}),[]),l=qe.useCallback((function(e){var n=e;if(tM.length&&tM[tM.length-1]===i){var r="deltaY"in n?Jj(n):Gj(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(s.current.shards||[]).map(Xj).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?a(n,l[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),c=qe.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:nM(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),u=qe.useCallback((function(e){n.current=Gj(e),r.current=void 0}),[]),d=qe.useCallback((function(t){c(t.type,Jj(t),t.target,a(t,e.lockRef.current))}),[]),f=qe.useCallback((function(t){c(t.type,Gj(t),t.target,a(t,e.lockRef.current))}),[]);qe.useEffect((function(){return tM.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Wj),document.addEventListener("touchmove",l,Wj),document.addEventListener("touchstart",u,Wj),function(){tM=tM.filter((function(e){return e!==i})),document.removeEventListener("wheel",l,Wj),document.removeEventListener("touchmove",l,Wj),document.removeEventListener("touchstart",u,Wj)}}),[]);var p=e.removeScrollBar,h=e.inert;return qe.createElement(qe.Fragment,null,h?qe.createElement(i,{styles:Zj(o)}):null,p?qe.createElement(Fj,{gapMode:e.gapMode}):null)},Pj.useMedium(oM),Nj);var oM,iM=qe.forwardRef((function(e,t){return qe.createElement(Oj,Wy({},e,{ref:t,sideCar:rM}))}));iM.classNames=Oj.classNames;var sM=["Enter"," "],aM=["ArrowUp","PageDown","End"],lM=["ArrowDown","PageUp","Home",...aM],cM={ltr:[...sM,"ArrowRight"],rtl:[...sM,"ArrowLeft"]},uM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},dM="Menu",[fM,pM,hM]=E$(dM),[vM,mM]=f$(dM,[hM,AR,rj]),gM=AR(),yM=rj(),[bM,wM]=vM(dM),[xM,kM]=vM(dM),EM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=gM(t),[l,c]=qe.useState(null),u=qe.useRef(!1),d=h$(i),f=C$(o);return qe.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),nt.jsx(HR,{...a,children:nt.jsx(bM,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:nt.jsx(xM,{scope:t,onClose:qe.useCallback((()=>d(!1)),[d]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};EM.displayName=dM;var SM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=gM(n);return nt.jsx(VR,{...o,...r,ref:t})}));SM.displayName="MenuAnchor";var CM="MenuPortal",[_M,AM]=vM(CM,{forceMount:void 0}),NM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=wM(CM,t);return nt.jsx(_M,{scope:t,forceMount:n,children:nt.jsx(QR,{present:n||i.open,children:nt.jsx(KR,{asChild:!0,container:o,children:r})})})};NM.displayName=CM;var PM="MenuContent",[$M,OM]=vM(PM),RM=qe.forwardRef(((e,t)=>{const n=AM(PM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=wM(PM,e.__scopeMenu),s=kM(PM,e.__scopeMenu);return nt.jsx(fM.Provider,{scope:e.__scopeMenu,children:nt.jsx(QR,{present:r||i.open,children:nt.jsx(fM.Slot,{scope:e.__scopeMenu,children:s.modal?nt.jsx(jM,{...o,ref:t}):nt.jsx(MM,{...o,ref:t})})})})})),jM=qe.forwardRef(((e,t)=>{const n=wM(PM,e.__scopeMenu),r=qe.useRef(null),o=d$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return wj(e)}),[]),nt.jsx(TM,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:l$(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),MM=qe.forwardRef(((e,t)=>{const n=wM(PM,e.__scopeMenu);return nt.jsx(TM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),TM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...v}=e,m=wM(PM,n),g=kM(PM,n),y=gM(n),b=yM(n),w=pM(n),[x,k]=qe.useState(null),E=qe.useRef(null),S=d$(t,E,m.onContentChange),C=qe.useRef(0),_=qe.useRef(""),A=qe.useRef(0),N=qe.useRef(null),P=qe.useRef("right"),$=qe.useRef(0),O=h?iM:qe.Fragment,R=h?{as:m$,allowPinchZoom:!0}:void 0,j=e=>{var t,n;const r=_.current+e,o=w().filter((e=>!e.disabled)),i=document.activeElement,s=null==(t=o.find((e=>e.ref.current===i)))?void 0:t.textValue,a=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,s),l=null==(n=o.find((e=>e.textValue===a)))?void 0:n.ref.current;!function e(t){_.current=t,window.clearTimeout(C.current),""!==t&&(C.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};qe.useEffect((()=>()=>window.clearTimeout(C.current)),[]),qe.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??T$()),document.body.insertAdjacentElement("beforeend",e[1]??T$()),M$++,()=>{1===M$&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),M$--}}),[]);const M=qe.useCallback((e=>{var t,n;return P.current===(null==(t=N.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=c>r&&n<(l-e)*(r-a)/(c-a)+e&&(o=!o)}return o}(n,t)}(e,null==(n=N.current)?void 0:n.area)}),[]);return nt.jsx($M,{scope:n,searchRef:_,onItemEnter:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),onItemLeave:qe.useCallback((e=>{var t;M(e)||(null==(t=E.current)||t.focus(),k(null))}),[M]),onTriggerLeave:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),pointerGraceTimerRef:A,onPointerGraceIntentChange:qe.useCallback((e=>{N.current=e}),[]),children:nt.jsx(O,{...R,children:nt.jsx(D$,{asChild:!0,trapped:o,onMountAutoFocus:l$(i,(e=>{var t;e.preventDefault(),null==(t=E.current)||t.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:nt.jsx(O$,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:nt.jsx(fj,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:k,onEntryFocus:l$(l,(e=>{g.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:nt.jsx(WR,{role:"menu","aria-orientation":"vertical","data-state":aT(m.open),"data-radix-menu-content":"",dir:g.dir,...y,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:l$(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&j(e.key));const o=E.current;if(e.target!==o)return;if(!lM.includes(e.key))return;e.preventDefault();const i=w().filter((e=>!e.disabled)).map((e=>e.ref.current));aM.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:l$(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),_.current="")})),onPointerMove:l$(e.onPointerMove,uT((e=>{const t=e.target,n=$.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>$.current?"right":"left";P.current=t,$.current=e.clientX}})))})})})})})})}));RM.displayName=PM;var LM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(x$.div,{role:"group",...r,ref:t})}));LM.displayName="MenuGroup";var zM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(x$.div,{...r,ref:t})}));zM.displayName="MenuLabel";var IM="MenuItem",DM="menu.itemSelect",BM=qe.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=qe.useRef(null),s=kM(IM,e.__scopeMenu),a=OM(IM,e.__scopeMenu),l=d$(t,i),c=qe.useRef(!1);return nt.jsx(UM,{...o,ref:l,disabled:n,onClick:l$(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(DM,{bubbles:!0,cancelable:!0});e.addEventListener(DM,(e=>null==r?void 0:r(e)),{once:!0}),k$(e,t),t.defaultPrevented?c.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null==(n=e.onPointerDown)||n.call(e,t),c.current=!0},onPointerUp:l$(e.onPointerUp,(e=>{var t;c.current||null==(t=e.currentTarget)||t.click()})),onKeyDown:l$(e.onKeyDown,(e=>{const t=""!==a.searchRef.current;n||t&&" "===e.key||sM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));BM.displayName=IM;var UM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=OM(IM,n),a=yM(n),l=qe.useRef(null),c=d$(t,l),[u,d]=qe.useState(!1),[f,p]=qe.useState("");return qe.useEffect((()=>{const e=l.current;e&&p((e.textContent??"").trim())}),[i.children]),nt.jsx(fM.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:nt.jsx(pj,{asChild:!0,...a,focusable:!r,children:nt.jsx(x$.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:l$(e.onPointerMove,uT((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:l$(e.onPointerLeave,uT((e=>s.onItemLeave(e)))),onFocus:l$(e.onFocus,(()=>d(!0))),onBlur:l$(e.onBlur,(()=>d(!1)))})})})})),FM=qe.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return nt.jsx(GM,{scope:e.__scopeMenu,checked:n,children:nt.jsx(BM,{role:"menuitemcheckbox","aria-checked":lT(n)?"mixed":n,...o,ref:t,"data-state":cT(n),onSelect:l$(o.onSelect,(()=>null==r?void 0:r(!!lT(n)||!n)),{checkForDefaultPrevented:!1})})})}));FM.displayName="MenuCheckboxItem";var HM="MenuRadioGroup",[VM,WM]=vM(HM,{value:void 0,onValueChange:()=>{}}),qM=qe.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=h$(r);return nt.jsx(VM,{scope:e.__scopeMenu,value:n,onValueChange:i,children:nt.jsx(LM,{...o,ref:t})})}));qM.displayName=HM;var KM="MenuRadioItem",QM=qe.forwardRef(((e,t)=>{const{value:n,...r}=e,o=WM(KM,e.__scopeMenu),i=n===o.value;return nt.jsx(GM,{scope:e.__scopeMenu,checked:i,children:nt.jsx(BM,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":cT(i),onSelect:l$(r.onSelect,(()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,n)}),{checkForDefaultPrevented:!1})})})}));QM.displayName=KM;var YM="MenuItemIndicator",[GM,JM]=vM(YM,{checked:!1}),XM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=JM(YM,n);return nt.jsx(QR,{present:r||lT(i.checked)||!0===i.checked,children:nt.jsx(x$.span,{...o,ref:t,"data-state":cT(i.checked)})})}));XM.displayName=YM;var ZM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(x$.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));ZM.displayName="MenuSeparator";var eT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=gM(n);return nt.jsx(qR,{...o,...r,ref:t})}));eT.displayName="MenuArrow";var[tT,nT]=vM("MenuSub"),rT="MenuSubTrigger",oT=qe.forwardRef(((e,t)=>{const n=wM(rT,e.__scopeMenu),r=kM(rT,e.__scopeMenu),o=nT(rT,e.__scopeMenu),i=OM(rT,e.__scopeMenu),s=qe.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=qe.useCallback((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return qe.useEffect((()=>u),[u]),qe.useEffect((()=>{const e=a.current;return()=>{window.clearTimeout(e),l(null)}}),[a,l]),nt.jsx(SM,{asChild:!0,...c,children:nt.jsx(UM,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":aT(n.open),...e,ref:u$(t,o.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:l$(e.onPointerMove,uT((t=>{i.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),u()}),100))}))),onPointerLeave:l$(e.onPointerLeave,uT((e=>{var t,r;u();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,s="right"===t,l=s?-5:5,c=o[s?"left":"right"],u=o[s?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+l,y:e.clientY},{x:c,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:c,y:o.bottom}],side:t}),window.clearTimeout(a.current),a.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:l$(e.onKeyDown,(t=>{var o;const s=""!==i.searchRef.current;e.disabled||s&&" "===t.key||cM[r.dir].includes(t.key)&&(n.onOpenChange(!0),null==(o=n.content)||o.focus(),t.preventDefault())}))})})}));oT.displayName=rT;var iT="MenuSubContent",sT=qe.forwardRef(((e,t)=>{const n=AM(PM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=wM(PM,e.__scopeMenu),s=kM(PM,e.__scopeMenu),a=nT(iT,e.__scopeMenu),l=qe.useRef(null),c=d$(t,l);return nt.jsx(fM.Provider,{scope:e.__scopeMenu,children:nt.jsx(QR,{present:r||i.open,children:nt.jsx(fM.Slot,{scope:e.__scopeMenu,children:nt.jsx(TM,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null==(t=l.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:l$(e.onFocusOutside,(e=>{e.target!==a.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:l$(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:l$(e.onKeyDown,(e=>{var t;const n=e.currentTarget.contains(e.target),r=uM[s.dir].includes(e.key);n&&r&&(i.onOpenChange(!1),null==(t=a.trigger)||t.focus(),e.preventDefault())}))})})})})}));function aT(e){return e?"open":"closed"}function lT(e){return"indeterminate"===e}function cT(e){return lT(e)?"indeterminate":e?"checked":"unchecked"}function uT(e){return t=>"mouse"===t.pointerType?e(t):void 0}sT.displayName=iT;var dT=EM,fT=SM,pT=NM,hT=RM,vT=LM,mT=zM,gT=BM,yT=FM,bT=qM,wT=QM,xT=XM,kT=ZM,ET=eT,ST=oT,CT=sT,_T="DropdownMenu",[AT,NT]=f$(_T,[mM]),PT=mM(),[$T,OT]=AT(_T),RT=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=PT(t),c=qe.useRef(null),[u=!1,d]=v$({prop:o,defaultProp:i,onChange:s});return nt.jsx($T,{scope:t,triggerId:Y$(),triggerRef:c,contentId:Y$(),open:u,onOpenChange:d,onOpenToggle:qe.useCallback((()=>d((e=>!e))),[d]),modal:a,children:nt.jsx(dT,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};RT.displayName=_T;var jT="DropdownMenuTrigger",MT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=OT(jT,n),s=PT(n);return nt.jsx(fT,{asChild:!0,...s,children:nt.jsx(x$.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:u$(t,i.triggerRef),onPointerDown:l$(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:l$(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));MT.displayName=jT;var TT=e=>{const{__scopeDropdownMenu:t,...n}=e,r=PT(t);return nt.jsx(pT,{...r,...n})};TT.displayName="DropdownMenuPortal";var LT="DropdownMenuContent",zT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=OT(LT,n),i=PT(n),s=qe.useRef(!1);return nt.jsx(hT,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:l$(e.onCloseAutoFocus,(e=>{var t;s.current||null==(t=o.triggerRef.current)||t.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:l$(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;o.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));zT.displayName=LT;qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(vT,{...o,...r,ref:t})})).displayName="DropdownMenuGroup";var IT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(mT,{...o,...r,ref:t})}));IT.displayName="DropdownMenuLabel";var DT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(gT,{...o,...r,ref:t})}));DT.displayName="DropdownMenuItem";var BT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(yT,{...o,...r,ref:t})}));BT.displayName="DropdownMenuCheckboxItem";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(bT,{...o,...r,ref:t})})).displayName="DropdownMenuRadioGroup";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(wT,{...o,...r,ref:t})})).displayName="DropdownMenuRadioItem";var UT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(xT,{...o,...r,ref:t})}));UT.displayName="DropdownMenuItemIndicator";var FT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(kT,{...o,...r,ref:t})}));FT.displayName="DropdownMenuSeparator";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(ET,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var HT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(ST,{...o,...r,ref:t})}));HT.displayName="DropdownMenuSubTrigger";var VT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=PT(n);return nt.jsx(CT,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));VT.displayName="DropdownMenuSubContent";var WT=RT,qT=MT,KT=TT,QT=zT,YT=IT,GT=DT,JT=BT,XT=UT,ZT=FT,eL=HT,tL=VT;const nL=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim();var rL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const oL=qe.forwardRef((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>qe.createElement("svg",{ref:l,...rL,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:nL("lucide",o),...a},[...s.map((([e,t])=>qe.createElement(e,t))),...Array.isArray(i)?i:[i]]))),iL=(e,t)=>{const n=qe.forwardRef((({className:n,...r},o)=>{return qe.createElement(oL,{ref:o,iconNode:t,className:nL(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},sL=iL("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),aL=iL("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),lL=WT,cL=qT;qe.forwardRef((({className:e,inset:t,children:n,...r},o)=>nt.jsxs(eL,{ref:o,className:ap("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,nt.jsx(aL,{className:"ml-auto h-4 w-4"})]}))).displayName=eL.displayName;qe.forwardRef((({className:e,...t},n)=>nt.jsx(tL,{ref:n,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}))).displayName=tL.displayName;const uL=qe.forwardRef((({className:e,sideOffset:t=4,...n},r)=>nt.jsx(KT,{children:nt.jsx(QT,{ref:r,sideOffset:t,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})));uL.displayName=QT.displayName;const dL=qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(GT,{ref:r,className:ap("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n})));dL.displayName=GT.displayName;qe.forwardRef((({className:e,children:t,checked:n,...r},o)=>nt.jsxs(JT,{ref:o,className:ap("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[nt.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:nt.jsx(XT,{children:nt.jsx(sL,{className:"h-4 w-4"})})}),t]}))).displayName=JT.displayName;qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(YT,{ref:r,className:ap("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}))).displayName=YT.displayName;const fL=qe.forwardRef((({className:e,...t},n)=>nt.jsx(ZT,{ref:n,className:ap("-mx-1 my-1 h-px bg-muted",e),...t})));fL.displayName=ZT.displayName;const pL=new Set(["children","localName","ref","style","className"]),hL=new WeakMap,vL=(e,t,n,r,o)=>{const i=null==o?void 0:o[t];void 0===i?(e[t]=n,null==n&&t in HTMLElement.prototype&&e.removeAttribute(t)):n!==r&&((e,t,n)=>{let r=hL.get(e);void 0===r&&hL.set(e,r=new Map);let o=r.get(t);void 0!==n?void 0===o?(r.set(t,o={handleEvent:n}),e.addEventListener(t,o)):o.handleEvent=n:void 0!==o&&(r.delete(t),e.removeEventListener(t,o))})(e,i,n)},mL=({react:e,tagName:t,elementClass:n,events:r,displayName:o})=>{const i=new Set(Object.keys(r??{})),s=e.forwardRef(((o,s)=>{const a=e.useRef(new Map),l=e.useRef(null),c={},u={};for(const[e,t]of Object.entries(o))pL.has(e)?c["className"===e?"class":e]=t:i.has(e)||e in n.prototype?u[e]=t:c[e]=t;return e.useLayoutEffect((()=>{if(null===l.current)return;const e=new Map;for(const t in u)vL(l.current,t,o[t],a.current.get(t),r),a.current.delete(t),e.set(t,o[t]);for(const[t,n]of a.current)vL(l.current,t,void 0,n,r);a.current=e})),e.useLayoutEffect((()=>{var e;null==(e=l.current)||e.removeAttribute("defer-hydration")}),[]),c.suppressHydrationWarning=!0,e.createElement(t,{...c,ref:e.useCallback((e=>{l.current=e,"function"==typeof s?s(e):null!==s&&(s.current=e)}),[s])})}));return s.displayName=o??n.name,s};mL({tagName:"dc-connection-button",elementClass:s$,react:Ke});const gL=mL({tagName:"dc-connection-dialog",elementClass:ZP,react:Ke,events:{onClose:"close"}});function yL(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}function bL(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}}function wL(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function xL(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const o=[],i=Array.from(e);for(i.forEach((e=>{if(e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,s=!0;for(let o=r;o{if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(t))throw new Error("radix.encode input should be Uint8Array");return xL(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(xL(t,e,256))}}}const EL=(e=>yL(kL(58),bL(e),wL("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function SL(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function CL(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function _L(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const AL=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),NL=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],PL=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,$L=NL?e=>e:e=>PL(e);function OL(e){for(let t=0;te(n).update(RL(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}const TL=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class LL extends jL{constructor(e,t,n={},r,o,i){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,SL(e),SL(t),SL(r),t<0||t>r)throw new Error("outputLen bigger than keyLen");if(void 0!==n.key&&(n.key.length<1||n.key.length>r))throw new Error(`key must be up 1..${r} byte long or undefined`);if(void 0!==n.salt&&n.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(void 0!==n.personalization&&n.personalization.length!==i)throw new Error(`personalization must be ${i} byte long or undefined`);this.buffer32=AL(this.buffer=new Uint8Array(e))}update(e){_L(this);const{blockLen:t,buffer:n,buffer32:r}=this,o=(e=RL(e)).length,i=e.byteOffset,s=e.buffer;for(let a=0;ar[t]=$L(e)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){const{buffer:t,length:n,finished:r,destroyed:o,outputLen:i,pos:s}=this;return e||(e=new this.constructor({dkLen:i})),e.set(...this.get()),e.length=n,e.finished=r,e.destroyed=o,e.outputLen=i,e.buffer.set(t),e.pos=s,e}}const zL=BigInt(2**32-1),IL=BigInt(32);function DL(e,t=!1){return t?{h:Number(e&zL),l:Number(e>>IL&zL)}:{h:0|Number(e>>IL&zL),l:0|Number(e&zL)}}const BL={fromBig:DL,split:function(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<>>32-n,rotlSL:(e,t,n)=>t<>>32-n,rotlBH:(e,t,n)=>t<>>64-n,rotlBL:(e,t,n)=>e<>>64-n,add:function(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,add5H:(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,add5L:(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0)},UL=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),FL=new Uint32Array(32);function HL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=FL[2*e],c=FL[2*e+1],u=FL[2*t],d=FL[2*t+1],f=FL[2*n],p=FL[2*n+1],h=FL[2*r],v=FL[2*r+1],m=BL.add3L(l,u,s);c=BL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:BL.rotr32H(v,h),Dl:BL.rotr32L(v,h)}),({h:p,l:f}=BL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:BL.rotrSH(d,u,24),Bl:BL.rotrSL(d,u,24)}),FL[2*e]=l,FL[2*e+1]=c,FL[2*t]=u,FL[2*t+1]=d,FL[2*n]=f,FL[2*n+1]=p,FL[2*r]=h,FL[2*r+1]=v}function VL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=FL[2*e],c=FL[2*e+1],u=FL[2*t],d=FL[2*t+1],f=FL[2*n],p=FL[2*n+1],h=FL[2*r],v=FL[2*r+1],m=BL.add3L(l,u,s);c=BL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:BL.rotrSH(v,h,16),Dl:BL.rotrSL(v,h,16)}),({h:p,l:f}=BL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:BL.rotrBH(d,u,63),Bl:BL.rotrBL(d,u,63)}),FL[2*e]=l,FL[2*e+1]=c,FL[2*t]=u,FL[2*t+1]=d,FL[2*n]=f,FL[2*n+1]=p,FL[2*r]=h,FL[2*r+1]=v}class WL extends LL{constructor(e={}){super(128,void 0===e.dkLen?64:e.dkLen,e,64,16,16),this.v0l=0|UL[0],this.v0h=0|UL[1],this.v1l=0|UL[2],this.v1h=0|UL[3],this.v2l=0|UL[4],this.v2h=0|UL[5],this.v3l=0|UL[6],this.v3h=0|UL[7],this.v4l=0|UL[8],this.v4h=0|UL[9],this.v5l=0|UL[10],this.v5h=0|UL[11],this.v6l=0|UL[12],this.v6h=0|UL[13],this.v7l=0|UL[14],this.v7h=0|UL[15];const t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|65536|1<<24,e.salt){const t=AL(RL(e.salt));this.v4l^=$L(t[0]),this.v4h^=$L(t[1]),this.v5l^=$L(t[2]),this.v5h^=$L(t[3])}if(e.personalization){const t=AL(RL(e.personalization));this.v6l^=$L(t[0]),this.v6h^=$L(t[1]),this.v7l^=$L(t[2]),this.v7h^=$L(t[3])}if(e.key){const t=new Uint8Array(this.blockLen);t.set(RL(e.key)),this.update(t)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:o,v2h:i,v3l:s,v3h:a,v4l:l,v4h:c,v5l:u,v5h:d,v6l:f,v6h:p,v7l:h,v7h:v}=this;return[e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v]}set(e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v){this.v0l=0|e,this.v0h=0|t,this.v1l=0|n,this.v1h=0|r,this.v2l=0|o,this.v2h=0|i,this.v3l=0|s,this.v3h=0|a,this.v4l=0|l,this.v4h=0|c,this.v5l=0|u,this.v5h=0|d,this.v6l=0|f,this.v6h=0|p,this.v7l=0|h,this.v7h=0|v}compress(e,t,n){this.get().forEach(((e,t)=>FL[t]=e)),FL.set(UL,16);let{h:r,l:o}=BL.fromBig(BigInt(this.length));FL[24]=UL[8]^o,FL[25]=UL[9]^r,n&&(FL[28]=~FL[28],FL[29]=~FL[29]);let i=0;const s=TL;for(let a=0;a<12;a++)HL(0,4,8,12,e,t+2*s[i++]),VL(0,4,8,12,e,t+2*s[i++]),HL(1,5,9,13,e,t+2*s[i++]),VL(1,5,9,13,e,t+2*s[i++]),HL(2,6,10,14,e,t+2*s[i++]),VL(2,6,10,14,e,t+2*s[i++]),HL(3,7,11,15,e,t+2*s[i++]),VL(3,7,11,15,e,t+2*s[i++]),HL(0,5,10,15,e,t+2*s[i++]),VL(0,5,10,15,e,t+2*s[i++]),HL(1,6,11,12,e,t+2*s[i++]),VL(1,6,11,12,e,t+2*s[i++]),HL(2,7,8,13,e,t+2*s[i++]),VL(2,7,8,13,e,t+2*s[i++]),HL(3,4,9,14,e,t+2*s[i++]),VL(3,4,9,14,e,t+2*s[i++]);this.v0l^=FL[0]^FL[16],this.v0h^=FL[1]^FL[17],this.v1l^=FL[2]^FL[18],this.v1h^=FL[3]^FL[19],this.v2l^=FL[4]^FL[20],this.v2h^=FL[5]^FL[21],this.v3l^=FL[6]^FL[22],this.v3h^=FL[7]^FL[23],this.v4l^=FL[8]^FL[24],this.v4h^=FL[9]^FL[25],this.v5l^=FL[10]^FL[26],this.v5h^=FL[11]^FL[27],this.v6l^=FL[12]^FL[28],this.v6h^=FL[13]^FL[29],this.v7l^=FL[14]^FL[30],this.v7h^=FL[15]^FL[31],FL.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const qL=ML((e=>new WL(e))),KL=(new TextEncoder).encode("SS58PRE"),QL=e=>{try{const t=EL.decode(e),n=t.subarray(0,64&t[0]?2:1),r=t.subarray(n.length,t.length-2),o=t.subarray(n.length+r.length),i=qL(Uint8Array.of(...KL,...n,...r),{dkLen:64}).subarray(0,2);return o[0]===i[0]&&o[1]===i[1]?{isValid:!0,ss58Format:YL(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},YL=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return 1===t.byteLength?t.getUint8(0):t.getUint16(0)},GL={target:{colors:[0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,1],freq:1},cube:{colors:[0,1,3,2,4,3,0,1,3,2,4,3,0,1,3,2,4,3,5],freq:20},quazar:{colors:[1,2,3,1,2,4,5,5,4,1,2,3,1,2,4,5,5,4,0],freq:16},flower:{colors:[0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,3],freq:32},cyclic:{colors:[0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,6],freq:32},vmirror:{colors:[0,1,2,3,4,5,3,4,2,0,1,6,7,8,9,7,8,6,10],freq:128},hmirror:{colors:[0,1,2,3,4,5,6,7,8,9,10,8,6,7,5,3,4,2,11],freq:128}},JL=e=>{let t=0;const n=Object.values(GL).find((n=>(t+=n.freq,e{var l;const[c,u]=qe.useState(!1),[d,f]=qe.useState(i),[p,h]=qe.useState(),[v,m]=qe.useState(),[g,y]=qe.useState();qe.useEffect((()=>{if("string"==typeof e&&!e.includes("px")&&!e.includes("rem"))throw new Error("Providing a string for 'size' in Polkicon should be expressed either in 'px', 'rem' or 'em'");let t,n;if("string"==typeof e)switch(n=e.replace(/[0-9.]/g,""),n){case"px":t=parseFloat(e);break;case"rem":t=10*parseFloat(e)}else"number"==typeof e&&(t=e);var r,o;h(n?""+("px"===n?t+"px":t/10+"rem"):t),t<12&&(r=n||"number",o="px"===n?"12px":"rem"===n?"1.2rem":12,console.warn(`Polkicon: 'Size' expressed in '${r}' cannot be less than ${o}. Will be resized to minimum size.`)),t<32?(y("0rem 0.5rem"),m("0.5rem")):t>=32&&t<64?(y("1rem 0.5rem"),m("1rem")):t>=64&&t<100?(y("2rem 1rem"),m("1.5rem")):t>=100&&(y("3rem 1rem"),m("2rem"))}),[e]);const b=qe.useCallback((()=>{n&&(async e=>{try{await navigator.clipboard.writeText(e),u(!0),f(i)}catch{u(!0),f("Failed!")}})(t)}),[n,t,i]);qe.useEffect((()=>{n&&c&&setTimeout((()=>{u(!1)}),o)}),[n,c,o]);const{c:w,r:x,rroot3o2:k,ro2:E,rroot3o4:S,ro4:C,r3o4:_,z:A,rot:N,scheme:P,palette:$}=(e=>{const t=qL(new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),n=QL(e);let r=n.isValid?n.publicKey:e;if(!("object"==typeof r&&r&&r instanceof Uint8Array&&32==r.length))return{};r=Uint8Array.from(qL(r)).map(((e,n)=>(e+256-t[n])%256));const o=22.4,i=o*Math.sqrt(3)/2,s=o*Math.sqrt(3)/4,a=3*o/4,l=Object.keys(GL).map((e=>GL[e].freq)).reduce(((e,t)=>e+t)),c=Math.floor(70*r[29]/256+26)%80+30,u=Math.floor((r[30]+256*r[31])%l),d=JL(u),f=Array.from(r).map(((e,t)=>{const n=(e+t%28*58)%256;if(0==n)return"#444";if(255==n)return"transparent";const r=Math.floor(n%64*360/64),o=[53,15,35,75][Math.floor(n/64)];return`hsl(${r}, ${c}%, ${o}%)`}));return{c:32,r:o,rroot3o2:i,ro2:11.2,rroot3o4:s,ro4:5.6,r3o4:a,z:5,rot:r[28]%6*3,scheme:d,palette:f}})(t),O=QL(t).isValid?null==(l=null==P?void 0:P.colors)?void 0:l.map(((e,t)=>$[null==P?void 0:P.colors[t<18?(t+N)%18:18]])):[];let R=0;return O?nt.jsxs("div",{onClick:n?b:void 0,style:n?{cursor:c?"none":"copy",position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}:{display:"flex",justifyContent:"center",alignItems:"center"},children:[nt.jsxs("svg",{id:Math.random().toString(36).substring(2,9),className:a,style:s,width:p,height:p,viewBox:"0 0 64 64",children:[nt.jsx("circle",{cx:32,cy:32,r:32,fill:r}),nt.jsx("circle",{cx:w,cy:w-x,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w,cy:w-E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-S,cy:w-_,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-k,cy:w-E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-S,cy:w-C,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-k,cy:w,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-k,cy:w+E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-S,cy:w+C,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-S,cy:w+_,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w,cy:w+x,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w,cy:w+E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+S,cy:w+_,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+k,cy:w+E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+S,cy:w+C,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+k,cy:w,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+k,cy:w-E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+S,cy:w-C,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+S,cy:w-_,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w,cy:w,r:A,fill:O[R++]})]}),n&&c&&nt.jsx("p",{style:{fontSize:v,fontWeight:"bold",padding:g,width:p,height:p,position:"absolute",borderRadius:"55rem",color:"white",background:"green",opacity:"80%",alignItems:"center",justifyContent:"center",display:"flex"},children:d})]}):null},ZL=()=>{const{accounts:e,selectAccount:t,selectedAccount:n}=qS(),[,r]=zS(),[o,i]=qe.useState(!1);return qe.useEffect((()=>{!(null==n?void 0:n.address)&&e.length>0&&(t(e[0]),i(!1))}),[e,t,null==n?void 0:n.address]),nt.jsxs(nt.Fragment,{children:[nt.jsx("div",{className:"flex w-full justify-center",children:nt.jsxs("div",{className:"flex w-full",children:[!e.length&&nt.jsx(iC,{onClick:()=>i(!0),className:"w-full text-lg font-bold bg-pink-700 hover:bg-blue-600",children:"Connect Wallet"}),!!e.length&&nt.jsxs(lL,{children:[nt.jsx(cL,{asChild:!0,children:nt.jsxs(iC,{variant:"outline",size:"default",className:"cursor-pointer overflow-hidden w-full flex items-center justify-center gap-2",children:[nt.jsx(XL,{size:36,address:(null==n?void 0:n.address)||"",className:"mr-2",outerColor:"transparent"}),null==n?void 0:n.name,nt.jsx(aC,{className:"ml-2 h-4 w-4",isOpen:!1})]})}),nt.jsxs(uL,{className:"max-h-[calc(100vh-5rem)] overflow-auto",children:[e.map(((n,r)=>nt.jsxs(qe.Fragment,{children:[nt.jsxs(dL,{className:"cursor-pointer",onClick:()=>t(n),children:[nt.jsx(XL,{size:28,address:n.address||"",className:"mr-2",outerColor:"transparent"}),n.name]},n.address),r!==e.length-1&&nt.jsx(fL,{})]},n.address))),nt.jsx(dL,{className:"cursor-pointer",onClick:()=>{i(!0)},children:"Show wallets"},"show"),nt.jsx(dL,{className:"cursor-pointer",onClick:()=>{r(),t(void 0)},children:"Logout"},"logout")]})]})]})}),nt.jsx(gL,{open:o,onClose:()=>i(!1)})]})};function ez(){return nt.jsx("div",{className:"flex items-center justify-center mt-6",children:nt.jsxs(lp,{className:"w-full max-w-xl",children:[nt.jsx(cp,{children:nt.jsxs(up,{className:"text-4xl pb-6 text-center flex items-center justify-center gap-2",children:[nt.jsx(tz,{}),nt.jsxs("span",{children:["CLI: ",nt.jsx("span",{className:"font-light",children:"Signing Portal"})]})]})}),nt.jsx(dp,{className:"grid gap-4",children:nt.jsx(AS,{config:a$,children:nt.jsx(WS,{children:nt.jsxs("div",{className:"overflow-auto break-words whitespace-pre-wrap",children:[nt.jsx(ZL,{}),nt.jsx(pC,{})]})})})})]})})}const tz=()=>nt.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",fill:"none",viewBox:"0 0 512 512",children:[nt.jsxs("g",{clipPath:"url(#clip0_873_174)",children:[nt.jsx("rect",{width:"512",height:"512",fill:"#1C0533",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint0_radial_873_174)",fillOpacity:"0.8",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint1_radial_873_174)",fillOpacity:"0.6",rx:"256"}),nt.jsx("mask",{id:"mask0_873_174",width:"1428",height:"1351",x:"-429",y:"-502",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},children:nt.jsx("path",{fill:"#D9D9D9",d:"m127.637-501.289 871.274 824.192-14.25 13.48-871.273-824.192zM88.96-464.701l871.272 824.192-14.249 13.48L74.71-451.221zM50.281-428.113l871.273 824.192-14.249 13.48L36.032-414.633zM11.603-391.525l871.273 824.192-14.249 13.48L-2.646-378.045zM-27.075-354.937l871.273 824.192-14.249 13.48-871.273-824.192zM-65.753-318.349 805.52 505.843l-14.249 13.48-871.273-824.192zM-104.431-281.761l871.273 824.192-14.249 13.48-871.273-824.192zM-143.109-245.173l871.273 824.192-14.249 13.48-871.273-824.192zM-181.787-208.585l871.273 824.192-14.249 13.48-871.273-824.192zM-220.465-171.997l871.273 824.192-14.249 13.48-871.273-824.192zM-259.143-135.409 612.13 688.783l-14.249 13.48-871.273-824.192zM-297.821-98.821 573.452 725.37l-14.249 13.48L-312.07-85.341zM-336.499-62.233l871.273 824.192-14.249 13.48-871.273-824.192zM-375.177-25.645l871.273 824.192-14.249 13.479-871.273-824.191zM-413.855 10.943l871.273 824.192-14.249 13.48-871.273-824.192z"})}),nt.jsx("g",{mask:"url(#mask0_873_174)",children:nt.jsx("path",{fill:"#E6007A",d:"M511.169 254.929C511.169 396.905 396.739 512 255.584 512 114.428 512-.001 396.905-.001 254.929S114.428-2.142 255.584-2.142c141.155 0 255.585 115.095 255.585 257.071"})}),nt.jsx("path",{fill:"#2B0532",d:"M183.804 160.44c-12.752-9.296-27.346-13.272-41.94-13.272h-89.63L5.63 367.567h117.053l9.399-44.802a86.4 86.4 0 0 0 28.32-8.371 104 104 0 0 0 4.133-2.155 97.7 97.7 0 0 0 14.779 24.342c8.258 9.967 18.342 17.785 29.802 23.435l.003.002.397.195.4.186c12.688 5.89 26.181 8.385 39.713 8.385 13.588 0 26.877-2.295 39.662-6.916a127 127 0 0 0 17.54-7.88l-2.871 13.579h117.052l9.4-44.802a86.4 86.4 0 0 0 28.32-8.371 101.4 101.4 0 0 0 28.939-21.348l.01-.011.159-.168.154-.167.003-.003c8.092-8.766 14.613-18.702 19.34-29.722 4.865-11.344 7.542-23.439 7.542-36.022 0-12.506-2.649-24.626-7.879-35.976-5.493-12.224-13.86-22.642-24.867-30.537-12.752-9.296-27.346-13.272-41.94-13.272h-89.631l-5.24 24.781c-7.026-6.908-15.096-12.504-24.009-16.758-12.764-6.233-26.404-8.834-40.034-8.834-13.589 0-26.878 2.295-39.662 6.916-12.145 4.39-23.444 10.507-33.804 18.268a133 133 0 0 0-7.099 5.68 74.6 74.6 0 0 0-16.911-16.781"}),nt.jsx("path",{fill:"#E6007A",fillRule:"evenodd",d:"m229.569 331.163.063.031.064.03c7.896 3.665 16.711 5.426 26.323 5.426 9.96 0 19.59-1.672 28.858-5.022a94.6 94.6 0 0 0 25.4-13.857c7.69-5.873 14.403-12.621 20.12-20.24l.016-.022.016-.022c5.708-7.75 10.156-16.036 13.319-24.849 3.326-9.027 5.005-18.25 5.005-27.639 0-8.458-1.303-16.601-3.928-24.399-2.514-8.002-6.373-15.177-11.585-21.468-5.277-6.369-11.756-11.363-19.365-14.972-7.797-3.835-16.58-5.669-26.205-5.669-9.961 0-19.591 1.673-28.858 5.022-9.165 3.313-17.687 7.924-25.551 13.819-7.719 5.752-14.51 12.512-20.362 20.265l-.01.014a97.4 97.4 0 0 0-13.544 24.867l-.015.04-.014.041c-3.181 9.016-4.784 18.219-4.784 27.583 0 8.482 1.311 16.702 3.94 24.634l.005.016.005.016c2.653 7.855 6.575 14.936 11.766 21.201 5.269 6.361 11.733 11.413 19.321 15.154m58.163-55.148.01-.015c2.998-4.343 5.197-8.955 6.622-13.852 1.467-5.04 2.176-9.872 2.176-14.513 0-4.335-.697-8.177-2.012-11.592l-.041-.109-.038-.11c-1.121-3.279-2.866-5.693-5.197-7.475-2.026-1.548-5.053-2.613-9.646-2.613-5.335 0-9.796 1.243-13.579 3.569l-.053.032-.053.031c-4.052 2.378-7.426 5.537-10.156 9.541a52.3 52.3 0 0 0-6.661 13.745c-1.454 5.016-2.157 9.826-2.157 14.447 0 4.358.638 8.321 1.862 11.932 1.246 3.306 3.081 5.852 5.484 7.803 2.047 1.543 5.008 2.569 9.387 2.569 5.495 0 10.017-1.255 13.78-3.568 4.107-2.524 7.515-5.779 10.262-9.808zM171.542 186.53c-6.663-4.89-14.525-7.228-23.288-7.228H84.491L51.478 335.434h51.685l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.864-14.652l.025-.027.025-.027c5.695-6.169 10.18-13.036 13.418-20.587 3.261-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.969-4.328l.037-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.013-.01h-11.5l-3.905 18.655h10.249c.063-.013.306-.078.757-.35.511-.309 1.235-.919 2.103-2.084zM469.872 186.53c-6.663-4.89-14.525-7.228-23.289-7.228h-63.762l-33.014 156.132h51.686l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.863-14.652l.026-.027.024-.027c5.696-6.169 10.18-13.036 13.419-20.587 3.26-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.968-4.328l.038-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.014-.01h-11.5l-3.904 18.655h10.249c.063-.013.306-.078.756-.35.511-.309 1.235-.919 2.104-2.084z",clipRule:"evenodd"}),nt.jsxs("mask",{id:"path-6-outside-1_873_174",width:"435",height:"156",x:"35.823",y:"166.788",fill:"#000",maskUnits:"userSpaceOnUse",children:[nt.jsx("path",{fill:"#fff",d:"M35.823 166.788h435v156h-435z"}),nt.jsx("path",{fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"})]}),nt.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"}),nt.jsx("path",{stroke:"#fff",strokeWidth:"0.3",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318Zm-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391Zm-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852Zm133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd",mask:"url(#path-6-outside-1_873_174)"})]}),nt.jsxs("defs",{children:[nt.jsxs("radialGradient",{id:"paint0_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(229.99965 647.20057 -371.3092 131.95444 -62.8 -86.4)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#6335EC"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsxs("radialGradient",{id:"paint1_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"rotate(-116.448 530.068 140.453)scale(1055.25 662.094)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#E6007A"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsx("clipPath",{id:"clip0_873_174",children:nt.jsx("rect",{width:"512",height:"512",fill:"#fff",rx:"256"})})]})]});rt.createRoot(document.getElementById("root")).render(nt.jsx(Ke.StrictMode,{children:nt.jsx(ez,{})})); diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs index c29986ffa..293098b50 100644 --- a/crates/pop-cli/src/common/wallet.rs +++ b/crates/pop-cli/src/common/wallet.rs @@ -16,15 +16,22 @@ pub const USE_WALLET_PROMPT: &str = "Do you want to use your browser wallet to s /// * `url` - Chain rpc. /// # Returns /// * The signed payload, if it exists. -pub async fn request_signature(call_data: Vec, url: String) -> anyhow::Result> { +pub async fn request_signature(call_data: Vec, rpc: String) -> anyhow::Result> { let ui = FrontendFromString::new(include_str!("../assets/index.html").to_string()); - let transaction_data = TransactionData::new(url, call_data); + let transaction_data = TransactionData::new(rpc, call_data); // Starts server with random port. let mut wallet = WalletIntegrationManager::new(ui, transaction_data, None); - log::step(format!("Wallet signing portal started at http://{}", wallet.server_url))?; + let url = wallet.server_url.clone(); + log::step(format!("Wallet signing portal started at http://{url}."))?; let spinner = spinner(); + spinner.start(format!("Opening browser to http://{url}")); + let res = open::that(format!("http://{url}")); + if let Err(e) = res { + spinner.error(format!("Failed to launch browser. Please open link manually. {e}")); + } + spinner.start("Waiting for signature... Press Ctrl+C to terminate early."); loop { // Display error, if any. From 72b404c2e5639cca847edc9ade0f6a6b92ab01d2 Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 17 Dec 2024 14:33:54 -0700 Subject: [PATCH 15/25] refactor: find_free_port has preferred port --- crates/pop-cli/src/commands/up/contract.rs | 2 +- crates/pop-cli/src/common/wallet.rs | 4 ++-- crates/pop-cli/src/wallet_integration.rs | 9 ++++----- crates/pop-cli/tests/contract.rs | 2 +- crates/pop-cli/tests/parachain.rs | 2 +- crates/pop-common/src/lib.rs | 16 ++++++++++++---- crates/pop-contracts/src/call.rs | 2 +- crates/pop-contracts/src/node/mod.rs | 2 +- crates/pop-contracts/src/up.rs | 2 +- 9 files changed, 24 insertions(+), 17 deletions(-) diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index 07f3aacc0..5f7693bc5 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -435,7 +435,7 @@ mod tests { } async fn start_test_environment() -> anyhow::Result<(Child, u16, TempDir)> { - let random_port = find_free_port(); + let random_port = find_free_port(None); let temp_dir = new_environment("testing")?; let current_dir = env::current_dir().expect("Failed to get current directory"); mock_build_process( diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs index 293098b50..9f0e28712 100644 --- a/crates/pop-cli/src/common/wallet.rs +++ b/crates/pop-cli/src/common/wallet.rs @@ -20,8 +20,8 @@ pub async fn request_signature(call_data: Vec, rpc: String) -> anyhow::Resul let ui = FrontendFromString::new(include_str!("../assets/index.html").to_string()); let transaction_data = TransactionData::new(rpc, call_data); - // Starts server with random port. - let mut wallet = WalletIntegrationManager::new(ui, transaction_data, None); + // Starts server with port 9090. + let mut wallet = WalletIntegrationManager::new(ui, transaction_data, Some(9090)); let url = wallet.server_url.clone(); log::step(format!("Wallet signing portal started at http://{url}."))?; diff --git a/crates/pop-cli/src/wallet_integration.rs b/crates/pop-cli/src/wallet_integration.rs index bb55ffd9c..571b37d99 100644 --- a/crates/pop-cli/src/wallet_integration.rs +++ b/crates/pop-cli/src/wallet_integration.rs @@ -73,9 +73,9 @@ impl WalletIntegrationManager { pub fn new( frontend: F, payload: TransactionData, - maybe_port: Option, + maybe_port: Option, ) -> Self { - let port = if let Some(port) = maybe_port { port } else { find_free_port().to_string() }; + let port = if let Some(port) = maybe_port { port } else { find_free_port(maybe_port) }; Self::new_with_address(frontend, payload, format!("127.0.0.1:{}", port)) } @@ -284,10 +284,9 @@ mod tests { #[tokio::test] async fn new_works() { let frontend = FrontendFromString::new(TEST_HTML.to_string()); - let mut wim = - WalletIntegrationManager::new(frontend, default_payload(), Some("9090".to_string())); + let mut wim = WalletIntegrationManager::new(frontend, default_payload(), Some(9190)); - assert_eq!(wim.server_url, "127.0.0.1:9090"); + assert_eq!(wim.server_url, "127.0.0.1:9190"); assert_eq!(wim.is_running(), true); assert!(wim.state.lock().await.shutdown_tx.is_some()); assert!(wim.state.lock().await.signed_payload.is_none()); diff --git a/crates/pop-cli/tests/contract.rs b/crates/pop-cli/tests/contract.rs index 6effb4d25..1af21b385 100644 --- a/crates/pop-cli/tests/contract.rs +++ b/crates/pop-cli/tests/contract.rs @@ -51,7 +51,7 @@ impl TransactionData { async fn contract_lifecycle() -> Result<()> { const WALLET_INT_URI: &str = "http://127.0.0.1:9090"; const WAIT_SECS: u64 = 240; - let endpoint_port = find_free_port(); + let endpoint_port = find_free_port(None); let default_endpoint: &str = &format!("ws://127.0.0.1:{}", endpoint_port); let temp = tempfile::tempdir().unwrap(); let temp_dir = temp.path(); diff --git a/crates/pop-cli/tests/parachain.rs b/crates/pop-cli/tests/parachain.rs index 67132e6d4..31ad6bded 100644 --- a/crates/pop-cli/tests/parachain.rs +++ b/crates/pop-cli/tests/parachain.rs @@ -95,7 +95,7 @@ async fn parachain_lifecycle() -> Result<()> { // Overwrite the config file to manually set the port to test pop call parachain. let network_toml_path = temp_parachain_dir.join("network.toml"); fs::create_dir_all(&temp_parachain_dir)?; - let random_port = find_free_port(); + let random_port = find_free_port(None); let localhost_url = format!("ws://127.0.0.1:{}", random_port); fs::write( &network_toml_path, diff --git a/crates/pop-common/src/lib.rs b/crates/pop-common/src/lib.rs index 70dbcc8f8..b4c0c1973 100644 --- a/crates/pop-common/src/lib.rs +++ b/crates/pop-common/src/lib.rs @@ -64,12 +64,20 @@ pub fn target() -> Result<&'static str, Error> { Err(Error::UnsupportedPlatform { arch: ARCH, os: OS }) } -/// Finds an available port by binding to port 0 and retrieving the assigned port. -pub fn find_free_port() -> u16 { +/// Checks if preferred port is available, otherwise returns a random available port. +pub fn find_free_port(preferred_port: Option) -> u16 { + // Try to bind to preferred port if provided. + if let Some(port) = preferred_port { + if TcpListener::bind(format!("127.0.0.1:{}", port)).is_ok() { + return port; + } + } + + // Else, fallback to a random available port TcpListener::bind("127.0.0.1:0") .expect("Failed to bind to an available port") .local_addr() - .expect("Failed to retrieve local address") + .expect("Failed to retrieve local address. This should never occur.") .port() } @@ -105,7 +113,7 @@ mod test { #[test] fn find_free_port_works() -> Result<()> { - let port = find_free_port(); + let port = find_free_port(None); let addr = format!("127.0.0.1:{}", port); // Constructs the TcpListener from the above port let listener = TcpListener::bind(&addr); diff --git a/crates/pop-contracts/src/call.rs b/crates/pop-contracts/src/call.rs index ed948c38b..2ffbd3258 100644 --- a/crates/pop-contracts/src/call.rs +++ b/crates/pop-contracts/src/call.rs @@ -385,7 +385,7 @@ mod tests { #[tokio::test] async fn call_works() -> Result<()> { - let random_port = find_free_port(); + let random_port = find_free_port(None); let localhost_url = format!("ws://127.0.0.1:{}", random_port); let temp_dir = new_environment("testing")?; let current_dir = env::current_dir().expect("Failed to get current directory"); diff --git a/crates/pop-contracts/src/node/mod.rs b/crates/pop-contracts/src/node/mod.rs index a7d067b76..425a2d05c 100644 --- a/crates/pop-contracts/src/node/mod.rs +++ b/crates/pop-contracts/src/node/mod.rs @@ -239,7 +239,7 @@ mod tests { #[ignore = "Works fine locally but is causing issues when running tests in parallel in the CI environment."] #[tokio::test] async fn run_contracts_node_works() -> Result<(), Error> { - let random_port = find_free_port(); + let random_port = find_free_port(None); let localhost_url = format!("ws://127.0.0.1:{}", random_port); let local_url = url::Url::parse(&localhost_url)?; diff --git a/crates/pop-contracts/src/up.rs b/crates/pop-contracts/src/up.rs index 4e663a2aa..efd3817b5 100644 --- a/crates/pop-contracts/src/up.rs +++ b/crates/pop-contracts/src/up.rs @@ -596,7 +596,7 @@ mod tests { #[tokio::test] async fn instantiate_and_upload() -> Result<()> { - let random_port = find_free_port(); + let random_port = find_free_port(None); let localhost_url = format!("ws://127.0.0.1:{}", random_port); let temp_dir = new_environment("testing")?; let current_dir = env::current_dir().expect("Failed to get current directory"); From ca1e62277b9c909ffc0cae2bd4a18e3bc3be3f0a Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 17 Dec 2024 17:42:37 -0700 Subject: [PATCH 16/25] fix: conflicting tests merged to one --- crates/pop-cli/src/commands/up/contract.rs | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index 5f7693bc5..497a01c06 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -478,10 +478,20 @@ mod tests { } #[tokio::test] - async fn get_upload_call_data_works() -> anyhow::Result<()> { + async fn get_upload_and_instantiate_call_data_works() -> anyhow::Result<()> { let (contracts_node_process, port, temp_dir) = start_test_environment().await?; let localhost_url = format!("ws://127.0.0.1:{}", port); - sleep(Duration::from_secs(20)).await; + sleep(Duration::from_secs(5)).await; + + get_upload_call_data_works(port, temp_dir).await?; + + // Stop running contracts-node + stop_test_environment(&contracts_node_process.id().to_string())?; + Ok(()) + } + + async fn get_upload_call_data_works(port: u16, temp_dir: TempDir) -> anyhow::Result<()> { + let localhost_url = format!("ws://127.0.0.1:{}", port); let up_contract_opts = UpContractCommand { path: Some(temp_dir.path().join("testing")), @@ -528,17 +538,11 @@ mod tests { // Retrieved call data and calculated match. assert_eq!(retrieved_call_data, encoded_expected_call_data); - - // Stop running contracts-node - stop_test_environment(&contracts_node_process.id().to_string())?; Ok(()) } - #[tokio::test] - async fn get_instantiate_call_data_works() -> anyhow::Result<()> { - let (contracts_node_process, port, temp_dir) = start_test_environment().await?; + async fn get_instantiate_call_data_works(port: u16, temp_dir: TempDir) -> anyhow::Result<()> { let localhost_url = format!("ws://127.0.0.1:{}", port); - sleep(Duration::from_secs(20)).await; let up_contract_opts = UpContractCommand { path: Some(temp_dir.path().join("testing")), @@ -575,8 +579,6 @@ mod tests { // Retrieved call data matches the one crafted above. assert_eq!(retrieved_call_data, expected_call_data); - // Stop running contracts-node - stop_test_environment(&contracts_node_process.id().to_string())?; Ok(()) } } From ecb8eaa9ffe1f6ba77473ead7b0e2c086fedf874 Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 17 Dec 2024 18:01:28 -0700 Subject: [PATCH 17/25] fix(wallet): port selection, update frontend --- crates/pop-cli/src/assets/index.html | 204 +++++++++++------------ crates/pop-cli/src/wallet_integration.rs | 2 +- 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/crates/pop-cli/src/assets/index.html b/crates/pop-cli/src/assets/index.html index 0ea7aa6af..4714210c6 100644 --- a/crates/pop-cli/src/assets/index.html +++ b/crates/pop-cli/src/assets/index.html @@ -7,7 +7,7 @@ href="data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_873_174)'%3E%3Crect width='512' height='512' rx='256' fill='%231C0533'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint0_radial_873_174)' fill-opacity='0.8'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint1_radial_873_174)' fill-opacity='0.6'/%3E%3Cmask id='mask0_873_174' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='-429' y='-502' width='1428' height='1351'%3E%3Cpath d='M127.637 -501.289L998.911 322.903L984.661 336.383L113.388 -487.809L127.637 -501.289Z' fill='%23D9D9D9'/%3E%3Cpath d='M88.9594 -464.701L960.232 359.491L945.983 372.971L74.7096 -451.221L88.9594 -464.701Z' fill='%23D9D9D9'/%3E%3Cpath d='M50.2814 -428.113L921.554 396.079L907.305 409.559L36.0316 -414.633L50.2814 -428.113Z' fill='%23D9D9D9'/%3E%3Cpath d='M11.6034 -391.525L882.876 432.667L868.627 446.147L-2.64642 -378.045L11.6034 -391.525Z' fill='%23D9D9D9'/%3E%3Cpath d='M-27.0746 -354.937L844.198 469.255L829.949 482.735L-41.3244 -341.457L-27.0746 -354.937Z' fill='%23D9D9D9'/%3E%3Cpath d='M-65.7526 -318.349L805.52 505.843L791.271 519.323L-80.0024 -304.869L-65.7526 -318.349Z' fill='%23D9D9D9'/%3E%3Cpath d='M-104.431 -281.761L766.842 542.431L752.593 555.911L-118.68 -268.281L-104.431 -281.761Z' fill='%23D9D9D9'/%3E%3Cpath d='M-143.109 -245.173L728.164 579.019L713.915 592.499L-157.358 -231.693L-143.109 -245.173Z' fill='%23D9D9D9'/%3E%3Cpath d='M-181.787 -208.585L689.486 615.607L675.237 629.087L-196.036 -195.105L-181.787 -208.585Z' fill='%23D9D9D9'/%3E%3Cpath d='M-220.465 -171.997L650.808 652.195L636.559 665.675L-234.714 -158.517L-220.465 -171.997Z' fill='%23D9D9D9'/%3E%3Cpath d='M-259.143 -135.409L612.13 688.783L597.881 702.263L-273.392 -121.929L-259.143 -135.409Z' fill='%23D9D9D9'/%3E%3Cpath d='M-297.821 -98.8211L573.452 725.371L559.203 738.851L-312.07 -85.3413L-297.821 -98.8211Z' fill='%23D9D9D9'/%3E%3Cpath d='M-336.499 -62.2331L534.774 761.959L520.525 775.439L-350.748 -48.7533L-336.499 -62.2331Z' fill='%23D9D9D9'/%3E%3Cpath d='M-375.177 -25.6452L496.096 798.547L481.847 812.026L-389.426 -12.1654L-375.177 -25.6452Z' fill='%23D9D9D9'/%3E%3Cpath d='M-413.855 10.9428L457.418 835.135L443.169 848.615L-428.104 24.4225L-413.855 10.9428Z' fill='%23D9D9D9'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_873_174)'%3E%3Cpath d='M511.169 254.929C511.169 396.905 396.739 512 255.584 512C114.428 512 -0.000976562 396.905 -0.000976562 254.929C-0.000976562 112.953 114.428 -2.14209 255.584 -2.14209C396.739 -2.14209 511.169 112.953 511.169 254.929Z' fill='%23E6007A'/%3E%3C/g%3E%3Cpath d='M183.804 160.44C171.052 151.144 156.458 147.168 141.864 147.168H52.2334L5.63086 367.567H122.684L132.083 322.765C141.879 321.622 151.384 318.84 160.403 314.394C161.8 313.705 163.178 312.986 164.536 312.239C168.249 321.014 173.177 329.173 179.315 336.581C187.573 346.548 197.657 354.366 209.117 360.016L209.12 360.018L209.517 360.213L209.917 360.399C222.605 366.289 236.098 368.784 249.63 368.784C263.218 368.784 276.507 366.489 289.292 361.868C295.36 359.675 301.212 357.046 306.832 353.988L303.961 367.567H421.013L430.413 322.765C440.209 321.622 449.714 318.84 458.733 314.394C469.61 309.03 479.317 301.877 487.672 293.046L487.682 293.035L487.841 292.867L487.995 292.7L487.998 292.697C496.09 283.931 502.611 273.995 507.338 262.975C512.203 251.631 514.88 239.536 514.88 226.953C514.88 214.447 512.231 202.327 507.001 190.977C501.508 178.753 493.141 168.335 482.134 160.44C469.382 151.144 454.788 147.168 440.194 147.168H350.563L345.323 171.949C338.297 165.041 330.227 159.445 321.314 155.191C308.55 148.958 294.91 146.357 281.28 146.357C267.691 146.357 254.402 148.652 241.618 153.273C229.473 157.663 218.174 163.78 207.814 171.541C205.377 173.358 203.011 175.252 200.715 177.221C196.062 170.823 190.408 165.177 183.804 160.44Z' fill='%232B0532'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M229.569 331.163L229.632 331.194L229.696 331.224C237.592 334.889 246.407 336.65 256.019 336.65C265.979 336.65 275.609 334.978 284.877 331.628C294.055 328.31 302.528 323.689 310.277 317.771C317.967 311.898 324.68 305.15 330.397 297.531L330.413 297.509L330.429 297.487C336.137 289.737 340.585 281.451 343.748 272.638C347.074 263.611 348.753 254.388 348.753 244.999C348.753 236.541 347.45 228.398 344.825 220.6C342.311 212.598 338.452 205.423 333.24 199.132C327.963 192.763 321.484 187.769 313.875 184.16C306.078 180.325 297.295 178.491 287.67 178.491C277.709 178.491 268.079 180.164 258.812 183.513C249.647 186.826 241.125 191.437 233.261 197.332C225.542 203.084 218.751 209.844 212.899 217.597L212.889 217.611C207.16 225.246 202.642 233.54 199.345 242.478L199.33 242.518L199.316 242.559C196.135 251.575 194.532 260.778 194.532 270.142C194.532 278.624 195.843 286.844 198.472 294.776L198.477 294.792L198.482 294.808C201.135 302.663 205.057 309.744 210.248 316.009C215.517 322.37 221.981 327.422 229.569 331.163ZM287.732 276.015L287.742 276C290.74 271.657 292.939 267.045 294.364 262.148C295.831 257.108 296.54 252.276 296.54 247.635C296.54 243.3 295.843 239.458 294.528 236.043L294.487 235.934L294.449 235.824C293.328 232.545 291.583 230.131 289.252 228.349C287.226 226.801 284.199 225.736 279.606 225.736C274.271 225.736 269.81 226.979 266.027 229.305L265.974 229.337L265.921 229.368C261.869 231.746 258.495 234.905 255.765 238.909C252.893 243.123 250.673 247.698 249.104 252.654C247.65 257.67 246.947 262.48 246.947 267.101C246.947 271.459 247.585 275.422 248.809 279.033C250.055 282.339 251.89 284.885 254.293 286.836C256.34 288.379 259.301 289.405 263.68 289.405C269.175 289.405 273.697 288.15 277.46 285.837C281.567 283.313 284.975 280.058 287.722 276.029L287.732 276.015Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M171.542 186.53C164.879 181.64 157.017 179.302 148.254 179.302H84.4909L51.4775 335.434H103.163L112.436 291.23H128.094C136.792 291.23 145.029 289.337 152.73 285.54C160.225 281.844 166.856 276.954 172.594 270.888L172.619 270.861L172.644 270.834C178.339 264.665 182.824 257.798 186.062 250.247C189.323 242.645 190.992 234.866 190.992 226.953C190.992 219.052 189.327 211.496 186.009 204.348C182.762 197.062 177.927 191.083 171.542 186.53ZM135.575 242.131L135.598 242.101C136.363 241.1 137.06 239.71 137.567 237.773L137.604 237.631L137.648 237.49C138.222 235.663 138.577 233.269 138.577 230.197C138.577 227.864 138.266 226.771 138.111 226.428C138.024 226.235 137.948 226.093 137.889 225.994L137.862 225.949L137.849 225.939H126.349L122.444 244.594H132.693C132.756 244.581 132.999 244.516 133.45 244.244C133.961 243.935 134.685 243.325 135.553 242.16L135.575 242.131Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M469.872 186.53C463.209 181.64 455.347 179.302 446.583 179.302H382.821L349.807 335.434H401.493L410.766 291.23H426.424C435.122 291.23 443.359 289.337 451.06 285.54C458.555 281.844 465.186 276.954 470.923 270.888L470.949 270.861L470.973 270.834C476.669 264.665 481.153 257.798 484.392 250.247C487.652 242.645 489.322 234.866 489.322 226.953C489.322 219.052 487.657 211.496 484.339 204.348C481.092 197.062 476.257 191.083 469.872 186.53ZM433.905 242.131L433.928 242.101C434.693 241.1 435.39 239.71 435.896 237.773L435.934 237.631L435.978 237.49C436.552 235.663 436.907 233.269 436.907 230.197C436.907 227.864 436.596 226.771 436.441 226.428C436.354 226.235 436.278 226.093 436.219 225.994L436.192 225.949L436.178 225.939H424.678L420.774 244.594H431.023C431.086 244.581 431.329 244.516 431.779 244.244C432.29 243.935 433.014 243.325 433.883 242.16L433.905 242.131Z' fill='%23E6007A'/%3E%3Cmask id='path-6-outside-1_873_174' maskUnits='userSpaceOnUse' x='35.8232' y='166.788' width='435' height='156' fill='black'%3E%3Crect fill='white' x='35.8232' y='166.788' width='435' height='156'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z'/%3E%3C/mask%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' stroke='white' stroke-width='0.3' mask='url(%23path-6-outside-1_873_174)'/%3E%3C/g%3E%3Cdefs%3E%3CradialGradient id='paint0_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(-62.8 -86.4) rotate(70.436) scale(686.854 394.059)'%3E%3Cstop stop-color='%236335EC'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='paint1_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(640.4 677.6) rotate(-116.448) scale(1055.25 662.094)'%3E%3Cstop stop-color='%23E6007A'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CclipPath id='clip0_873_174'%3E%3Crect width='512' height='512' rx='256' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A" /> Pop CLI Signing Portal - - + `],K);c$=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}([OA("dc-connection-button")],c$);const u$={chains:{},wallets:[new class extends QE{constructor(e){super(),X(this,"options"),this.options=e}async getWallets(){return await lS,(()=>{const{injectedWeb3:e}=window;return e?Object.keys(e):[]})().map((e=>new aS(e,this.options)))}}]};function d$(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function f$(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function p$(...e){return t=>{let n=!1;const r=e.map((e=>{const r=f$(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t{const t=n.map((e=>qe.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return qe.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=qe.createContext(r),i=n.length;n=[...n,r];const s=t=>{var n;const{scope:r,children:s,...a}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[i])||o,c=qe.useMemo((()=>a),Object.values(a));return nt.jsx(l.Provider,{value:c,children:s})};return s.displayName=t+"Provider",[s,function(n,s){var a;const l=(null==(a=null==s?void 0:s[e])?void 0:a[i])||o,c=qe.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},m$(r,...t)]}function m$(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return qe.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function g$(e){const t=qe.useRef(e);return qe.useEffect((()=>{t.current=e})),qe.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function y$({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=qe.useState(e),[r]=n,o=qe.useRef(r),i=g$(t);return qe.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,a=g$(n);return[s,qe.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&a(n)}else o(t)}),[i,e,o,a])]}!function(e){SA.next(e.wallets)}({wallets:u$.wallets});var b$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e,o=qe.Children.toArray(n),i=o.find(k$);if(i){const e=i.props.children,n=o.map((t=>t===i?qe.Children.count(e)>1?qe.Children.only(null):qe.isValidElement(e)?e.props.children:null:t));return nt.jsx(w$,{...r,ref:t,children:qe.isValidElement(e)?qe.cloneElement(e,void 0,n):null})}return nt.jsx(w$,{...r,ref:t,children:n})}));b$.displayName="Slot";var w$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e;if(qe.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n);return qe.cloneElement(n,{...E$(r,n.props),ref:t?p$(t,e):e})}return qe.Children.count(n)>1?qe.Children.only(null):null}));w$.displayName="SlotClone";var x$=({children:e})=>nt.jsx(nt.Fragment,{children:e});function k$(e){return qe.isValidElement(e)&&e.type===x$}function E$(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var S$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=qe.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?b$:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),nt.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function C$(e,t){e&&df.flushSync((()=>e.dispatchEvent(t)))}function _$(e){const t=e+"CollectionProvider",[n,r]=v$(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,r=Ke.useRef(null),i=Ke.useRef(new Map).current;return nt.jsx(o,{scope:t,itemMap:i,collectionRef:r,children:n})};s.displayName=t;const a=e+"CollectionSlot",l=Ke.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=h$(t,i(a,n).collectionRef);return nt.jsx(b$,{ref:o,children:r})}));l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=Ke.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,s=Ke.useRef(null),a=h$(t,s),l=i(c,n);return Ke.useEffect((()=>(l.itemMap.set(s,{ref:s,...o}),()=>{l.itemMap.delete(s)}))),nt.jsx(b$,{[u]:"",ref:a,children:r})}));return d.displayName=c,[{Provider:s,Slot:l,ItemSlot:d},function(t){const n=i(e+"CollectionConsumer",t),r=Ke.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${u}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}var A$=qe.createContext(void 0);function N$(e){const t=qe.useContext(A$);return e||t||"ltr"}var P$,$$="dismissableLayer.update",O$="dismissableLayer.pointerDownOutside",R$="dismissableLayer.focusOutside",j$=qe.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),M$=qe.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=qe.useContext(j$),[u,d]=qe.useState(null),f=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=qe.useState({}),h=h$(t,(e=>d(e))),v=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(m),y=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,w=y>=g,x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=g$(e),r=qe.useRef(!1),o=qe.useRef((()=>{}));return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){L$(O$,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));w&&!n&&(null==o||o(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f),k=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=g$(e),r=qe.useRef(!1);return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){L$(R$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=g$(e);qe.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{y===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&a&&(e.preventDefault(),a()))}),f),qe.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(P$=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),T$(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=P$)}}),[u,f,n,c]),qe.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),T$())}),[u,c]),qe.useEffect((()=>{const e=()=>p({});return document.addEventListener($$,e),()=>document.removeEventListener($$,e)}),[]),nt.jsx(S$.div,{...l,ref:h,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:d$(e.onFocusCapture,k.onFocusCapture),onBlurCapture:d$(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:d$(e.onPointerDownCapture,x.onPointerDownCapture)})}));M$.displayName="DismissableLayer";function T$(){const e=new CustomEvent($$);document.dispatchEvent(e)}function L$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?C$(o,i):o.dispatchEvent(i)}qe.forwardRef(((e,t)=>{const n=qe.useContext(j$),r=qe.useRef(null),o=h$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),nt.jsx(S$.div,{...e,ref:o})})).displayName="DismissableLayerBranch";var I$=0;function z$(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var D$="focusScope.autoFocusOnMount",B$="focusScope.autoFocusOnUnmount",U$={bubbles:!1,cancelable:!0},F$=qe.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=qe.useState(null),c=g$(o),u=g$(i),d=qe.useRef(null),f=h$(t,(e=>l(e))),p=qe.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;qe.useEffect((()=>{if(r){let e=function(e){if(p.paused||!a)return;const t=e.target;a.contains(t)?d.current=t:q$(d.current,{select:!0})},t=function(e){if(p.paused||!a)return;const t=e.relatedTarget;null!==t&&(a.contains(t)||q$(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&q$(a)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,a,p.paused]),qe.useEffect((()=>{if(a){K$.add(p);const t=document.activeElement;if(!a.contains(t)){const n=new CustomEvent(D$,U$);a.addEventListener(D$,c),a.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(q$(r,{select:t}),document.activeElement!==n)return}((e=H$(a),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&q$(a))}return()=>{a.removeEventListener(D$,c),setTimeout((()=>{const e=new CustomEvent(B$,U$);a.addEventListener(B$,u),a.dispatchEvent(e),e.defaultPrevented||q$(t??document.body,{select:!0}),a.removeEventListener(B$,u),K$.remove(p)}),0)}}var e}),[a,c,u,p]);const h=qe.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=H$(e),n=V$(t,e),r=V$(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&q$(i,{select:!0})):(e.preventDefault(),n&&q$(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return nt.jsx(S$.div,{tabIndex:-1,...s,ref:f,onKeyDown:h})}));function H$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function V$(e,t){for(const n of e)if(!W$(n,{upTo:t}))return n}function W$(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function q$(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}F$.displayName="FocusScope";var K$=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Q$(e,t),e.unshift(t)},remove(t){var n;e=Q$(e,t),null==(n=e[0])||n.resume()}}}();function Q$(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Y$=Boolean(null==globalThis?void 0:globalThis.document)?qe.useLayoutEffect:()=>{},G$=Qe["useId".toString()]||(()=>{}),J$=0;function X$(e){const[t,n]=qe.useState(G$());return Y$((()=>{n((e=>e??String(J$++)))}),[e]),t?`radix-${t}`:""}const Z$=["top","right","bottom","left"],eO=Math.min,tO=Math.max,nO=Math.round,rO=Math.floor,oO=e=>({x:e,y:e}),iO={left:"right",right:"left",bottom:"top",top:"bottom"},sO={start:"end",end:"start"};function aO(e,t,n){return tO(e,eO(t,n))}function lO(e,t){return"function"==typeof e?e(t):e}function cO(e){return e.split("-")[0]}function uO(e){return e.split("-")[1]}function dO(e){return"x"===e?"y":"x"}function fO(e){return"y"===e?"height":"width"}function pO(e){return["top","bottom"].includes(cO(e))?"y":"x"}function hO(e){return dO(pO(e))}function vO(e){return e.replace(/start|end/g,(e=>sO[e]))}function mO(e){return e.replace(/left|right|bottom|top/g,(e=>iO[e]))}function gO(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function yO(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function bO(e,t,n){let{reference:r,floating:o}=e;const i=pO(t),s=hO(t),a=fO(s),l=cO(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(uO(t)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1)}return p}async function wO(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=lO(t,e),h=gO(p),v=a[f?"floating"===d?"reference":"floating":d],m=yO(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=yO(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:l}):g);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}function xO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kO(e){return Z$.some((t=>e[t]>=0))}function EO(){return"undefined"!=typeof window}function SO(e){return AO(e)?(e.nodeName||"").toLowerCase():"#document"}function CO(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function _O(e){var t;return null==(t=(AO(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function AO(e){return!!EO()&&(e instanceof Node||e instanceof CO(e).Node)}function NO(e){return!!EO()&&(e instanceof Element||e instanceof CO(e).Element)}function PO(e){return!!EO()&&(e instanceof HTMLElement||e instanceof CO(e).HTMLElement)}function $O(e){return!(!EO()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof CO(e).ShadowRoot)}function OO(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=IO(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function RO(e){return["table","td","th"].includes(SO(e))}function jO(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(n){return!1}}))}function MO(e){const t=TO(),n=NO(e)?IO(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function TO(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function LO(e){return["html","body","#document"].includes(SO(e))}function IO(e){return CO(e).getComputedStyle(e)}function zO(e){return NO(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function DO(e){if("html"===SO(e))return e;const t=e.assignedSlot||e.parentNode||$O(e)&&e.host||_O(e);return $O(t)?t.host:t}function BO(e){const t=DO(e);return LO(t)?e.ownerDocument?e.ownerDocument.body:e.body:PO(t)&&OO(t)?t:BO(t)}function UO(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=BO(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=CO(o);if(i){const e=FO(s);return t.concat(s,s.visualViewport||[],OO(o)?o:[],e&&n?UO(e):[])}return t.concat(o,UO(o,[],n))}function FO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HO(e){const t=IO(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=PO(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=nO(n)!==i||nO(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function VO(e){return NO(e)?e:e.contextElement}function WO(e){const t=VO(e);if(!PO(t))return oO(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=HO(t);let s=(i?nO(n.width):n.width)/r,a=(i?nO(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const qO=oO(0);function KO(e){const t=CO(e);return TO()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:qO}function QO(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=VO(e);let s=oO(1);t&&(r?NO(r)&&(s=WO(r)):s=WO(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==CO(e))&&t}(i,n,r)?KO(i):oO(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=CO(i),t=r&&NO(r)?CO(r):r;let n=e,o=FO(n);for(;o&&r&&t!==n;){const e=WO(o),t=o.getBoundingClientRect(),r=IO(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=CO(o),o=FO(n)}}return yO({width:u,height:d,x:l,y:c})}function YO(e,t){const n=zO(e).scrollLeft;return t?t.left+n:QO(_O(e)).left+n}function GO(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:YO(e,r)),y:r.top+t.scrollTop}}function JO(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=CO(e),r=_O(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=TO();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=_O(e),n=zO(e),r=e.ownerDocument.body,o=tO(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tO(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+YO(e);const a=-n.scrollTop;return"rtl"===IO(r).direction&&(s+=tO(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(_O(e));else if(NO(t))r=function(e,t){const n=QO(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=PO(e)?WO(e):oO(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=KO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yO(r)}function XO(e,t){const n=DO(e);return!(n===t||!NO(n)||LO(n))&&("fixed"===IO(n).position||XO(n,t))}function ZO(e,t,n){const r=PO(t),o=_O(t),i="fixed"===n,s=QO(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=oO(0);if(r||!r&&!i)if(("body"!==SO(t)||OO(o))&&(a=zO(t)),r){const e=QO(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=YO(o));const c=!o||r||i?oO(0):GO(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function eR(e){return"static"===IO(e).position}function tR(e,t){if(!PO(e)||"fixed"===IO(e).position)return null;if(t)return t(e);let n=e.offsetParent;return _O(e)===n&&(n=n.ownerDocument.body),n}function nR(e,t){const n=CO(e);if(jO(e))return n;if(!PO(e)){let t=DO(e);for(;t&&!LO(t);){if(NO(t)&&!eR(t))return t;t=DO(t)}return n}let r=tR(e,t);for(;r&&RO(r)&&eR(r);)r=tR(r,t);return r&&LO(r)&&eR(r)&&!MO(r)?n:r||function(e){let t=DO(e);for(;PO(t)&&!LO(t);){if(MO(t))return t;if(jO(t))return null;t=DO(t)}return null}(e)||n}const rR={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=_O(r),a=!!t&&jO(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=oO(1);const u=oO(0),d=PO(r);if((d||!d&&!i)&&(("body"!==SO(r)||OO(s))&&(l=zO(r)),PO(r))){const e=QO(r);c=WO(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!s||d||i?oO(0):GO(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:_O,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?jO(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=UO(e,[],!1).filter((e=>NO(e)&&"body"!==SO(e))),o=null;const i="fixed"===IO(e).position;let s=i?DO(e):e;for(;NO(s)&&!LO(s);){const t=IO(s),n=MO(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||OO(s)&&!n&&XO(e,s))?r=r.filter((e=>e!==s)):o=t,s=DO(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=JO(t,n,o);return e.top=tO(r.top,e.top),e.right=eO(r.right,e.right),e.bottom=eO(r.bottom,e.bottom),e.left=tO(r.left,e.left),e}),JO(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:nR,getElementRects:async function(e){const t=this.getOffsetParent||nR,n=this.getDimensions,r=await n(e.floating);return{reference:ZO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=HO(e);return{width:t,height:n}},getScale:WO,isElement:NO,isRTL:function(e){return"rtl"===IO(e).direction}};function oR(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=VO(e),u=o||i?[...c?UO(c):[],...UO(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=_O(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const p={rootMargin:-rO(u)+"px "+-rO(o.clientWidth-(c+d))+"px "+-rO(o.clientHeight-(u+f))+"px "+-rO(c)+"px",threshold:tO(0,eO(1,l))||1};let h=!0;function v(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(m){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let v=l?QO(e):null;return l&&function t(){const r=QO(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const iR=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=cO(n),a=uO(n),l="y"===pO(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=lO(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},sR=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=lO(e,t),c={x:n,y:r},u=await wO(t,l),d=pO(cO(o)),f=dO(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=aO(p+u["y"===f?"top":"left"],p,p-u[e])}if(s){const e="y"===d?"bottom":"right";h=aO(h+u["y"===d?"top":"left"],h,h-u[e])}const v=a.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[d]:s}}}}}},aR=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...m}=lO(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=cO(o),y=pO(a),b=cO(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!v?[mO(a)]:function(e){const t=mO(e);return[vO(e),t,vO(t)]}(a)),k="none"!==h;!f&&k&&x.push(...function(e,t,n,r){const o=uO(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(cO(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(vO)))),i}(a,v,h,w));const E=[a,...x],S=await wO(t,m),C=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(S[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=uO(e),o=hO(e),i=fO(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=mO(s)),[s,mO(s)]}(o,s,w);C.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:o,overflows:C}],!C.every((e=>e<=0))){var A,N;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(N=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=_.filter((e=>{if(k){const t=pO(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},lR=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=lO(e,t),u=await wO(t,c),d=cO(o),f=uO(o),p="y"===pO(o),{width:h,height:v}=i.floating;let m,g;"top"===d||"bottom"===d?(m=d,g=f===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,m="end"===f?"top":"bottom");const y=v-u.top-u.bottom,b=h-u.left-u.right,w=eO(v-u[m],y),x=eO(h-u[g],b),k=!t.middlewareData.shift;let E=w,S=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),k&&!f){const e=tO(u.left,0),t=tO(u.right,0),n=tO(u.top,0),r=tO(u.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:tO(u.left,u.right)):E=v-2*(0!==n||0!==r?n+r:tO(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:E});const C=await s.getDimensions(a.floating);return h!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}},cR=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=lO(e,t);switch(r){case"referenceHidden":{const e=xO(await wO(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:kO(e)}}}case"escaped":{const e=xO(await wO(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:kO(e)}}}default:return{}}}}},uR=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=lO(e,t)||{};if(null==c)return{};const d=gO(u),f={x:n,y:r},p=hO(o),h=fO(p),v=await s.getDimensions(c),m="y"===p,g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-f[p]-i.floating[h],x=f[p]-i.reference[p],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=k?k[b]:0;E&&await(null==s.isElement?void 0:s.isElement(k))||(E=a.floating[b]||i.floating[h]);const S=w/2-x/2,C=E/2-v[h]/2-1,_=eO(d[g],C),A=eO(d[y],C),N=_,P=E-v[h]-A,$=E/2-v[h]/2+S,O=aO(N,$,P),R=!l.arrow&&null!=uO(o)&&$!==O&&i.reference[h]/2-($n&&(p=n)}if(c){var g,y;const e="y"===f?"width":"height",t=["top","left"].includes(cO(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=s.offset)?void 0:g[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);hr&&(h=r)}return{[f]:p,[d]:h}}}},fR=(e,t,n)=>{const r=new Map,o={platform:rR,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=bO(c,r,l),f=r,p={},h=0;for(let v=0;v{t.current=e})),t}const yR=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?uR({element:n.current,padding:r}).fn(t):{}:n?uR({element:n,padding:r}).fn(t):{};var o}}),bR=(e,t)=>({...iR(e),options:[e,t]}),wR=(e,t)=>({...sR(e),options:[e,t]}),xR=(e,t)=>({...dR(e),options:[e,t]}),kR=(e,t)=>({...aR(e),options:[e,t]}),ER=(e,t)=>({...lR(e),options:[e,t]}),SR=(e,t)=>({...cR(e),options:[e,t]}),CR=(e,t)=>({...yR(e),options:[e,t]});var _R=qe.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return nt.jsx(S$.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:nt.jsx("polygon",{points:"0,0 30,0 15,10"})})}));_R.displayName="Arrow";var AR=_R;var NR="Popper",[PR,$R]=v$(NR),[OR,RR]=PR(NR),jR=e=>{const{__scopePopper:t,children:n}=e,[r,o]=qe.useState(null);return nt.jsx(OR,{scope:t,anchor:r,onAnchorChange:o,children:n})};jR.displayName=NR;var MR="PopperAnchor",TR=qe.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=RR(MR,n),s=qe.useRef(null),a=h$(t,s);return qe.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:nt.jsx(S$.div,{...o,ref:a})}));TR.displayName=MR;var LR="PopperContent",[IR,zR]=PR(LR),DR=qe.forwardRef(((e,t)=>{var n,r,o,i,s,a;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:h=!0,collisionBoundary:v=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:w,...x}=e,k=RR(LR,l),[E,S]=qe.useState(null),C=h$(t,(e=>S(e))),[_,A]=qe.useState(null),N=function(e){const[t,n]=qe.useState(void 0);return Y$((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(_),P=(null==N?void 0:N.width)??0,$=(null==N?void 0:N.height)??0,O=c+("center"!==d?"-"+d:""),R="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},j=Array.isArray(v)?v:[v],M=j.length>0,T={padding:R,boundary:j.filter(HR),altBoundary:M},{refs:L,floatingStyles:I,placement:z,isPositioned:D,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=qe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=qe.useState(r);hR(f,r)||p(r);const[h,v]=qe.useState(null),[m,g]=qe.useState(null),y=qe.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),b=qe.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),w=i||h,x=s||m,k=qe.useRef(null),E=qe.useRef(null),S=qe.useRef(u),C=null!=l,_=gR(l),A=gR(o),N=gR(c),P=qe.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:f};A.current&&(e.platform=A.current),fR(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};$.current&&!hR(S.current,t)&&(S.current=t,df.flushSync((()=>{d(t)})))}))}),[f,t,n,A,N]);pR((()=>{!1===c&&S.current.isPositioned&&(S.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const $=qe.useRef(!1);pR((()=>($.current=!0,()=>{$.current=!1})),[]),pR((()=>{if(w&&(k.current=w),x&&(E.current=x),w&&x){if(_.current)return _.current(w,x,P);P()}}),[w,x,P,_,C]);const O=qe.useMemo((()=>({reference:k,floating:E,setReference:y,setFloating:b})),[y,b]),R=qe.useMemo((()=>({reference:w,floating:x})),[w,x]),j=qe.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=mR(R.floating,u.x),r=mR(R.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...vR(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,R.floating,u.x,u.y]);return qe.useMemo((()=>({...u,update:P,refs:O,elements:R,floatingStyles:j})),[u,P,O,R,j])}({strategy:"fixed",placement:O,whileElementsMounted:(...e)=>oR(...e,{animationFrame:"always"===b}),elements:{reference:k.anchor},middleware:[bR({mainAxis:u+$,alignmentAxis:f}),h&&wR({mainAxis:!0,crossAxis:!1,limiter:"partial"===g?xR():void 0,...T}),h&&kR({...T}),ER({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),_&&CR({element:_,padding:p}),VR({arrowWidth:P,arrowHeight:$}),y&&SR({strategy:"referenceHidden",...T})]}),[U,F]=WR(z),H=g$(w);Y$((()=>{D&&(null==H||H())}),[D,H]);const V=null==(n=B.arrow)?void 0:n.x,W=null==(r=B.arrow)?void 0:r.y,q=0!==(null==(o=B.arrow)?void 0:o.centerOffset),[K,Q]=qe.useState();return Y$((()=>{E&&Q(window.getComputedStyle(E).zIndex)}),[E]),nt.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:D?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null==(i=B.transformOrigin)?void 0:i.x,null==(s=B.transformOrigin)?void 0:s.y].join(" "),...(null==(a=B.hide)?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:nt.jsx(IR,{scope:l,placedSide:U,onArrowChange:A,arrowX:V,arrowY:W,shouldHideArrow:q,children:nt.jsx(S$.div,{"data-side":U,"data-align":F,...x,ref:C,style:{...x.style,animation:D?void 0:"none"}})})})}));DR.displayName=LR;var BR="PopperArrow",UR={top:"bottom",right:"left",bottom:"top",left:"right"},FR=qe.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=zR(BR,n),i=UR[o.placedSide];return nt.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:nt.jsx(AR,{...r,ref:t,style:{...r.style,display:"block"}})})}));function HR(e){return null!==e}FR.displayName=BR;var VR=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:s,middlewareData:a}=t,l=0!==(null==(n=a.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,f]=WR(i),p={start:"0%",center:"50%",end:"100%"}[f],h=((null==(r=a.arrow)?void 0:r.x)??0)+c/2,v=((null==(o=a.arrow)?void 0:o.y)??0)+u/2;let m="",g="";return"bottom"===d?(m=l?p:`${h}px`,g=-u+"px"):"top"===d?(m=l?p:`${h}px`,g=`${s.floating.height+u}px`):"right"===d?(m=-u+"px",g=l?p:`${v}px`):"left"===d&&(m=`${s.floating.width+u}px`,g=l?p:`${v}px`),{data:{x:m,y:g}}}});function WR(e){const[t,n="center"]=e.split("-");return[t,n]}var qR=jR,KR=TR,QR=DR,YR=FR,GR=qe.forwardRef(((e,t)=>{var n;const{container:r,...o}=e,[i,s]=qe.useState(!1);Y$((()=>s(!0)),[]);const a=r||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return a?ff.createPortal(nt.jsx(S$.div,{...o,ref:t}),a):null}));GR.displayName="Portal";var JR=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=qe.useState(),r=qe.useRef({}),o=qe.useRef(e),i=qe.useRef("none"),s=e?"mounted":"unmounted",[a,l]=function(e,t){return qe.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return qe.useEffect((()=>{const e=XR(r.current);i.current="mounted"===a?e:"none"}),[a]),Y$((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,s=XR(t);if(e)l("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==s?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,l]),Y$((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,s=i=>{const s=XR(r.current).includes(i.animationName);if(i.target===t&&s&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(i.current=XR(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:qe.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):qe.Children.only(n),i=h$(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?qe.cloneElement(o,{ref:i}):null};function XR(e){return(null==e?void 0:e.animationName)||"none"}JR.displayName="Presence";var ZR="rovingFocusGroup.onEntryFocus",ej={bubbles:!1,cancelable:!0},tj="RovingFocusGroup",[nj,rj,oj]=_$(tj),[ij,sj]=v$(tj,[oj]),[aj,lj]=ij(tj),cj=qe.forwardRef(((e,t)=>nt.jsx(nj.Provider,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(nj.Slot,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(uj,{...e,ref:t})})})));cj.displayName=tj;var uj=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=qe.useRef(null),p=h$(t,f),h=N$(i),[v=null,m]=y$({prop:s,defaultProp:a,onChange:l}),[g,y]=qe.useState(!1),b=g$(c),w=rj(n),x=qe.useRef(!1),[k,E]=qe.useState(0);return qe.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(ZR,b),()=>e.removeEventListener(ZR,b)}),[b]),nt.jsx(aj,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:v,onItemFocus:qe.useCallback((e=>m(e)),[m]),onItemShiftTab:qe.useCallback((()=>y(!0)),[]),onFocusableItemAdd:qe.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:qe.useCallback((()=>E((e=>e-1))),[]),children:nt.jsx(S$.div,{tabIndex:g||0===k?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:d$(e.onMouseDown,(()=>{x.current=!0})),onFocus:d$(e.onFocus,(e=>{const t=!x.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(ZR,ej);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=w().filter((e=>e.focusable));hj([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}x.current=!1})),onBlur:d$(e.onBlur,(()=>y(!1)))})})})),dj="RovingFocusGroupItem",fj=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=X$(),l=i||a,c=lj(dj,n),u=c.currentTabStopId===l,d=rj(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return qe.useEffect((()=>{if(r)return f(),()=>p()}),[r,f,p]),nt.jsx(nj.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:nt.jsx(S$.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:d$(e.onMouseDown,(e=>{r?c.onItemFocus(l):e.preventDefault()})),onFocus:d$(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:d$(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:pj[r]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=d().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=c.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>hj(o)))}var n,r}))})})}));fj.displayName=dj;var pj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hj(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var vj=cj,mj=fj,gj=new WeakMap,yj=new WeakMap,bj={},wj=0,xj=function(e){return e&&(e.host||xj(e.parentNode))},kj=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=xj(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);bj[n]||(bj[n]=new WeakMap);var i=bj[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(gj.get(e)||0)+1,c=(i.get(e)||0)+1;gj.set(e,l),i.set(e,c),s.push(e),1===l&&o&&yj.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",e,d)}}))};return u(t),a.clear(),wj++,function(){s.forEach((function(e){var t=gj.get(e)-1,o=i.get(e)-1;gj.set(e,t),i.set(e,o),t||(yj.has(e)||e.removeAttribute(r),yj.delete(e)),o||e.removeAttribute(n)})),--wj||(gj=new WeakMap,gj=new WeakMap,yj=new WeakMap,bj={})}},Ej=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),kj(r,o,n,"aria-hidden")):function(){return null}},Sj="right-scroll-bar-position",Cj="width-before-scroll-bar";function _j(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Aj="undefined"!=typeof window?qe.useLayoutEffect:qe.useEffect,Nj=new WeakMap;function Pj(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach((function(e){return _j(e,t)}))},(o=qe.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return Aj((function(){var t=Nj.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach((function(e){r.has(e)||_j(e,null)})),r.forEach((function(e){n.has(e)||_j(e,o)}))}Nj.set(i,e)}),[e]),i}function $j(e){return e}var Oj=function(e){var t=e.sideCar,n=Qy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return qe.createElement(r,Ky({},n))};Oj.isSideCarExport=!0;var Rj=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=$j);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=Ky({async:!0,ssr:!1},e),t}(),jj=function(){},Mj=qe.forwardRef((function(e,t){var n=qe.useRef(null),r=qe.useState({onScrollCapture:jj,onWheelCapture:jj,onTouchMoveCapture:jj}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,h=e.inert,v=e.allowPinchZoom,m=e.as,g=void 0===m?"div":m,y=e.gapMode,b=Qy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,x=Pj([n,t]),k=Ky(Ky({},b),o);return qe.createElement(qe.Fragment,null,u&&qe.createElement(w,{sideCar:Rj,removeScrollBar:c,shards:d,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:y}),s?qe.cloneElement(qe.Children.only(a),Ky(Ky({},k),{ref:x})):qe.createElement(g,Ky({},k,{className:l,ref:x}),a))}));Mj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Mj.classNames={fullWidth:Cj,zeroRight:Sj};function Tj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Lj=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=Tj())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ij=function(){var e,t=(e=Lj(),function(t,n){qe.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},zj={left:0,top:0,right:0,gap:0},Dj=function(e){return parseInt(e||"",10)||0},Bj=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return zj;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Dj(n),Dj(r),Dj(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Uj=Ij(),Fj="data-scroll-locked",Hj=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(Fj,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Sj," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(Cj," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(Sj," .").concat(Sj," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Cj," .").concat(Cj," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Fj,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},Vj=function(){var e=parseInt(document.body.getAttribute(Fj)||"0",10);return isFinite(e)?e:0},Wj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;qe.useEffect((function(){return document.body.setAttribute(Fj,(Vj()+1).toString()),function(){var e=Vj()-1;e<=0?document.body.removeAttribute(Fj):document.body.setAttribute(Fj,e.toString())}}),[]);var i=qe.useMemo((function(){return Bj(o)}),[o]);return qe.createElement(Uj,{styles:Hj(i,!t,o,n?"":"!important")})},qj=!1;if("undefined"!=typeof window)try{var Kj=Object.defineProperty({},"passive",{get:function(){return qj=!0,!0}});window.addEventListener("test",Kj,Kj),window.removeEventListener("test",Kj,Kj)}catch(iI){qj=!1}var Qj=!!qj&&{passive:!1},Yj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Gj=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Jj(e,r)){var o=Xj(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Jj=function(e,t){return"v"===e?function(e){return Yj(e,"overflowY")}(t):function(e){return Yj(e,"overflowX")}(t)},Xj=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Zj=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eM=function(e){return[e.deltaX,e.deltaY]},tM=function(e){return e&&"current"in e?e.current:e},nM=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},rM=0,oM=[];function iM(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sM=(aM=function(e){var t=qe.useRef([]),n=qe.useRef([0,0]),r=qe.useRef(),o=qe.useState(rM++)[0],i=qe.useState(Ij)[0],s=qe.useRef(e);qe.useEffect((function(){s.current=e}),[e]),qe.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Zy([e.lockRef.current],(e.shards||[]).map(tM),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var a=qe.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,i=Zj(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Gj(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Gj(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=Xj(e,a),h=p[0],v=p[1]-p[2]-i*h;(h||v)&&Jj(e,a)&&(d+=v,f+=h),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(f)<1)&&o||(c=!0),c}(p,t,e,"h"===p?l:c,!0)}),[]),l=qe.useCallback((function(e){var n=e;if(oM.length&&oM[oM.length-1]===i){var r="deltaY"in n?eM(n):Zj(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(s.current.shards||[]).map(tM).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?a(n,l[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),c=qe.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:iM(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),u=qe.useCallback((function(e){n.current=Zj(e),r.current=void 0}),[]),d=qe.useCallback((function(t){c(t.type,eM(t),t.target,a(t,e.lockRef.current))}),[]),f=qe.useCallback((function(t){c(t.type,Zj(t),t.target,a(t,e.lockRef.current))}),[]);qe.useEffect((function(){return oM.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Qj),document.addEventListener("touchmove",l,Qj),document.addEventListener("touchstart",u,Qj),function(){oM=oM.filter((function(e){return e!==i})),document.removeEventListener("wheel",l,Qj),document.removeEventListener("touchmove",l,Qj),document.removeEventListener("touchstart",u,Qj)}}),[]);var p=e.removeScrollBar,h=e.inert;return qe.createElement(qe.Fragment,null,h?qe.createElement(i,{styles:nM(o)}):null,p?qe.createElement(Wj,{gapMode:e.gapMode}):null)},Rj.useMedium(aM),Oj);var aM,lM=qe.forwardRef((function(e,t){return qe.createElement(Mj,Ky({},e,{ref:t,sideCar:sM}))}));lM.classNames=Mj.classNames;var cM=["Enter"," "],uM=["ArrowUp","PageDown","End"],dM=["ArrowDown","PageUp","Home",...uM],fM={ltr:[...cM,"ArrowRight"],rtl:[...cM,"ArrowLeft"]},pM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hM="Menu",[vM,mM,gM]=_$(hM),[yM,bM]=v$(hM,[gM,$R,sj]),wM=$R(),xM=sj(),[kM,EM]=yM(hM),[SM,CM]=yM(hM),_M=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=wM(t),[l,c]=qe.useState(null),u=qe.useRef(!1),d=g$(i),f=N$(o);return qe.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),nt.jsx(qR,{...a,children:nt.jsx(kM,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:nt.jsx(SM,{scope:t,onClose:qe.useCallback((()=>d(!1)),[d]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};_M.displayName=hM;var AM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=wM(n);return nt.jsx(KR,{...o,...r,ref:t})}));AM.displayName="MenuAnchor";var NM="MenuPortal",[PM,$M]=yM(NM,{forceMount:void 0}),OM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=EM(NM,t);return nt.jsx(PM,{scope:t,forceMount:n,children:nt.jsx(JR,{present:n||i.open,children:nt.jsx(GR,{asChild:!0,container:o,children:r})})})};OM.displayName=NM;var RM="MenuContent",[jM,MM]=yM(RM),TM=qe.forwardRef(((e,t)=>{const n=$M(RM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=EM(RM,e.__scopeMenu),s=CM(RM,e.__scopeMenu);return nt.jsx(vM.Provider,{scope:e.__scopeMenu,children:nt.jsx(JR,{present:r||i.open,children:nt.jsx(vM.Slot,{scope:e.__scopeMenu,children:s.modal?nt.jsx(LM,{...o,ref:t}):nt.jsx(IM,{...o,ref:t})})})})})),LM=qe.forwardRef(((e,t)=>{const n=EM(RM,e.__scopeMenu),r=qe.useRef(null),o=h$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return Ej(e)}),[]),nt.jsx(zM,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:d$(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),IM=qe.forwardRef(((e,t)=>{const n=EM(RM,e.__scopeMenu);return nt.jsx(zM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),zM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...v}=e,m=EM(RM,n),g=CM(RM,n),y=wM(n),b=xM(n),w=mM(n),[x,k]=qe.useState(null),E=qe.useRef(null),S=h$(t,E,m.onContentChange),C=qe.useRef(0),_=qe.useRef(""),A=qe.useRef(0),N=qe.useRef(null),P=qe.useRef("right"),$=qe.useRef(0),O=h?lM:qe.Fragment,R=h?{as:b$,allowPinchZoom:!0}:void 0,j=e=>{var t,n;const r=_.current+e,o=w().filter((e=>!e.disabled)),i=document.activeElement,s=null==(t=o.find((e=>e.ref.current===i)))?void 0:t.textValue,a=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,s),l=null==(n=o.find((e=>e.textValue===a)))?void 0:n.ref.current;!function e(t){_.current=t,window.clearTimeout(C.current),""!==t&&(C.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};qe.useEffect((()=>()=>window.clearTimeout(C.current)),[]),qe.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??z$()),document.body.insertAdjacentElement("beforeend",e[1]??z$()),I$++,()=>{1===I$&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),I$--}}),[]);const M=qe.useCallback((e=>{var t,n;return P.current===(null==(t=N.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=c>r&&n<(l-e)*(r-a)/(c-a)+e&&(o=!o)}return o}(n,t)}(e,null==(n=N.current)?void 0:n.area)}),[]);return nt.jsx(jM,{scope:n,searchRef:_,onItemEnter:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),onItemLeave:qe.useCallback((e=>{var t;M(e)||(null==(t=E.current)||t.focus(),k(null))}),[M]),onTriggerLeave:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),pointerGraceTimerRef:A,onPointerGraceIntentChange:qe.useCallback((e=>{N.current=e}),[]),children:nt.jsx(O,{...R,children:nt.jsx(F$,{asChild:!0,trapped:o,onMountAutoFocus:d$(i,(e=>{var t;e.preventDefault(),null==(t=E.current)||t.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:nt.jsx(M$,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:nt.jsx(vj,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:k,onEntryFocus:d$(l,(e=>{g.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:nt.jsx(QR,{role:"menu","aria-orientation":"vertical","data-state":uT(m.open),"data-radix-menu-content":"",dir:g.dir,...y,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:d$(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&j(e.key));const o=E.current;if(e.target!==o)return;if(!dM.includes(e.key))return;e.preventDefault();const i=w().filter((e=>!e.disabled)).map((e=>e.ref.current));uM.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:d$(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),_.current="")})),onPointerMove:d$(e.onPointerMove,pT((e=>{const t=e.target,n=$.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>$.current?"right":"left";P.current=t,$.current=e.clientX}})))})})})})})})}));TM.displayName=RM;var DM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(S$.div,{role:"group",...r,ref:t})}));DM.displayName="MenuGroup";var BM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(S$.div,{...r,ref:t})}));BM.displayName="MenuLabel";var UM="MenuItem",FM="menu.itemSelect",HM=qe.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=qe.useRef(null),s=CM(UM,e.__scopeMenu),a=MM(UM,e.__scopeMenu),l=h$(t,i),c=qe.useRef(!1);return nt.jsx(VM,{...o,ref:l,disabled:n,onClick:d$(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(FM,{bubbles:!0,cancelable:!0});e.addEventListener(FM,(e=>null==r?void 0:r(e)),{once:!0}),C$(e,t),t.defaultPrevented?c.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null==(n=e.onPointerDown)||n.call(e,t),c.current=!0},onPointerUp:d$(e.onPointerUp,(e=>{var t;c.current||null==(t=e.currentTarget)||t.click()})),onKeyDown:d$(e.onKeyDown,(e=>{const t=""!==a.searchRef.current;n||t&&" "===e.key||cM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));HM.displayName=UM;var VM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=MM(UM,n),a=xM(n),l=qe.useRef(null),c=h$(t,l),[u,d]=qe.useState(!1),[f,p]=qe.useState("");return qe.useEffect((()=>{const e=l.current;e&&p((e.textContent??"").trim())}),[i.children]),nt.jsx(vM.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:nt.jsx(mj,{asChild:!0,...a,focusable:!r,children:nt.jsx(S$.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:d$(e.onPointerMove,pT((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:d$(e.onPointerLeave,pT((e=>s.onItemLeave(e)))),onFocus:d$(e.onFocus,(()=>d(!0))),onBlur:d$(e.onBlur,(()=>d(!1)))})})})})),WM=qe.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return nt.jsx(ZM,{scope:e.__scopeMenu,checked:n,children:nt.jsx(HM,{role:"menuitemcheckbox","aria-checked":dT(n)?"mixed":n,...o,ref:t,"data-state":fT(n),onSelect:d$(o.onSelect,(()=>null==r?void 0:r(!!dT(n)||!n)),{checkForDefaultPrevented:!1})})})}));WM.displayName="MenuCheckboxItem";var qM="MenuRadioGroup",[KM,QM]=yM(qM,{value:void 0,onValueChange:()=>{}}),YM=qe.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=g$(r);return nt.jsx(KM,{scope:e.__scopeMenu,value:n,onValueChange:i,children:nt.jsx(DM,{...o,ref:t})})}));YM.displayName=qM;var GM="MenuRadioItem",JM=qe.forwardRef(((e,t)=>{const{value:n,...r}=e,o=QM(GM,e.__scopeMenu),i=n===o.value;return nt.jsx(ZM,{scope:e.__scopeMenu,checked:i,children:nt.jsx(HM,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":fT(i),onSelect:d$(r.onSelect,(()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,n)}),{checkForDefaultPrevented:!1})})})}));JM.displayName=GM;var XM="MenuItemIndicator",[ZM,eT]=yM(XM,{checked:!1}),tT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=eT(XM,n);return nt.jsx(JR,{present:r||dT(i.checked)||!0===i.checked,children:nt.jsx(S$.span,{...o,ref:t,"data-state":fT(i.checked)})})}));tT.displayName=XM;var nT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(S$.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));nT.displayName="MenuSeparator";var rT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=wM(n);return nt.jsx(YR,{...o,...r,ref:t})}));rT.displayName="MenuArrow";var[oT,iT]=yM("MenuSub"),sT="MenuSubTrigger",aT=qe.forwardRef(((e,t)=>{const n=EM(sT,e.__scopeMenu),r=CM(sT,e.__scopeMenu),o=iT(sT,e.__scopeMenu),i=MM(sT,e.__scopeMenu),s=qe.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=qe.useCallback((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return qe.useEffect((()=>u),[u]),qe.useEffect((()=>{const e=a.current;return()=>{window.clearTimeout(e),l(null)}}),[a,l]),nt.jsx(AM,{asChild:!0,...c,children:nt.jsx(VM,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":uT(n.open),...e,ref:p$(t,o.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:d$(e.onPointerMove,pT((t=>{i.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),u()}),100))}))),onPointerLeave:d$(e.onPointerLeave,pT((e=>{var t,r;u();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,s="right"===t,l=s?-5:5,c=o[s?"left":"right"],u=o[s?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+l,y:e.clientY},{x:c,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:c,y:o.bottom}],side:t}),window.clearTimeout(a.current),a.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:d$(e.onKeyDown,(t=>{var o;const s=""!==i.searchRef.current;e.disabled||s&&" "===t.key||fM[r.dir].includes(t.key)&&(n.onOpenChange(!0),null==(o=n.content)||o.focus(),t.preventDefault())}))})})}));aT.displayName=sT;var lT="MenuSubContent",cT=qe.forwardRef(((e,t)=>{const n=$M(RM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=EM(RM,e.__scopeMenu),s=CM(RM,e.__scopeMenu),a=iT(lT,e.__scopeMenu),l=qe.useRef(null),c=h$(t,l);return nt.jsx(vM.Provider,{scope:e.__scopeMenu,children:nt.jsx(JR,{present:r||i.open,children:nt.jsx(vM.Slot,{scope:e.__scopeMenu,children:nt.jsx(zM,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null==(t=l.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:d$(e.onFocusOutside,(e=>{e.target!==a.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:d$(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:d$(e.onKeyDown,(e=>{var t;const n=e.currentTarget.contains(e.target),r=pM[s.dir].includes(e.key);n&&r&&(i.onOpenChange(!1),null==(t=a.trigger)||t.focus(),e.preventDefault())}))})})})})}));function uT(e){return e?"open":"closed"}function dT(e){return"indeterminate"===e}function fT(e){return dT(e)?"indeterminate":e?"checked":"unchecked"}function pT(e){return t=>"mouse"===t.pointerType?e(t):void 0}cT.displayName=lT;var hT=_M,vT=AM,mT=OM,gT=TM,yT=DM,bT=BM,wT=HM,xT=WM,kT=YM,ET=JM,ST=tT,CT=nT,_T=rT,AT=aT,NT=cT,PT="DropdownMenu",[$T,OT]=v$(PT,[bM]),RT=bM(),[jT,MT]=$T(PT),TT=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=RT(t),c=qe.useRef(null),[u=!1,d]=y$({prop:o,defaultProp:i,onChange:s});return nt.jsx(jT,{scope:t,triggerId:X$(),triggerRef:c,contentId:X$(),open:u,onOpenChange:d,onOpenToggle:qe.useCallback((()=>d((e=>!e))),[d]),modal:a,children:nt.jsx(hT,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};TT.displayName=PT;var LT="DropdownMenuTrigger",IT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=MT(LT,n),s=RT(n);return nt.jsx(vT,{asChild:!0,...s,children:nt.jsx(S$.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:p$(t,i.triggerRef),onPointerDown:d$(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:d$(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));IT.displayName=LT;var zT=e=>{const{__scopeDropdownMenu:t,...n}=e,r=RT(t);return nt.jsx(mT,{...r,...n})};zT.displayName="DropdownMenuPortal";var DT="DropdownMenuContent",BT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(DT,n),i=RT(n),s=qe.useRef(!1);return nt.jsx(gT,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:d$(e.onCloseAutoFocus,(e=>{var t;s.current||null==(t=o.triggerRef.current)||t.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:d$(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;o.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));BT.displayName=DT;qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(yT,{...o,...r,ref:t})})).displayName="DropdownMenuGroup";var UT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(bT,{...o,...r,ref:t})}));UT.displayName="DropdownMenuLabel";var FT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(wT,{...o,...r,ref:t})}));FT.displayName="DropdownMenuItem";var HT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(xT,{...o,...r,ref:t})}));HT.displayName="DropdownMenuCheckboxItem";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(kT,{...o,...r,ref:t})})).displayName="DropdownMenuRadioGroup";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(ET,{...o,...r,ref:t})})).displayName="DropdownMenuRadioItem";var VT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(ST,{...o,...r,ref:t})}));VT.displayName="DropdownMenuItemIndicator";var WT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(CT,{...o,...r,ref:t})}));WT.displayName="DropdownMenuSeparator";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(_T,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var qT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(AT,{...o,...r,ref:t})}));qT.displayName="DropdownMenuSubTrigger";var KT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=RT(n);return nt.jsx(NT,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));KT.displayName="DropdownMenuSubContent";var QT=TT,YT=IT,GT=zT,JT=BT,XT=UT,ZT=FT,eL=HT,tL=VT,nL=WT,rL=qT,oL=KT;const iL=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim();var sL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const aL=qe.forwardRef((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>qe.createElement("svg",{ref:l,...sL,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:iL("lucide",o),...a},[...s.map((([e,t])=>qe.createElement(e,t))),...Array.isArray(i)?i:[i]]))),lL=(e,t)=>{const n=qe.forwardRef((({className:n,...r},o)=>{return qe.createElement(aL,{ref:o,iconNode:t,className:iL(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},cL=lL("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),uL=lL("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),dL=QT,fL=YT;qe.forwardRef((({className:e,inset:t,children:n,...r},o)=>nt.jsxs(rL,{ref:o,className:ap("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,nt.jsx(uL,{className:"ml-auto h-4 w-4"})]}))).displayName=rL.displayName;qe.forwardRef((({className:e,...t},n)=>nt.jsx(oL,{ref:n,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}))).displayName=oL.displayName;const pL=qe.forwardRef((({className:e,sideOffset:t=4,...n},r)=>nt.jsx(GT,{children:nt.jsx(JT,{ref:r,sideOffset:t,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})));pL.displayName=JT.displayName;const hL=qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(ZT,{ref:r,className:ap("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n})));hL.displayName=ZT.displayName;qe.forwardRef((({className:e,children:t,checked:n,...r},o)=>nt.jsxs(eL,{ref:o,className:ap("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[nt.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:nt.jsx(tL,{children:nt.jsx(cL,{className:"h-4 w-4"})})}),t]}))).displayName=eL.displayName;qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(XT,{ref:r,className:ap("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}))).displayName=XT.displayName;const vL=qe.forwardRef((({className:e,...t},n)=>nt.jsx(nL,{ref:n,className:ap("-mx-1 my-1 h-px bg-muted",e),...t})));vL.displayName=nL.displayName;const mL=new Set(["children","localName","ref","style","className"]),gL=new WeakMap,yL=(e,t,n,r,o)=>{const i=null==o?void 0:o[t];void 0===i?(e[t]=n,null==n&&t in HTMLElement.prototype&&e.removeAttribute(t)):n!==r&&((e,t,n)=>{let r=gL.get(e);void 0===r&&gL.set(e,r=new Map);let o=r.get(t);void 0!==n?void 0===o?(r.set(t,o={handleEvent:n}),e.addEventListener(t,o)):o.handleEvent=n:void 0!==o&&(r.delete(t),e.removeEventListener(t,o))})(e,i,n)},bL=({react:e,tagName:t,elementClass:n,events:r,displayName:o})=>{const i=new Set(Object.keys(r??{})),s=e.forwardRef(((o,s)=>{const a=e.useRef(new Map),l=e.useRef(null),c={},u={};for(const[e,t]of Object.entries(o))mL.has(e)?c["className"===e?"class":e]=t:i.has(e)||e in n.prototype?u[e]=t:c[e]=t;return e.useLayoutEffect((()=>{if(null===l.current)return;const e=new Map;for(const t in u)yL(l.current,t,o[t],a.current.get(t),r),a.current.delete(t),e.set(t,o[t]);for(const[t,n]of a.current)yL(l.current,t,void 0,n,r);a.current=e})),e.useLayoutEffect((()=>{var e;null==(e=l.current)||e.removeAttribute("defer-hydration")}),[]),c.suppressHydrationWarning=!0,e.createElement(t,{...c,ref:e.useCallback((e=>{l.current=e,"function"==typeof s?s(e):null!==s&&(s.current=e)}),[s])})}));return s.displayName=o??n.name,s};bL({tagName:"dc-connection-button",elementClass:c$,react:Ke});const wL=bL({tagName:"dc-connection-dialog",elementClass:n$,react:Ke,events:{onClose:"close"}});function xL(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}function kL(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}}function EL(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function SL(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const o=[],i=Array.from(e);for(i.forEach((e=>{if(e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,s=!0;for(let o=r;o{if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(t))throw new Error("radix.encode input should be Uint8Array");return SL(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(SL(t,e,256))}}}const _L=(e=>xL(CL(58),kL(e),EL("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function AL(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function NL(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function PL(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const $L=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),OL=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],RL=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,jL=OL?e=>e:e=>RL(e);function ML(e){for(let t=0;te(n).update(TL(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}const zL=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class DL extends LL{constructor(e,t,n={},r,o,i){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,AL(e),AL(t),AL(r),t<0||t>r)throw new Error("outputLen bigger than keyLen");if(void 0!==n.key&&(n.key.length<1||n.key.length>r))throw new Error(`key must be up 1..${r} byte long or undefined`);if(void 0!==n.salt&&n.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(void 0!==n.personalization&&n.personalization.length!==i)throw new Error(`personalization must be ${i} byte long or undefined`);this.buffer32=$L(this.buffer=new Uint8Array(e))}update(e){PL(this);const{blockLen:t,buffer:n,buffer32:r}=this,o=(e=TL(e)).length,i=e.byteOffset,s=e.buffer;for(let a=0;ar[t]=jL(e)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){const{buffer:t,length:n,finished:r,destroyed:o,outputLen:i,pos:s}=this;return e||(e=new this.constructor({dkLen:i})),e.set(...this.get()),e.length=n,e.finished=r,e.destroyed=o,e.outputLen=i,e.buffer.set(t),e.pos=s,e}}const BL=BigInt(2**32-1),UL=BigInt(32);function FL(e,t=!1){return t?{h:Number(e&BL),l:Number(e>>UL&BL)}:{h:0|Number(e>>UL&BL),l:0|Number(e&BL)}}const HL={fromBig:FL,split:function(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<>>32-n,rotlSL:(e,t,n)=>t<>>32-n,rotlBH:(e,t,n)=>t<>>64-n,rotlBL:(e,t,n)=>e<>>64-n,add:function(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,add5H:(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,add5L:(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0)},VL=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),WL=new Uint32Array(32);function qL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=WL[2*e],c=WL[2*e+1],u=WL[2*t],d=WL[2*t+1],f=WL[2*n],p=WL[2*n+1],h=WL[2*r],v=WL[2*r+1],m=HL.add3L(l,u,s);c=HL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:HL.rotr32H(v,h),Dl:HL.rotr32L(v,h)}),({h:p,l:f}=HL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:HL.rotrSH(d,u,24),Bl:HL.rotrSL(d,u,24)}),WL[2*e]=l,WL[2*e+1]=c,WL[2*t]=u,WL[2*t+1]=d,WL[2*n]=f,WL[2*n+1]=p,WL[2*r]=h,WL[2*r+1]=v}function KL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=WL[2*e],c=WL[2*e+1],u=WL[2*t],d=WL[2*t+1],f=WL[2*n],p=WL[2*n+1],h=WL[2*r],v=WL[2*r+1],m=HL.add3L(l,u,s);c=HL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:HL.rotrSH(v,h,16),Dl:HL.rotrSL(v,h,16)}),({h:p,l:f}=HL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:HL.rotrBH(d,u,63),Bl:HL.rotrBL(d,u,63)}),WL[2*e]=l,WL[2*e+1]=c,WL[2*t]=u,WL[2*t+1]=d,WL[2*n]=f,WL[2*n+1]=p,WL[2*r]=h,WL[2*r+1]=v}class QL extends DL{constructor(e={}){super(128,void 0===e.dkLen?64:e.dkLen,e,64,16,16),this.v0l=0|VL[0],this.v0h=0|VL[1],this.v1l=0|VL[2],this.v1h=0|VL[3],this.v2l=0|VL[4],this.v2h=0|VL[5],this.v3l=0|VL[6],this.v3h=0|VL[7],this.v4l=0|VL[8],this.v4h=0|VL[9],this.v5l=0|VL[10],this.v5h=0|VL[11],this.v6l=0|VL[12],this.v6h=0|VL[13],this.v7l=0|VL[14],this.v7h=0|VL[15];const t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|65536|1<<24,e.salt){const t=$L(TL(e.salt));this.v4l^=jL(t[0]),this.v4h^=jL(t[1]),this.v5l^=jL(t[2]),this.v5h^=jL(t[3])}if(e.personalization){const t=$L(TL(e.personalization));this.v6l^=jL(t[0]),this.v6h^=jL(t[1]),this.v7l^=jL(t[2]),this.v7h^=jL(t[3])}if(e.key){const t=new Uint8Array(this.blockLen);t.set(TL(e.key)),this.update(t)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:o,v2h:i,v3l:s,v3h:a,v4l:l,v4h:c,v5l:u,v5h:d,v6l:f,v6h:p,v7l:h,v7h:v}=this;return[e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v]}set(e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v){this.v0l=0|e,this.v0h=0|t,this.v1l=0|n,this.v1h=0|r,this.v2l=0|o,this.v2h=0|i,this.v3l=0|s,this.v3h=0|a,this.v4l=0|l,this.v4h=0|c,this.v5l=0|u,this.v5h=0|d,this.v6l=0|f,this.v6h=0|p,this.v7l=0|h,this.v7h=0|v}compress(e,t,n){this.get().forEach(((e,t)=>WL[t]=e)),WL.set(VL,16);let{h:r,l:o}=HL.fromBig(BigInt(this.length));WL[24]=VL[8]^o,WL[25]=VL[9]^r,n&&(WL[28]=~WL[28],WL[29]=~WL[29]);let i=0;const s=zL;for(let a=0;a<12;a++)qL(0,4,8,12,e,t+2*s[i++]),KL(0,4,8,12,e,t+2*s[i++]),qL(1,5,9,13,e,t+2*s[i++]),KL(1,5,9,13,e,t+2*s[i++]),qL(2,6,10,14,e,t+2*s[i++]),KL(2,6,10,14,e,t+2*s[i++]),qL(3,7,11,15,e,t+2*s[i++]),KL(3,7,11,15,e,t+2*s[i++]),qL(0,5,10,15,e,t+2*s[i++]),KL(0,5,10,15,e,t+2*s[i++]),qL(1,6,11,12,e,t+2*s[i++]),KL(1,6,11,12,e,t+2*s[i++]),qL(2,7,8,13,e,t+2*s[i++]),KL(2,7,8,13,e,t+2*s[i++]),qL(3,4,9,14,e,t+2*s[i++]),KL(3,4,9,14,e,t+2*s[i++]);this.v0l^=WL[0]^WL[16],this.v0h^=WL[1]^WL[17],this.v1l^=WL[2]^WL[18],this.v1h^=WL[3]^WL[19],this.v2l^=WL[4]^WL[20],this.v2h^=WL[5]^WL[21],this.v3l^=WL[6]^WL[22],this.v3h^=WL[7]^WL[23],this.v4l^=WL[8]^WL[24],this.v4h^=WL[9]^WL[25],this.v5l^=WL[10]^WL[26],this.v5h^=WL[11]^WL[27],this.v6l^=WL[12]^WL[28],this.v6h^=WL[13]^WL[29],this.v7l^=WL[14]^WL[30],this.v7h^=WL[15]^WL[31],WL.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const YL=IL((e=>new QL(e))),GL=(new TextEncoder).encode("SS58PRE"),JL=e=>{try{const t=_L.decode(e),n=t.subarray(0,64&t[0]?2:1),r=t.subarray(n.length,t.length-2),o=t.subarray(n.length+r.length),i=YL(Uint8Array.of(...GL,...n,...r),{dkLen:64}).subarray(0,2);return o[0]===i[0]&&o[1]===i[1]?{isValid:!0,ss58Format:XL(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},XL=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return 1===t.byteLength?t.getUint8(0):t.getUint16(0)},ZL={target:{colors:[0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,1],freq:1},cube:{colors:[0,1,3,2,4,3,0,1,3,2,4,3,0,1,3,2,4,3,5],freq:20},quazar:{colors:[1,2,3,1,2,4,5,5,4,1,2,3,1,2,4,5,5,4,0],freq:16},flower:{colors:[0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,3],freq:32},cyclic:{colors:[0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,6],freq:32},vmirror:{colors:[0,1,2,3,4,5,3,4,2,0,1,6,7,8,9,7,8,6,10],freq:128},hmirror:{colors:[0,1,2,3,4,5,6,7,8,9,10,8,6,7,5,3,4,2,11],freq:128}},eI=e=>{let t=0;const n=Object.values(ZL).find((n=>(t+=n.freq,e{var l;const[c,u]=qe.useState(!1),[d,f]=qe.useState(i),[p,h]=qe.useState(),[v,m]=qe.useState(),[g,y]=qe.useState();qe.useEffect((()=>{if("string"==typeof e&&!e.includes("px")&&!e.includes("rem"))throw new Error("Providing a string for 'size' in Polkicon should be expressed either in 'px', 'rem' or 'em'");let t,n;if("string"==typeof e)switch(n=e.replace(/[0-9.]/g,""),n){case"px":t=parseFloat(e);break;case"rem":t=10*parseFloat(e)}else"number"==typeof e&&(t=e);var r,o;h(n?""+("px"===n?t+"px":t/10+"rem"):t),t<12&&(r=n||"number",o="px"===n?"12px":"rem"===n?"1.2rem":12,console.warn(`Polkicon: 'Size' expressed in '${r}' cannot be less than ${o}. Will be resized to minimum size.`)),t<32?(y("0rem 0.5rem"),m("0.5rem")):t>=32&&t<64?(y("1rem 0.5rem"),m("1rem")):t>=64&&t<100?(y("2rem 1rem"),m("1.5rem")):t>=100&&(y("3rem 1rem"),m("2rem"))}),[e]);const b=qe.useCallback((()=>{n&&(async e=>{try{await navigator.clipboard.writeText(e),u(!0),f(i)}catch{u(!0),f("Failed!")}})(t)}),[n,t,i]);qe.useEffect((()=>{n&&c&&setTimeout((()=>{u(!1)}),o)}),[n,c,o]);const{c:w,r:x,rroot3o2:k,ro2:E,rroot3o4:S,ro4:C,r3o4:_,z:A,rot:N,scheme:P,palette:$}=(e=>{const t=YL(new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),n=JL(e);let r=n.isValid?n.publicKey:e;if(!("object"==typeof r&&r&&r instanceof Uint8Array&&32==r.length))return{};r=Uint8Array.from(YL(r)).map(((e,n)=>(e+256-t[n])%256));const o=22.4,i=o*Math.sqrt(3)/2,s=o*Math.sqrt(3)/4,a=3*o/4,l=Object.keys(ZL).map((e=>ZL[e].freq)).reduce(((e,t)=>e+t)),c=Math.floor(70*r[29]/256+26)%80+30,u=Math.floor((r[30]+256*r[31])%l),d=eI(u),f=Array.from(r).map(((e,t)=>{const n=(e+t%28*58)%256;if(0==n)return"#444";if(255==n)return"transparent";const r=Math.floor(n%64*360/64),o=[53,15,35,75][Math.floor(n/64)];return`hsl(${r}, ${c}%, ${o}%)`}));return{c:32,r:o,rroot3o2:i,ro2:11.2,rroot3o4:s,ro4:5.6,r3o4:a,z:5,rot:r[28]%6*3,scheme:d,palette:f}})(t),O=JL(t).isValid?null==(l=null==P?void 0:P.colors)?void 0:l.map(((e,t)=>$[null==P?void 0:P.colors[t<18?(t+N)%18:18]])):[];let R=0;return O?nt.jsxs("div",{onClick:n?b:void 0,style:n?{cursor:c?"none":"copy",position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}:{display:"flex",justifyContent:"center",alignItems:"center"},children:[nt.jsxs("svg",{id:Math.random().toString(36).substring(2,9),className:a,style:s,width:p,height:p,viewBox:"0 0 64 64",children:[nt.jsx("circle",{cx:32,cy:32,r:32,fill:r}),nt.jsx("circle",{cx:w,cy:w-x,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w,cy:w-E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-S,cy:w-_,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-k,cy:w-E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-S,cy:w-C,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-k,cy:w,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-k,cy:w+E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-S,cy:w+C,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w-S,cy:w+_,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w,cy:w+x,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w,cy:w+E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+S,cy:w+_,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+k,cy:w+E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+S,cy:w+C,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+k,cy:w,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+k,cy:w-E,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+S,cy:w-C,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w+S,cy:w-_,r:A,fill:O[R++]}),nt.jsx("circle",{cx:w,cy:w,r:A,fill:O[R++]})]}),n&&c&&nt.jsx("p",{style:{fontSize:v,fontWeight:"bold",padding:g,width:p,height:p,position:"absolute",borderRadius:"55rem",color:"white",background:"green",opacity:"80%",alignItems:"center",justifyContent:"center",display:"flex"},children:d})]}):null},nI=()=>{const{accounts:e,selectAccount:t,selectedAccount:n}=QS(),[,r]=DS(),[o,i]=qe.useState(!1);return qe.useEffect((()=>{!(null==n?void 0:n.address)&&e.length>0&&(t(e[0]),i(!1))}),[e,t,null==n?void 0:n.address]),nt.jsxs(nt.Fragment,{children:[nt.jsx("div",{className:"flex w-full justify-center",children:nt.jsxs("div",{className:"flex w-full",children:[!e.length&&nt.jsx(aC,{onClick:()=>i(!0),className:"w-full text-lg font-bold bg-pink-700 hover:bg-blue-600",children:"Connect Wallet"}),!!e.length&&nt.jsxs(dL,{children:[nt.jsx(fL,{asChild:!0,children:nt.jsxs(aC,{variant:"outline",size:"default",className:"cursor-pointer overflow-hidden w-full flex items-center justify-center gap-2",children:[nt.jsx(tI,{size:36,address:(null==n?void 0:n.address)||"",className:"mr-2",outerColor:"transparent"}),null==n?void 0:n.name,nt.jsx(cC,{className:"ml-2 h-4 w-4",isOpen:!1})]})}),nt.jsxs(pL,{className:"max-h-[calc(100vh-5rem)] overflow-auto",children:[e.map(((n,r)=>nt.jsxs(qe.Fragment,{children:[nt.jsxs(hL,{className:"cursor-pointer",onClick:()=>t(n),children:[nt.jsx(tI,{size:28,address:n.address||"",className:"mr-2",outerColor:"transparent"}),n.name]},n.address),r!==e.length-1&&nt.jsx(vL,{})]},n.address))),nt.jsx(hL,{className:"cursor-pointer",onClick:()=>{i(!0)},children:"Show wallets"},"show"),nt.jsx(hL,{className:"cursor-pointer",onClick:()=>{r(),t(void 0)},children:"Logout"},"logout")]})]})]})}),nt.jsx(wL,{open:o,onClose:()=>i(!1)})]})};function rI(){return nt.jsx("div",{className:"flex items-center justify-center mt-6",children:nt.jsxs(up,{className:"w-full max-w-xl",children:[nt.jsx(dp,{children:nt.jsxs(fp,{className:"text-4xl pb-6 text-center flex items-center justify-center gap-2",children:[nt.jsx(oI,{}),nt.jsxs("span",{children:["CLI: ",nt.jsx("span",{className:"font-light",children:"Signing Portal"})]})]})}),nt.jsx(pp,{className:"grid gap-4",children:nt.jsx(PS,{config:u$,children:nt.jsx(KS,{children:nt.jsxs("div",{className:"overflow-auto break-words whitespace-pre-wrap",children:[nt.jsx(nI,{}),nt.jsx(mC,{})]})})})})]})})}const oI=()=>nt.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",fill:"none",viewBox:"0 0 512 512",children:[nt.jsxs("g",{clipPath:"url(#clip0_873_174)",children:[nt.jsx("rect",{width:"512",height:"512",fill:"#1C0533",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint0_radial_873_174)",fillOpacity:"0.8",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint1_radial_873_174)",fillOpacity:"0.6",rx:"256"}),nt.jsx("mask",{id:"mask0_873_174",width:"1428",height:"1351",x:"-429",y:"-502",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},children:nt.jsx("path",{fill:"#D9D9D9",d:"m127.637-501.289 871.274 824.192-14.25 13.48-871.273-824.192zM88.96-464.701l871.272 824.192-14.249 13.48L74.71-451.221zM50.281-428.113l871.273 824.192-14.249 13.48L36.032-414.633zM11.603-391.525l871.273 824.192-14.249 13.48L-2.646-378.045zM-27.075-354.937l871.273 824.192-14.249 13.48-871.273-824.192zM-65.753-318.349 805.52 505.843l-14.249 13.48-871.273-824.192zM-104.431-281.761l871.273 824.192-14.249 13.48-871.273-824.192zM-143.109-245.173l871.273 824.192-14.249 13.48-871.273-824.192zM-181.787-208.585l871.273 824.192-14.249 13.48-871.273-824.192zM-220.465-171.997l871.273 824.192-14.249 13.48-871.273-824.192zM-259.143-135.409 612.13 688.783l-14.249 13.48-871.273-824.192zM-297.821-98.821 573.452 725.37l-14.249 13.48L-312.07-85.341zM-336.499-62.233l871.273 824.192-14.249 13.48-871.273-824.192zM-375.177-25.645l871.273 824.192-14.249 13.479-871.273-824.191zM-413.855 10.943l871.273 824.192-14.249 13.48-871.273-824.192z"})}),nt.jsx("g",{mask:"url(#mask0_873_174)",children:nt.jsx("path",{fill:"#E6007A",d:"M511.169 254.929C511.169 396.905 396.739 512 255.584 512 114.428 512-.001 396.905-.001 254.929S114.428-2.142 255.584-2.142c141.155 0 255.585 115.095 255.585 257.071"})}),nt.jsx("path",{fill:"#2B0532",d:"M183.804 160.44c-12.752-9.296-27.346-13.272-41.94-13.272h-89.63L5.63 367.567h117.053l9.399-44.802a86.4 86.4 0 0 0 28.32-8.371 104 104 0 0 0 4.133-2.155 97.7 97.7 0 0 0 14.779 24.342c8.258 9.967 18.342 17.785 29.802 23.435l.003.002.397.195.4.186c12.688 5.89 26.181 8.385 39.713 8.385 13.588 0 26.877-2.295 39.662-6.916a127 127 0 0 0 17.54-7.88l-2.871 13.579h117.052l9.4-44.802a86.4 86.4 0 0 0 28.32-8.371 101.4 101.4 0 0 0 28.939-21.348l.01-.011.159-.168.154-.167.003-.003c8.092-8.766 14.613-18.702 19.34-29.722 4.865-11.344 7.542-23.439 7.542-36.022 0-12.506-2.649-24.626-7.879-35.976-5.493-12.224-13.86-22.642-24.867-30.537-12.752-9.296-27.346-13.272-41.94-13.272h-89.631l-5.24 24.781c-7.026-6.908-15.096-12.504-24.009-16.758-12.764-6.233-26.404-8.834-40.034-8.834-13.589 0-26.878 2.295-39.662 6.916-12.145 4.39-23.444 10.507-33.804 18.268a133 133 0 0 0-7.099 5.68 74.6 74.6 0 0 0-16.911-16.781"}),nt.jsx("path",{fill:"#E6007A",fillRule:"evenodd",d:"m229.569 331.163.063.031.064.03c7.896 3.665 16.711 5.426 26.323 5.426 9.96 0 19.59-1.672 28.858-5.022a94.6 94.6 0 0 0 25.4-13.857c7.69-5.873 14.403-12.621 20.12-20.24l.016-.022.016-.022c5.708-7.75 10.156-16.036 13.319-24.849 3.326-9.027 5.005-18.25 5.005-27.639 0-8.458-1.303-16.601-3.928-24.399-2.514-8.002-6.373-15.177-11.585-21.468-5.277-6.369-11.756-11.363-19.365-14.972-7.797-3.835-16.58-5.669-26.205-5.669-9.961 0-19.591 1.673-28.858 5.022-9.165 3.313-17.687 7.924-25.551 13.819-7.719 5.752-14.51 12.512-20.362 20.265l-.01.014a97.4 97.4 0 0 0-13.544 24.867l-.015.04-.014.041c-3.181 9.016-4.784 18.219-4.784 27.583 0 8.482 1.311 16.702 3.94 24.634l.005.016.005.016c2.653 7.855 6.575 14.936 11.766 21.201 5.269 6.361 11.733 11.413 19.321 15.154m58.163-55.148.01-.015c2.998-4.343 5.197-8.955 6.622-13.852 1.467-5.04 2.176-9.872 2.176-14.513 0-4.335-.697-8.177-2.012-11.592l-.041-.109-.038-.11c-1.121-3.279-2.866-5.693-5.197-7.475-2.026-1.548-5.053-2.613-9.646-2.613-5.335 0-9.796 1.243-13.579 3.569l-.053.032-.053.031c-4.052 2.378-7.426 5.537-10.156 9.541a52.3 52.3 0 0 0-6.661 13.745c-1.454 5.016-2.157 9.826-2.157 14.447 0 4.358.638 8.321 1.862 11.932 1.246 3.306 3.081 5.852 5.484 7.803 2.047 1.543 5.008 2.569 9.387 2.569 5.495 0 10.017-1.255 13.78-3.568 4.107-2.524 7.515-5.779 10.262-9.808zM171.542 186.53c-6.663-4.89-14.525-7.228-23.288-7.228H84.491L51.478 335.434h51.685l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.864-14.652l.025-.027.025-.027c5.695-6.169 10.18-13.036 13.418-20.587 3.261-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.969-4.328l.037-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.013-.01h-11.5l-3.905 18.655h10.249c.063-.013.306-.078.757-.35.511-.309 1.235-.919 2.103-2.084zM469.872 186.53c-6.663-4.89-14.525-7.228-23.289-7.228h-63.762l-33.014 156.132h51.686l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.863-14.652l.026-.027.024-.027c5.696-6.169 10.18-13.036 13.419-20.587 3.26-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.968-4.328l.038-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.014-.01h-11.5l-3.904 18.655h10.249c.063-.013.306-.078.756-.35.511-.309 1.235-.919 2.104-2.084z",clipRule:"evenodd"}),nt.jsxs("mask",{id:"path-6-outside-1_873_174",width:"435",height:"156",x:"35.823",y:"166.788",fill:"#000",maskUnits:"userSpaceOnUse",children:[nt.jsx("path",{fill:"#fff",d:"M35.823 166.788h435v156h-435z"}),nt.jsx("path",{fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"})]}),nt.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"}),nt.jsx("path",{stroke:"#fff",strokeWidth:"0.3",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318Zm-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391Zm-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852Zm133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd",mask:"url(#path-6-outside-1_873_174)"})]}),nt.jsxs("defs",{children:[nt.jsxs("radialGradient",{id:"paint0_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(229.99965 647.20057 -371.3092 131.95444 -62.8 -86.4)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#6335EC"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsxs("radialGradient",{id:"paint1_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"rotate(-116.448 530.068 140.453)scale(1055.25 662.094)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#E6007A"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsx("clipPath",{id:"clip0_873_174",children:nt.jsx("rect",{width:"512",height:"512",fill:"#fff",rx:"256"})})]})]});rt.createRoot(document.getElementById("root")).render(nt.jsx(Ke.StrictMode,{children:nt.jsx(rI,{})})); + diff --git a/crates/pop-cli/src/wallet_integration.rs b/crates/pop-cli/src/wallet_integration.rs index 571b37d99..dfe43cfed 100644 --- a/crates/pop-cli/src/wallet_integration.rs +++ b/crates/pop-cli/src/wallet_integration.rs @@ -75,7 +75,7 @@ impl WalletIntegrationManager { payload: TransactionData, maybe_port: Option, ) -> Self { - let port = if let Some(port) = maybe_port { port } else { find_free_port(maybe_port) }; + let port = find_free_port(maybe_port); Self::new_with_address(frontend, payload, format!("127.0.0.1:{}", port)) } From 5e12dea260dcb90f52aec6a610a8f05b99682294 Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 17 Dec 2024 19:40:44 -0700 Subject: [PATCH 18/25] feat: update frontend with warning --- crates/pop-cli/src/assets/index.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/pop-cli/src/assets/index.html b/crates/pop-cli/src/assets/index.html index 4714210c6..9538725b2 100644 --- a/crates/pop-cli/src/assets/index.html +++ b/crates/pop-cli/src/assets/index.html @@ -7,7 +7,7 @@ href="data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_873_174)'%3E%3Crect width='512' height='512' rx='256' fill='%231C0533'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint0_radial_873_174)' fill-opacity='0.8'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint1_radial_873_174)' fill-opacity='0.6'/%3E%3Cmask id='mask0_873_174' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='-429' y='-502' width='1428' height='1351'%3E%3Cpath d='M127.637 -501.289L998.911 322.903L984.661 336.383L113.388 -487.809L127.637 -501.289Z' fill='%23D9D9D9'/%3E%3Cpath d='M88.9594 -464.701L960.232 359.491L945.983 372.971L74.7096 -451.221L88.9594 -464.701Z' fill='%23D9D9D9'/%3E%3Cpath d='M50.2814 -428.113L921.554 396.079L907.305 409.559L36.0316 -414.633L50.2814 -428.113Z' fill='%23D9D9D9'/%3E%3Cpath d='M11.6034 -391.525L882.876 432.667L868.627 446.147L-2.64642 -378.045L11.6034 -391.525Z' fill='%23D9D9D9'/%3E%3Cpath d='M-27.0746 -354.937L844.198 469.255L829.949 482.735L-41.3244 -341.457L-27.0746 -354.937Z' fill='%23D9D9D9'/%3E%3Cpath d='M-65.7526 -318.349L805.52 505.843L791.271 519.323L-80.0024 -304.869L-65.7526 -318.349Z' fill='%23D9D9D9'/%3E%3Cpath d='M-104.431 -281.761L766.842 542.431L752.593 555.911L-118.68 -268.281L-104.431 -281.761Z' fill='%23D9D9D9'/%3E%3Cpath d='M-143.109 -245.173L728.164 579.019L713.915 592.499L-157.358 -231.693L-143.109 -245.173Z' fill='%23D9D9D9'/%3E%3Cpath d='M-181.787 -208.585L689.486 615.607L675.237 629.087L-196.036 -195.105L-181.787 -208.585Z' fill='%23D9D9D9'/%3E%3Cpath d='M-220.465 -171.997L650.808 652.195L636.559 665.675L-234.714 -158.517L-220.465 -171.997Z' fill='%23D9D9D9'/%3E%3Cpath d='M-259.143 -135.409L612.13 688.783L597.881 702.263L-273.392 -121.929L-259.143 -135.409Z' fill='%23D9D9D9'/%3E%3Cpath d='M-297.821 -98.8211L573.452 725.371L559.203 738.851L-312.07 -85.3413L-297.821 -98.8211Z' fill='%23D9D9D9'/%3E%3Cpath d='M-336.499 -62.2331L534.774 761.959L520.525 775.439L-350.748 -48.7533L-336.499 -62.2331Z' fill='%23D9D9D9'/%3E%3Cpath d='M-375.177 -25.6452L496.096 798.547L481.847 812.026L-389.426 -12.1654L-375.177 -25.6452Z' fill='%23D9D9D9'/%3E%3Cpath d='M-413.855 10.9428L457.418 835.135L443.169 848.615L-428.104 24.4225L-413.855 10.9428Z' fill='%23D9D9D9'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_873_174)'%3E%3Cpath d='M511.169 254.929C511.169 396.905 396.739 512 255.584 512C114.428 512 -0.000976562 396.905 -0.000976562 254.929C-0.000976562 112.953 114.428 -2.14209 255.584 -2.14209C396.739 -2.14209 511.169 112.953 511.169 254.929Z' fill='%23E6007A'/%3E%3C/g%3E%3Cpath d='M183.804 160.44C171.052 151.144 156.458 147.168 141.864 147.168H52.2334L5.63086 367.567H122.684L132.083 322.765C141.879 321.622 151.384 318.84 160.403 314.394C161.8 313.705 163.178 312.986 164.536 312.239C168.249 321.014 173.177 329.173 179.315 336.581C187.573 346.548 197.657 354.366 209.117 360.016L209.12 360.018L209.517 360.213L209.917 360.399C222.605 366.289 236.098 368.784 249.63 368.784C263.218 368.784 276.507 366.489 289.292 361.868C295.36 359.675 301.212 357.046 306.832 353.988L303.961 367.567H421.013L430.413 322.765C440.209 321.622 449.714 318.84 458.733 314.394C469.61 309.03 479.317 301.877 487.672 293.046L487.682 293.035L487.841 292.867L487.995 292.7L487.998 292.697C496.09 283.931 502.611 273.995 507.338 262.975C512.203 251.631 514.88 239.536 514.88 226.953C514.88 214.447 512.231 202.327 507.001 190.977C501.508 178.753 493.141 168.335 482.134 160.44C469.382 151.144 454.788 147.168 440.194 147.168H350.563L345.323 171.949C338.297 165.041 330.227 159.445 321.314 155.191C308.55 148.958 294.91 146.357 281.28 146.357C267.691 146.357 254.402 148.652 241.618 153.273C229.473 157.663 218.174 163.78 207.814 171.541C205.377 173.358 203.011 175.252 200.715 177.221C196.062 170.823 190.408 165.177 183.804 160.44Z' fill='%232B0532'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M229.569 331.163L229.632 331.194L229.696 331.224C237.592 334.889 246.407 336.65 256.019 336.65C265.979 336.65 275.609 334.978 284.877 331.628C294.055 328.31 302.528 323.689 310.277 317.771C317.967 311.898 324.68 305.15 330.397 297.531L330.413 297.509L330.429 297.487C336.137 289.737 340.585 281.451 343.748 272.638C347.074 263.611 348.753 254.388 348.753 244.999C348.753 236.541 347.45 228.398 344.825 220.6C342.311 212.598 338.452 205.423 333.24 199.132C327.963 192.763 321.484 187.769 313.875 184.16C306.078 180.325 297.295 178.491 287.67 178.491C277.709 178.491 268.079 180.164 258.812 183.513C249.647 186.826 241.125 191.437 233.261 197.332C225.542 203.084 218.751 209.844 212.899 217.597L212.889 217.611C207.16 225.246 202.642 233.54 199.345 242.478L199.33 242.518L199.316 242.559C196.135 251.575 194.532 260.778 194.532 270.142C194.532 278.624 195.843 286.844 198.472 294.776L198.477 294.792L198.482 294.808C201.135 302.663 205.057 309.744 210.248 316.009C215.517 322.37 221.981 327.422 229.569 331.163ZM287.732 276.015L287.742 276C290.74 271.657 292.939 267.045 294.364 262.148C295.831 257.108 296.54 252.276 296.54 247.635C296.54 243.3 295.843 239.458 294.528 236.043L294.487 235.934L294.449 235.824C293.328 232.545 291.583 230.131 289.252 228.349C287.226 226.801 284.199 225.736 279.606 225.736C274.271 225.736 269.81 226.979 266.027 229.305L265.974 229.337L265.921 229.368C261.869 231.746 258.495 234.905 255.765 238.909C252.893 243.123 250.673 247.698 249.104 252.654C247.65 257.67 246.947 262.48 246.947 267.101C246.947 271.459 247.585 275.422 248.809 279.033C250.055 282.339 251.89 284.885 254.293 286.836C256.34 288.379 259.301 289.405 263.68 289.405C269.175 289.405 273.697 288.15 277.46 285.837C281.567 283.313 284.975 280.058 287.722 276.029L287.732 276.015Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M171.542 186.53C164.879 181.64 157.017 179.302 148.254 179.302H84.4909L51.4775 335.434H103.163L112.436 291.23H128.094C136.792 291.23 145.029 289.337 152.73 285.54C160.225 281.844 166.856 276.954 172.594 270.888L172.619 270.861L172.644 270.834C178.339 264.665 182.824 257.798 186.062 250.247C189.323 242.645 190.992 234.866 190.992 226.953C190.992 219.052 189.327 211.496 186.009 204.348C182.762 197.062 177.927 191.083 171.542 186.53ZM135.575 242.131L135.598 242.101C136.363 241.1 137.06 239.71 137.567 237.773L137.604 237.631L137.648 237.49C138.222 235.663 138.577 233.269 138.577 230.197C138.577 227.864 138.266 226.771 138.111 226.428C138.024 226.235 137.948 226.093 137.889 225.994L137.862 225.949L137.849 225.939H126.349L122.444 244.594H132.693C132.756 244.581 132.999 244.516 133.45 244.244C133.961 243.935 134.685 243.325 135.553 242.16L135.575 242.131Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M469.872 186.53C463.209 181.64 455.347 179.302 446.583 179.302H382.821L349.807 335.434H401.493L410.766 291.23H426.424C435.122 291.23 443.359 289.337 451.06 285.54C458.555 281.844 465.186 276.954 470.923 270.888L470.949 270.861L470.973 270.834C476.669 264.665 481.153 257.798 484.392 250.247C487.652 242.645 489.322 234.866 489.322 226.953C489.322 219.052 487.657 211.496 484.339 204.348C481.092 197.062 476.257 191.083 469.872 186.53ZM433.905 242.131L433.928 242.101C434.693 241.1 435.39 239.71 435.896 237.773L435.934 237.631L435.978 237.49C436.552 235.663 436.907 233.269 436.907 230.197C436.907 227.864 436.596 226.771 436.441 226.428C436.354 226.235 436.278 226.093 436.219 225.994L436.192 225.949L436.178 225.939H424.678L420.774 244.594H431.023C431.086 244.581 431.329 244.516 431.779 244.244C432.29 243.935 433.014 243.325 433.883 242.16L433.905 242.131Z' fill='%23E6007A'/%3E%3Cmask id='path-6-outside-1_873_174' maskUnits='userSpaceOnUse' x='35.8232' y='166.788' width='435' height='156' fill='black'%3E%3Crect fill='white' x='35.8232' y='166.788' width='435' height='156'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z'/%3E%3C/mask%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' stroke='white' stroke-width='0.3' mask='url(%23path-6-outside-1_873_174)'/%3E%3C/g%3E%3Cdefs%3E%3CradialGradient id='paint0_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(-62.8 -86.4) rotate(70.436) scale(686.854 394.059)'%3E%3Cstop stop-color='%236335EC'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='paint1_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(640.4 677.6) rotate(-116.448) scale(1055.25 662.094)'%3E%3Cstop stop-color='%23E6007A'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CclipPath id='clip0_873_174'%3E%3Crect width='512' height='512' rx='256' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A" /> Pop CLI Signing Portal - - + `],K);c$=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}([OA("dc-connection-button")],c$);const u$={chains:{},wallets:[new class extends QE{constructor(e){super(),X(this,"options"),this.options=e}async getWallets(){return await lS,(()=>{const{injectedWeb3:e}=window;return e?Object.keys(e):[]})().map((e=>new aS(e,this.options)))}}]};function d$(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function f$(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function p$(...e){return t=>{let n=!1;const r=e.map((e=>{const r=f$(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t{const t=n.map((e=>qe.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return qe.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=qe.createContext(r),i=n.length;n=[...n,r];const s=t=>{var n;const{scope:r,children:s,...a}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[i])||o,c=qe.useMemo((()=>a),Object.values(a));return nt.jsx(l.Provider,{value:c,children:s})};return s.displayName=t+"Provider",[s,function(n,s){var a;const l=(null==(a=null==s?void 0:s[e])?void 0:a[i])||o,c=qe.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},m$(r,...t)]}function m$(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return qe.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function g$(e){const t=qe.useRef(e);return qe.useEffect((()=>{t.current=e})),qe.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function y$({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=qe.useState(e),[r]=n,o=qe.useRef(r),i=g$(t);return qe.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,a=g$(n);return[s,qe.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&a(n)}else o(t)}),[i,e,o,a])]}!function(e){SA.next(e.wallets)}({wallets:u$.wallets});var b$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e,o=qe.Children.toArray(n),i=o.find(k$);if(i){const e=i.props.children,n=o.map((t=>t===i?qe.Children.count(e)>1?qe.Children.only(null):qe.isValidElement(e)?e.props.children:null:t));return nt.jsx(w$,{...r,ref:t,children:qe.isValidElement(e)?qe.cloneElement(e,void 0,n):null})}return nt.jsx(w$,{...r,ref:t,children:n})}));b$.displayName="Slot";var w$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e;if(qe.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n);return qe.cloneElement(n,{...E$(r,n.props),ref:t?p$(t,e):e})}return qe.Children.count(n)>1?qe.Children.only(null):null}));w$.displayName="SlotClone";var x$=({children:e})=>nt.jsx(nt.Fragment,{children:e});function k$(e){return qe.isValidElement(e)&&e.type===x$}function E$(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var S$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=qe.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?b$:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),nt.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function C$(e,t){e&&df.flushSync((()=>e.dispatchEvent(t)))}function _$(e){const t=e+"CollectionProvider",[n,r]=v$(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,r=Ke.useRef(null),i=Ke.useRef(new Map).current;return nt.jsx(o,{scope:t,itemMap:i,collectionRef:r,children:n})};s.displayName=t;const a=e+"CollectionSlot",l=Ke.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=h$(t,i(a,n).collectionRef);return nt.jsx(b$,{ref:o,children:r})}));l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=Ke.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,s=Ke.useRef(null),a=h$(t,s),l=i(c,n);return Ke.useEffect((()=>(l.itemMap.set(s,{ref:s,...o}),()=>{l.itemMap.delete(s)}))),nt.jsx(b$,{[u]:"",ref:a,children:r})}));return d.displayName=c,[{Provider:s,Slot:l,ItemSlot:d},function(t){const n=i(e+"CollectionConsumer",t),r=Ke.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${u}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}var A$=qe.createContext(void 0);function N$(e){const t=qe.useContext(A$);return e||t||"ltr"}var P$,$$="dismissableLayer.update",O$="dismissableLayer.pointerDownOutside",j$="dismissableLayer.focusOutside",R$=qe.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),M$=qe.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=qe.useContext(R$),[u,d]=qe.useState(null),f=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=qe.useState({}),h=h$(t,(e=>d(e))),v=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(m),y=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,w=y>=g,x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=g$(e),r=qe.useRef(!1),o=qe.useRef((()=>{}));return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){L$(O$,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));w&&!n&&(null==o||o(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f),k=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=g$(e),r=qe.useRef(!1);return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){L$(j$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=g$(e);qe.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{y===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&a&&(e.preventDefault(),a()))}),f),qe.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(P$=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),T$(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=P$)}}),[u,f,n,c]),qe.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),T$())}),[u,c]),qe.useEffect((()=>{const e=()=>p({});return document.addEventListener($$,e),()=>document.removeEventListener($$,e)}),[]),nt.jsx(S$.div,{...l,ref:h,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:d$(e.onFocusCapture,k.onFocusCapture),onBlurCapture:d$(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:d$(e.onPointerDownCapture,x.onPointerDownCapture)})}));M$.displayName="DismissableLayer";function T$(){const e=new CustomEvent($$);document.dispatchEvent(e)}function L$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?C$(o,i):o.dispatchEvent(i)}qe.forwardRef(((e,t)=>{const n=qe.useContext(R$),r=qe.useRef(null),o=h$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),nt.jsx(S$.div,{...e,ref:o})})).displayName="DismissableLayerBranch";var I$=0;function z$(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var D$="focusScope.autoFocusOnMount",B$="focusScope.autoFocusOnUnmount",U$={bubbles:!1,cancelable:!0},F$=qe.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=qe.useState(null),c=g$(o),u=g$(i),d=qe.useRef(null),f=h$(t,(e=>l(e))),p=qe.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;qe.useEffect((()=>{if(r){let e=function(e){if(p.paused||!a)return;const t=e.target;a.contains(t)?d.current=t:q$(d.current,{select:!0})},t=function(e){if(p.paused||!a)return;const t=e.relatedTarget;null!==t&&(a.contains(t)||q$(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&q$(a)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,a,p.paused]),qe.useEffect((()=>{if(a){K$.add(p);const t=document.activeElement;if(!a.contains(t)){const n=new CustomEvent(D$,U$);a.addEventListener(D$,c),a.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(q$(r,{select:t}),document.activeElement!==n)return}((e=H$(a),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&q$(a))}return()=>{a.removeEventListener(D$,c),setTimeout((()=>{const e=new CustomEvent(B$,U$);a.addEventListener(B$,u),a.dispatchEvent(e),e.defaultPrevented||q$(t??document.body,{select:!0}),a.removeEventListener(B$,u),K$.remove(p)}),0)}}var e}),[a,c,u,p]);const h=qe.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=H$(e),n=V$(t,e),r=V$(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&q$(i,{select:!0})):(e.preventDefault(),n&&q$(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return nt.jsx(S$.div,{tabIndex:-1,...s,ref:f,onKeyDown:h})}));function H$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function V$(e,t){for(const n of e)if(!W$(n,{upTo:t}))return n}function W$(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function q$(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}F$.displayName="FocusScope";var K$=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Q$(e,t),e.unshift(t)},remove(t){var n;e=Q$(e,t),null==(n=e[0])||n.resume()}}}();function Q$(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Y$=Boolean(null==globalThis?void 0:globalThis.document)?qe.useLayoutEffect:()=>{},G$=Qe["useId".toString()]||(()=>{}),J$=0;function X$(e){const[t,n]=qe.useState(G$());return Y$((()=>{n((e=>e??String(J$++)))}),[e]),t?`radix-${t}`:""}const Z$=["top","right","bottom","left"],eO=Math.min,tO=Math.max,nO=Math.round,rO=Math.floor,oO=e=>({x:e,y:e}),iO={left:"right",right:"left",bottom:"top",top:"bottom"},sO={start:"end",end:"start"};function aO(e,t,n){return tO(e,eO(t,n))}function lO(e,t){return"function"==typeof e?e(t):e}function cO(e){return e.split("-")[0]}function uO(e){return e.split("-")[1]}function dO(e){return"x"===e?"y":"x"}function fO(e){return"y"===e?"height":"width"}function pO(e){return["top","bottom"].includes(cO(e))?"y":"x"}function hO(e){return dO(pO(e))}function vO(e){return e.replace(/start|end/g,(e=>sO[e]))}function mO(e){return e.replace(/left|right|bottom|top/g,(e=>iO[e]))}function gO(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function yO(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function bO(e,t,n){let{reference:r,floating:o}=e;const i=pO(t),s=hO(t),a=fO(s),l=cO(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(uO(t)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1)}return p}async function wO(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=lO(t,e),h=gO(p),v=a[f?"floating"===d?"reference":"floating":d],m=yO(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=yO(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:l}):g);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}function xO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kO(e){return Z$.some((t=>e[t]>=0))}function EO(){return"undefined"!=typeof window}function SO(e){return AO(e)?(e.nodeName||"").toLowerCase():"#document"}function CO(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function _O(e){var t;return null==(t=(AO(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function AO(e){return!!EO()&&(e instanceof Node||e instanceof CO(e).Node)}function NO(e){return!!EO()&&(e instanceof Element||e instanceof CO(e).Element)}function PO(e){return!!EO()&&(e instanceof HTMLElement||e instanceof CO(e).HTMLElement)}function $O(e){return!(!EO()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof CO(e).ShadowRoot)}function OO(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=IO(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function jO(e){return["table","td","th"].includes(SO(e))}function RO(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(n){return!1}}))}function MO(e){const t=TO(),n=NO(e)?IO(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function TO(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function LO(e){return["html","body","#document"].includes(SO(e))}function IO(e){return CO(e).getComputedStyle(e)}function zO(e){return NO(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function DO(e){if("html"===SO(e))return e;const t=e.assignedSlot||e.parentNode||$O(e)&&e.host||_O(e);return $O(t)?t.host:t}function BO(e){const t=DO(e);return LO(t)?e.ownerDocument?e.ownerDocument.body:e.body:PO(t)&&OO(t)?t:BO(t)}function UO(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=BO(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=CO(o);if(i){const e=FO(s);return t.concat(s,s.visualViewport||[],OO(o)?o:[],e&&n?UO(e):[])}return t.concat(o,UO(o,[],n))}function FO(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HO(e){const t=IO(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=PO(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=nO(n)!==i||nO(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function VO(e){return NO(e)?e:e.contextElement}function WO(e){const t=VO(e);if(!PO(t))return oO(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=HO(t);let s=(i?nO(n.width):n.width)/r,a=(i?nO(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const qO=oO(0);function KO(e){const t=CO(e);return TO()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:qO}function QO(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=VO(e);let s=oO(1);t&&(r?NO(r)&&(s=WO(r)):s=WO(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==CO(e))&&t}(i,n,r)?KO(i):oO(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=CO(i),t=r&&NO(r)?CO(r):r;let n=e,o=FO(n);for(;o&&r&&t!==n;){const e=WO(o),t=o.getBoundingClientRect(),r=IO(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=CO(o),o=FO(n)}}return yO({width:u,height:d,x:l,y:c})}function YO(e,t){const n=zO(e).scrollLeft;return t?t.left+n:QO(_O(e)).left+n}function GO(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:YO(e,r)),y:r.top+t.scrollTop}}function JO(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=CO(e),r=_O(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=TO();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=_O(e),n=zO(e),r=e.ownerDocument.body,o=tO(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=tO(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+YO(e);const a=-n.scrollTop;return"rtl"===IO(r).direction&&(s+=tO(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(_O(e));else if(NO(t))r=function(e,t){const n=QO(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=PO(e)?WO(e):oO(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=KO(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yO(r)}function XO(e,t){const n=DO(e);return!(n===t||!NO(n)||LO(n))&&("fixed"===IO(n).position||XO(n,t))}function ZO(e,t,n){const r=PO(t),o=_O(t),i="fixed"===n,s=QO(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=oO(0);if(r||!r&&!i)if(("body"!==SO(t)||OO(o))&&(a=zO(t)),r){const e=QO(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=YO(o));const c=!o||r||i?oO(0):GO(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function ej(e){return"static"===IO(e).position}function tj(e,t){if(!PO(e)||"fixed"===IO(e).position)return null;if(t)return t(e);let n=e.offsetParent;return _O(e)===n&&(n=n.ownerDocument.body),n}function nj(e,t){const n=CO(e);if(RO(e))return n;if(!PO(e)){let t=DO(e);for(;t&&!LO(t);){if(NO(t)&&!ej(t))return t;t=DO(t)}return n}let r=tj(e,t);for(;r&&jO(r)&&ej(r);)r=tj(r,t);return r&&LO(r)&&ej(r)&&!MO(r)?n:r||function(e){let t=DO(e);for(;PO(t)&&!LO(t);){if(MO(t))return t;if(RO(t))return null;t=DO(t)}return null}(e)||n}const rj={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=_O(r),a=!!t&&RO(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=oO(1);const u=oO(0),d=PO(r);if((d||!d&&!i)&&(("body"!==SO(r)||OO(s))&&(l=zO(r)),PO(r))){const e=QO(r);c=WO(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!s||d||i?oO(0):GO(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:_O,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?RO(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=UO(e,[],!1).filter((e=>NO(e)&&"body"!==SO(e))),o=null;const i="fixed"===IO(e).position;let s=i?DO(e):e;for(;NO(s)&&!LO(s);){const t=IO(s),n=MO(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||OO(s)&&!n&&XO(e,s))?r=r.filter((e=>e!==s)):o=t,s=DO(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=JO(t,n,o);return e.top=tO(r.top,e.top),e.right=eO(r.right,e.right),e.bottom=eO(r.bottom,e.bottom),e.left=tO(r.left,e.left),e}),JO(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:nj,getElementRects:async function(e){const t=this.getOffsetParent||nj,n=this.getDimensions,r=await n(e.floating);return{reference:ZO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=HO(e);return{width:t,height:n}},getScale:WO,isElement:NO,isRTL:function(e){return"rtl"===IO(e).direction}};function oj(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=VO(e),u=o||i?[...c?UO(c):[],...UO(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=_O(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const p={rootMargin:-rO(u)+"px "+-rO(o.clientWidth-(c+d))+"px "+-rO(o.clientHeight-(u+f))+"px "+-rO(c)+"px",threshold:tO(0,eO(1,l))||1};let h=!0;function v(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(m){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let v=l?QO(e):null;return l&&function t(){const r=QO(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const ij=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=cO(n),a=uO(n),l="y"===pO(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=lO(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},sj=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=lO(e,t),c={x:n,y:r},u=await wO(t,l),d=pO(cO(o)),f=dO(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=aO(p+u["y"===f?"top":"left"],p,p-u[e])}if(s){const e="y"===d?"bottom":"right";h=aO(h+u["y"===d?"top":"left"],h,h-u[e])}const v=a.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[d]:s}}}}}},aj=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...m}=lO(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=cO(o),y=pO(a),b=cO(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!v?[mO(a)]:function(e){const t=mO(e);return[vO(e),t,vO(t)]}(a)),k="none"!==h;!f&&k&&x.push(...function(e,t,n,r){const o=uO(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(cO(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(vO)))),i}(a,v,h,w));const E=[a,...x],S=await wO(t,m),C=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(S[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=uO(e),o=hO(e),i=fO(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=mO(s)),[s,mO(s)]}(o,s,w);C.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:o,overflows:C}],!C.every((e=>e<=0))){var A,N;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(N=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=_.filter((e=>{if(k){const t=pO(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},lj=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=lO(e,t),u=await wO(t,c),d=cO(o),f=uO(o),p="y"===pO(o),{width:h,height:v}=i.floating;let m,g;"top"===d||"bottom"===d?(m=d,g=f===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,m="end"===f?"top":"bottom");const y=v-u.top-u.bottom,b=h-u.left-u.right,w=eO(v-u[m],y),x=eO(h-u[g],b),k=!t.middlewareData.shift;let E=w,S=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),k&&!f){const e=tO(u.left,0),t=tO(u.right,0),n=tO(u.top,0),r=tO(u.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:tO(u.left,u.right)):E=v-2*(0!==n||0!==r?n+r:tO(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:E});const C=await s.getDimensions(a.floating);return h!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}},cj=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=lO(e,t);switch(r){case"referenceHidden":{const e=xO(await wO(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:kO(e)}}}case"escaped":{const e=xO(await wO(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:kO(e)}}}default:return{}}}}},uj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=lO(e,t)||{};if(null==c)return{};const d=gO(u),f={x:n,y:r},p=hO(o),h=fO(p),v=await s.getDimensions(c),m="y"===p,g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-f[p]-i.floating[h],x=f[p]-i.reference[p],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=k?k[b]:0;E&&await(null==s.isElement?void 0:s.isElement(k))||(E=a.floating[b]||i.floating[h]);const S=w/2-x/2,C=E/2-v[h]/2-1,_=eO(d[g],C),A=eO(d[y],C),N=_,P=E-v[h]-A,$=E/2-v[h]/2+S,O=aO(N,$,P),j=!l.arrow&&null!=uO(o)&&$!==O&&i.reference[h]/2-($n&&(p=n)}if(c){var g,y;const e="y"===f?"width":"height",t=["top","left"].includes(cO(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=s.offset)?void 0:g[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);hr&&(h=r)}return{[f]:p,[d]:h}}}},fj=(e,t,n)=>{const r=new Map,o={platform:rj,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=bO(c,r,l),f=r,p={},h=0;for(let v=0;v{t.current=e})),t}const yj=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?uj({element:n.current,padding:r}).fn(t):{}:n?uj({element:n,padding:r}).fn(t):{};var o}}),bj=(e,t)=>({...ij(e),options:[e,t]}),wj=(e,t)=>({...sj(e),options:[e,t]}),xj=(e,t)=>({...dj(e),options:[e,t]}),kj=(e,t)=>({...aj(e),options:[e,t]}),Ej=(e,t)=>({...lj(e),options:[e,t]}),Sj=(e,t)=>({...cj(e),options:[e,t]}),Cj=(e,t)=>({...yj(e),options:[e,t]});var _j=qe.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return nt.jsx(S$.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:nt.jsx("polygon",{points:"0,0 30,0 15,10"})})}));_j.displayName="Arrow";var Aj=_j;var Nj="Popper",[Pj,$j]=v$(Nj),[Oj,jj]=Pj(Nj),Rj=e=>{const{__scopePopper:t,children:n}=e,[r,o]=qe.useState(null);return nt.jsx(Oj,{scope:t,anchor:r,onAnchorChange:o,children:n})};Rj.displayName=Nj;var Mj="PopperAnchor",Tj=qe.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=jj(Mj,n),s=qe.useRef(null),a=h$(t,s);return qe.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:nt.jsx(S$.div,{...o,ref:a})}));Tj.displayName=Mj;var Lj="PopperContent",[Ij,zj]=Pj(Lj),Dj=qe.forwardRef(((e,t)=>{var n,r,o,i,s,a;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:h=!0,collisionBoundary:v=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:w,...x}=e,k=jj(Lj,l),[E,S]=qe.useState(null),C=h$(t,(e=>S(e))),[_,A]=qe.useState(null),N=function(e){const[t,n]=qe.useState(void 0);return Y$((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(_),P=(null==N?void 0:N.width)??0,$=(null==N?void 0:N.height)??0,O=c+("center"!==d?"-"+d:""),j="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},R=Array.isArray(v)?v:[v],M=R.length>0,T={padding:j,boundary:R.filter(Hj),altBoundary:M},{refs:L,floatingStyles:I,placement:z,isPositioned:D,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=qe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=qe.useState(r);hj(f,r)||p(r);const[h,v]=qe.useState(null),[m,g]=qe.useState(null),y=qe.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),b=qe.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),w=i||h,x=s||m,k=qe.useRef(null),E=qe.useRef(null),S=qe.useRef(u),C=null!=l,_=gj(l),A=gj(o),N=gj(c),P=qe.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:f};A.current&&(e.platform=A.current),fj(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};$.current&&!hj(S.current,t)&&(S.current=t,df.flushSync((()=>{d(t)})))}))}),[f,t,n,A,N]);pj((()=>{!1===c&&S.current.isPositioned&&(S.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const $=qe.useRef(!1);pj((()=>($.current=!0,()=>{$.current=!1})),[]),pj((()=>{if(w&&(k.current=w),x&&(E.current=x),w&&x){if(_.current)return _.current(w,x,P);P()}}),[w,x,P,_,C]);const O=qe.useMemo((()=>({reference:k,floating:E,setReference:y,setFloating:b})),[y,b]),j=qe.useMemo((()=>({reference:w,floating:x})),[w,x]),R=qe.useMemo((()=>{const e={position:n,left:0,top:0};if(!j.floating)return e;const t=mj(j.floating,u.x),r=mj(j.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...vj(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,j.floating,u.x,u.y]);return qe.useMemo((()=>({...u,update:P,refs:O,elements:j,floatingStyles:R})),[u,P,O,j,R])}({strategy:"fixed",placement:O,whileElementsMounted:(...e)=>oj(...e,{animationFrame:"always"===b}),elements:{reference:k.anchor},middleware:[bj({mainAxis:u+$,alignmentAxis:f}),h&&wj({mainAxis:!0,crossAxis:!1,limiter:"partial"===g?xj():void 0,...T}),h&&kj({...T}),Ej({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),_&&Cj({element:_,padding:p}),Vj({arrowWidth:P,arrowHeight:$}),y&&Sj({strategy:"referenceHidden",...T})]}),[U,F]=Wj(z),H=g$(w);Y$((()=>{D&&(null==H||H())}),[D,H]);const V=null==(n=B.arrow)?void 0:n.x,W=null==(r=B.arrow)?void 0:r.y,q=0!==(null==(o=B.arrow)?void 0:o.centerOffset),[K,Q]=qe.useState();return Y$((()=>{E&&Q(window.getComputedStyle(E).zIndex)}),[E]),nt.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:D?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null==(i=B.transformOrigin)?void 0:i.x,null==(s=B.transformOrigin)?void 0:s.y].join(" "),...(null==(a=B.hide)?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:nt.jsx(Ij,{scope:l,placedSide:U,onArrowChange:A,arrowX:V,arrowY:W,shouldHideArrow:q,children:nt.jsx(S$.div,{"data-side":U,"data-align":F,...x,ref:C,style:{...x.style,animation:D?void 0:"none"}})})})}));Dj.displayName=Lj;var Bj="PopperArrow",Uj={top:"bottom",right:"left",bottom:"top",left:"right"},Fj=qe.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=zj(Bj,n),i=Uj[o.placedSide];return nt.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:nt.jsx(Aj,{...r,ref:t,style:{...r.style,display:"block"}})})}));function Hj(e){return null!==e}Fj.displayName=Bj;var Vj=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:s,middlewareData:a}=t,l=0!==(null==(n=a.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,f]=Wj(i),p={start:"0%",center:"50%",end:"100%"}[f],h=((null==(r=a.arrow)?void 0:r.x)??0)+c/2,v=((null==(o=a.arrow)?void 0:o.y)??0)+u/2;let m="",g="";return"bottom"===d?(m=l?p:`${h}px`,g=-u+"px"):"top"===d?(m=l?p:`${h}px`,g=`${s.floating.height+u}px`):"right"===d?(m=-u+"px",g=l?p:`${v}px`):"left"===d&&(m=`${s.floating.width+u}px`,g=l?p:`${v}px`),{data:{x:m,y:g}}}});function Wj(e){const[t,n="center"]=e.split("-");return[t,n]}var qj=Rj,Kj=Tj,Qj=Dj,Yj=Fj,Gj=qe.forwardRef(((e,t)=>{var n;const{container:r,...o}=e,[i,s]=qe.useState(!1);Y$((()=>s(!0)),[]);const a=r||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return a?ff.createPortal(nt.jsx(S$.div,{...o,ref:t}),a):null}));Gj.displayName="Portal";var Jj=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=qe.useState(),r=qe.useRef({}),o=qe.useRef(e),i=qe.useRef("none"),s=e?"mounted":"unmounted",[a,l]=function(e,t){return qe.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return qe.useEffect((()=>{const e=Xj(r.current);i.current="mounted"===a?e:"none"}),[a]),Y$((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,s=Xj(t);if(e)l("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==s?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,l]),Y$((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,s=i=>{const s=Xj(r.current).includes(i.animationName);if(i.target===t&&s&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(i.current=Xj(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:qe.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):qe.Children.only(n),i=h$(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?qe.cloneElement(o,{ref:i}):null};function Xj(e){return(null==e?void 0:e.animationName)||"none"}Jj.displayName="Presence";var Zj="rovingFocusGroup.onEntryFocus",eR={bubbles:!1,cancelable:!0},tR="RovingFocusGroup",[nR,rR,oR]=_$(tR),[iR,sR]=v$(tR,[oR]),[aR,lR]=iR(tR),cR=qe.forwardRef(((e,t)=>nt.jsx(nR.Provider,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(nR.Slot,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(uR,{...e,ref:t})})})));cR.displayName=tR;var uR=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=qe.useRef(null),p=h$(t,f),h=N$(i),[v=null,m]=y$({prop:s,defaultProp:a,onChange:l}),[g,y]=qe.useState(!1),b=g$(c),w=rR(n),x=qe.useRef(!1),[k,E]=qe.useState(0);return qe.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(Zj,b),()=>e.removeEventListener(Zj,b)}),[b]),nt.jsx(aR,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:v,onItemFocus:qe.useCallback((e=>m(e)),[m]),onItemShiftTab:qe.useCallback((()=>y(!0)),[]),onFocusableItemAdd:qe.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:qe.useCallback((()=>E((e=>e-1))),[]),children:nt.jsx(S$.div,{tabIndex:g||0===k?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:d$(e.onMouseDown,(()=>{x.current=!0})),onFocus:d$(e.onFocus,(e=>{const t=!x.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(Zj,eR);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=w().filter((e=>e.focusable));hR([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}x.current=!1})),onBlur:d$(e.onBlur,(()=>y(!1)))})})})),dR="RovingFocusGroupItem",fR=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=X$(),l=i||a,c=lR(dR,n),u=c.currentTabStopId===l,d=rR(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return qe.useEffect((()=>{if(r)return f(),()=>p()}),[r,f,p]),nt.jsx(nR.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:nt.jsx(S$.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:d$(e.onMouseDown,(e=>{r?c.onItemFocus(l):e.preventDefault()})),onFocus:d$(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:d$(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:pR[r]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=d().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=c.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>hR(o)))}var n,r}))})})}));fR.displayName=dR;var pR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hR(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var vR=cR,mR=fR,gR=new WeakMap,yR=new WeakMap,bR={},wR=0,xR=function(e){return e&&(e.host||xR(e.parentNode))},kR=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=xR(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);bR[n]||(bR[n]=new WeakMap);var i=bR[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(gR.get(e)||0)+1,c=(i.get(e)||0)+1;gR.set(e,l),i.set(e,c),s.push(e),1===l&&o&&yR.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",e,d)}}))};return u(t),a.clear(),wR++,function(){s.forEach((function(e){var t=gR.get(e)-1,o=i.get(e)-1;gR.set(e,t),i.set(e,o),t||(yR.has(e)||e.removeAttribute(r),yR.delete(e)),o||e.removeAttribute(n)})),--wR||(gR=new WeakMap,gR=new WeakMap,yR=new WeakMap,bR={})}},ER=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),kR(r,o,n,"aria-hidden")):function(){return null}},SR="right-scroll-bar-position",CR="width-before-scroll-bar";function _R(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var AR="undefined"!=typeof window?qe.useLayoutEffect:qe.useEffect,NR=new WeakMap;function PR(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach((function(e){return _R(e,t)}))},(o=qe.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return AR((function(){var t=NR.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach((function(e){r.has(e)||_R(e,null)})),r.forEach((function(e){n.has(e)||_R(e,o)}))}NR.set(i,e)}),[e]),i}function $R(e){return e}var OR=function(e){var t=e.sideCar,n=Qy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return qe.createElement(r,Ky({},n))};OR.isSideCarExport=!0;var jR=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=$R);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=Ky({async:!0,ssr:!1},e),t}(),RR=function(){},MR=qe.forwardRef((function(e,t){var n=qe.useRef(null),r=qe.useState({onScrollCapture:RR,onWheelCapture:RR,onTouchMoveCapture:RR}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,h=e.inert,v=e.allowPinchZoom,m=e.as,g=void 0===m?"div":m,y=e.gapMode,b=Qy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,x=PR([n,t]),k=Ky(Ky({},b),o);return qe.createElement(qe.Fragment,null,u&&qe.createElement(w,{sideCar:jR,removeScrollBar:c,shards:d,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:y}),s?qe.cloneElement(qe.Children.only(a),Ky(Ky({},k),{ref:x})):qe.createElement(g,Ky({},k,{className:l,ref:x}),a))}));MR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},MR.classNames={fullWidth:CR,zeroRight:SR};function TR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var LR=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=TR())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IR=function(){var e,t=(e=LR(),function(t,n){qe.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},zR={left:0,top:0,right:0,gap:0},DR=function(e){return parseInt(e||"",10)||0},BR=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return zR;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[DR(n),DR(r),DR(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},UR=IR(),FR="data-scroll-locked",HR=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(FR,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(SR," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(CR," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(SR," .").concat(SR," {\n right: 0 ").concat(r,";\n }\n \n .").concat(CR," .").concat(CR," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(FR,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},VR=function(){var e=parseInt(document.body.getAttribute(FR)||"0",10);return isFinite(e)?e:0},WR=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;qe.useEffect((function(){return document.body.setAttribute(FR,(VR()+1).toString()),function(){var e=VR()-1;e<=0?document.body.removeAttribute(FR):document.body.setAttribute(FR,e.toString())}}),[]);var i=qe.useMemo((function(){return BR(o)}),[o]);return qe.createElement(UR,{styles:HR(i,!t,o,n?"":"!important")})},qR=!1;if("undefined"!=typeof window)try{var KR=Object.defineProperty({},"passive",{get:function(){return qR=!0,!0}});window.addEventListener("test",KR,KR),window.removeEventListener("test",KR,KR)}catch(iI){qR=!1}var QR=!!qR&&{passive:!1},YR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},GR=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),JR(e,r)){var o=XR(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},JR=function(e,t){return"v"===e?function(e){return YR(e,"overflowY")}(t):function(e){return YR(e,"overflowX")}(t)},XR=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},ZR=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eM=function(e){return[e.deltaX,e.deltaY]},tM=function(e){return e&&"current"in e?e.current:e},nM=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},rM=0,oM=[];function iM(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const sM=(aM=function(e){var t=qe.useRef([]),n=qe.useRef([0,0]),r=qe.useRef(),o=qe.useState(rM++)[0],i=qe.useState(IR)[0],s=qe.useRef(e);qe.useEffect((function(){s.current=e}),[e]),qe.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Zy([e.lockRef.current],(e.shards||[]).map(tM),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var a=qe.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,i=ZR(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=GR(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=GR(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=XR(e,a),h=p[0],v=p[1]-p[2]-i*h;(h||v)&&JR(e,a)&&(d+=v,f+=h),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(f)<1)&&o||(c=!0),c}(p,t,e,"h"===p?l:c,!0)}),[]),l=qe.useCallback((function(e){var n=e;if(oM.length&&oM[oM.length-1]===i){var r="deltaY"in n?eM(n):ZR(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(s.current.shards||[]).map(tM).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?a(n,l[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),c=qe.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:iM(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),u=qe.useCallback((function(e){n.current=ZR(e),r.current=void 0}),[]),d=qe.useCallback((function(t){c(t.type,eM(t),t.target,a(t,e.lockRef.current))}),[]),f=qe.useCallback((function(t){c(t.type,ZR(t),t.target,a(t,e.lockRef.current))}),[]);qe.useEffect((function(){return oM.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,QR),document.addEventListener("touchmove",l,QR),document.addEventListener("touchstart",u,QR),function(){oM=oM.filter((function(e){return e!==i})),document.removeEventListener("wheel",l,QR),document.removeEventListener("touchmove",l,QR),document.removeEventListener("touchstart",u,QR)}}),[]);var p=e.removeScrollBar,h=e.inert;return qe.createElement(qe.Fragment,null,h?qe.createElement(i,{styles:nM(o)}):null,p?qe.createElement(WR,{gapMode:e.gapMode}):null)},jR.useMedium(aM),OR);var aM,lM=qe.forwardRef((function(e,t){return qe.createElement(MR,Ky({},e,{ref:t,sideCar:sM}))}));lM.classNames=MR.classNames;var cM=["Enter"," "],uM=["ArrowUp","PageDown","End"],dM=["ArrowDown","PageUp","Home",...uM],fM={ltr:[...cM,"ArrowRight"],rtl:[...cM,"ArrowLeft"]},pM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hM="Menu",[vM,mM,gM]=_$(hM),[yM,bM]=v$(hM,[gM,$j,sR]),wM=$j(),xM=sR(),[kM,EM]=yM(hM),[SM,CM]=yM(hM),_M=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=wM(t),[l,c]=qe.useState(null),u=qe.useRef(!1),d=g$(i),f=N$(o);return qe.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),nt.jsx(qj,{...a,children:nt.jsx(kM,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:nt.jsx(SM,{scope:t,onClose:qe.useCallback((()=>d(!1)),[d]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};_M.displayName=hM;var AM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=wM(n);return nt.jsx(Kj,{...o,...r,ref:t})}));AM.displayName="MenuAnchor";var NM="MenuPortal",[PM,$M]=yM(NM,{forceMount:void 0}),OM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=EM(NM,t);return nt.jsx(PM,{scope:t,forceMount:n,children:nt.jsx(Jj,{present:n||i.open,children:nt.jsx(Gj,{asChild:!0,container:o,children:r})})})};OM.displayName=NM;var jM="MenuContent",[RM,MM]=yM(jM),TM=qe.forwardRef(((e,t)=>{const n=$M(jM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=EM(jM,e.__scopeMenu),s=CM(jM,e.__scopeMenu);return nt.jsx(vM.Provider,{scope:e.__scopeMenu,children:nt.jsx(Jj,{present:r||i.open,children:nt.jsx(vM.Slot,{scope:e.__scopeMenu,children:s.modal?nt.jsx(LM,{...o,ref:t}):nt.jsx(IM,{...o,ref:t})})})})})),LM=qe.forwardRef(((e,t)=>{const n=EM(jM,e.__scopeMenu),r=qe.useRef(null),o=h$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return ER(e)}),[]),nt.jsx(zM,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:d$(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),IM=qe.forwardRef(((e,t)=>{const n=EM(jM,e.__scopeMenu);return nt.jsx(zM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),zM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...v}=e,m=EM(jM,n),g=CM(jM,n),y=wM(n),b=xM(n),w=mM(n),[x,k]=qe.useState(null),E=qe.useRef(null),S=h$(t,E,m.onContentChange),C=qe.useRef(0),_=qe.useRef(""),A=qe.useRef(0),N=qe.useRef(null),P=qe.useRef("right"),$=qe.useRef(0),O=h?lM:qe.Fragment,j=h?{as:b$,allowPinchZoom:!0}:void 0,R=e=>{var t,n;const r=_.current+e,o=w().filter((e=>!e.disabled)),i=document.activeElement,s=null==(t=o.find((e=>e.ref.current===i)))?void 0:t.textValue,a=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,s),l=null==(n=o.find((e=>e.textValue===a)))?void 0:n.ref.current;!function e(t){_.current=t,window.clearTimeout(C.current),""!==t&&(C.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};qe.useEffect((()=>()=>window.clearTimeout(C.current)),[]),qe.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??z$()),document.body.insertAdjacentElement("beforeend",e[1]??z$()),I$++,()=>{1===I$&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),I$--}}),[]);const M=qe.useCallback((e=>{var t,n;return P.current===(null==(t=N.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=c>r&&n<(l-e)*(r-a)/(c-a)+e&&(o=!o)}return o}(n,t)}(e,null==(n=N.current)?void 0:n.area)}),[]);return nt.jsx(RM,{scope:n,searchRef:_,onItemEnter:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),onItemLeave:qe.useCallback((e=>{var t;M(e)||(null==(t=E.current)||t.focus(),k(null))}),[M]),onTriggerLeave:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),pointerGraceTimerRef:A,onPointerGraceIntentChange:qe.useCallback((e=>{N.current=e}),[]),children:nt.jsx(O,{...j,children:nt.jsx(F$,{asChild:!0,trapped:o,onMountAutoFocus:d$(i,(e=>{var t;e.preventDefault(),null==(t=E.current)||t.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:nt.jsx(M$,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:nt.jsx(vR,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:k,onEntryFocus:d$(l,(e=>{g.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:nt.jsx(Qj,{role:"menu","aria-orientation":"vertical","data-state":uT(m.open),"data-radix-menu-content":"",dir:g.dir,...y,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:d$(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&R(e.key));const o=E.current;if(e.target!==o)return;if(!dM.includes(e.key))return;e.preventDefault();const i=w().filter((e=>!e.disabled)).map((e=>e.ref.current));uM.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:d$(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),_.current="")})),onPointerMove:d$(e.onPointerMove,pT((e=>{const t=e.target,n=$.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>$.current?"right":"left";P.current=t,$.current=e.clientX}})))})})})})})})}));TM.displayName=jM;var DM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(S$.div,{role:"group",...r,ref:t})}));DM.displayName="MenuGroup";var BM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(S$.div,{...r,ref:t})}));BM.displayName="MenuLabel";var UM="MenuItem",FM="menu.itemSelect",HM=qe.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=qe.useRef(null),s=CM(UM,e.__scopeMenu),a=MM(UM,e.__scopeMenu),l=h$(t,i),c=qe.useRef(!1);return nt.jsx(VM,{...o,ref:l,disabled:n,onClick:d$(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(FM,{bubbles:!0,cancelable:!0});e.addEventListener(FM,(e=>null==r?void 0:r(e)),{once:!0}),C$(e,t),t.defaultPrevented?c.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null==(n=e.onPointerDown)||n.call(e,t),c.current=!0},onPointerUp:d$(e.onPointerUp,(e=>{var t;c.current||null==(t=e.currentTarget)||t.click()})),onKeyDown:d$(e.onKeyDown,(e=>{const t=""!==a.searchRef.current;n||t&&" "===e.key||cM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));HM.displayName=UM;var VM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=MM(UM,n),a=xM(n),l=qe.useRef(null),c=h$(t,l),[u,d]=qe.useState(!1),[f,p]=qe.useState("");return qe.useEffect((()=>{const e=l.current;e&&p((e.textContent??"").trim())}),[i.children]),nt.jsx(vM.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:nt.jsx(mR,{asChild:!0,...a,focusable:!r,children:nt.jsx(S$.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:d$(e.onPointerMove,pT((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:d$(e.onPointerLeave,pT((e=>s.onItemLeave(e)))),onFocus:d$(e.onFocus,(()=>d(!0))),onBlur:d$(e.onBlur,(()=>d(!1)))})})})})),WM=qe.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return nt.jsx(ZM,{scope:e.__scopeMenu,checked:n,children:nt.jsx(HM,{role:"menuitemcheckbox","aria-checked":dT(n)?"mixed":n,...o,ref:t,"data-state":fT(n),onSelect:d$(o.onSelect,(()=>null==r?void 0:r(!!dT(n)||!n)),{checkForDefaultPrevented:!1})})})}));WM.displayName="MenuCheckboxItem";var qM="MenuRadioGroup",[KM,QM]=yM(qM,{value:void 0,onValueChange:()=>{}}),YM=qe.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=g$(r);return nt.jsx(KM,{scope:e.__scopeMenu,value:n,onValueChange:i,children:nt.jsx(DM,{...o,ref:t})})}));YM.displayName=qM;var GM="MenuRadioItem",JM=qe.forwardRef(((e,t)=>{const{value:n,...r}=e,o=QM(GM,e.__scopeMenu),i=n===o.value;return nt.jsx(ZM,{scope:e.__scopeMenu,checked:i,children:nt.jsx(HM,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":fT(i),onSelect:d$(r.onSelect,(()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,n)}),{checkForDefaultPrevented:!1})})})}));JM.displayName=GM;var XM="MenuItemIndicator",[ZM,eT]=yM(XM,{checked:!1}),tT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=eT(XM,n);return nt.jsx(Jj,{present:r||dT(i.checked)||!0===i.checked,children:nt.jsx(S$.span,{...o,ref:t,"data-state":fT(i.checked)})})}));tT.displayName=XM;var nT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(S$.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));nT.displayName="MenuSeparator";var rT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=wM(n);return nt.jsx(Yj,{...o,...r,ref:t})}));rT.displayName="MenuArrow";var[oT,iT]=yM("MenuSub"),sT="MenuSubTrigger",aT=qe.forwardRef(((e,t)=>{const n=EM(sT,e.__scopeMenu),r=CM(sT,e.__scopeMenu),o=iT(sT,e.__scopeMenu),i=MM(sT,e.__scopeMenu),s=qe.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=qe.useCallback((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return qe.useEffect((()=>u),[u]),qe.useEffect((()=>{const e=a.current;return()=>{window.clearTimeout(e),l(null)}}),[a,l]),nt.jsx(AM,{asChild:!0,...c,children:nt.jsx(VM,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":uT(n.open),...e,ref:p$(t,o.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:d$(e.onPointerMove,pT((t=>{i.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),u()}),100))}))),onPointerLeave:d$(e.onPointerLeave,pT((e=>{var t,r;u();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,s="right"===t,l=s?-5:5,c=o[s?"left":"right"],u=o[s?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+l,y:e.clientY},{x:c,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:c,y:o.bottom}],side:t}),window.clearTimeout(a.current),a.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:d$(e.onKeyDown,(t=>{var o;const s=""!==i.searchRef.current;e.disabled||s&&" "===t.key||fM[r.dir].includes(t.key)&&(n.onOpenChange(!0),null==(o=n.content)||o.focus(),t.preventDefault())}))})})}));aT.displayName=sT;var lT="MenuSubContent",cT=qe.forwardRef(((e,t)=>{const n=$M(jM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=EM(jM,e.__scopeMenu),s=CM(jM,e.__scopeMenu),a=iT(lT,e.__scopeMenu),l=qe.useRef(null),c=h$(t,l);return nt.jsx(vM.Provider,{scope:e.__scopeMenu,children:nt.jsx(Jj,{present:r||i.open,children:nt.jsx(vM.Slot,{scope:e.__scopeMenu,children:nt.jsx(zM,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null==(t=l.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:d$(e.onFocusOutside,(e=>{e.target!==a.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:d$(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:d$(e.onKeyDown,(e=>{var t;const n=e.currentTarget.contains(e.target),r=pM[s.dir].includes(e.key);n&&r&&(i.onOpenChange(!1),null==(t=a.trigger)||t.focus(),e.preventDefault())}))})})})})}));function uT(e){return e?"open":"closed"}function dT(e){return"indeterminate"===e}function fT(e){return dT(e)?"indeterminate":e?"checked":"unchecked"}function pT(e){return t=>"mouse"===t.pointerType?e(t):void 0}cT.displayName=lT;var hT=_M,vT=AM,mT=OM,gT=TM,yT=DM,bT=BM,wT=HM,xT=WM,kT=YM,ET=JM,ST=tT,CT=nT,_T=rT,AT=aT,NT=cT,PT="DropdownMenu",[$T,OT]=v$(PT,[bM]),jT=bM(),[RT,MT]=$T(PT),TT=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=jT(t),c=qe.useRef(null),[u=!1,d]=y$({prop:o,defaultProp:i,onChange:s});return nt.jsx(RT,{scope:t,triggerId:X$(),triggerRef:c,contentId:X$(),open:u,onOpenChange:d,onOpenToggle:qe.useCallback((()=>d((e=>!e))),[d]),modal:a,children:nt.jsx(hT,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};TT.displayName=PT;var LT="DropdownMenuTrigger",IT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=MT(LT,n),s=jT(n);return nt.jsx(vT,{asChild:!0,...s,children:nt.jsx(S$.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:p$(t,i.triggerRef),onPointerDown:d$(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:d$(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));IT.displayName=LT;var zT=e=>{const{__scopeDropdownMenu:t,...n}=e,r=jT(t);return nt.jsx(mT,{...r,...n})};zT.displayName="DropdownMenuPortal";var DT="DropdownMenuContent",BT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(DT,n),i=jT(n),s=qe.useRef(!1);return nt.jsx(gT,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:d$(e.onCloseAutoFocus,(e=>{var t;s.current||null==(t=o.triggerRef.current)||t.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:d$(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;o.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));BT.displayName=DT;qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(yT,{...o,...r,ref:t})})).displayName="DropdownMenuGroup";var UT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(bT,{...o,...r,ref:t})}));UT.displayName="DropdownMenuLabel";var FT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(wT,{...o,...r,ref:t})}));FT.displayName="DropdownMenuItem";var HT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(xT,{...o,...r,ref:t})}));HT.displayName="DropdownMenuCheckboxItem";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(kT,{...o,...r,ref:t})})).displayName="DropdownMenuRadioGroup";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(ET,{...o,...r,ref:t})})).displayName="DropdownMenuRadioItem";var VT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(ST,{...o,...r,ref:t})}));VT.displayName="DropdownMenuItemIndicator";var WT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(CT,{...o,...r,ref:t})}));WT.displayName="DropdownMenuSeparator";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(_T,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var qT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(AT,{...o,...r,ref:t})}));qT.displayName="DropdownMenuSubTrigger";var KT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jT(n);return nt.jsx(NT,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));KT.displayName="DropdownMenuSubContent";var QT=TT,YT=IT,GT=zT,JT=BT,XT=UT,ZT=FT,eL=HT,tL=VT,nL=WT,rL=qT,oL=KT;const iL=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim();var sL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const aL=qe.forwardRef((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>qe.createElement("svg",{ref:l,...sL,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:iL("lucide",o),...a},[...s.map((([e,t])=>qe.createElement(e,t))),...Array.isArray(i)?i:[i]]))),lL=(e,t)=>{const n=qe.forwardRef((({className:n,...r},o)=>{return qe.createElement(aL,{ref:o,iconNode:t,className:iL(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},cL=lL("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),uL=lL("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),dL=QT,fL=YT;qe.forwardRef((({className:e,inset:t,children:n,...r},o)=>nt.jsxs(rL,{ref:o,className:ap("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,nt.jsx(uL,{className:"ml-auto h-4 w-4"})]}))).displayName=rL.displayName;qe.forwardRef((({className:e,...t},n)=>nt.jsx(oL,{ref:n,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}))).displayName=oL.displayName;const pL=qe.forwardRef((({className:e,sideOffset:t=4,...n},r)=>nt.jsx(GT,{children:nt.jsx(JT,{ref:r,sideOffset:t,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})));pL.displayName=JT.displayName;const hL=qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(ZT,{ref:r,className:ap("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n})));hL.displayName=ZT.displayName;qe.forwardRef((({className:e,children:t,checked:n,...r},o)=>nt.jsxs(eL,{ref:o,className:ap("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[nt.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:nt.jsx(tL,{children:nt.jsx(cL,{className:"h-4 w-4"})})}),t]}))).displayName=eL.displayName;qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(XT,{ref:r,className:ap("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}))).displayName=XT.displayName;const vL=qe.forwardRef((({className:e,...t},n)=>nt.jsx(nL,{ref:n,className:ap("-mx-1 my-1 h-px bg-muted",e),...t})));vL.displayName=nL.displayName;const mL=new Set(["children","localName","ref","style","className"]),gL=new WeakMap,yL=(e,t,n,r,o)=>{const i=null==o?void 0:o[t];void 0===i?(e[t]=n,null==n&&t in HTMLElement.prototype&&e.removeAttribute(t)):n!==r&&((e,t,n)=>{let r=gL.get(e);void 0===r&&gL.set(e,r=new Map);let o=r.get(t);void 0!==n?void 0===o?(r.set(t,o={handleEvent:n}),e.addEventListener(t,o)):o.handleEvent=n:void 0!==o&&(r.delete(t),e.removeEventListener(t,o))})(e,i,n)},bL=({react:e,tagName:t,elementClass:n,events:r,displayName:o})=>{const i=new Set(Object.keys(r??{})),s=e.forwardRef(((o,s)=>{const a=e.useRef(new Map),l=e.useRef(null),c={},u={};for(const[e,t]of Object.entries(o))mL.has(e)?c["className"===e?"class":e]=t:i.has(e)||e in n.prototype?u[e]=t:c[e]=t;return e.useLayoutEffect((()=>{if(null===l.current)return;const e=new Map;for(const t in u)yL(l.current,t,o[t],a.current.get(t),r),a.current.delete(t),e.set(t,o[t]);for(const[t,n]of a.current)yL(l.current,t,void 0,n,r);a.current=e})),e.useLayoutEffect((()=>{var e;null==(e=l.current)||e.removeAttribute("defer-hydration")}),[]),c.suppressHydrationWarning=!0,e.createElement(t,{...c,ref:e.useCallback((e=>{l.current=e,"function"==typeof s?s(e):null!==s&&(s.current=e)}),[s])})}));return s.displayName=o??n.name,s};bL({tagName:"dc-connection-button",elementClass:c$,react:Ke});const wL=bL({tagName:"dc-connection-dialog",elementClass:n$,react:Ke,events:{onClose:"close"}});function xL(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}function kL(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}}function EL(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function SL(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const o=[],i=Array.from(e);for(i.forEach((e=>{if(e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,s=!0;for(let o=r;o{if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(t))throw new Error("radix.encode input should be Uint8Array");return SL(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(SL(t,e,256))}}}const _L=(e=>xL(CL(58),kL(e),EL("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function AL(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function NL(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function PL(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const $L=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),OL=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],jL=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,RL=OL?e=>e:e=>jL(e);function ML(e){for(let t=0;te(n).update(TL(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}const zL=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class DL extends LL{constructor(e,t,n={},r,o,i){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,AL(e),AL(t),AL(r),t<0||t>r)throw new Error("outputLen bigger than keyLen");if(void 0!==n.key&&(n.key.length<1||n.key.length>r))throw new Error(`key must be up 1..${r} byte long or undefined`);if(void 0!==n.salt&&n.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(void 0!==n.personalization&&n.personalization.length!==i)throw new Error(`personalization must be ${i} byte long or undefined`);this.buffer32=$L(this.buffer=new Uint8Array(e))}update(e){PL(this);const{blockLen:t,buffer:n,buffer32:r}=this,o=(e=TL(e)).length,i=e.byteOffset,s=e.buffer;for(let a=0;ar[t]=RL(e)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){const{buffer:t,length:n,finished:r,destroyed:o,outputLen:i,pos:s}=this;return e||(e=new this.constructor({dkLen:i})),e.set(...this.get()),e.length=n,e.finished=r,e.destroyed=o,e.outputLen=i,e.buffer.set(t),e.pos=s,e}}const BL=BigInt(2**32-1),UL=BigInt(32);function FL(e,t=!1){return t?{h:Number(e&BL),l:Number(e>>UL&BL)}:{h:0|Number(e>>UL&BL),l:0|Number(e&BL)}}const HL={fromBig:FL,split:function(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<>>32-n,rotlSL:(e,t,n)=>t<>>32-n,rotlBH:(e,t,n)=>t<>>64-n,rotlBL:(e,t,n)=>e<>>64-n,add:function(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,add5H:(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,add5L:(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0)},VL=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),WL=new Uint32Array(32);function qL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=WL[2*e],c=WL[2*e+1],u=WL[2*t],d=WL[2*t+1],f=WL[2*n],p=WL[2*n+1],h=WL[2*r],v=WL[2*r+1],m=HL.add3L(l,u,s);c=HL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:HL.rotr32H(v,h),Dl:HL.rotr32L(v,h)}),({h:p,l:f}=HL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:HL.rotrSH(d,u,24),Bl:HL.rotrSL(d,u,24)}),WL[2*e]=l,WL[2*e+1]=c,WL[2*t]=u,WL[2*t+1]=d,WL[2*n]=f,WL[2*n+1]=p,WL[2*r]=h,WL[2*r+1]=v}function KL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=WL[2*e],c=WL[2*e+1],u=WL[2*t],d=WL[2*t+1],f=WL[2*n],p=WL[2*n+1],h=WL[2*r],v=WL[2*r+1],m=HL.add3L(l,u,s);c=HL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:HL.rotrSH(v,h,16),Dl:HL.rotrSL(v,h,16)}),({h:p,l:f}=HL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:HL.rotrBH(d,u,63),Bl:HL.rotrBL(d,u,63)}),WL[2*e]=l,WL[2*e+1]=c,WL[2*t]=u,WL[2*t+1]=d,WL[2*n]=f,WL[2*n+1]=p,WL[2*r]=h,WL[2*r+1]=v}class QL extends DL{constructor(e={}){super(128,void 0===e.dkLen?64:e.dkLen,e,64,16,16),this.v0l=0|VL[0],this.v0h=0|VL[1],this.v1l=0|VL[2],this.v1h=0|VL[3],this.v2l=0|VL[4],this.v2h=0|VL[5],this.v3l=0|VL[6],this.v3h=0|VL[7],this.v4l=0|VL[8],this.v4h=0|VL[9],this.v5l=0|VL[10],this.v5h=0|VL[11],this.v6l=0|VL[12],this.v6h=0|VL[13],this.v7l=0|VL[14],this.v7h=0|VL[15];const t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|65536|1<<24,e.salt){const t=$L(TL(e.salt));this.v4l^=RL(t[0]),this.v4h^=RL(t[1]),this.v5l^=RL(t[2]),this.v5h^=RL(t[3])}if(e.personalization){const t=$L(TL(e.personalization));this.v6l^=RL(t[0]),this.v6h^=RL(t[1]),this.v7l^=RL(t[2]),this.v7h^=RL(t[3])}if(e.key){const t=new Uint8Array(this.blockLen);t.set(TL(e.key)),this.update(t)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:o,v2h:i,v3l:s,v3h:a,v4l:l,v4h:c,v5l:u,v5h:d,v6l:f,v6h:p,v7l:h,v7h:v}=this;return[e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v]}set(e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v){this.v0l=0|e,this.v0h=0|t,this.v1l=0|n,this.v1h=0|r,this.v2l=0|o,this.v2h=0|i,this.v3l=0|s,this.v3h=0|a,this.v4l=0|l,this.v4h=0|c,this.v5l=0|u,this.v5h=0|d,this.v6l=0|f,this.v6h=0|p,this.v7l=0|h,this.v7h=0|v}compress(e,t,n){this.get().forEach(((e,t)=>WL[t]=e)),WL.set(VL,16);let{h:r,l:o}=HL.fromBig(BigInt(this.length));WL[24]=VL[8]^o,WL[25]=VL[9]^r,n&&(WL[28]=~WL[28],WL[29]=~WL[29]);let i=0;const s=zL;for(let a=0;a<12;a++)qL(0,4,8,12,e,t+2*s[i++]),KL(0,4,8,12,e,t+2*s[i++]),qL(1,5,9,13,e,t+2*s[i++]),KL(1,5,9,13,e,t+2*s[i++]),qL(2,6,10,14,e,t+2*s[i++]),KL(2,6,10,14,e,t+2*s[i++]),qL(3,7,11,15,e,t+2*s[i++]),KL(3,7,11,15,e,t+2*s[i++]),qL(0,5,10,15,e,t+2*s[i++]),KL(0,5,10,15,e,t+2*s[i++]),qL(1,6,11,12,e,t+2*s[i++]),KL(1,6,11,12,e,t+2*s[i++]),qL(2,7,8,13,e,t+2*s[i++]),KL(2,7,8,13,e,t+2*s[i++]),qL(3,4,9,14,e,t+2*s[i++]),KL(3,4,9,14,e,t+2*s[i++]);this.v0l^=WL[0]^WL[16],this.v0h^=WL[1]^WL[17],this.v1l^=WL[2]^WL[18],this.v1h^=WL[3]^WL[19],this.v2l^=WL[4]^WL[20],this.v2h^=WL[5]^WL[21],this.v3l^=WL[6]^WL[22],this.v3h^=WL[7]^WL[23],this.v4l^=WL[8]^WL[24],this.v4h^=WL[9]^WL[25],this.v5l^=WL[10]^WL[26],this.v5h^=WL[11]^WL[27],this.v6l^=WL[12]^WL[28],this.v6h^=WL[13]^WL[29],this.v7l^=WL[14]^WL[30],this.v7h^=WL[15]^WL[31],WL.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const YL=IL((e=>new QL(e))),GL=(new TextEncoder).encode("SS58PRE"),JL=e=>{try{const t=_L.decode(e),n=t.subarray(0,64&t[0]?2:1),r=t.subarray(n.length,t.length-2),o=t.subarray(n.length+r.length),i=YL(Uint8Array.of(...GL,...n,...r),{dkLen:64}).subarray(0,2);return o[0]===i[0]&&o[1]===i[1]?{isValid:!0,ss58Format:XL(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},XL=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return 1===t.byteLength?t.getUint8(0):t.getUint16(0)},ZL={target:{colors:[0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,1],freq:1},cube:{colors:[0,1,3,2,4,3,0,1,3,2,4,3,0,1,3,2,4,3,5],freq:20},quazar:{colors:[1,2,3,1,2,4,5,5,4,1,2,3,1,2,4,5,5,4,0],freq:16},flower:{colors:[0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,3],freq:32},cyclic:{colors:[0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,6],freq:32},vmirror:{colors:[0,1,2,3,4,5,3,4,2,0,1,6,7,8,9,7,8,6,10],freq:128},hmirror:{colors:[0,1,2,3,4,5,6,7,8,9,10,8,6,7,5,3,4,2,11],freq:128}},eI=e=>{let t=0;const n=Object.values(ZL).find((n=>(t+=n.freq,e{var l;const[c,u]=qe.useState(!1),[d,f]=qe.useState(i),[p,h]=qe.useState(),[v,m]=qe.useState(),[g,y]=qe.useState();qe.useEffect((()=>{if("string"==typeof e&&!e.includes("px")&&!e.includes("rem"))throw new Error("Providing a string for 'size' in Polkicon should be expressed either in 'px', 'rem' or 'em'");let t,n;if("string"==typeof e)switch(n=e.replace(/[0-9.]/g,""),n){case"px":t=parseFloat(e);break;case"rem":t=10*parseFloat(e)}else"number"==typeof e&&(t=e);var r,o;h(n?""+("px"===n?t+"px":t/10+"rem"):t),t<12&&(r=n||"number",o="px"===n?"12px":"rem"===n?"1.2rem":12,console.warn(`Polkicon: 'Size' expressed in '${r}' cannot be less than ${o}. Will be resized to minimum size.`)),t<32?(y("0rem 0.5rem"),m("0.5rem")):t>=32&&t<64?(y("1rem 0.5rem"),m("1rem")):t>=64&&t<100?(y("2rem 1rem"),m("1.5rem")):t>=100&&(y("3rem 1rem"),m("2rem"))}),[e]);const b=qe.useCallback((()=>{n&&(async e=>{try{await navigator.clipboard.writeText(e),u(!0),f(i)}catch{u(!0),f("Failed!")}})(t)}),[n,t,i]);qe.useEffect((()=>{n&&c&&setTimeout((()=>{u(!1)}),o)}),[n,c,o]);const{c:w,r:x,rroot3o2:k,ro2:E,rroot3o4:S,ro4:C,r3o4:_,z:A,rot:N,scheme:P,palette:$}=(e=>{const t=YL(new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),n=JL(e);let r=n.isValid?n.publicKey:e;if(!("object"==typeof r&&r&&r instanceof Uint8Array&&32==r.length))return{};r=Uint8Array.from(YL(r)).map(((e,n)=>(e+256-t[n])%256));const o=22.4,i=o*Math.sqrt(3)/2,s=o*Math.sqrt(3)/4,a=3*o/4,l=Object.keys(ZL).map((e=>ZL[e].freq)).reduce(((e,t)=>e+t)),c=Math.floor(70*r[29]/256+26)%80+30,u=Math.floor((r[30]+256*r[31])%l),d=eI(u),f=Array.from(r).map(((e,t)=>{const n=(e+t%28*58)%256;if(0==n)return"#444";if(255==n)return"transparent";const r=Math.floor(n%64*360/64),o=[53,15,35,75][Math.floor(n/64)];return`hsl(${r}, ${c}%, ${o}%)`}));return{c:32,r:o,rroot3o2:i,ro2:11.2,rroot3o4:s,ro4:5.6,r3o4:a,z:5,rot:r[28]%6*3,scheme:d,palette:f}})(t),O=JL(t).isValid?null==(l=null==P?void 0:P.colors)?void 0:l.map(((e,t)=>$[null==P?void 0:P.colors[t<18?(t+N)%18:18]])):[];let j=0;return O?nt.jsxs("div",{onClick:n?b:void 0,style:n?{cursor:c?"none":"copy",position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}:{display:"flex",justifyContent:"center",alignItems:"center"},children:[nt.jsxs("svg",{id:Math.random().toString(36).substring(2,9),className:a,style:s,width:p,height:p,viewBox:"0 0 64 64",children:[nt.jsx("circle",{cx:32,cy:32,r:32,fill:r}),nt.jsx("circle",{cx:w,cy:w-x,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w,cy:w-E,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w-S,cy:w-_,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w-k,cy:w-E,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w-S,cy:w-C,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w-k,cy:w,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w-k,cy:w+E,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w-S,cy:w+C,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w-S,cy:w+_,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w,cy:w+x,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w,cy:w+E,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w+S,cy:w+_,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w+k,cy:w+E,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w+S,cy:w+C,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w+k,cy:w,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w+k,cy:w-E,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w+S,cy:w-C,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w+S,cy:w-_,r:A,fill:O[j++]}),nt.jsx("circle",{cx:w,cy:w,r:A,fill:O[j++]})]}),n&&c&&nt.jsx("p",{style:{fontSize:v,fontWeight:"bold",padding:g,width:p,height:p,position:"absolute",borderRadius:"55rem",color:"white",background:"green",opacity:"80%",alignItems:"center",justifyContent:"center",display:"flex"},children:d})]}):null},nI=()=>{const{accounts:e,selectAccount:t,selectedAccount:n}=QS(),[,r]=DS(),[o,i]=qe.useState(!1);return qe.useEffect((()=>{!(null==n?void 0:n.address)&&e.length>0&&(t(e[0]),i(!1))}),[e,t,null==n?void 0:n.address]),nt.jsxs(nt.Fragment,{children:[nt.jsx("div",{className:"flex w-full justify-center",children:nt.jsxs("div",{className:"flex w-full",children:[!e.length&&nt.jsx(aC,{onClick:()=>i(!0),className:"w-full text-lg font-bold bg-pink-700 hover:bg-blue-600",children:"Connect Wallet"}),!!e.length&&nt.jsxs(dL,{children:[nt.jsx(fL,{asChild:!0,children:nt.jsxs(aC,{variant:"outline",size:"default",className:"cursor-pointer overflow-hidden w-full flex items-center justify-center gap-2",children:[nt.jsx(tI,{size:36,address:(null==n?void 0:n.address)||"",className:"mr-2",outerColor:"transparent"}),null==n?void 0:n.name,nt.jsx(cC,{className:"ml-2 h-4 w-4",isOpen:!1})]})}),nt.jsxs(pL,{className:"max-h-[calc(100vh-5rem)] overflow-auto",children:[e.map(((n,r)=>nt.jsxs(qe.Fragment,{children:[nt.jsxs(hL,{className:"cursor-pointer",onClick:()=>t(n),children:[nt.jsx(tI,{size:28,address:n.address||"",className:"mr-2",outerColor:"transparent"}),n.name]},n.address),r!==e.length-1&&nt.jsx(vL,{})]},n.address))),nt.jsx(hL,{className:"cursor-pointer",onClick:()=>{i(!0)},children:"Show wallets"},"show"),nt.jsx(hL,{className:"cursor-pointer",onClick:()=>{r(),t(void 0)},children:"Logout"},"logout")]})]})]})}),nt.jsx(wL,{open:o,onClose:()=>i(!1)})]})};function rI(){return nt.jsx("div",{className:"flex items-center justify-center mt-6",children:nt.jsxs(up,{className:"w-full max-w-xl",children:[nt.jsx(dp,{children:nt.jsxs(fp,{className:"text-4xl pb-6 text-center flex items-center justify-center gap-2",children:[nt.jsx(oI,{}),nt.jsxs("span",{children:["CLI: ",nt.jsx("span",{className:"font-light",children:"Signing Portal"})]})]})}),nt.jsx(pp,{className:"grid gap-4",children:nt.jsx(PS,{config:u$,children:nt.jsx(KS,{children:nt.jsxs("div",{className:"overflow-auto break-words whitespace-pre-wrap",children:[nt.jsx(nI,{}),nt.jsx(mC,{})]})})})})]})})}const oI=()=>nt.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",fill:"none",viewBox:"0 0 512 512",children:[nt.jsxs("g",{clipPath:"url(#clip0_873_174)",children:[nt.jsx("rect",{width:"512",height:"512",fill:"#1C0533",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint0_radial_873_174)",fillOpacity:"0.8",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint1_radial_873_174)",fillOpacity:"0.6",rx:"256"}),nt.jsx("mask",{id:"mask0_873_174",width:"1428",height:"1351",x:"-429",y:"-502",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},children:nt.jsx("path",{fill:"#D9D9D9",d:"m127.637-501.289 871.274 824.192-14.25 13.48-871.273-824.192zM88.96-464.701l871.272 824.192-14.249 13.48L74.71-451.221zM50.281-428.113l871.273 824.192-14.249 13.48L36.032-414.633zM11.603-391.525l871.273 824.192-14.249 13.48L-2.646-378.045zM-27.075-354.937l871.273 824.192-14.249 13.48-871.273-824.192zM-65.753-318.349 805.52 505.843l-14.249 13.48-871.273-824.192zM-104.431-281.761l871.273 824.192-14.249 13.48-871.273-824.192zM-143.109-245.173l871.273 824.192-14.249 13.48-871.273-824.192zM-181.787-208.585l871.273 824.192-14.249 13.48-871.273-824.192zM-220.465-171.997l871.273 824.192-14.249 13.48-871.273-824.192zM-259.143-135.409 612.13 688.783l-14.249 13.48-871.273-824.192zM-297.821-98.821 573.452 725.37l-14.249 13.48L-312.07-85.341zM-336.499-62.233l871.273 824.192-14.249 13.48-871.273-824.192zM-375.177-25.645l871.273 824.192-14.249 13.479-871.273-824.191zM-413.855 10.943l871.273 824.192-14.249 13.48-871.273-824.192z"})}),nt.jsx("g",{mask:"url(#mask0_873_174)",children:nt.jsx("path",{fill:"#E6007A",d:"M511.169 254.929C511.169 396.905 396.739 512 255.584 512 114.428 512-.001 396.905-.001 254.929S114.428-2.142 255.584-2.142c141.155 0 255.585 115.095 255.585 257.071"})}),nt.jsx("path",{fill:"#2B0532",d:"M183.804 160.44c-12.752-9.296-27.346-13.272-41.94-13.272h-89.63L5.63 367.567h117.053l9.399-44.802a86.4 86.4 0 0 0 28.32-8.371 104 104 0 0 0 4.133-2.155 97.7 97.7 0 0 0 14.779 24.342c8.258 9.967 18.342 17.785 29.802 23.435l.003.002.397.195.4.186c12.688 5.89 26.181 8.385 39.713 8.385 13.588 0 26.877-2.295 39.662-6.916a127 127 0 0 0 17.54-7.88l-2.871 13.579h117.052l9.4-44.802a86.4 86.4 0 0 0 28.32-8.371 101.4 101.4 0 0 0 28.939-21.348l.01-.011.159-.168.154-.167.003-.003c8.092-8.766 14.613-18.702 19.34-29.722 4.865-11.344 7.542-23.439 7.542-36.022 0-12.506-2.649-24.626-7.879-35.976-5.493-12.224-13.86-22.642-24.867-30.537-12.752-9.296-27.346-13.272-41.94-13.272h-89.631l-5.24 24.781c-7.026-6.908-15.096-12.504-24.009-16.758-12.764-6.233-26.404-8.834-40.034-8.834-13.589 0-26.878 2.295-39.662 6.916-12.145 4.39-23.444 10.507-33.804 18.268a133 133 0 0 0-7.099 5.68 74.6 74.6 0 0 0-16.911-16.781"}),nt.jsx("path",{fill:"#E6007A",fillRule:"evenodd",d:"m229.569 331.163.063.031.064.03c7.896 3.665 16.711 5.426 26.323 5.426 9.96 0 19.59-1.672 28.858-5.022a94.6 94.6 0 0 0 25.4-13.857c7.69-5.873 14.403-12.621 20.12-20.24l.016-.022.016-.022c5.708-7.75 10.156-16.036 13.319-24.849 3.326-9.027 5.005-18.25 5.005-27.639 0-8.458-1.303-16.601-3.928-24.399-2.514-8.002-6.373-15.177-11.585-21.468-5.277-6.369-11.756-11.363-19.365-14.972-7.797-3.835-16.58-5.669-26.205-5.669-9.961 0-19.591 1.673-28.858 5.022-9.165 3.313-17.687 7.924-25.551 13.819-7.719 5.752-14.51 12.512-20.362 20.265l-.01.014a97.4 97.4 0 0 0-13.544 24.867l-.015.04-.014.041c-3.181 9.016-4.784 18.219-4.784 27.583 0 8.482 1.311 16.702 3.94 24.634l.005.016.005.016c2.653 7.855 6.575 14.936 11.766 21.201 5.269 6.361 11.733 11.413 19.321 15.154m58.163-55.148.01-.015c2.998-4.343 5.197-8.955 6.622-13.852 1.467-5.04 2.176-9.872 2.176-14.513 0-4.335-.697-8.177-2.012-11.592l-.041-.109-.038-.11c-1.121-3.279-2.866-5.693-5.197-7.475-2.026-1.548-5.053-2.613-9.646-2.613-5.335 0-9.796 1.243-13.579 3.569l-.053.032-.053.031c-4.052 2.378-7.426 5.537-10.156 9.541a52.3 52.3 0 0 0-6.661 13.745c-1.454 5.016-2.157 9.826-2.157 14.447 0 4.358.638 8.321 1.862 11.932 1.246 3.306 3.081 5.852 5.484 7.803 2.047 1.543 5.008 2.569 9.387 2.569 5.495 0 10.017-1.255 13.78-3.568 4.107-2.524 7.515-5.779 10.262-9.808zM171.542 186.53c-6.663-4.89-14.525-7.228-23.288-7.228H84.491L51.478 335.434h51.685l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.864-14.652l.025-.027.025-.027c5.695-6.169 10.18-13.036 13.418-20.587 3.261-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.969-4.328l.037-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.013-.01h-11.5l-3.905 18.655h10.249c.063-.013.306-.078.757-.35.511-.309 1.235-.919 2.103-2.084zM469.872 186.53c-6.663-4.89-14.525-7.228-23.289-7.228h-63.762l-33.014 156.132h51.686l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.863-14.652l.026-.027.024-.027c5.696-6.169 10.18-13.036 13.419-20.587 3.26-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.968-4.328l.038-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.014-.01h-11.5l-3.904 18.655h10.249c.063-.013.306-.078.756-.35.511-.309 1.235-.919 2.104-2.084z",clipRule:"evenodd"}),nt.jsxs("mask",{id:"path-6-outside-1_873_174",width:"435",height:"156",x:"35.823",y:"166.788",fill:"#000",maskUnits:"userSpaceOnUse",children:[nt.jsx("path",{fill:"#fff",d:"M35.823 166.788h435v156h-435z"}),nt.jsx("path",{fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"})]}),nt.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"}),nt.jsx("path",{stroke:"#fff",strokeWidth:"0.3",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318Zm-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391Zm-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852Zm133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd",mask:"url(#path-6-outside-1_873_174)"})]}),nt.jsxs("defs",{children:[nt.jsxs("radialGradient",{id:"paint0_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(229.99965 647.20057 -371.3092 131.95444 -62.8 -86.4)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#6335EC"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsxs("radialGradient",{id:"paint1_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"rotate(-116.448 530.068 140.453)scale(1055.25 662.094)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#E6007A"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsx("clipPath",{id:"clip0_873_174",children:nt.jsx("rect",{width:"512",height:"512",fill:"#fff",rx:"256"})})]})]});rt.createRoot(document.getElementById("root")).render(nt.jsx(Ke.StrictMode,{children:nt.jsx(rI,{})})); + From 4663b5e8c754193909308a892dcb9454ea9b5f99 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez <11448715+al3mart@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:47:31 +0100 Subject: [PATCH 19/25] [CI test] test: include instantiate_call_data_works (#389) * test: include instantiate_call_data_works * test: increase sleep time in run_contracts_node * fix: fmt --------- Co-authored-by: AlexD10S --- crates/pop-cli/src/commands/up/contract.rs | 11 ++++++----- crates/pop-contracts/src/node/mod.rs | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index 497a01c06..df1edaf6b 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -483,18 +483,19 @@ mod tests { let localhost_url = format!("ws://127.0.0.1:{}", port); sleep(Duration::from_secs(5)).await; - get_upload_call_data_works(port, temp_dir).await?; + get_upload_call_data_works(port, temp_dir.path().join("testing")).await?; + get_instantiate_call_data_works(port, temp_dir.path().join("testing")).await?; // Stop running contracts-node stop_test_environment(&contracts_node_process.id().to_string())?; Ok(()) } - async fn get_upload_call_data_works(port: u16, temp_dir: TempDir) -> anyhow::Result<()> { + async fn get_upload_call_data_works(port: u16, temp_dir: PathBuf) -> anyhow::Result<()> { let localhost_url = format!("ws://127.0.0.1:{}", port); let up_contract_opts = UpContractCommand { - path: Some(temp_dir.path().join("testing")), + path: Some(temp_dir), constructor: "new".to_string(), args: vec![], value: "0".to_string(), @@ -541,11 +542,11 @@ mod tests { Ok(()) } - async fn get_instantiate_call_data_works(port: u16, temp_dir: TempDir) -> anyhow::Result<()> { + async fn get_instantiate_call_data_works(port: u16, temp_dir: PathBuf) -> anyhow::Result<()> { let localhost_url = format!("ws://127.0.0.1:{}", port); let up_contract_opts = UpContractCommand { - path: Some(temp_dir.path().join("testing")), + path: Some(temp_dir), constructor: "new".to_string(), args: vec!["false".to_string()], value: "0".to_string(), diff --git a/crates/pop-contracts/src/node/mod.rs b/crates/pop-contracts/src/node/mod.rs index 425a2d05c..060dca164 100644 --- a/crates/pop-contracts/src/node/mod.rs +++ b/crates/pop-contracts/src/node/mod.rs @@ -132,8 +132,8 @@ pub async fn run_contracts_node( let process = command.spawn()?; - // Wait 5 secs until the node is ready - sleep(Duration::from_millis(5000)).await; + // Wait 20 secs until the node is ready + sleep(Duration::from_millis(20000)).await; let data = Value::from_bytes(subxt::utils::to_hex("initialize contracts node")); let payload = subxt::dynamic::tx("System", "remark", [data].to_vec()); From b757ac1d05086fc2aed4a90f48a62969a65c45fc Mon Sep 17 00:00:00 2001 From: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:05:59 +0000 Subject: [PATCH 20/25] refactor: review fixes and improvements (#390) * docs: align description across commands for consistency * refactor: use short = '' arg style recently adopted in main for consistency * test: remove unused variable * refactor: align function naming * refactor: remove unnecessary async * refactor: improve result handling Eliminates the expects and unwraps. * refactor: remove unnecessary clones * refactor: simplify code * style: formatting * docs: adds missing doc comments * refactor: remove unused function * refactor: use .expect() as server_url is parameter on public function * docs: add missing public function doc comments * refactor: use constant * refactor: module directory to file * refactor: use imports * refactor: eliminate duplication * docs: add missing doc comments * style: formatting --- crates/pop-cli/src/commands/call/chain.rs | 8 ++- crates/pop-cli/src/commands/call/contract.rs | 12 +++-- crates/pop-cli/src/commands/up/contract.rs | 54 ++++++++++--------- crates/pop-cli/src/common/wallet.rs | 11 ++-- crates/pop-cli/src/wallet_integration.rs | 29 +++++++--- .../src/{node/mod.rs => node.rs} | 5 +- crates/pop-contracts/src/up.rs | 49 ++++++++--------- 7 files changed, 99 insertions(+), 69 deletions(-) rename crates/pop-contracts/src/{node/mod.rs => node.rs} (98%) diff --git a/crates/pop-cli/src/commands/call/chain.rs b/crates/pop-cli/src/commands/call/chain.rs index 27dbee6da..41348826f 100644 --- a/crates/pop-cli/src/commands/call/chain.rs +++ b/crates/pop-cli/src/commands/call/chain.rs @@ -44,7 +44,13 @@ pub struct CallChainCommand { #[arg(short, long)] suri: Option, /// Use a browser extension wallet to sign the extrinsic. - #[arg(name = "use-wallet", short('w'), long, default_value = "false", conflicts_with = "suri")] + #[arg( + name = "use-wallet", + short = 'w', + long, + default_value = "false", + conflicts_with = "suri" + )] use_wallet: bool, /// SCALE encoded bytes representing the call data of the extrinsic. #[arg(name = "call", short, long, conflicts_with_all = ["pallet", "function", "args"])] diff --git a/crates/pop-cli/src/commands/call/contract.rs b/crates/pop-cli/src/commands/call/contract.rs index da12002a9..45ba0a094 100644 --- a/crates/pop-cli/src/commands/call/contract.rs +++ b/crates/pop-cli/src/commands/call/contract.rs @@ -60,7 +60,13 @@ pub struct CallContractCommand { #[arg(short, long, default_value = DEFAULT_URI)] suri: String, /// Use a browser extension wallet to sign the extrinsic. - #[arg(name = "use-wallet", long, short('w'), default_value = "false", conflicts_with = "suri")] + #[arg( + name = "use-wallet", + long, + short = 'w', + default_value = "false", + conflicts_with = "suri" + )] use_wallet: bool, /// Submit an extrinsic for on-chain execution. #[arg(short = 'x', long)] @@ -394,7 +400,7 @@ impl CallContractCommand { // Perform signing steps with wallet integration, skipping secure signing for query-only // operations. if self.use_wallet { - self.execute_with_secure_signing(call_exec, cli).await?; + self.execute_with_wallet(call_exec, cli).await?; return self.finalize_execute_call(cli, prompt_to_repeat_call).await; } if self.dry_run { @@ -476,7 +482,7 @@ impl CallContractCommand { } /// Execute the smart contract call using wallet integration. - async fn execute_with_secure_signing( + async fn execute_with_wallet( &self, call_exec: CallExec, cli: &mut impl Cli, diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index df1edaf6b..fed9c2068 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -66,7 +66,7 @@ pub struct UpContractCommand { /// - with a password "//Alice///SECRET_PASSWORD" #[clap(short, long, default_value = "//Alice")] suri: String, - /// Use your browser wallet to sign a transaction. + /// Use a browser extension wallet to sign the extrinsic. #[clap( name = "use-wallet", long, @@ -194,14 +194,18 @@ impl UpContractCommand { spinner.start("Uploading contract..."); if self.upload_only { - let result = upload_contract_signed(self.url.as_str(), payload).await; - if let Err(e) = result { - spinner.error(format!("An error occurred uploading your contract: {e}")); - terminate_node(process)?; - Cli.outro_cancel(FAILED)?; - return Ok(()); - } - let upload_result = result.expect("Error check above."); + let upload_result = match upload_contract_signed(self.url.as_str(), payload) + .await + { + Err(e) => { + spinner + .error(format!("An error occurred uploading your contract: {e}")); + terminate_node(process)?; + Cli.outro_cancel(FAILED)?; + return Ok(()); + }, + Ok(result) => result, + }; match get_code_hash_from_event(&upload_result, hash) { Ok(r) => { @@ -213,15 +217,19 @@ impl UpContractCommand { }, }; } else { - let result = instantiate_contract_signed(self.url.as_str(), payload).await; - if let Err(e) = result { - spinner.error(format!("An error occurred uploading your contract: {e}")); - terminate_node(process)?; - Cli.outro_cancel(FAILED)?; - return Ok(()); - } - - let contract_info = result.unwrap(); + let contract_info = + match instantiate_contract_signed(self.url.as_str(), payload).await { + Err(e) => { + spinner.error(format!( + "An error occurred uploading your contract: {e}" + )); + terminate_node(process)?; + Cli.outro_cancel(FAILED)?; + return Ok(()); + }, + Ok(result) => result, + }; + let hash = contract_info.code_hash.map(|code_hash| format!("{:?}", code_hash)); display_contract_info( &spinner, @@ -344,7 +352,7 @@ impl UpContractCommand { // get the call data and contract code hash async fn get_contract_data(&self) -> anyhow::Result<(Vec, [u8; 32])> { - let contract_code = get_contract_code(self.path.as_ref()).await?; + let contract_code = get_contract_code(self.path.as_ref())?; let hash = contract_code.code_hash(); if self.upload_only { let call_data = get_upload_payload(contract_code, self.url.as_str()).await?; @@ -358,7 +366,7 @@ impl UpContractCommand { // Frontend will do dry run and update call data. Weight::zero() }; - let call_data = get_instantiate_payload(instantiate_exec, weight_limit).await?; + let call_data = get_instantiate_payload(instantiate_exec, weight_limit)?; Ok((call_data, hash)) } } @@ -480,7 +488,6 @@ mod tests { #[tokio::test] async fn get_upload_and_instantiate_call_data_works() -> anyhow::Result<()> { let (contracts_node_process, port, temp_dir) = start_test_environment().await?; - let localhost_url = format!("ws://127.0.0.1:{}", port); sleep(Duration::from_secs(5)).await; get_upload_call_data_works(port, temp_dir.path().join("testing")).await?; @@ -525,7 +532,7 @@ mod tests { assert!(!retrieved_call_data.is_empty()); // Craft encoded call data for an upload code call. - let contract_code = get_contract_code(up_contract_opts.path.as_ref()).await?; + let contract_code = get_contract_code(up_contract_opts.path.as_ref())?; let storage_deposit_limit: Option = None; let upload_code = contract_extrinsics::extrinsic_calls::UploadCode::new( contract_code, @@ -575,8 +582,7 @@ mod tests { // Craft instantiate call data. let weight = Weight::from_parts(200_000_000, 30_000); let expected_call_data = - get_instantiate_payload(set_up_deployment(up_contract_opts.into()).await?, weight) - .await?; + get_instantiate_payload(set_up_deployment(up_contract_opts.into()).await?, weight)?; // Retrieved call data matches the one crafted above. assert_eq!(retrieved_call_data, expected_call_data); diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs index 9f0e28712..1aedd0294 100644 --- a/crates/pop-cli/src/common/wallet.rs +++ b/crates/pop-cli/src/common/wallet.rs @@ -22,13 +22,12 @@ pub async fn request_signature(call_data: Vec, rpc: String) -> anyhow::Resul let transaction_data = TransactionData::new(rpc, call_data); // Starts server with port 9090. let mut wallet = WalletIntegrationManager::new(ui, transaction_data, Some(9090)); - let url = wallet.server_url.clone(); - log::step(format!("Wallet signing portal started at http://{url}."))?; + let url = format!("http://{}", &wallet.server_url); + log::step(format!("Wallet signing portal started at {url}."))?; let spinner = spinner(); - spinner.start(format!("Opening browser to http://{url}")); - let res = open::that(format!("http://{url}")); - if let Err(e) = res { + spinner.start(format!("Opening browser to {url}")); + if let Err(e) = open::that(url) { spinner.error(format!("Failed to launch browser. Please open link manually. {e}")); } @@ -48,7 +47,7 @@ pub async fn request_signature(call_data: Vec, rpc: String) -> anyhow::Resul } spinner.stop(""); - let signed_payload = wallet.state.lock().await.signed_payload.clone(); + let signed_payload = wallet.state.lock().await.signed_payload.take(); Ok(signed_payload) } diff --git a/crates/pop-cli/src/wallet_integration.rs b/crates/pop-cli/src/wallet_integration.rs index dfe43cfed..92e3395ec 100644 --- a/crates/pop-cli/src/wallet_integration.rs +++ b/crates/pop-cli/src/wallet_integration.rs @@ -13,9 +13,9 @@ use tokio::{ }; use tower_http::{cors::Any, services::ServeDir}; -/// Make frontend sourcing more flexible by allowing a custom route -/// to be defined. +/// Make frontend sourcing more flexible by allowing a custom route to be defined. pub trait Frontend { + /// Serves the content via a [Router]. fn serve_content(&self) -> Router; } @@ -28,13 +28,15 @@ pub struct TransactionData { } impl TransactionData { + /// Create a new transaction payload. + /// # Arguments + /// * `chain_rpc`: The RPC of the chain. + /// * `call_data`: the call data. + /// # Returns + /// The transaction payload to be sent to frontend for signing. pub fn new(chain_rpc: String, call_data: Vec) -> Self { Self { chain_rpc, call_data } } - #[allow(dead_code)] - pub fn call_data(&self) -> Vec { - self.call_data.clone() - } } /// Shared state between routes. Serves two purposes: @@ -80,6 +82,13 @@ impl WalletIntegrationManager { } /// Same as `new`, but allows specifying the address to bind to. + /// # Arguments + /// * `frontend`: A frontend with custom route to serve content. + /// * `payload`: Payload to be sent to the frontend for signing. + /// * `server_url`: The address to bind to. + /// + /// # Returns + /// A `WalletIntegrationManager` instance, with access to the state and task handle for the pub fn new_with_address( frontend: F, payload: TransactionData, @@ -97,7 +106,7 @@ impl WalletIntegrationManager { let payload = Arc::new(payload); let cors = tower_http::cors::CorsLayer::new() - .allow_origin(server_url.parse::().unwrap()) + .allow_origin(server_url.parse::().expect("invalid server url")) .allow_methods(Any) // Allow any HTTP method .allow_headers(Any); // Allow any headers (like 'Content-Type') @@ -235,6 +244,9 @@ pub struct FrontendFromDir { } #[allow(dead_code)] impl FrontendFromDir { + /// A new static server. + /// # Arguments + /// * `content`: A directory path. pub fn new(content: PathBuf) -> Self { Self { content } } @@ -253,6 +265,9 @@ pub struct FrontendFromString { #[allow(dead_code)] impl FrontendFromString { + /// A new static server. + /// # Arguments + /// * `content`: A hard-coded HTML string pub fn new(content: String) -> Self { Self { content } } diff --git a/crates/pop-contracts/src/node/mod.rs b/crates/pop-contracts/src/node.rs similarity index 98% rename from crates/pop-contracts/src/node/mod.rs rename to crates/pop-contracts/src/node.rs index 060dca164..158865d40 100644 --- a/crates/pop-contracts/src/node/mod.rs +++ b/crates/pop-contracts/src/node.rs @@ -23,6 +23,7 @@ use subxt::{dynamic::Value, SubstrateConfig}; use tokio::time::sleep; const BIN_NAME: &str = "substrate-contracts-node"; +const STARTUP: Duration = Duration::from_millis(20_000); /// Checks if the specified node is alive and responsive. /// @@ -132,8 +133,8 @@ pub async fn run_contracts_node( let process = command.spawn()?; - // Wait 20 secs until the node is ready - sleep(Duration::from_millis(20000)).await; + // Wait until the node is ready + sleep(STARTUP).await; let data = Value::from_bytes(subxt::utils::to_hex("initialize contracts node")); let payload = subxt::dynamic::tx("System", "remark", [data].to_vec()); diff --git a/crates/pop-contracts/src/up.rs b/crates/pop-contracts/src/up.rs index efd3817b5..3ed614c7e 100644 --- a/crates/pop-contracts/src/up.rs +++ b/crates/pop-contracts/src/up.rs @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-3.0 + use crate::{ errors::Error, utils::{ @@ -9,9 +10,11 @@ use crate::{ }; use contract_extrinsics::{ events::{CodeStored, ContractInstantiated}, - extrinsic_calls::{Instantiate, InstantiateWithCode}, - BalanceVariant, ErrorVariant, ExtrinsicOptsBuilder, InstantiateCommandBuilder, InstantiateExec, - InstantiateExecResult, TokenMetadata, UploadCommandBuilder, UploadExec, UploadResult, WasmCode, + extrinsic_calls::{Instantiate, InstantiateWithCode, UploadCode}, + upload::Determinism, + BalanceVariant, Code, ErrorVariant, ExtrinsicOptsBuilder, InstantiateCommandBuilder, + InstantiateExec, InstantiateExecResult, TokenMetadata, UploadCommandBuilder, UploadExec, + UploadResult, WasmCode, }; use ink_env::{DefaultEnvironment, Environment}; use pop_common::{create_signer, DefaultConfig, Keypair}; @@ -121,11 +124,7 @@ pub async fn set_up_upload( /// * `url` - the rpc of the chain node. pub async fn get_upload_payload(code: WasmCode, url: &str) -> anyhow::Result> { let storage_deposit_limit: Option = None; - let upload_code = contract_extrinsics::extrinsic_calls::UploadCode::new( - code, - storage_deposit_limit, - contract_extrinsics::upload::Determinism::Enforced, - ); + let upload_code = UploadCode::new(code, storage_deposit_limit, Determinism::Enforced); let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; let client = subxt::OnlineClient::::from_rpc_client(rpc_client).await?; @@ -135,35 +134,37 @@ pub async fn get_upload_payload(code: WasmCode, url: &str) -> anyhow::Result, gas_limit: Weight, ) -> anyhow::Result> { let storage_deposit_limit: Option = None; let mut encoded_data = Vec::::new(); - match instantiate_exec.args().code() { - contract_extrinsics::Code::Upload(code) => InstantiateWithCode::new( - instantiate_exec.args().value(), + let args = instantiate_exec.args(); + match args.code() { + Code::Upload(code) => InstantiateWithCode::new( + args.value(), gas_limit, storage_deposit_limit, code.clone(), - instantiate_exec.args().data().into(), - instantiate_exec.args().salt().into(), + args.data().into(), + args.salt().into(), ) .build() .encode_call_data_to(&instantiate_exec.client().metadata(), &mut encoded_data), - contract_extrinsics::Code::Existing(hash) => Instantiate::new( - instantiate_exec.args().value(), + Code::Existing(hash) => Instantiate::new( + args.value(), gas_limit, storage_deposit_limit, hash, - instantiate_exec.args().data().into(), - instantiate_exec.args().salt().into(), + args.data().into(), + args.salt().into(), ) .build() .encode_call_data_to(&instantiate_exec.client().metadata(), &mut encoded_data), @@ -176,9 +177,7 @@ pub async fn get_instantiate_payload( /// /// # Arguments /// * `path` - path to the contract file. -pub async fn get_contract_code( - path: Option<&PathBuf>, -) -> anyhow::Result { +pub fn get_contract_code(path: Option<&PathBuf>) -> anyhow::Result { let manifest_path = get_manifest_path(path.map(|p| p as &Path))?; // signer does not matter for this @@ -285,7 +284,6 @@ pub async fn submit_signed_payload( /// blockchain. /// /// # Arguments -/// /// * `instantiate_exec` - the preprocessed data to instantiate a contract. pub async fn dry_run_gas_estimate_instantiate( instantiate_exec: &InstantiateExec, @@ -314,14 +312,15 @@ pub async fn dry_run_gas_estimate_instantiate( /// Result of a dry-run upload of a smart contract. pub struct UploadDryRunResult { + /// The key under which the new code is stored. pub code_hash: String, + /// The deposit that was reserved at the caller. Is zero when the code already existed. pub deposit: String, } /// Performs a dry-run for uploading a contract without modifying the state of the blockchain. /// /// # Arguments -/// /// * `upload_exec` - the preprocessed data to upload a contract. pub async fn dry_run_upload( upload_exec: &UploadExec, @@ -353,7 +352,6 @@ pub struct ContractInfo { /// Instantiate a contract. /// /// # Arguments -/// /// * `instantiate_exec` - the preprocessed data to instantiate a contract. /// * `gas_limit` - maximum amount of gas to be used for this call. pub async fn instantiate_smart_contract( @@ -373,7 +371,6 @@ pub async fn instantiate_smart_contract( /// Upload a contract. /// /// # Arguments -/// /// * `upload_exec` - the preprocessed data to upload a contract. pub async fn upload_smart_contract( upload_exec: &UploadExec, @@ -495,7 +492,7 @@ mod tests { url: Url::parse(CONTRACTS_NETWORK_URL)?, suri: "//Alice".to_string(), }; - let contract_code = get_contract_code(up_opts.path.as_ref()).await?; + let contract_code = get_contract_code(up_opts.path.as_ref())?; let call_data = get_upload_payload(contract_code, CONTRACTS_NETWORK_URL).await?; let payload_hash = BlakeTwo256::hash(&call_data); // We know that for the above opts the payload hash should be: From c479866a8af3e573c2158bbdb4c6bd9aa63555c8 Mon Sep 17 00:00:00 2001 From: Peter White Date: Wed, 18 Dec 2024 11:54:51 -0700 Subject: [PATCH 21/25] chore: use latest frontend --- crates/pop-cli/src/assets/index.html | 200 +++++++++++++-------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/crates/pop-cli/src/assets/index.html b/crates/pop-cli/src/assets/index.html index 9538725b2..b856e1801 100644 --- a/crates/pop-cli/src/assets/index.html +++ b/crates/pop-cli/src/assets/index.html @@ -7,7 +7,7 @@ href="data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_873_174)'%3E%3Crect width='512' height='512' rx='256' fill='%231C0533'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint0_radial_873_174)' fill-opacity='0.8'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint1_radial_873_174)' fill-opacity='0.6'/%3E%3Cmask id='mask0_873_174' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='-429' y='-502' width='1428' height='1351'%3E%3Cpath d='M127.637 -501.289L998.911 322.903L984.661 336.383L113.388 -487.809L127.637 -501.289Z' fill='%23D9D9D9'/%3E%3Cpath d='M88.9594 -464.701L960.232 359.491L945.983 372.971L74.7096 -451.221L88.9594 -464.701Z' fill='%23D9D9D9'/%3E%3Cpath d='M50.2814 -428.113L921.554 396.079L907.305 409.559L36.0316 -414.633L50.2814 -428.113Z' fill='%23D9D9D9'/%3E%3Cpath d='M11.6034 -391.525L882.876 432.667L868.627 446.147L-2.64642 -378.045L11.6034 -391.525Z' fill='%23D9D9D9'/%3E%3Cpath d='M-27.0746 -354.937L844.198 469.255L829.949 482.735L-41.3244 -341.457L-27.0746 -354.937Z' fill='%23D9D9D9'/%3E%3Cpath d='M-65.7526 -318.349L805.52 505.843L791.271 519.323L-80.0024 -304.869L-65.7526 -318.349Z' fill='%23D9D9D9'/%3E%3Cpath d='M-104.431 -281.761L766.842 542.431L752.593 555.911L-118.68 -268.281L-104.431 -281.761Z' fill='%23D9D9D9'/%3E%3Cpath d='M-143.109 -245.173L728.164 579.019L713.915 592.499L-157.358 -231.693L-143.109 -245.173Z' fill='%23D9D9D9'/%3E%3Cpath d='M-181.787 -208.585L689.486 615.607L675.237 629.087L-196.036 -195.105L-181.787 -208.585Z' fill='%23D9D9D9'/%3E%3Cpath d='M-220.465 -171.997L650.808 652.195L636.559 665.675L-234.714 -158.517L-220.465 -171.997Z' fill='%23D9D9D9'/%3E%3Cpath d='M-259.143 -135.409L612.13 688.783L597.881 702.263L-273.392 -121.929L-259.143 -135.409Z' fill='%23D9D9D9'/%3E%3Cpath d='M-297.821 -98.8211L573.452 725.371L559.203 738.851L-312.07 -85.3413L-297.821 -98.8211Z' fill='%23D9D9D9'/%3E%3Cpath d='M-336.499 -62.2331L534.774 761.959L520.525 775.439L-350.748 -48.7533L-336.499 -62.2331Z' fill='%23D9D9D9'/%3E%3Cpath d='M-375.177 -25.6452L496.096 798.547L481.847 812.026L-389.426 -12.1654L-375.177 -25.6452Z' fill='%23D9D9D9'/%3E%3Cpath d='M-413.855 10.9428L457.418 835.135L443.169 848.615L-428.104 24.4225L-413.855 10.9428Z' fill='%23D9D9D9'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_873_174)'%3E%3Cpath d='M511.169 254.929C511.169 396.905 396.739 512 255.584 512C114.428 512 -0.000976562 396.905 -0.000976562 254.929C-0.000976562 112.953 114.428 -2.14209 255.584 -2.14209C396.739 -2.14209 511.169 112.953 511.169 254.929Z' fill='%23E6007A'/%3E%3C/g%3E%3Cpath d='M183.804 160.44C171.052 151.144 156.458 147.168 141.864 147.168H52.2334L5.63086 367.567H122.684L132.083 322.765C141.879 321.622 151.384 318.84 160.403 314.394C161.8 313.705 163.178 312.986 164.536 312.239C168.249 321.014 173.177 329.173 179.315 336.581C187.573 346.548 197.657 354.366 209.117 360.016L209.12 360.018L209.517 360.213L209.917 360.399C222.605 366.289 236.098 368.784 249.63 368.784C263.218 368.784 276.507 366.489 289.292 361.868C295.36 359.675 301.212 357.046 306.832 353.988L303.961 367.567H421.013L430.413 322.765C440.209 321.622 449.714 318.84 458.733 314.394C469.61 309.03 479.317 301.877 487.672 293.046L487.682 293.035L487.841 292.867L487.995 292.7L487.998 292.697C496.09 283.931 502.611 273.995 507.338 262.975C512.203 251.631 514.88 239.536 514.88 226.953C514.88 214.447 512.231 202.327 507.001 190.977C501.508 178.753 493.141 168.335 482.134 160.44C469.382 151.144 454.788 147.168 440.194 147.168H350.563L345.323 171.949C338.297 165.041 330.227 159.445 321.314 155.191C308.55 148.958 294.91 146.357 281.28 146.357C267.691 146.357 254.402 148.652 241.618 153.273C229.473 157.663 218.174 163.78 207.814 171.541C205.377 173.358 203.011 175.252 200.715 177.221C196.062 170.823 190.408 165.177 183.804 160.44Z' fill='%232B0532'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M229.569 331.163L229.632 331.194L229.696 331.224C237.592 334.889 246.407 336.65 256.019 336.65C265.979 336.65 275.609 334.978 284.877 331.628C294.055 328.31 302.528 323.689 310.277 317.771C317.967 311.898 324.68 305.15 330.397 297.531L330.413 297.509L330.429 297.487C336.137 289.737 340.585 281.451 343.748 272.638C347.074 263.611 348.753 254.388 348.753 244.999C348.753 236.541 347.45 228.398 344.825 220.6C342.311 212.598 338.452 205.423 333.24 199.132C327.963 192.763 321.484 187.769 313.875 184.16C306.078 180.325 297.295 178.491 287.67 178.491C277.709 178.491 268.079 180.164 258.812 183.513C249.647 186.826 241.125 191.437 233.261 197.332C225.542 203.084 218.751 209.844 212.899 217.597L212.889 217.611C207.16 225.246 202.642 233.54 199.345 242.478L199.33 242.518L199.316 242.559C196.135 251.575 194.532 260.778 194.532 270.142C194.532 278.624 195.843 286.844 198.472 294.776L198.477 294.792L198.482 294.808C201.135 302.663 205.057 309.744 210.248 316.009C215.517 322.37 221.981 327.422 229.569 331.163ZM287.732 276.015L287.742 276C290.74 271.657 292.939 267.045 294.364 262.148C295.831 257.108 296.54 252.276 296.54 247.635C296.54 243.3 295.843 239.458 294.528 236.043L294.487 235.934L294.449 235.824C293.328 232.545 291.583 230.131 289.252 228.349C287.226 226.801 284.199 225.736 279.606 225.736C274.271 225.736 269.81 226.979 266.027 229.305L265.974 229.337L265.921 229.368C261.869 231.746 258.495 234.905 255.765 238.909C252.893 243.123 250.673 247.698 249.104 252.654C247.65 257.67 246.947 262.48 246.947 267.101C246.947 271.459 247.585 275.422 248.809 279.033C250.055 282.339 251.89 284.885 254.293 286.836C256.34 288.379 259.301 289.405 263.68 289.405C269.175 289.405 273.697 288.15 277.46 285.837C281.567 283.313 284.975 280.058 287.722 276.029L287.732 276.015Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M171.542 186.53C164.879 181.64 157.017 179.302 148.254 179.302H84.4909L51.4775 335.434H103.163L112.436 291.23H128.094C136.792 291.23 145.029 289.337 152.73 285.54C160.225 281.844 166.856 276.954 172.594 270.888L172.619 270.861L172.644 270.834C178.339 264.665 182.824 257.798 186.062 250.247C189.323 242.645 190.992 234.866 190.992 226.953C190.992 219.052 189.327 211.496 186.009 204.348C182.762 197.062 177.927 191.083 171.542 186.53ZM135.575 242.131L135.598 242.101C136.363 241.1 137.06 239.71 137.567 237.773L137.604 237.631L137.648 237.49C138.222 235.663 138.577 233.269 138.577 230.197C138.577 227.864 138.266 226.771 138.111 226.428C138.024 226.235 137.948 226.093 137.889 225.994L137.862 225.949L137.849 225.939H126.349L122.444 244.594H132.693C132.756 244.581 132.999 244.516 133.45 244.244C133.961 243.935 134.685 243.325 135.553 242.16L135.575 242.131Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M469.872 186.53C463.209 181.64 455.347 179.302 446.583 179.302H382.821L349.807 335.434H401.493L410.766 291.23H426.424C435.122 291.23 443.359 289.337 451.06 285.54C458.555 281.844 465.186 276.954 470.923 270.888L470.949 270.861L470.973 270.834C476.669 264.665 481.153 257.798 484.392 250.247C487.652 242.645 489.322 234.866 489.322 226.953C489.322 219.052 487.657 211.496 484.339 204.348C481.092 197.062 476.257 191.083 469.872 186.53ZM433.905 242.131L433.928 242.101C434.693 241.1 435.39 239.71 435.896 237.773L435.934 237.631L435.978 237.49C436.552 235.663 436.907 233.269 436.907 230.197C436.907 227.864 436.596 226.771 436.441 226.428C436.354 226.235 436.278 226.093 436.219 225.994L436.192 225.949L436.178 225.939H424.678L420.774 244.594H431.023C431.086 244.581 431.329 244.516 431.779 244.244C432.29 243.935 433.014 243.325 433.883 242.16L433.905 242.131Z' fill='%23E6007A'/%3E%3Cmask id='path-6-outside-1_873_174' maskUnits='userSpaceOnUse' x='35.8232' y='166.788' width='435' height='156' fill='black'%3E%3Crect fill='white' x='35.8232' y='166.788' width='435' height='156'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z'/%3E%3C/mask%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' stroke='white' stroke-width='0.3' mask='url(%23path-6-outside-1_873_174)'/%3E%3C/g%3E%3Cdefs%3E%3CradialGradient id='paint0_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(-62.8 -86.4) rotate(70.436) scale(686.854 394.059)'%3E%3Cstop stop-color='%236335EC'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='paint1_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(640.4 677.6) rotate(-116.448) scale(1055.25 662.094)'%3E%3Cstop stop-color='%23E6007A'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CclipPath id='clip0_873_174'%3E%3Crect width='512' height='512' rx='256' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A" /> Pop CLI Signing Portal - - + `],K);d$=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}([RA("dc-connection-button")],d$);const f$={chains:{},wallets:[new class extends QE{constructor(e){super(),X(this,"options"),this.options=e}async getWallets(){return await lS,(()=>{const{injectedWeb3:e}=window;return e?Object.keys(e):[]})().map((e=>new aS(e,this.options)))}}]};function p$(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function h$(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function v$(...e){return t=>{let n=!1;const r=e.map((e=>{const r=h$(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t{const t=n.map((e=>qe.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return qe.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=qe.createContext(r),i=n.length;n=[...n,r];const s=t=>{var n;const{scope:r,children:s,...a}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[i])||o,c=qe.useMemo((()=>a),Object.values(a));return nt.jsx(l.Provider,{value:c,children:s})};return s.displayName=t+"Provider",[s,function(n,s){var a;const l=(null==(a=null==s?void 0:s[e])?void 0:a[i])||o,c=qe.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},y$(r,...t)]}function y$(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return qe.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function b$(e){const t=qe.useRef(e);return qe.useEffect((()=>{t.current=e})),qe.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function w$({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=qe.useState(e),[r]=n,o=qe.useRef(r),i=b$(t);return qe.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,a=b$(n);return[s,qe.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&a(n)}else o(t)}),[i,e,o,a])]}!function(e){_A.next(e.wallets)}({wallets:f$.wallets});var x$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e,o=qe.Children.toArray(n),i=o.find(S$);if(i){const e=i.props.children,n=o.map((t=>t===i?qe.Children.count(e)>1?qe.Children.only(null):qe.isValidElement(e)?e.props.children:null:t));return nt.jsx(k$,{...r,ref:t,children:qe.isValidElement(e)?qe.cloneElement(e,void 0,n):null})}return nt.jsx(k$,{...r,ref:t,children:n})}));x$.displayName="Slot";var k$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e;if(qe.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n);return qe.cloneElement(n,{...C$(r,n.props),ref:t?v$(t,e):e})}return qe.Children.count(n)>1?qe.Children.only(null):null}));k$.displayName="SlotClone";var E$=({children:e})=>nt.jsx(nt.Fragment,{children:e});function S$(e){return qe.isValidElement(e)&&e.type===E$}function C$(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var _$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=qe.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?x$:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),nt.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function A$(e,t){e&&df.flushSync((()=>e.dispatchEvent(t)))}function N$(e){const t=e+"CollectionProvider",[n,r]=g$(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,r=Ke.useRef(null),i=Ke.useRef(new Map).current;return nt.jsx(o,{scope:t,itemMap:i,collectionRef:r,children:n})};s.displayName=t;const a=e+"CollectionSlot",l=Ke.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=m$(t,i(a,n).collectionRef);return nt.jsx(x$,{ref:o,children:r})}));l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=Ke.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,s=Ke.useRef(null),a=m$(t,s),l=i(c,n);return Ke.useEffect((()=>(l.itemMap.set(s,{ref:s,...o}),()=>{l.itemMap.delete(s)}))),nt.jsx(x$,{[u]:"",ref:a,children:r})}));return d.displayName=c,[{Provider:s,Slot:l,ItemSlot:d},function(t){const n=i(e+"CollectionConsumer",t),r=Ke.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${u}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}var P$=qe.createContext(void 0);function $$(e){const t=qe.useContext(P$);return e||t||"ltr"}var j$,O$="dismissableLayer.update",R$="dismissableLayer.pointerDownOutside",M$="dismissableLayer.focusOutside",T$=qe.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),L$=qe.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=qe.useContext(T$),[u,d]=qe.useState(null),f=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=qe.useState({}),h=m$(t,(e=>d(e))),v=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(m),y=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,w=y>=g,x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=b$(e),r=qe.useRef(!1),o=qe.useRef((()=>{}));return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){z$(R$,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));w&&!n&&(null==o||o(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f),k=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=b$(e),r=qe.useRef(!1);return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){z$(M$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=b$(e);qe.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{y===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&a&&(e.preventDefault(),a()))}),f),qe.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(j$=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),I$(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=j$)}}),[u,f,n,c]),qe.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),I$())}),[u,c]),qe.useEffect((()=>{const e=()=>p({});return document.addEventListener(O$,e),()=>document.removeEventListener(O$,e)}),[]),nt.jsx(_$.div,{...l,ref:h,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:p$(e.onFocusCapture,k.onFocusCapture),onBlurCapture:p$(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:p$(e.onPointerDownCapture,x.onPointerDownCapture)})}));L$.displayName="DismissableLayer";function I$(){const e=new CustomEvent(O$);document.dispatchEvent(e)}function z$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?A$(o,i):o.dispatchEvent(i)}qe.forwardRef(((e,t)=>{const n=qe.useContext(T$),r=qe.useRef(null),o=m$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),nt.jsx(_$.div,{...e,ref:o})})).displayName="DismissableLayerBranch";var D$=0;function B$(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var U$="focusScope.autoFocusOnMount",F$="focusScope.autoFocusOnUnmount",H$={bubbles:!1,cancelable:!0},V$=qe.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=qe.useState(null),c=b$(o),u=b$(i),d=qe.useRef(null),f=m$(t,(e=>l(e))),p=qe.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;qe.useEffect((()=>{if(r){let e=function(e){if(p.paused||!a)return;const t=e.target;a.contains(t)?d.current=t:Q$(d.current,{select:!0})},t=function(e){if(p.paused||!a)return;const t=e.relatedTarget;null!==t&&(a.contains(t)||Q$(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Q$(a)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,a,p.paused]),qe.useEffect((()=>{if(a){Y$.add(p);const t=document.activeElement;if(!a.contains(t)){const n=new CustomEvent(U$,H$);a.addEventListener(U$,c),a.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Q$(r,{select:t}),document.activeElement!==n)return}((e=W$(a),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Q$(a))}return()=>{a.removeEventListener(U$,c),setTimeout((()=>{const e=new CustomEvent(F$,H$);a.addEventListener(F$,u),a.dispatchEvent(e),e.defaultPrevented||Q$(t??document.body,{select:!0}),a.removeEventListener(F$,u),Y$.remove(p)}),0)}}var e}),[a,c,u,p]);const h=qe.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=W$(e),n=q$(t,e),r=q$(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&Q$(i,{select:!0})):(e.preventDefault(),n&&Q$(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return nt.jsx(_$.div,{tabIndex:-1,...s,ref:f,onKeyDown:h})}));function W$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function q$(e,t){for(const n of e)if(!K$(n,{upTo:t}))return n}function K$(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Q$(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}V$.displayName="FocusScope";var Y$=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=G$(e,t),e.unshift(t)},remove(t){var n;e=G$(e,t),null==(n=e[0])||n.resume()}}}();function G$(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var J$=Boolean(null==globalThis?void 0:globalThis.document)?qe.useLayoutEffect:()=>{},X$=Qe["useId".toString()]||(()=>{}),Z$=0;function ej(e){const[t,n]=qe.useState(X$());return J$((()=>{n((e=>e??String(Z$++)))}),[e]),t?`radix-${t}`:""}const tj=["top","right","bottom","left"],nj=Math.min,rj=Math.max,oj=Math.round,ij=Math.floor,sj=e=>({x:e,y:e}),aj={left:"right",right:"left",bottom:"top",top:"bottom"},lj={start:"end",end:"start"};function cj(e,t,n){return rj(e,nj(t,n))}function uj(e,t){return"function"==typeof e?e(t):e}function dj(e){return e.split("-")[0]}function fj(e){return e.split("-")[1]}function pj(e){return"x"===e?"y":"x"}function hj(e){return"y"===e?"height":"width"}function vj(e){return["top","bottom"].includes(dj(e))?"y":"x"}function mj(e){return pj(vj(e))}function gj(e){return e.replace(/start|end/g,(e=>lj[e]))}function yj(e){return e.replace(/left|right|bottom|top/g,(e=>aj[e]))}function bj(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function wj(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xj(e,t,n){let{reference:r,floating:o}=e;const i=vj(t),s=mj(t),a=hj(s),l=dj(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(fj(t)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1)}return p}async function kj(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=uj(t,e),h=bj(p),v=a[f?"floating"===d?"reference":"floating":d],m=wj(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=wj(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:l}):g);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}function Ej(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sj(e){return tj.some((t=>e[t]>=0))}function Cj(){return"undefined"!=typeof window}function _j(e){return Pj(e)?(e.nodeName||"").toLowerCase():"#document"}function Aj(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Nj(e){var t;return null==(t=(Pj(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Pj(e){return!!Cj()&&(e instanceof Node||e instanceof Aj(e).Node)}function $j(e){return!!Cj()&&(e instanceof Element||e instanceof Aj(e).Element)}function jj(e){return!!Cj()&&(e instanceof HTMLElement||e instanceof Aj(e).HTMLElement)}function Oj(e){return!(!Cj()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Aj(e).ShadowRoot)}function Rj(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Dj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Mj(e){return["table","td","th"].includes(_j(e))}function Tj(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(n){return!1}}))}function Lj(e){const t=Ij(),n=$j(e)?Dj(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Ij(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function zj(e){return["html","body","#document"].includes(_j(e))}function Dj(e){return Aj(e).getComputedStyle(e)}function Bj(e){return $j(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uj(e){if("html"===_j(e))return e;const t=e.assignedSlot||e.parentNode||Oj(e)&&e.host||Nj(e);return Oj(t)?t.host:t}function Fj(e){const t=Uj(e);return zj(t)?e.ownerDocument?e.ownerDocument.body:e.body:jj(t)&&Rj(t)?t:Fj(t)}function Hj(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Fj(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=Aj(o);if(i){const e=Vj(s);return t.concat(s,s.visualViewport||[],Rj(o)?o:[],e&&n?Hj(e):[])}return t.concat(o,Hj(o,[],n))}function Vj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wj(e){const t=Dj(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=jj(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=oj(n)!==i||oj(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function qj(e){return $j(e)?e:e.contextElement}function Kj(e){const t=qj(e);if(!jj(t))return sj(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Wj(t);let s=(i?oj(n.width):n.width)/r,a=(i?oj(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Qj=sj(0);function Yj(e){const t=Aj(e);return Ij()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Qj}function Gj(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=qj(e);let s=sj(1);t&&(r?$j(r)&&(s=Kj(r)):s=Kj(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Aj(e))&&t}(i,n,r)?Yj(i):sj(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=Aj(i),t=r&&$j(r)?Aj(r):r;let n=e,o=Vj(n);for(;o&&r&&t!==n;){const e=Kj(o),t=o.getBoundingClientRect(),r=Dj(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=Aj(o),o=Vj(n)}}return wj({width:u,height:d,x:l,y:c})}function Jj(e,t){const n=Bj(e).scrollLeft;return t?t.left+n:Gj(Nj(e)).left+n}function Xj(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Jj(e,r)),y:r.top+t.scrollTop}}function Zj(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Aj(e),r=Nj(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=Ij();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=Nj(e),n=Bj(e),r=e.ownerDocument.body,o=rj(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=rj(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Jj(e);const a=-n.scrollTop;return"rtl"===Dj(r).direction&&(s+=rj(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(Nj(e));else if($j(t))r=function(e,t){const n=Gj(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=jj(e)?Kj(e):sj(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Yj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wj(r)}function eO(e,t){const n=Uj(e);return!(n===t||!$j(n)||zj(n))&&("fixed"===Dj(n).position||eO(n,t))}function tO(e,t,n){const r=jj(t),o=Nj(t),i="fixed"===n,s=Gj(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=sj(0);if(r||!r&&!i)if(("body"!==_j(t)||Rj(o))&&(a=Bj(t)),r){const e=Gj(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Jj(o));const c=!o||r||i?sj(0):Xj(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function nO(e){return"static"===Dj(e).position}function rO(e,t){if(!jj(e)||"fixed"===Dj(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Nj(e)===n&&(n=n.ownerDocument.body),n}function oO(e,t){const n=Aj(e);if(Tj(e))return n;if(!jj(e)){let t=Uj(e);for(;t&&!zj(t);){if($j(t)&&!nO(t))return t;t=Uj(t)}return n}let r=rO(e,t);for(;r&&Mj(r)&&nO(r);)r=rO(r,t);return r&&zj(r)&&nO(r)&&!Lj(r)?n:r||function(e){let t=Uj(e);for(;jj(t)&&!zj(t);){if(Lj(t))return t;if(Tj(t))return null;t=Uj(t)}return null}(e)||n}const iO={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=Nj(r),a=!!t&&Tj(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=sj(1);const u=sj(0),d=jj(r);if((d||!d&&!i)&&(("body"!==_j(r)||Rj(s))&&(l=Bj(r)),jj(r))){const e=Gj(r);c=Kj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!s||d||i?sj(0):Xj(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Nj,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Tj(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Hj(e,[],!1).filter((e=>$j(e)&&"body"!==_j(e))),o=null;const i="fixed"===Dj(e).position;let s=i?Uj(e):e;for(;$j(s)&&!zj(s);){const t=Dj(s),n=Lj(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Rj(s)&&!n&&eO(e,s))?r=r.filter((e=>e!==s)):o=t,s=Uj(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Zj(t,n,o);return e.top=rj(r.top,e.top),e.right=nj(r.right,e.right),e.bottom=nj(r.bottom,e.bottom),e.left=rj(r.left,e.left),e}),Zj(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:oO,getElementRects:async function(e){const t=this.getOffsetParent||oO,n=this.getDimensions,r=await n(e.floating);return{reference:tO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Wj(e);return{width:t,height:n}},getScale:Kj,isElement:$j,isRTL:function(e){return"rtl"===Dj(e).direction}};function sO(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=qj(e),u=o||i?[...c?Hj(c):[],...Hj(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=Nj(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const p={rootMargin:-ij(u)+"px "+-ij(o.clientWidth-(c+d))+"px "+-ij(o.clientHeight-(u+f))+"px "+-ij(c)+"px",threshold:rj(0,nj(1,l))||1};let h=!0;function v(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(m){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let v=l?Gj(e):null;return l&&function t(){const r=Gj(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const aO=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=dj(n),a=fj(n),l="y"===vj(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=uj(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},lO=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=uj(e,t),c={x:n,y:r},u=await kj(t,l),d=vj(dj(o)),f=pj(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=cj(p+u["y"===f?"top":"left"],p,p-u[e])}if(s){const e="y"===d?"bottom":"right";h=cj(h+u["y"===d?"top":"left"],h,h-u[e])}const v=a.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[d]:s}}}}}},cO=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...m}=uj(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=dj(o),y=vj(a),b=dj(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!v?[yj(a)]:function(e){const t=yj(e);return[gj(e),t,gj(t)]}(a)),k="none"!==h;!f&&k&&x.push(...function(e,t,n,r){const o=fj(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(dj(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(gj)))),i}(a,v,h,w));const E=[a,...x],S=await kj(t,m),C=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(S[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=fj(e),o=mj(e),i=hj(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=yj(s)),[s,yj(s)]}(o,s,w);C.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:o,overflows:C}],!C.every((e=>e<=0))){var A,N;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(N=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=_.filter((e=>{if(k){const t=vj(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},uO=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=uj(e,t),u=await kj(t,c),d=dj(o),f=fj(o),p="y"===vj(o),{width:h,height:v}=i.floating;let m,g;"top"===d||"bottom"===d?(m=d,g=f===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,m="end"===f?"top":"bottom");const y=v-u.top-u.bottom,b=h-u.left-u.right,w=nj(v-u[m],y),x=nj(h-u[g],b),k=!t.middlewareData.shift;let E=w,S=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),k&&!f){const e=rj(u.left,0),t=rj(u.right,0),n=rj(u.top,0),r=rj(u.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:rj(u.left,u.right)):E=v-2*(0!==n||0!==r?n+r:rj(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:E});const C=await s.getDimensions(a.floating);return h!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}},dO=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=uj(e,t);switch(r){case"referenceHidden":{const e=Ej(await kj(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Sj(e)}}}case"escaped":{const e=Ej(await kj(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Sj(e)}}}default:return{}}}}},fO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=uj(e,t)||{};if(null==c)return{};const d=bj(u),f={x:n,y:r},p=mj(o),h=hj(p),v=await s.getDimensions(c),m="y"===p,g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-f[p]-i.floating[h],x=f[p]-i.reference[p],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=k?k[b]:0;E&&await(null==s.isElement?void 0:s.isElement(k))||(E=a.floating[b]||i.floating[h]);const S=w/2-x/2,C=E/2-v[h]/2-1,_=nj(d[g],C),A=nj(d[y],C),N=_,P=E-v[h]-A,$=E/2-v[h]/2+S,j=cj(N,$,P),O=!l.arrow&&null!=fj(o)&&$!==j&&i.reference[h]/2-($n&&(p=n)}if(c){var g,y;const e="y"===f?"width":"height",t=["top","left"].includes(dj(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=s.offset)?void 0:g[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);hr&&(h=r)}return{[f]:p,[d]:h}}}},hO=(e,t,n)=>{const r=new Map,o={platform:iO,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=xj(c,r,l),f=r,p={},h=0;for(let v=0;v{t.current=e})),t}const wO=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?fO({element:n.current,padding:r}).fn(t):{}:n?fO({element:n,padding:r}).fn(t):{};var o}}),xO=(e,t)=>({...aO(e),options:[e,t]}),kO=(e,t)=>({...lO(e),options:[e,t]}),EO=(e,t)=>({...pO(e),options:[e,t]}),SO=(e,t)=>({...cO(e),options:[e,t]}),CO=(e,t)=>({...uO(e),options:[e,t]}),_O=(e,t)=>({...dO(e),options:[e,t]}),AO=(e,t)=>({...wO(e),options:[e,t]});var NO=qe.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return nt.jsx(_$.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:nt.jsx("polygon",{points:"0,0 30,0 15,10"})})}));NO.displayName="Arrow";var PO=NO;var $O="Popper",[jO,OO]=g$($O),[RO,MO]=jO($O),TO=e=>{const{__scopePopper:t,children:n}=e,[r,o]=qe.useState(null);return nt.jsx(RO,{scope:t,anchor:r,onAnchorChange:o,children:n})};TO.displayName=$O;var LO="PopperAnchor",IO=qe.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=MO(LO,n),s=qe.useRef(null),a=m$(t,s);return qe.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:nt.jsx(_$.div,{...o,ref:a})}));IO.displayName=LO;var zO="PopperContent",[DO,BO]=jO(zO),UO=qe.forwardRef(((e,t)=>{var n,r,o,i,s,a;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:h=!0,collisionBoundary:v=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:w,...x}=e,k=MO(zO,l),[E,S]=qe.useState(null),C=m$(t,(e=>S(e))),[_,A]=qe.useState(null),N=function(e){const[t,n]=qe.useState(void 0);return J$((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(_),P=(null==N?void 0:N.width)??0,$=(null==N?void 0:N.height)??0,j=c+("center"!==d?"-"+d:""),O="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},R=Array.isArray(v)?v:[v],M=R.length>0,T={padding:O,boundary:R.filter(WO),altBoundary:M},{refs:L,floatingStyles:I,placement:z,isPositioned:D,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=qe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=qe.useState(r);mO(f,r)||p(r);const[h,v]=qe.useState(null),[m,g]=qe.useState(null),y=qe.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),b=qe.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),w=i||h,x=s||m,k=qe.useRef(null),E=qe.useRef(null),S=qe.useRef(u),C=null!=l,_=bO(l),A=bO(o),N=bO(c),P=qe.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:f};A.current&&(e.platform=A.current),hO(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};$.current&&!mO(S.current,t)&&(S.current=t,df.flushSync((()=>{d(t)})))}))}),[f,t,n,A,N]);vO((()=>{!1===c&&S.current.isPositioned&&(S.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const $=qe.useRef(!1);vO((()=>($.current=!0,()=>{$.current=!1})),[]),vO((()=>{if(w&&(k.current=w),x&&(E.current=x),w&&x){if(_.current)return _.current(w,x,P);P()}}),[w,x,P,_,C]);const j=qe.useMemo((()=>({reference:k,floating:E,setReference:y,setFloating:b})),[y,b]),O=qe.useMemo((()=>({reference:w,floating:x})),[w,x]),R=qe.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=yO(O.floating,u.x),r=yO(O.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...gO(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,O.floating,u.x,u.y]);return qe.useMemo((()=>({...u,update:P,refs:j,elements:O,floatingStyles:R})),[u,P,j,O,R])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>sO(...e,{animationFrame:"always"===b}),elements:{reference:k.anchor},middleware:[xO({mainAxis:u+$,alignmentAxis:f}),h&&kO({mainAxis:!0,crossAxis:!1,limiter:"partial"===g?EO():void 0,...T}),h&&SO({...T}),CO({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),_&&AO({element:_,padding:p}),qO({arrowWidth:P,arrowHeight:$}),y&&_O({strategy:"referenceHidden",...T})]}),[U,F]=KO(z),H=b$(w);J$((()=>{D&&(null==H||H())}),[D,H]);const V=null==(n=B.arrow)?void 0:n.x,W=null==(r=B.arrow)?void 0:r.y,q=0!==(null==(o=B.arrow)?void 0:o.centerOffset),[K,Q]=qe.useState();return J$((()=>{E&&Q(window.getComputedStyle(E).zIndex)}),[E]),nt.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:D?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null==(i=B.transformOrigin)?void 0:i.x,null==(s=B.transformOrigin)?void 0:s.y].join(" "),...(null==(a=B.hide)?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:nt.jsx(DO,{scope:l,placedSide:U,onArrowChange:A,arrowX:V,arrowY:W,shouldHideArrow:q,children:nt.jsx(_$.div,{"data-side":U,"data-align":F,...x,ref:C,style:{...x.style,animation:D?void 0:"none"}})})})}));UO.displayName=zO;var FO="PopperArrow",HO={top:"bottom",right:"left",bottom:"top",left:"right"},VO=qe.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=BO(FO,n),i=HO[o.placedSide];return nt.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:nt.jsx(PO,{...r,ref:t,style:{...r.style,display:"block"}})})}));function WO(e){return null!==e}VO.displayName=FO;var qO=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:s,middlewareData:a}=t,l=0!==(null==(n=a.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,f]=KO(i),p={start:"0%",center:"50%",end:"100%"}[f],h=((null==(r=a.arrow)?void 0:r.x)??0)+c/2,v=((null==(o=a.arrow)?void 0:o.y)??0)+u/2;let m="",g="";return"bottom"===d?(m=l?p:`${h}px`,g=-u+"px"):"top"===d?(m=l?p:`${h}px`,g=`${s.floating.height+u}px`):"right"===d?(m=-u+"px",g=l?p:`${v}px`):"left"===d&&(m=`${s.floating.width+u}px`,g=l?p:`${v}px`),{data:{x:m,y:g}}}});function KO(e){const[t,n="center"]=e.split("-");return[t,n]}var QO=TO,YO=IO,GO=UO,JO=VO,XO=qe.forwardRef(((e,t)=>{var n;const{container:r,...o}=e,[i,s]=qe.useState(!1);J$((()=>s(!0)),[]);const a=r||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return a?ff.createPortal(nt.jsx(_$.div,{...o,ref:t}),a):null}));XO.displayName="Portal";var ZO=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=qe.useState(),r=qe.useRef({}),o=qe.useRef(e),i=qe.useRef("none"),s=e?"mounted":"unmounted",[a,l]=function(e,t){return qe.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return qe.useEffect((()=>{const e=eR(r.current);i.current="mounted"===a?e:"none"}),[a]),J$((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,s=eR(t);if(e)l("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==s?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,l]),J$((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,s=i=>{const s=eR(r.current).includes(i.animationName);if(i.target===t&&s&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(i.current=eR(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:qe.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):qe.Children.only(n),i=m$(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?qe.cloneElement(o,{ref:i}):null};function eR(e){return(null==e?void 0:e.animationName)||"none"}ZO.displayName="Presence";var tR="rovingFocusGroup.onEntryFocus",nR={bubbles:!1,cancelable:!0},rR="RovingFocusGroup",[oR,iR,sR]=N$(rR),[aR,lR]=g$(rR,[sR]),[cR,uR]=aR(rR),dR=qe.forwardRef(((e,t)=>nt.jsx(oR.Provider,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(oR.Slot,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(fR,{...e,ref:t})})})));dR.displayName=rR;var fR=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=qe.useRef(null),p=m$(t,f),h=$$(i),[v=null,m]=w$({prop:s,defaultProp:a,onChange:l}),[g,y]=qe.useState(!1),b=b$(c),w=iR(n),x=qe.useRef(!1),[k,E]=qe.useState(0);return qe.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(tR,b),()=>e.removeEventListener(tR,b)}),[b]),nt.jsx(cR,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:v,onItemFocus:qe.useCallback((e=>m(e)),[m]),onItemShiftTab:qe.useCallback((()=>y(!0)),[]),onFocusableItemAdd:qe.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:qe.useCallback((()=>E((e=>e-1))),[]),children:nt.jsx(_$.div,{tabIndex:g||0===k?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:p$(e.onMouseDown,(()=>{x.current=!0})),onFocus:p$(e.onFocus,(e=>{const t=!x.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(tR,nR);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=w().filter((e=>e.focusable));mR([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}x.current=!1})),onBlur:p$(e.onBlur,(()=>y(!1)))})})})),pR="RovingFocusGroupItem",hR=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=ej(),l=i||a,c=uR(pR,n),u=c.currentTabStopId===l,d=iR(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return qe.useEffect((()=>{if(r)return f(),()=>p()}),[r,f,p]),nt.jsx(oR.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:nt.jsx(_$.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:p$(e.onMouseDown,(e=>{r?c.onItemFocus(l):e.preventDefault()})),onFocus:p$(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:p$(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:vR[r]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=d().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=c.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>mR(o)))}var n,r}))})})}));hR.displayName=pR;var vR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mR(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var gR=dR,yR=hR,bR=new WeakMap,wR=new WeakMap,xR={},kR=0,ER=function(e){return e&&(e.host||ER(e.parentNode))},SR=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=ER(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);xR[n]||(xR[n]=new WeakMap);var i=xR[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(bR.get(e)||0)+1,c=(i.get(e)||0)+1;bR.set(e,l),i.set(e,c),s.push(e),1===l&&o&&wR.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",e,d)}}))};return u(t),a.clear(),kR++,function(){s.forEach((function(e){var t=bR.get(e)-1,o=i.get(e)-1;bR.set(e,t),i.set(e,o),t||(wR.has(e)||e.removeAttribute(r),wR.delete(e)),o||e.removeAttribute(n)})),--kR||(bR=new WeakMap,bR=new WeakMap,wR=new WeakMap,xR={})}},CR=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),SR(r,o,n,"aria-hidden")):function(){return null}},_R="right-scroll-bar-position",AR="width-before-scroll-bar";function NR(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var PR="undefined"!=typeof window?qe.useLayoutEffect:qe.useEffect,$R=new WeakMap;function jR(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach((function(e){return NR(e,t)}))},(o=qe.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return PR((function(){var t=$R.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach((function(e){r.has(e)||NR(e,null)})),r.forEach((function(e){n.has(e)||NR(e,o)}))}$R.set(i,e)}),[e]),i}function OR(e){return e}var RR=function(e){var t=e.sideCar,n=Qy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return qe.createElement(r,Ky({},n))};RR.isSideCarExport=!0;var MR=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=OR);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=Ky({async:!0,ssr:!1},e),t}(),TR=function(){},LR=qe.forwardRef((function(e,t){var n=qe.useRef(null),r=qe.useState({onScrollCapture:TR,onWheelCapture:TR,onTouchMoveCapture:TR}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,h=e.inert,v=e.allowPinchZoom,m=e.as,g=void 0===m?"div":m,y=e.gapMode,b=Qy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,x=jR([n,t]),k=Ky(Ky({},b),o);return qe.createElement(qe.Fragment,null,u&&qe.createElement(w,{sideCar:MR,removeScrollBar:c,shards:d,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:y}),s?qe.cloneElement(qe.Children.only(a),Ky(Ky({},k),{ref:x})):qe.createElement(g,Ky({},k,{className:l,ref:x}),a))}));LR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},LR.classNames={fullWidth:AR,zeroRight:_R};function IR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var zR=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=IR())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},DR=function(){var e,t=(e=zR(),function(t,n){qe.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},BR={left:0,top:0,right:0,gap:0},UR=function(e){return parseInt(e||"",10)||0},FR=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return BR;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[UR(n),UR(r),UR(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},HR=DR(),VR="data-scroll-locked",WR=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(VR,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(_R," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(AR," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(_R," .").concat(_R," {\n right: 0 ").concat(r,";\n }\n \n .").concat(AR," .").concat(AR," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(VR,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},qR=function(){var e=parseInt(document.body.getAttribute(VR)||"0",10);return isFinite(e)?e:0},KR=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;qe.useEffect((function(){return document.body.setAttribute(VR,(qR()+1).toString()),function(){var e=qR()-1;e<=0?document.body.removeAttribute(VR):document.body.setAttribute(VR,e.toString())}}),[]);var i=qe.useMemo((function(){return FR(o)}),[o]);return qe.createElement(HR,{styles:WR(i,!t,o,n?"":"!important")})},QR=!1;if("undefined"!=typeof window)try{var YR=Object.defineProperty({},"passive",{get:function(){return QR=!0,!0}});window.addEventListener("test",YR,YR),window.removeEventListener("test",YR,YR)}catch(aI){QR=!1}var GR=!!QR&&{passive:!1},JR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},XR=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),ZR(e,r)){var o=eM(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZR=function(e,t){return"v"===e?function(e){return JR(e,"overflowY")}(t):function(e){return JR(e,"overflowX")}(t)},eM=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},tM=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nM=function(e){return[e.deltaX,e.deltaY]},rM=function(e){return e&&"current"in e?e.current:e},oM=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},iM=0,sM=[];function aM(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lM=(cM=function(e){var t=qe.useRef([]),n=qe.useRef([0,0]),r=qe.useRef(),o=qe.useState(iM++)[0],i=qe.useState(DR)[0],s=qe.useRef(e);qe.useEffect((function(){s.current=e}),[e]),qe.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Zy([e.lockRef.current],(e.shards||[]).map(rM),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var a=qe.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,i=tM(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=XR(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=XR(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=eM(e,a),h=p[0],v=p[1]-p[2]-i*h;(h||v)&&ZR(e,a)&&(d+=v,f+=h),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(f)<1)&&o||(c=!0),c}(p,t,e,"h"===p?l:c,!0)}),[]),l=qe.useCallback((function(e){var n=e;if(sM.length&&sM[sM.length-1]===i){var r="deltaY"in n?nM(n):tM(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(s.current.shards||[]).map(rM).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?a(n,l[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),c=qe.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:aM(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),u=qe.useCallback((function(e){n.current=tM(e),r.current=void 0}),[]),d=qe.useCallback((function(t){c(t.type,nM(t),t.target,a(t,e.lockRef.current))}),[]),f=qe.useCallback((function(t){c(t.type,tM(t),t.target,a(t,e.lockRef.current))}),[]);qe.useEffect((function(){return sM.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,GR),document.addEventListener("touchmove",l,GR),document.addEventListener("touchstart",u,GR),function(){sM=sM.filter((function(e){return e!==i})),document.removeEventListener("wheel",l,GR),document.removeEventListener("touchmove",l,GR),document.removeEventListener("touchstart",u,GR)}}),[]);var p=e.removeScrollBar,h=e.inert;return qe.createElement(qe.Fragment,null,h?qe.createElement(i,{styles:oM(o)}):null,p?qe.createElement(KR,{gapMode:e.gapMode}):null)},MR.useMedium(cM),RR);var cM,uM=qe.forwardRef((function(e,t){return qe.createElement(LR,Ky({},e,{ref:t,sideCar:lM}))}));uM.classNames=LR.classNames;var dM=["Enter"," "],fM=["ArrowUp","PageDown","End"],pM=["ArrowDown","PageUp","Home",...fM],hM={ltr:[...dM,"ArrowRight"],rtl:[...dM,"ArrowLeft"]},vM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mM="Menu",[gM,yM,bM]=N$(mM),[wM,xM]=g$(mM,[bM,OO,lR]),kM=OO(),EM=lR(),[SM,CM]=wM(mM),[_M,AM]=wM(mM),NM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=kM(t),[l,c]=qe.useState(null),u=qe.useRef(!1),d=b$(i),f=$$(o);return qe.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),nt.jsx(QO,{...a,children:nt.jsx(SM,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:nt.jsx(_M,{scope:t,onClose:qe.useCallback((()=>d(!1)),[d]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};NM.displayName=mM;var PM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=kM(n);return nt.jsx(YO,{...o,...r,ref:t})}));PM.displayName="MenuAnchor";var $M="MenuPortal",[jM,OM]=wM($M,{forceMount:void 0}),RM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=CM($M,t);return nt.jsx(jM,{scope:t,forceMount:n,children:nt.jsx(ZO,{present:n||i.open,children:nt.jsx(XO,{asChild:!0,container:o,children:r})})})};RM.displayName=$M;var MM="MenuContent",[TM,LM]=wM(MM),IM=qe.forwardRef(((e,t)=>{const n=OM(MM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=CM(MM,e.__scopeMenu),s=AM(MM,e.__scopeMenu);return nt.jsx(gM.Provider,{scope:e.__scopeMenu,children:nt.jsx(ZO,{present:r||i.open,children:nt.jsx(gM.Slot,{scope:e.__scopeMenu,children:s.modal?nt.jsx(zM,{...o,ref:t}):nt.jsx(DM,{...o,ref:t})})})})})),zM=qe.forwardRef(((e,t)=>{const n=CM(MM,e.__scopeMenu),r=qe.useRef(null),o=m$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return CR(e)}),[]),nt.jsx(BM,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:p$(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),DM=qe.forwardRef(((e,t)=>{const n=CM(MM,e.__scopeMenu);return nt.jsx(BM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),BM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...v}=e,m=CM(MM,n),g=AM(MM,n),y=kM(n),b=EM(n),w=yM(n),[x,k]=qe.useState(null),E=qe.useRef(null),S=m$(t,E,m.onContentChange),C=qe.useRef(0),_=qe.useRef(""),A=qe.useRef(0),N=qe.useRef(null),P=qe.useRef("right"),$=qe.useRef(0),j=h?uM:qe.Fragment,O=h?{as:x$,allowPinchZoom:!0}:void 0,R=e=>{var t,n;const r=_.current+e,o=w().filter((e=>!e.disabled)),i=document.activeElement,s=null==(t=o.find((e=>e.ref.current===i)))?void 0:t.textValue,a=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,s),l=null==(n=o.find((e=>e.textValue===a)))?void 0:n.ref.current;!function e(t){_.current=t,window.clearTimeout(C.current),""!==t&&(C.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};qe.useEffect((()=>()=>window.clearTimeout(C.current)),[]),qe.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??B$()),document.body.insertAdjacentElement("beforeend",e[1]??B$()),D$++,()=>{1===D$&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),D$--}}),[]);const M=qe.useCallback((e=>{var t,n;return P.current===(null==(t=N.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=c>r&&n<(l-e)*(r-a)/(c-a)+e&&(o=!o)}return o}(n,t)}(e,null==(n=N.current)?void 0:n.area)}),[]);return nt.jsx(TM,{scope:n,searchRef:_,onItemEnter:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),onItemLeave:qe.useCallback((e=>{var t;M(e)||(null==(t=E.current)||t.focus(),k(null))}),[M]),onTriggerLeave:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),pointerGraceTimerRef:A,onPointerGraceIntentChange:qe.useCallback((e=>{N.current=e}),[]),children:nt.jsx(j,{...O,children:nt.jsx(V$,{asChild:!0,trapped:o,onMountAutoFocus:p$(i,(e=>{var t;e.preventDefault(),null==(t=E.current)||t.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:nt.jsx(L$,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:nt.jsx(gR,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:k,onEntryFocus:p$(l,(e=>{g.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:nt.jsx(GO,{role:"menu","aria-orientation":"vertical","data-state":fT(m.open),"data-radix-menu-content":"",dir:g.dir,...y,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:p$(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&R(e.key));const o=E.current;if(e.target!==o)return;if(!pM.includes(e.key))return;e.preventDefault();const i=w().filter((e=>!e.disabled)).map((e=>e.ref.current));fM.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:p$(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),_.current="")})),onPointerMove:p$(e.onPointerMove,vT((e=>{const t=e.target,n=$.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>$.current?"right":"left";P.current=t,$.current=e.clientX}})))})})})})})})}));IM.displayName=MM;var UM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(_$.div,{role:"group",...r,ref:t})}));UM.displayName="MenuGroup";var FM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(_$.div,{...r,ref:t})}));FM.displayName="MenuLabel";var HM="MenuItem",VM="menu.itemSelect",WM=qe.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=qe.useRef(null),s=AM(HM,e.__scopeMenu),a=LM(HM,e.__scopeMenu),l=m$(t,i),c=qe.useRef(!1);return nt.jsx(qM,{...o,ref:l,disabled:n,onClick:p$(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(VM,{bubbles:!0,cancelable:!0});e.addEventListener(VM,(e=>null==r?void 0:r(e)),{once:!0}),A$(e,t),t.defaultPrevented?c.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null==(n=e.onPointerDown)||n.call(e,t),c.current=!0},onPointerUp:p$(e.onPointerUp,(e=>{var t;c.current||null==(t=e.currentTarget)||t.click()})),onKeyDown:p$(e.onKeyDown,(e=>{const t=""!==a.searchRef.current;n||t&&" "===e.key||dM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));WM.displayName=HM;var qM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=LM(HM,n),a=EM(n),l=qe.useRef(null),c=m$(t,l),[u,d]=qe.useState(!1),[f,p]=qe.useState("");return qe.useEffect((()=>{const e=l.current;e&&p((e.textContent??"").trim())}),[i.children]),nt.jsx(gM.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:nt.jsx(yR,{asChild:!0,...a,focusable:!r,children:nt.jsx(_$.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:p$(e.onPointerMove,vT((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:p$(e.onPointerLeave,vT((e=>s.onItemLeave(e)))),onFocus:p$(e.onFocus,(()=>d(!0))),onBlur:p$(e.onBlur,(()=>d(!1)))})})})})),KM=qe.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return nt.jsx(tT,{scope:e.__scopeMenu,checked:n,children:nt.jsx(WM,{role:"menuitemcheckbox","aria-checked":pT(n)?"mixed":n,...o,ref:t,"data-state":hT(n),onSelect:p$(o.onSelect,(()=>null==r?void 0:r(!!pT(n)||!n)),{checkForDefaultPrevented:!1})})})}));KM.displayName="MenuCheckboxItem";var QM="MenuRadioGroup",[YM,GM]=wM(QM,{value:void 0,onValueChange:()=>{}}),JM=qe.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=b$(r);return nt.jsx(YM,{scope:e.__scopeMenu,value:n,onValueChange:i,children:nt.jsx(UM,{...o,ref:t})})}));JM.displayName=QM;var XM="MenuRadioItem",ZM=qe.forwardRef(((e,t)=>{const{value:n,...r}=e,o=GM(XM,e.__scopeMenu),i=n===o.value;return nt.jsx(tT,{scope:e.__scopeMenu,checked:i,children:nt.jsx(WM,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":hT(i),onSelect:p$(r.onSelect,(()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,n)}),{checkForDefaultPrevented:!1})})})}));ZM.displayName=XM;var eT="MenuItemIndicator",[tT,nT]=wM(eT,{checked:!1}),rT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=nT(eT,n);return nt.jsx(ZO,{present:r||pT(i.checked)||!0===i.checked,children:nt.jsx(_$.span,{...o,ref:t,"data-state":hT(i.checked)})})}));rT.displayName=eT;var oT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(_$.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));oT.displayName="MenuSeparator";var iT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=kM(n);return nt.jsx(JO,{...o,...r,ref:t})}));iT.displayName="MenuArrow";var[sT,aT]=wM("MenuSub"),lT="MenuSubTrigger",cT=qe.forwardRef(((e,t)=>{const n=CM(lT,e.__scopeMenu),r=AM(lT,e.__scopeMenu),o=aT(lT,e.__scopeMenu),i=LM(lT,e.__scopeMenu),s=qe.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=qe.useCallback((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return qe.useEffect((()=>u),[u]),qe.useEffect((()=>{const e=a.current;return()=>{window.clearTimeout(e),l(null)}}),[a,l]),nt.jsx(PM,{asChild:!0,...c,children:nt.jsx(qM,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":fT(n.open),...e,ref:v$(t,o.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:p$(e.onPointerMove,vT((t=>{i.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),u()}),100))}))),onPointerLeave:p$(e.onPointerLeave,vT((e=>{var t,r;u();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,s="right"===t,l=s?-5:5,c=o[s?"left":"right"],u=o[s?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+l,y:e.clientY},{x:c,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:c,y:o.bottom}],side:t}),window.clearTimeout(a.current),a.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:p$(e.onKeyDown,(t=>{var o;const s=""!==i.searchRef.current;e.disabled||s&&" "===t.key||hM[r.dir].includes(t.key)&&(n.onOpenChange(!0),null==(o=n.content)||o.focus(),t.preventDefault())}))})})}));cT.displayName=lT;var uT="MenuSubContent",dT=qe.forwardRef(((e,t)=>{const n=OM(MM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=CM(MM,e.__scopeMenu),s=AM(MM,e.__scopeMenu),a=aT(uT,e.__scopeMenu),l=qe.useRef(null),c=m$(t,l);return nt.jsx(gM.Provider,{scope:e.__scopeMenu,children:nt.jsx(ZO,{present:r||i.open,children:nt.jsx(gM.Slot,{scope:e.__scopeMenu,children:nt.jsx(BM,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null==(t=l.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:p$(e.onFocusOutside,(e=>{e.target!==a.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:p$(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:p$(e.onKeyDown,(e=>{var t;const n=e.currentTarget.contains(e.target),r=vM[s.dir].includes(e.key);n&&r&&(i.onOpenChange(!1),null==(t=a.trigger)||t.focus(),e.preventDefault())}))})})})})}));function fT(e){return e?"open":"closed"}function pT(e){return"indeterminate"===e}function hT(e){return pT(e)?"indeterminate":e?"checked":"unchecked"}function vT(e){return t=>"mouse"===t.pointerType?e(t):void 0}dT.displayName=uT;var mT=NM,gT=PM,yT=RM,bT=IM,wT=UM,xT=FM,kT=WM,ET=KM,ST=JM,CT=ZM,_T=rT,AT=oT,NT=iT,PT=cT,$T=dT,jT="DropdownMenu",[OT,RT]=g$(jT,[xM]),MT=xM(),[TT,LT]=OT(jT),IT=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=MT(t),c=qe.useRef(null),[u=!1,d]=w$({prop:o,defaultProp:i,onChange:s});return nt.jsx(TT,{scope:t,triggerId:ej(),triggerRef:c,contentId:ej(),open:u,onOpenChange:d,onOpenToggle:qe.useCallback((()=>d((e=>!e))),[d]),modal:a,children:nt.jsx(mT,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};IT.displayName=jT;var zT="DropdownMenuTrigger",DT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=LT(zT,n),s=MT(n);return nt.jsx(gT,{asChild:!0,...s,children:nt.jsx(_$.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:v$(t,i.triggerRef),onPointerDown:p$(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:p$(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));DT.displayName=zT;var BT=e=>{const{__scopeDropdownMenu:t,...n}=e,r=MT(t);return nt.jsx(yT,{...r,...n})};BT.displayName="DropdownMenuPortal";var UT="DropdownMenuContent",FT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=LT(UT,n),i=MT(n),s=qe.useRef(!1);return nt.jsx(bT,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:p$(e.onCloseAutoFocus,(e=>{var t;s.current||null==(t=o.triggerRef.current)||t.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:p$(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;o.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));FT.displayName=UT;qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(wT,{...o,...r,ref:t})})).displayName="DropdownMenuGroup";var HT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(xT,{...o,...r,ref:t})}));HT.displayName="DropdownMenuLabel";var VT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(kT,{...o,...r,ref:t})}));VT.displayName="DropdownMenuItem";var WT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(ET,{...o,...r,ref:t})}));WT.displayName="DropdownMenuCheckboxItem";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(ST,{...o,...r,ref:t})})).displayName="DropdownMenuRadioGroup";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(CT,{...o,...r,ref:t})})).displayName="DropdownMenuRadioItem";var qT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(_T,{...o,...r,ref:t})}));qT.displayName="DropdownMenuItemIndicator";var KT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(AT,{...o,...r,ref:t})}));KT.displayName="DropdownMenuSeparator";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(NT,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var QT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(PT,{...o,...r,ref:t})}));QT.displayName="DropdownMenuSubTrigger";var YT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx($T,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));YT.displayName="DropdownMenuSubContent";var GT=IT,JT=DT,XT=BT,ZT=FT,eL=HT,tL=VT,nL=WT,rL=qT,oL=KT,iL=QT,sL=YT;const aL=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim();var lL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const cL=qe.forwardRef((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>qe.createElement("svg",{ref:l,...lL,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:aL("lucide",o),...a},[...s.map((([e,t])=>qe.createElement(e,t))),...Array.isArray(i)?i:[i]]))),uL=(e,t)=>{const n=qe.forwardRef((({className:n,...r},o)=>{return qe.createElement(cL,{ref:o,iconNode:t,className:aL(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},dL=uL("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),fL=uL("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),pL=GT,hL=JT;qe.forwardRef((({className:e,inset:t,children:n,...r},o)=>nt.jsxs(iL,{ref:o,className:ap("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,nt.jsx(fL,{className:"ml-auto h-4 w-4"})]}))).displayName=iL.displayName;qe.forwardRef((({className:e,...t},n)=>nt.jsx(sL,{ref:n,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}))).displayName=sL.displayName;const vL=qe.forwardRef((({className:e,sideOffset:t=4,...n},r)=>nt.jsx(XT,{children:nt.jsx(ZT,{ref:r,sideOffset:t,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})));vL.displayName=ZT.displayName;const mL=qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(tL,{ref:r,className:ap("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n})));mL.displayName=tL.displayName;qe.forwardRef((({className:e,children:t,checked:n,...r},o)=>nt.jsxs(nL,{ref:o,className:ap("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[nt.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:nt.jsx(rL,{children:nt.jsx(dL,{className:"h-4 w-4"})})}),t]}))).displayName=nL.displayName;qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(eL,{ref:r,className:ap("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}))).displayName=eL.displayName;const gL=qe.forwardRef((({className:e,...t},n)=>nt.jsx(oL,{ref:n,className:ap("-mx-1 my-1 h-px bg-muted",e),...t})));gL.displayName=oL.displayName;const yL=new Set(["children","localName","ref","style","className"]),bL=new WeakMap,wL=(e,t,n,r,o)=>{const i=null==o?void 0:o[t];void 0===i?(e[t]=n,null==n&&t in HTMLElement.prototype&&e.removeAttribute(t)):n!==r&&((e,t,n)=>{let r=bL.get(e);void 0===r&&bL.set(e,r=new Map);let o=r.get(t);void 0!==n?void 0===o?(r.set(t,o={handleEvent:n}),e.addEventListener(t,o)):o.handleEvent=n:void 0!==o&&(r.delete(t),e.removeEventListener(t,o))})(e,i,n)},xL=({react:e,tagName:t,elementClass:n,events:r,displayName:o})=>{const i=new Set(Object.keys(r??{})),s=e.forwardRef(((o,s)=>{const a=e.useRef(new Map),l=e.useRef(null),c={},u={};for(const[e,t]of Object.entries(o))yL.has(e)?c["className"===e?"class":e]=t:i.has(e)||e in n.prototype?u[e]=t:c[e]=t;return e.useLayoutEffect((()=>{if(null===l.current)return;const e=new Map;for(const t in u)wL(l.current,t,o[t],a.current.get(t),r),a.current.delete(t),e.set(t,o[t]);for(const[t,n]of a.current)wL(l.current,t,void 0,n,r);a.current=e})),e.useLayoutEffect((()=>{var e;null==(e=l.current)||e.removeAttribute("defer-hydration")}),[]),c.suppressHydrationWarning=!0,e.createElement(t,{...c,ref:e.useCallback((e=>{l.current=e,"function"==typeof s?s(e):null!==s&&(s.current=e)}),[s])})}));return s.displayName=o??n.name,s};xL({tagName:"dc-connection-button",elementClass:d$,react:Ke});const kL=xL({tagName:"dc-connection-dialog",elementClass:o$,react:Ke,events:{onClose:"close"}});function EL(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}function SL(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}}function CL(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function _L(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const o=[],i=Array.from(e);for(i.forEach((e=>{if(e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,s=!0;for(let o=r;o{if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(t))throw new Error("radix.encode input should be Uint8Array");return _L(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(_L(t,e,256))}}}const NL=(e=>EL(AL(58),SL(e),CL("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function PL(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function $L(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function jL(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const OL=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),RL=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],ML=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,TL=RL?e=>e:e=>ML(e);function LL(e){for(let t=0;te(n).update(IL(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}const BL=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class UL extends zL{constructor(e,t,n={},r,o,i){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,PL(e),PL(t),PL(r),t<0||t>r)throw new Error("outputLen bigger than keyLen");if(void 0!==n.key&&(n.key.length<1||n.key.length>r))throw new Error(`key must be up 1..${r} byte long or undefined`);if(void 0!==n.salt&&n.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(void 0!==n.personalization&&n.personalization.length!==i)throw new Error(`personalization must be ${i} byte long or undefined`);this.buffer32=OL(this.buffer=new Uint8Array(e))}update(e){jL(this);const{blockLen:t,buffer:n,buffer32:r}=this,o=(e=IL(e)).length,i=e.byteOffset,s=e.buffer;for(let a=0;ar[t]=TL(e)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){const{buffer:t,length:n,finished:r,destroyed:o,outputLen:i,pos:s}=this;return e||(e=new this.constructor({dkLen:i})),e.set(...this.get()),e.length=n,e.finished=r,e.destroyed=o,e.outputLen=i,e.buffer.set(t),e.pos=s,e}}const FL=BigInt(2**32-1),HL=BigInt(32);function VL(e,t=!1){return t?{h:Number(e&FL),l:Number(e>>HL&FL)}:{h:0|Number(e>>HL&FL),l:0|Number(e&FL)}}const WL={fromBig:VL,split:function(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<>>32-n,rotlSL:(e,t,n)=>t<>>32-n,rotlBH:(e,t,n)=>t<>>64-n,rotlBL:(e,t,n)=>e<>>64-n,add:function(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,add5H:(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,add5L:(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0)},qL=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),KL=new Uint32Array(32);function QL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=KL[2*e],c=KL[2*e+1],u=KL[2*t],d=KL[2*t+1],f=KL[2*n],p=KL[2*n+1],h=KL[2*r],v=KL[2*r+1],m=WL.add3L(l,u,s);c=WL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:WL.rotr32H(v,h),Dl:WL.rotr32L(v,h)}),({h:p,l:f}=WL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:WL.rotrSH(d,u,24),Bl:WL.rotrSL(d,u,24)}),KL[2*e]=l,KL[2*e+1]=c,KL[2*t]=u,KL[2*t+1]=d,KL[2*n]=f,KL[2*n+1]=p,KL[2*r]=h,KL[2*r+1]=v}function YL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=KL[2*e],c=KL[2*e+1],u=KL[2*t],d=KL[2*t+1],f=KL[2*n],p=KL[2*n+1],h=KL[2*r],v=KL[2*r+1],m=WL.add3L(l,u,s);c=WL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:WL.rotrSH(v,h,16),Dl:WL.rotrSL(v,h,16)}),({h:p,l:f}=WL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:WL.rotrBH(d,u,63),Bl:WL.rotrBL(d,u,63)}),KL[2*e]=l,KL[2*e+1]=c,KL[2*t]=u,KL[2*t+1]=d,KL[2*n]=f,KL[2*n+1]=p,KL[2*r]=h,KL[2*r+1]=v}class GL extends UL{constructor(e={}){super(128,void 0===e.dkLen?64:e.dkLen,e,64,16,16),this.v0l=0|qL[0],this.v0h=0|qL[1],this.v1l=0|qL[2],this.v1h=0|qL[3],this.v2l=0|qL[4],this.v2h=0|qL[5],this.v3l=0|qL[6],this.v3h=0|qL[7],this.v4l=0|qL[8],this.v4h=0|qL[9],this.v5l=0|qL[10],this.v5h=0|qL[11],this.v6l=0|qL[12],this.v6h=0|qL[13],this.v7l=0|qL[14],this.v7h=0|qL[15];const t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|65536|1<<24,e.salt){const t=OL(IL(e.salt));this.v4l^=TL(t[0]),this.v4h^=TL(t[1]),this.v5l^=TL(t[2]),this.v5h^=TL(t[3])}if(e.personalization){const t=OL(IL(e.personalization));this.v6l^=TL(t[0]),this.v6h^=TL(t[1]),this.v7l^=TL(t[2]),this.v7h^=TL(t[3])}if(e.key){const t=new Uint8Array(this.blockLen);t.set(IL(e.key)),this.update(t)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:o,v2h:i,v3l:s,v3h:a,v4l:l,v4h:c,v5l:u,v5h:d,v6l:f,v6h:p,v7l:h,v7h:v}=this;return[e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v]}set(e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v){this.v0l=0|e,this.v0h=0|t,this.v1l=0|n,this.v1h=0|r,this.v2l=0|o,this.v2h=0|i,this.v3l=0|s,this.v3h=0|a,this.v4l=0|l,this.v4h=0|c,this.v5l=0|u,this.v5h=0|d,this.v6l=0|f,this.v6h=0|p,this.v7l=0|h,this.v7h=0|v}compress(e,t,n){this.get().forEach(((e,t)=>KL[t]=e)),KL.set(qL,16);let{h:r,l:o}=WL.fromBig(BigInt(this.length));KL[24]=qL[8]^o,KL[25]=qL[9]^r,n&&(KL[28]=~KL[28],KL[29]=~KL[29]);let i=0;const s=BL;for(let a=0;a<12;a++)QL(0,4,8,12,e,t+2*s[i++]),YL(0,4,8,12,e,t+2*s[i++]),QL(1,5,9,13,e,t+2*s[i++]),YL(1,5,9,13,e,t+2*s[i++]),QL(2,6,10,14,e,t+2*s[i++]),YL(2,6,10,14,e,t+2*s[i++]),QL(3,7,11,15,e,t+2*s[i++]),YL(3,7,11,15,e,t+2*s[i++]),QL(0,5,10,15,e,t+2*s[i++]),YL(0,5,10,15,e,t+2*s[i++]),QL(1,6,11,12,e,t+2*s[i++]),YL(1,6,11,12,e,t+2*s[i++]),QL(2,7,8,13,e,t+2*s[i++]),YL(2,7,8,13,e,t+2*s[i++]),QL(3,4,9,14,e,t+2*s[i++]),YL(3,4,9,14,e,t+2*s[i++]);this.v0l^=KL[0]^KL[16],this.v0h^=KL[1]^KL[17],this.v1l^=KL[2]^KL[18],this.v1h^=KL[3]^KL[19],this.v2l^=KL[4]^KL[20],this.v2h^=KL[5]^KL[21],this.v3l^=KL[6]^KL[22],this.v3h^=KL[7]^KL[23],this.v4l^=KL[8]^KL[24],this.v4h^=KL[9]^KL[25],this.v5l^=KL[10]^KL[26],this.v5h^=KL[11]^KL[27],this.v6l^=KL[12]^KL[28],this.v6h^=KL[13]^KL[29],this.v7l^=KL[14]^KL[30],this.v7h^=KL[15]^KL[31],KL.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const JL=DL((e=>new GL(e))),XL=(new TextEncoder).encode("SS58PRE"),ZL=e=>{try{const t=NL.decode(e),n=t.subarray(0,64&t[0]?2:1),r=t.subarray(n.length,t.length-2),o=t.subarray(n.length+r.length),i=JL(Uint8Array.of(...XL,...n,...r),{dkLen:64}).subarray(0,2);return o[0]===i[0]&&o[1]===i[1]?{isValid:!0,ss58Format:eI(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},eI=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return 1===t.byteLength?t.getUint8(0):t.getUint16(0)},tI={target:{colors:[0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,1],freq:1},cube:{colors:[0,1,3,2,4,3,0,1,3,2,4,3,0,1,3,2,4,3,5],freq:20},quazar:{colors:[1,2,3,1,2,4,5,5,4,1,2,3,1,2,4,5,5,4,0],freq:16},flower:{colors:[0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,3],freq:32},cyclic:{colors:[0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,6],freq:32},vmirror:{colors:[0,1,2,3,4,5,3,4,2,0,1,6,7,8,9,7,8,6,10],freq:128},hmirror:{colors:[0,1,2,3,4,5,6,7,8,9,10,8,6,7,5,3,4,2,11],freq:128}},nI=e=>{let t=0;const n=Object.values(tI).find((n=>(t+=n.freq,e{var l;const[c,u]=qe.useState(!1),[d,f]=qe.useState(i),[p,h]=qe.useState(),[v,m]=qe.useState(),[g,y]=qe.useState();qe.useEffect((()=>{if("string"==typeof e&&!e.includes("px")&&!e.includes("rem"))throw new Error("Providing a string for 'size' in Polkicon should be expressed either in 'px', 'rem' or 'em'");let t,n;if("string"==typeof e)switch(n=e.replace(/[0-9.]/g,""),n){case"px":t=parseFloat(e);break;case"rem":t=10*parseFloat(e)}else"number"==typeof e&&(t=e);var r,o;h(n?""+("px"===n?t+"px":t/10+"rem"):t),t<12&&(r=n||"number",o="px"===n?"12px":"rem"===n?"1.2rem":12,console.warn(`Polkicon: 'Size' expressed in '${r}' cannot be less than ${o}. Will be resized to minimum size.`)),t<32?(y("0rem 0.5rem"),m("0.5rem")):t>=32&&t<64?(y("1rem 0.5rem"),m("1rem")):t>=64&&t<100?(y("2rem 1rem"),m("1.5rem")):t>=100&&(y("3rem 1rem"),m("2rem"))}),[e]);const b=qe.useCallback((()=>{n&&(async e=>{try{await navigator.clipboard.writeText(e),u(!0),f(i)}catch{u(!0),f("Failed!")}})(t)}),[n,t,i]);qe.useEffect((()=>{n&&c&&setTimeout((()=>{u(!1)}),o)}),[n,c,o]);const{c:w,r:x,rroot3o2:k,ro2:E,rroot3o4:S,ro4:C,r3o4:_,z:A,rot:N,scheme:P,palette:$}=(e=>{const t=JL(new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),n=ZL(e);let r=n.isValid?n.publicKey:e;if(!("object"==typeof r&&r&&r instanceof Uint8Array&&32==r.length))return{};r=Uint8Array.from(JL(r)).map(((e,n)=>(e+256-t[n])%256));const o=22.4,i=o*Math.sqrt(3)/2,s=o*Math.sqrt(3)/4,a=3*o/4,l=Object.keys(tI).map((e=>tI[e].freq)).reduce(((e,t)=>e+t)),c=Math.floor(70*r[29]/256+26)%80+30,u=Math.floor((r[30]+256*r[31])%l),d=nI(u),f=Array.from(r).map(((e,t)=>{const n=(e+t%28*58)%256;if(0==n)return"#444";if(255==n)return"transparent";const r=Math.floor(n%64*360/64),o=[53,15,35,75][Math.floor(n/64)];return`hsl(${r}, ${c}%, ${o}%)`}));return{c:32,r:o,rroot3o2:i,ro2:11.2,rroot3o4:s,ro4:5.6,r3o4:a,z:5,rot:r[28]%6*3,scheme:d,palette:f}})(t),j=ZL(t).isValid?null==(l=null==P?void 0:P.colors)?void 0:l.map(((e,t)=>$[null==P?void 0:P.colors[t<18?(t+N)%18:18]])):[];let O=0;return j?nt.jsxs("div",{onClick:n?b:void 0,style:n?{cursor:c?"none":"copy",position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}:{display:"flex",justifyContent:"center",alignItems:"center"},children:[nt.jsxs("svg",{id:Math.random().toString(36).substring(2,9),className:a,style:s,width:p,height:p,viewBox:"0 0 64 64",children:[nt.jsx("circle",{cx:32,cy:32,r:32,fill:r}),nt.jsx("circle",{cx:w,cy:w-x,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w,cy:w-E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-S,cy:w-_,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-k,cy:w-E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-S,cy:w-C,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-k,cy:w,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-k,cy:w+E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-S,cy:w+C,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-S,cy:w+_,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w,cy:w+x,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w,cy:w+E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+S,cy:w+_,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+k,cy:w+E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+S,cy:w+C,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+k,cy:w,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+k,cy:w-E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+S,cy:w-C,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+S,cy:w-_,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w,cy:w,r:A,fill:j[O++]})]}),n&&c&&nt.jsx("p",{style:{fontSize:v,fontWeight:"bold",padding:g,width:p,height:p,position:"absolute",borderRadius:"55rem",color:"white",background:"green",opacity:"80%",alignItems:"center",justifyContent:"center",display:"flex"},children:d})]}):null},oI=()=>{const{accounts:e,selectAccount:t,selectedAccount:n}=QS(),[,r]=DS(),[o,i]=qe.useState(!1);return qe.useEffect((()=>{!(null==n?void 0:n.address)&&e.length>0&&(t(e[0]),i(!1))}),[e,t,null==n?void 0:n.address]),nt.jsxs(nt.Fragment,{children:[nt.jsx("div",{className:"flex w-full justify-center",children:nt.jsxs("div",{className:"flex w-full",children:[!e.length&&nt.jsx(aC,{onClick:()=>i(!0),className:"w-full text-lg font-bold bg-pink-700 hover:bg-blue-600",children:"Connect Wallet"}),!!e.length&&nt.jsxs(pL,{children:[nt.jsx(hL,{asChild:!0,children:nt.jsxs(aC,{variant:"outline",size:"default",className:"cursor-pointer overflow-hidden w-full flex items-center justify-center gap-2",children:[nt.jsx(rI,{size:36,address:(null==n?void 0:n.address)||"",className:"mr-2",outerColor:"transparent"}),null==n?void 0:n.name,nt.jsx(cC,{className:"ml-2 h-4 w-4",isOpen:!1})]})}),nt.jsxs(vL,{className:"max-h-[calc(100vh-5rem)] overflow-auto",children:[e.map(((n,r)=>nt.jsxs(qe.Fragment,{children:[nt.jsxs(mL,{className:"cursor-pointer",onClick:()=>t(n),children:[nt.jsx(rI,{size:28,address:n.address||"",className:"mr-2",outerColor:"transparent"}),n.name]},n.address),r!==e.length-1&&nt.jsx(gL,{})]},n.address))),nt.jsx(mL,{className:"cursor-pointer",onClick:()=>{i(!0)},children:"Show wallets"},"show"),nt.jsx(mL,{className:"cursor-pointer",onClick:()=>{r(),t(void 0)},children:"Disconnect"},"logout")]})]})]})}),nt.jsx(kL,{open:o,onClose:()=>i(!1)})]})};function iI(){return nt.jsx("div",{className:"flex items-center justify-center mt-6",children:nt.jsxs(up,{className:"w-full max-w-xl",children:[nt.jsx(dp,{children:nt.jsxs(fp,{className:"text-4xl text-center flex items-center justify-center gap-2",children:[nt.jsx(sI,{}),nt.jsxs("span",{children:["CLI: ",nt.jsx("span",{className:"font-light",children:"Signing Portal"})]})]})}),nt.jsx(pp,{className:"grid gap-4",children:nt.jsx(PS,{config:f$,children:nt.jsx(KS,{children:nt.jsxs("div",{className:"overflow-auto break-words whitespace-pre-wrap",children:[nt.jsx(oI,{}),nt.jsx(yC,{})]})})})})]})})}const sI=()=>nt.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",fill:"none",viewBox:"0 0 512 512",children:[nt.jsxs("g",{clipPath:"url(#clip0_873_174)",children:[nt.jsx("rect",{width:"512",height:"512",fill:"#1C0533",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint0_radial_873_174)",fillOpacity:"0.8",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint1_radial_873_174)",fillOpacity:"0.6",rx:"256"}),nt.jsx("mask",{id:"mask0_873_174",width:"1428",height:"1351",x:"-429",y:"-502",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},children:nt.jsx("path",{fill:"#D9D9D9",d:"m127.637-501.289 871.274 824.192-14.25 13.48-871.273-824.192zM88.96-464.701l871.272 824.192-14.249 13.48L74.71-451.221zM50.281-428.113l871.273 824.192-14.249 13.48L36.032-414.633zM11.603-391.525l871.273 824.192-14.249 13.48L-2.646-378.045zM-27.075-354.937l871.273 824.192-14.249 13.48-871.273-824.192zM-65.753-318.349 805.52 505.843l-14.249 13.48-871.273-824.192zM-104.431-281.761l871.273 824.192-14.249 13.48-871.273-824.192zM-143.109-245.173l871.273 824.192-14.249 13.48-871.273-824.192zM-181.787-208.585l871.273 824.192-14.249 13.48-871.273-824.192zM-220.465-171.997l871.273 824.192-14.249 13.48-871.273-824.192zM-259.143-135.409 612.13 688.783l-14.249 13.48-871.273-824.192zM-297.821-98.821 573.452 725.37l-14.249 13.48L-312.07-85.341zM-336.499-62.233l871.273 824.192-14.249 13.48-871.273-824.192zM-375.177-25.645l871.273 824.192-14.249 13.479-871.273-824.191zM-413.855 10.943l871.273 824.192-14.249 13.48-871.273-824.192z"})}),nt.jsx("g",{mask:"url(#mask0_873_174)",children:nt.jsx("path",{fill:"#E6007A",d:"M511.169 254.929C511.169 396.905 396.739 512 255.584 512 114.428 512-.001 396.905-.001 254.929S114.428-2.142 255.584-2.142c141.155 0 255.585 115.095 255.585 257.071"})}),nt.jsx("path",{fill:"#2B0532",d:"M183.804 160.44c-12.752-9.296-27.346-13.272-41.94-13.272h-89.63L5.63 367.567h117.053l9.399-44.802a86.4 86.4 0 0 0 28.32-8.371 104 104 0 0 0 4.133-2.155 97.7 97.7 0 0 0 14.779 24.342c8.258 9.967 18.342 17.785 29.802 23.435l.003.002.397.195.4.186c12.688 5.89 26.181 8.385 39.713 8.385 13.588 0 26.877-2.295 39.662-6.916a127 127 0 0 0 17.54-7.88l-2.871 13.579h117.052l9.4-44.802a86.4 86.4 0 0 0 28.32-8.371 101.4 101.4 0 0 0 28.939-21.348l.01-.011.159-.168.154-.167.003-.003c8.092-8.766 14.613-18.702 19.34-29.722 4.865-11.344 7.542-23.439 7.542-36.022 0-12.506-2.649-24.626-7.879-35.976-5.493-12.224-13.86-22.642-24.867-30.537-12.752-9.296-27.346-13.272-41.94-13.272h-89.631l-5.24 24.781c-7.026-6.908-15.096-12.504-24.009-16.758-12.764-6.233-26.404-8.834-40.034-8.834-13.589 0-26.878 2.295-39.662 6.916-12.145 4.39-23.444 10.507-33.804 18.268a133 133 0 0 0-7.099 5.68 74.6 74.6 0 0 0-16.911-16.781"}),nt.jsx("path",{fill:"#E6007A",fillRule:"evenodd",d:"m229.569 331.163.063.031.064.03c7.896 3.665 16.711 5.426 26.323 5.426 9.96 0 19.59-1.672 28.858-5.022a94.6 94.6 0 0 0 25.4-13.857c7.69-5.873 14.403-12.621 20.12-20.24l.016-.022.016-.022c5.708-7.75 10.156-16.036 13.319-24.849 3.326-9.027 5.005-18.25 5.005-27.639 0-8.458-1.303-16.601-3.928-24.399-2.514-8.002-6.373-15.177-11.585-21.468-5.277-6.369-11.756-11.363-19.365-14.972-7.797-3.835-16.58-5.669-26.205-5.669-9.961 0-19.591 1.673-28.858 5.022-9.165 3.313-17.687 7.924-25.551 13.819-7.719 5.752-14.51 12.512-20.362 20.265l-.01.014a97.4 97.4 0 0 0-13.544 24.867l-.015.04-.014.041c-3.181 9.016-4.784 18.219-4.784 27.583 0 8.482 1.311 16.702 3.94 24.634l.005.016.005.016c2.653 7.855 6.575 14.936 11.766 21.201 5.269 6.361 11.733 11.413 19.321 15.154m58.163-55.148.01-.015c2.998-4.343 5.197-8.955 6.622-13.852 1.467-5.04 2.176-9.872 2.176-14.513 0-4.335-.697-8.177-2.012-11.592l-.041-.109-.038-.11c-1.121-3.279-2.866-5.693-5.197-7.475-2.026-1.548-5.053-2.613-9.646-2.613-5.335 0-9.796 1.243-13.579 3.569l-.053.032-.053.031c-4.052 2.378-7.426 5.537-10.156 9.541a52.3 52.3 0 0 0-6.661 13.745c-1.454 5.016-2.157 9.826-2.157 14.447 0 4.358.638 8.321 1.862 11.932 1.246 3.306 3.081 5.852 5.484 7.803 2.047 1.543 5.008 2.569 9.387 2.569 5.495 0 10.017-1.255 13.78-3.568 4.107-2.524 7.515-5.779 10.262-9.808zM171.542 186.53c-6.663-4.89-14.525-7.228-23.288-7.228H84.491L51.478 335.434h51.685l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.864-14.652l.025-.027.025-.027c5.695-6.169 10.18-13.036 13.418-20.587 3.261-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.969-4.328l.037-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.013-.01h-11.5l-3.905 18.655h10.249c.063-.013.306-.078.757-.35.511-.309 1.235-.919 2.103-2.084zM469.872 186.53c-6.663-4.89-14.525-7.228-23.289-7.228h-63.762l-33.014 156.132h51.686l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.863-14.652l.026-.027.024-.027c5.696-6.169 10.18-13.036 13.419-20.587 3.26-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.968-4.328l.038-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.014-.01h-11.5l-3.904 18.655h10.249c.063-.013.306-.078.756-.35.511-.309 1.235-.919 2.104-2.084z",clipRule:"evenodd"}),nt.jsxs("mask",{id:"path-6-outside-1_873_174",width:"435",height:"156",x:"35.823",y:"166.788",fill:"#000",maskUnits:"userSpaceOnUse",children:[nt.jsx("path",{fill:"#fff",d:"M35.823 166.788h435v156h-435z"}),nt.jsx("path",{fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"})]}),nt.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"}),nt.jsx("path",{stroke:"#fff",strokeWidth:"0.3",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318Zm-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391Zm-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852Zm133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd",mask:"url(#path-6-outside-1_873_174)"})]}),nt.jsxs("defs",{children:[nt.jsxs("radialGradient",{id:"paint0_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(229.99965 647.20057 -371.3092 131.95444 -62.8 -86.4)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#6335EC"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsxs("radialGradient",{id:"paint1_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"rotate(-116.448 530.068 140.453)scale(1055.25 662.094)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#E6007A"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsx("clipPath",{id:"clip0_873_174",children:nt.jsx("rect",{width:"512",height:"512",fill:"#fff",rx:"256"})})]})]});rt.createRoot(document.getElementById("root")).render(nt.jsx(Ke.StrictMode,{children:nt.jsx(iI,{})})); + From b368da9ebcb4450b37fa1b04477b17773f1afed6 Mon Sep 17 00:00:00 2001 From: Peter White Date: Wed, 18 Dec 2024 12:24:32 -0700 Subject: [PATCH 22/25] chore: latest frontend --- crates/pop-cli/src/assets/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/pop-cli/src/assets/index.html b/crates/pop-cli/src/assets/index.html index b856e1801..c5fc00243 100644 --- a/crates/pop-cli/src/assets/index.html +++ b/crates/pop-cli/src/assets/index.html @@ -7,7 +7,7 @@ href="data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_873_174)'%3E%3Crect width='512' height='512' rx='256' fill='%231C0533'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint0_radial_873_174)' fill-opacity='0.8'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint1_radial_873_174)' fill-opacity='0.6'/%3E%3Cmask id='mask0_873_174' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='-429' y='-502' width='1428' height='1351'%3E%3Cpath d='M127.637 -501.289L998.911 322.903L984.661 336.383L113.388 -487.809L127.637 -501.289Z' fill='%23D9D9D9'/%3E%3Cpath d='M88.9594 -464.701L960.232 359.491L945.983 372.971L74.7096 -451.221L88.9594 -464.701Z' fill='%23D9D9D9'/%3E%3Cpath d='M50.2814 -428.113L921.554 396.079L907.305 409.559L36.0316 -414.633L50.2814 -428.113Z' fill='%23D9D9D9'/%3E%3Cpath d='M11.6034 -391.525L882.876 432.667L868.627 446.147L-2.64642 -378.045L11.6034 -391.525Z' fill='%23D9D9D9'/%3E%3Cpath d='M-27.0746 -354.937L844.198 469.255L829.949 482.735L-41.3244 -341.457L-27.0746 -354.937Z' fill='%23D9D9D9'/%3E%3Cpath d='M-65.7526 -318.349L805.52 505.843L791.271 519.323L-80.0024 -304.869L-65.7526 -318.349Z' fill='%23D9D9D9'/%3E%3Cpath d='M-104.431 -281.761L766.842 542.431L752.593 555.911L-118.68 -268.281L-104.431 -281.761Z' fill='%23D9D9D9'/%3E%3Cpath d='M-143.109 -245.173L728.164 579.019L713.915 592.499L-157.358 -231.693L-143.109 -245.173Z' fill='%23D9D9D9'/%3E%3Cpath d='M-181.787 -208.585L689.486 615.607L675.237 629.087L-196.036 -195.105L-181.787 -208.585Z' fill='%23D9D9D9'/%3E%3Cpath d='M-220.465 -171.997L650.808 652.195L636.559 665.675L-234.714 -158.517L-220.465 -171.997Z' fill='%23D9D9D9'/%3E%3Cpath d='M-259.143 -135.409L612.13 688.783L597.881 702.263L-273.392 -121.929L-259.143 -135.409Z' fill='%23D9D9D9'/%3E%3Cpath d='M-297.821 -98.8211L573.452 725.371L559.203 738.851L-312.07 -85.3413L-297.821 -98.8211Z' fill='%23D9D9D9'/%3E%3Cpath d='M-336.499 -62.2331L534.774 761.959L520.525 775.439L-350.748 -48.7533L-336.499 -62.2331Z' fill='%23D9D9D9'/%3E%3Cpath d='M-375.177 -25.6452L496.096 798.547L481.847 812.026L-389.426 -12.1654L-375.177 -25.6452Z' fill='%23D9D9D9'/%3E%3Cpath d='M-413.855 10.9428L457.418 835.135L443.169 848.615L-428.104 24.4225L-413.855 10.9428Z' fill='%23D9D9D9'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_873_174)'%3E%3Cpath d='M511.169 254.929C511.169 396.905 396.739 512 255.584 512C114.428 512 -0.000976562 396.905 -0.000976562 254.929C-0.000976562 112.953 114.428 -2.14209 255.584 -2.14209C396.739 -2.14209 511.169 112.953 511.169 254.929Z' fill='%23E6007A'/%3E%3C/g%3E%3Cpath d='M183.804 160.44C171.052 151.144 156.458 147.168 141.864 147.168H52.2334L5.63086 367.567H122.684L132.083 322.765C141.879 321.622 151.384 318.84 160.403 314.394C161.8 313.705 163.178 312.986 164.536 312.239C168.249 321.014 173.177 329.173 179.315 336.581C187.573 346.548 197.657 354.366 209.117 360.016L209.12 360.018L209.517 360.213L209.917 360.399C222.605 366.289 236.098 368.784 249.63 368.784C263.218 368.784 276.507 366.489 289.292 361.868C295.36 359.675 301.212 357.046 306.832 353.988L303.961 367.567H421.013L430.413 322.765C440.209 321.622 449.714 318.84 458.733 314.394C469.61 309.03 479.317 301.877 487.672 293.046L487.682 293.035L487.841 292.867L487.995 292.7L487.998 292.697C496.09 283.931 502.611 273.995 507.338 262.975C512.203 251.631 514.88 239.536 514.88 226.953C514.88 214.447 512.231 202.327 507.001 190.977C501.508 178.753 493.141 168.335 482.134 160.44C469.382 151.144 454.788 147.168 440.194 147.168H350.563L345.323 171.949C338.297 165.041 330.227 159.445 321.314 155.191C308.55 148.958 294.91 146.357 281.28 146.357C267.691 146.357 254.402 148.652 241.618 153.273C229.473 157.663 218.174 163.78 207.814 171.541C205.377 173.358 203.011 175.252 200.715 177.221C196.062 170.823 190.408 165.177 183.804 160.44Z' fill='%232B0532'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M229.569 331.163L229.632 331.194L229.696 331.224C237.592 334.889 246.407 336.65 256.019 336.65C265.979 336.65 275.609 334.978 284.877 331.628C294.055 328.31 302.528 323.689 310.277 317.771C317.967 311.898 324.68 305.15 330.397 297.531L330.413 297.509L330.429 297.487C336.137 289.737 340.585 281.451 343.748 272.638C347.074 263.611 348.753 254.388 348.753 244.999C348.753 236.541 347.45 228.398 344.825 220.6C342.311 212.598 338.452 205.423 333.24 199.132C327.963 192.763 321.484 187.769 313.875 184.16C306.078 180.325 297.295 178.491 287.67 178.491C277.709 178.491 268.079 180.164 258.812 183.513C249.647 186.826 241.125 191.437 233.261 197.332C225.542 203.084 218.751 209.844 212.899 217.597L212.889 217.611C207.16 225.246 202.642 233.54 199.345 242.478L199.33 242.518L199.316 242.559C196.135 251.575 194.532 260.778 194.532 270.142C194.532 278.624 195.843 286.844 198.472 294.776L198.477 294.792L198.482 294.808C201.135 302.663 205.057 309.744 210.248 316.009C215.517 322.37 221.981 327.422 229.569 331.163ZM287.732 276.015L287.742 276C290.74 271.657 292.939 267.045 294.364 262.148C295.831 257.108 296.54 252.276 296.54 247.635C296.54 243.3 295.843 239.458 294.528 236.043L294.487 235.934L294.449 235.824C293.328 232.545 291.583 230.131 289.252 228.349C287.226 226.801 284.199 225.736 279.606 225.736C274.271 225.736 269.81 226.979 266.027 229.305L265.974 229.337L265.921 229.368C261.869 231.746 258.495 234.905 255.765 238.909C252.893 243.123 250.673 247.698 249.104 252.654C247.65 257.67 246.947 262.48 246.947 267.101C246.947 271.459 247.585 275.422 248.809 279.033C250.055 282.339 251.89 284.885 254.293 286.836C256.34 288.379 259.301 289.405 263.68 289.405C269.175 289.405 273.697 288.15 277.46 285.837C281.567 283.313 284.975 280.058 287.722 276.029L287.732 276.015Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M171.542 186.53C164.879 181.64 157.017 179.302 148.254 179.302H84.4909L51.4775 335.434H103.163L112.436 291.23H128.094C136.792 291.23 145.029 289.337 152.73 285.54C160.225 281.844 166.856 276.954 172.594 270.888L172.619 270.861L172.644 270.834C178.339 264.665 182.824 257.798 186.062 250.247C189.323 242.645 190.992 234.866 190.992 226.953C190.992 219.052 189.327 211.496 186.009 204.348C182.762 197.062 177.927 191.083 171.542 186.53ZM135.575 242.131L135.598 242.101C136.363 241.1 137.06 239.71 137.567 237.773L137.604 237.631L137.648 237.49C138.222 235.663 138.577 233.269 138.577 230.197C138.577 227.864 138.266 226.771 138.111 226.428C138.024 226.235 137.948 226.093 137.889 225.994L137.862 225.949L137.849 225.939H126.349L122.444 244.594H132.693C132.756 244.581 132.999 244.516 133.45 244.244C133.961 243.935 134.685 243.325 135.553 242.16L135.575 242.131Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M469.872 186.53C463.209 181.64 455.347 179.302 446.583 179.302H382.821L349.807 335.434H401.493L410.766 291.23H426.424C435.122 291.23 443.359 289.337 451.06 285.54C458.555 281.844 465.186 276.954 470.923 270.888L470.949 270.861L470.973 270.834C476.669 264.665 481.153 257.798 484.392 250.247C487.652 242.645 489.322 234.866 489.322 226.953C489.322 219.052 487.657 211.496 484.339 204.348C481.092 197.062 476.257 191.083 469.872 186.53ZM433.905 242.131L433.928 242.101C434.693 241.1 435.39 239.71 435.896 237.773L435.934 237.631L435.978 237.49C436.552 235.663 436.907 233.269 436.907 230.197C436.907 227.864 436.596 226.771 436.441 226.428C436.354 226.235 436.278 226.093 436.219 225.994L436.192 225.949L436.178 225.939H424.678L420.774 244.594H431.023C431.086 244.581 431.329 244.516 431.779 244.244C432.29 243.935 433.014 243.325 433.883 242.16L433.905 242.131Z' fill='%23E6007A'/%3E%3Cmask id='path-6-outside-1_873_174' maskUnits='userSpaceOnUse' x='35.8232' y='166.788' width='435' height='156' fill='black'%3E%3Crect fill='white' x='35.8232' y='166.788' width='435' height='156'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z'/%3E%3C/mask%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' stroke='white' stroke-width='0.3' mask='url(%23path-6-outside-1_873_174)'/%3E%3C/g%3E%3Cdefs%3E%3CradialGradient id='paint0_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(-62.8 -86.4) rotate(70.436) scale(686.854 394.059)'%3E%3Cstop stop-color='%236335EC'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='paint1_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(640.4 677.6) rotate(-116.448) scale(1055.25 662.094)'%3E%3Cstop stop-color='%23E6007A'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CclipPath id='clip0_873_174'%3E%3Crect width='512' height='512' rx='256' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A" /> Pop CLI Signing Portal - - + From f5c963e50dbcde3d80e5d5fb42734491b00c25e1 Mon Sep 17 00:00:00 2001 From: Peter White Date: Wed, 18 Dec 2024 14:10:37 -0700 Subject: [PATCH 23/25] chore: update frontend to remove trailing slash --- crates/pop-cli/src/assets/index.html | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/pop-cli/src/assets/index.html b/crates/pop-cli/src/assets/index.html index c5fc00243..d1d5a8ef7 100644 --- a/crates/pop-cli/src/assets/index.html +++ b/crates/pop-cli/src/assets/index.html @@ -7,7 +7,7 @@ href="data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_873_174)'%3E%3Crect width='512' height='512' rx='256' fill='%231C0533'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint0_radial_873_174)' fill-opacity='0.8'/%3E%3Crect width='512' height='512' rx='256' fill='url(%23paint1_radial_873_174)' fill-opacity='0.6'/%3E%3Cmask id='mask0_873_174' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='-429' y='-502' width='1428' height='1351'%3E%3Cpath d='M127.637 -501.289L998.911 322.903L984.661 336.383L113.388 -487.809L127.637 -501.289Z' fill='%23D9D9D9'/%3E%3Cpath d='M88.9594 -464.701L960.232 359.491L945.983 372.971L74.7096 -451.221L88.9594 -464.701Z' fill='%23D9D9D9'/%3E%3Cpath d='M50.2814 -428.113L921.554 396.079L907.305 409.559L36.0316 -414.633L50.2814 -428.113Z' fill='%23D9D9D9'/%3E%3Cpath d='M11.6034 -391.525L882.876 432.667L868.627 446.147L-2.64642 -378.045L11.6034 -391.525Z' fill='%23D9D9D9'/%3E%3Cpath d='M-27.0746 -354.937L844.198 469.255L829.949 482.735L-41.3244 -341.457L-27.0746 -354.937Z' fill='%23D9D9D9'/%3E%3Cpath d='M-65.7526 -318.349L805.52 505.843L791.271 519.323L-80.0024 -304.869L-65.7526 -318.349Z' fill='%23D9D9D9'/%3E%3Cpath d='M-104.431 -281.761L766.842 542.431L752.593 555.911L-118.68 -268.281L-104.431 -281.761Z' fill='%23D9D9D9'/%3E%3Cpath d='M-143.109 -245.173L728.164 579.019L713.915 592.499L-157.358 -231.693L-143.109 -245.173Z' fill='%23D9D9D9'/%3E%3Cpath d='M-181.787 -208.585L689.486 615.607L675.237 629.087L-196.036 -195.105L-181.787 -208.585Z' fill='%23D9D9D9'/%3E%3Cpath d='M-220.465 -171.997L650.808 652.195L636.559 665.675L-234.714 -158.517L-220.465 -171.997Z' fill='%23D9D9D9'/%3E%3Cpath d='M-259.143 -135.409L612.13 688.783L597.881 702.263L-273.392 -121.929L-259.143 -135.409Z' fill='%23D9D9D9'/%3E%3Cpath d='M-297.821 -98.8211L573.452 725.371L559.203 738.851L-312.07 -85.3413L-297.821 -98.8211Z' fill='%23D9D9D9'/%3E%3Cpath d='M-336.499 -62.2331L534.774 761.959L520.525 775.439L-350.748 -48.7533L-336.499 -62.2331Z' fill='%23D9D9D9'/%3E%3Cpath d='M-375.177 -25.6452L496.096 798.547L481.847 812.026L-389.426 -12.1654L-375.177 -25.6452Z' fill='%23D9D9D9'/%3E%3Cpath d='M-413.855 10.9428L457.418 835.135L443.169 848.615L-428.104 24.4225L-413.855 10.9428Z' fill='%23D9D9D9'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_873_174)'%3E%3Cpath d='M511.169 254.929C511.169 396.905 396.739 512 255.584 512C114.428 512 -0.000976562 396.905 -0.000976562 254.929C-0.000976562 112.953 114.428 -2.14209 255.584 -2.14209C396.739 -2.14209 511.169 112.953 511.169 254.929Z' fill='%23E6007A'/%3E%3C/g%3E%3Cpath d='M183.804 160.44C171.052 151.144 156.458 147.168 141.864 147.168H52.2334L5.63086 367.567H122.684L132.083 322.765C141.879 321.622 151.384 318.84 160.403 314.394C161.8 313.705 163.178 312.986 164.536 312.239C168.249 321.014 173.177 329.173 179.315 336.581C187.573 346.548 197.657 354.366 209.117 360.016L209.12 360.018L209.517 360.213L209.917 360.399C222.605 366.289 236.098 368.784 249.63 368.784C263.218 368.784 276.507 366.489 289.292 361.868C295.36 359.675 301.212 357.046 306.832 353.988L303.961 367.567H421.013L430.413 322.765C440.209 321.622 449.714 318.84 458.733 314.394C469.61 309.03 479.317 301.877 487.672 293.046L487.682 293.035L487.841 292.867L487.995 292.7L487.998 292.697C496.09 283.931 502.611 273.995 507.338 262.975C512.203 251.631 514.88 239.536 514.88 226.953C514.88 214.447 512.231 202.327 507.001 190.977C501.508 178.753 493.141 168.335 482.134 160.44C469.382 151.144 454.788 147.168 440.194 147.168H350.563L345.323 171.949C338.297 165.041 330.227 159.445 321.314 155.191C308.55 148.958 294.91 146.357 281.28 146.357C267.691 146.357 254.402 148.652 241.618 153.273C229.473 157.663 218.174 163.78 207.814 171.541C205.377 173.358 203.011 175.252 200.715 177.221C196.062 170.823 190.408 165.177 183.804 160.44Z' fill='%232B0532'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M229.569 331.163L229.632 331.194L229.696 331.224C237.592 334.889 246.407 336.65 256.019 336.65C265.979 336.65 275.609 334.978 284.877 331.628C294.055 328.31 302.528 323.689 310.277 317.771C317.967 311.898 324.68 305.15 330.397 297.531L330.413 297.509L330.429 297.487C336.137 289.737 340.585 281.451 343.748 272.638C347.074 263.611 348.753 254.388 348.753 244.999C348.753 236.541 347.45 228.398 344.825 220.6C342.311 212.598 338.452 205.423 333.24 199.132C327.963 192.763 321.484 187.769 313.875 184.16C306.078 180.325 297.295 178.491 287.67 178.491C277.709 178.491 268.079 180.164 258.812 183.513C249.647 186.826 241.125 191.437 233.261 197.332C225.542 203.084 218.751 209.844 212.899 217.597L212.889 217.611C207.16 225.246 202.642 233.54 199.345 242.478L199.33 242.518L199.316 242.559C196.135 251.575 194.532 260.778 194.532 270.142C194.532 278.624 195.843 286.844 198.472 294.776L198.477 294.792L198.482 294.808C201.135 302.663 205.057 309.744 210.248 316.009C215.517 322.37 221.981 327.422 229.569 331.163ZM287.732 276.015L287.742 276C290.74 271.657 292.939 267.045 294.364 262.148C295.831 257.108 296.54 252.276 296.54 247.635C296.54 243.3 295.843 239.458 294.528 236.043L294.487 235.934L294.449 235.824C293.328 232.545 291.583 230.131 289.252 228.349C287.226 226.801 284.199 225.736 279.606 225.736C274.271 225.736 269.81 226.979 266.027 229.305L265.974 229.337L265.921 229.368C261.869 231.746 258.495 234.905 255.765 238.909C252.893 243.123 250.673 247.698 249.104 252.654C247.65 257.67 246.947 262.48 246.947 267.101C246.947 271.459 247.585 275.422 248.809 279.033C250.055 282.339 251.89 284.885 254.293 286.836C256.34 288.379 259.301 289.405 263.68 289.405C269.175 289.405 273.697 288.15 277.46 285.837C281.567 283.313 284.975 280.058 287.722 276.029L287.732 276.015Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M171.542 186.53C164.879 181.64 157.017 179.302 148.254 179.302H84.4909L51.4775 335.434H103.163L112.436 291.23H128.094C136.792 291.23 145.029 289.337 152.73 285.54C160.225 281.844 166.856 276.954 172.594 270.888L172.619 270.861L172.644 270.834C178.339 264.665 182.824 257.798 186.062 250.247C189.323 242.645 190.992 234.866 190.992 226.953C190.992 219.052 189.327 211.496 186.009 204.348C182.762 197.062 177.927 191.083 171.542 186.53ZM135.575 242.131L135.598 242.101C136.363 241.1 137.06 239.71 137.567 237.773L137.604 237.631L137.648 237.49C138.222 235.663 138.577 233.269 138.577 230.197C138.577 227.864 138.266 226.771 138.111 226.428C138.024 226.235 137.948 226.093 137.889 225.994L137.862 225.949L137.849 225.939H126.349L122.444 244.594H132.693C132.756 244.581 132.999 244.516 133.45 244.244C133.961 243.935 134.685 243.325 135.553 242.16L135.575 242.131Z' fill='%23E6007A'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M469.872 186.53C463.209 181.64 455.347 179.302 446.583 179.302H382.821L349.807 335.434H401.493L410.766 291.23H426.424C435.122 291.23 443.359 289.337 451.06 285.54C458.555 281.844 465.186 276.954 470.923 270.888L470.949 270.861L470.973 270.834C476.669 264.665 481.153 257.798 484.392 250.247C487.652 242.645 489.322 234.866 489.322 226.953C489.322 219.052 487.657 211.496 484.339 204.348C481.092 197.062 476.257 191.083 469.872 186.53ZM433.905 242.131L433.928 242.101C434.693 241.1 435.39 239.71 435.896 237.773L435.934 237.631L435.978 237.49C436.552 235.663 436.907 233.269 436.907 230.197C436.907 227.864 436.596 226.771 436.441 226.428C436.354 226.235 436.278 226.093 436.219 225.994L436.192 225.949L436.178 225.939H424.678L420.774 244.594H431.023C431.086 244.581 431.329 244.516 431.779 244.244C432.29 243.935 433.014 243.325 433.883 242.16L433.905 242.131Z' fill='%23E6007A'/%3E%3Cmask id='path-6-outside-1_873_174' maskUnits='userSpaceOnUse' x='35.8232' y='166.788' width='435' height='156' fill='black'%3E%3Crect fill='white' x='35.8232' y='166.788' width='435' height='156'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z'/%3E%3C/mask%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M68.9791 168.599H131.11C139.505 168.599 146.942 170.833 153.22 175.445C159.314 179.787 163.927 185.486 167.032 192.461C170.229 199.344 171.832 206.612 171.832 214.222C171.832 221.841 170.226 229.347 167.067 236.713C163.922 244.045 159.566 250.719 154.022 256.724L154.006 256.742L153.989 256.759C148.417 262.651 141.98 267.398 134.699 270.989C127.28 274.646 119.347 276.472 110.95 276.472H93.6573L84.3839 320.675H36.8232L68.9791 168.599ZM90.3873 272.416H110.95C118.745 272.416 126.07 270.727 132.924 267.347C139.778 263.968 145.826 259.507 151.068 253.964C156.309 248.287 160.408 242.001 163.365 235.107C166.322 228.213 167.8 221.251 167.8 214.222C167.8 207.193 166.322 200.501 163.365 194.148C160.543 187.795 156.376 182.658 150.866 178.738C145.356 174.682 138.77 172.655 131.11 172.655H72.2437L41.8028 316.62H81.1139L90.3873 272.416ZM120.037 230.626L120.052 230.607C121.01 229.354 121.81 227.706 122.372 225.559L122.397 225.463L122.427 225.37C123.078 223.296 123.449 220.685 123.449 217.466C123.449 215.01 123.13 213.583 122.802 212.859C122.362 211.884 122.041 211.655 122.042 211.653L121.876 211.558L121.71 211.439C121.399 211.215 121.2 211.18 121.03 211.18H107.569L102.815 233.89H115.587C115.879 233.89 116.444 233.794 117.343 233.252C118.131 232.776 119.04 231.963 120.022 230.646L120.037 230.626ZM97.8464 237.946L104.297 207.125H121.03C122.105 207.125 123.113 207.463 124.054 208.139C124.995 208.68 125.801 209.693 126.473 211.18C127.145 212.667 127.481 214.763 127.481 217.466C127.481 220.981 127.078 224.022 126.271 226.591C125.599 229.159 124.591 231.322 123.247 233.079C122.038 234.701 120.761 235.918 119.417 236.729C118.073 237.54 116.796 237.946 115.587 237.946H97.8464ZM213.354 316.632L213.312 316.611C205.969 312.991 199.733 308.113 194.652 301.981C189.624 295.911 185.822 289.05 183.247 281.426L183.24 281.404C180.681 273.683 179.404 265.679 179.404 257.411C179.404 248.285 180.966 239.311 184.072 230.507L184.081 230.479L184.091 230.452C187.319 221.7 191.743 213.579 197.354 206.101L197.361 206.092C203.099 198.491 209.753 191.867 217.318 186.229C225.025 180.452 233.372 175.936 242.35 172.691C251.395 169.421 260.794 167.788 270.526 167.788C279.899 167.788 288.376 169.574 295.858 173.257C303.215 176.744 309.461 181.561 314.547 187.699C319.59 193.786 323.327 200.732 325.764 208.5C328.321 216.086 329.593 224.016 329.593 232.268C329.593 241.412 327.958 250.4 324.71 259.212C321.616 267.835 317.262 275.95 311.665 283.549L311.655 283.564L311.644 283.578C306.04 291.046 299.46 297.663 291.914 303.425C284.329 309.218 276.037 313.741 267.051 316.989C258.006 320.259 248.606 321.892 238.875 321.892C229.51 321.892 220.99 320.177 213.397 316.652L213.354 316.632ZM320.924 257.817C324.016 249.436 325.561 240.92 325.561 232.268C325.561 224.428 324.352 216.926 321.932 209.761C319.648 202.461 316.153 195.973 311.449 190.295C306.746 184.618 300.966 180.157 294.112 176.913C287.258 173.533 279.396 171.843 270.526 171.843C261.252 171.843 252.315 173.398 243.713 176.507C235.112 179.616 227.115 183.942 219.723 189.484C212.466 194.891 206.082 201.245 200.572 208.544C195.196 215.709 190.962 223.482 187.871 231.863C184.915 240.244 183.436 248.76 183.436 257.411C183.436 265.252 184.646 272.822 187.065 280.121C189.484 287.286 193.046 293.707 197.75 299.384C202.453 305.062 208.233 309.59 215.087 312.97C222.075 316.214 230.005 317.836 238.875 317.836C248.148 317.836 257.086 316.282 265.687 313.173C274.289 310.064 282.218 305.738 289.475 300.196C296.733 294.653 303.05 288.3 308.425 281.135C313.801 273.836 317.968 266.063 320.924 257.817ZM272.24 264.445L272.254 264.426C275.373 259.908 277.667 255.099 279.155 249.987C280.67 244.779 281.412 239.756 281.412 234.904C281.412 230.347 280.678 226.254 279.264 222.58L279.237 222.508L279.212 222.434C277.972 218.806 276.002 216.048 273.327 214.004C270.857 212.115 267.361 210.978 262.462 210.978C256.8 210.978 251.967 212.302 247.832 214.844L247.796 214.865L247.761 214.886C243.447 217.417 239.854 220.785 236.959 225.032C233.968 229.418 231.66 234.18 230.031 239.332C228.525 244.523 227.787 249.532 227.787 254.37C227.787 258.944 228.459 263.14 229.768 266.989C231.136 270.636 233.189 273.504 235.911 275.706C238.394 277.588 241.822 278.702 246.536 278.702C252.349 278.702 257.246 277.37 261.367 274.836C265.718 272.162 269.334 268.708 272.24 264.445ZM233.432 278.905C230.072 276.201 227.586 272.687 225.973 268.361C224.495 264.035 223.755 259.372 223.755 254.37C223.755 249.098 224.562 243.691 226.175 238.149C227.922 232.606 230.408 227.469 233.634 222.738C236.859 218.007 240.891 214.222 245.729 211.383C250.568 208.409 256.145 206.922 262.462 206.922C267.972 206.922 272.407 208.206 275.767 210.775C279.127 213.343 281.546 216.79 283.024 221.116C284.637 225.307 285.444 229.903 285.444 234.904C285.444 240.176 284.637 245.583 283.024 251.126C281.412 256.668 278.925 261.872 275.565 266.739C272.34 271.47 268.308 275.323 263.47 278.297C258.631 281.271 252.987 282.757 246.536 282.757C241.16 282.757 236.792 281.473 233.432 278.905ZM367.309 168.599H429.439C437.835 168.599 445.272 170.833 451.55 175.445C457.644 179.787 462.256 185.485 465.361 192.46C468.559 199.344 470.162 206.611 470.162 214.222C470.162 221.841 468.556 229.347 465.397 236.713C462.252 244.045 457.896 250.719 452.352 256.724L452.335 256.742L452.319 256.759C446.747 262.651 440.31 267.398 433.028 270.989C425.61 274.646 417.677 276.472 409.28 276.472H391.987L382.714 320.675H335.153L367.309 168.599ZM388.717 272.416H409.28C417.075 272.416 424.4 270.727 431.254 267.347C438.108 263.968 444.156 259.507 449.397 253.964C454.639 248.287 458.738 242.001 461.695 235.107C464.651 228.213 466.13 221.251 466.13 214.222C466.13 207.193 464.651 200.501 461.695 194.148C458.872 187.795 454.706 182.658 449.196 178.738C443.686 174.682 437.1 172.655 429.439 172.655H370.574L340.133 316.62H379.444L388.717 272.416ZM418.366 230.626L418.381 230.607C419.34 229.354 420.14 227.706 420.702 225.559L420.727 225.463L420.756 225.37C421.408 223.296 421.779 220.685 421.779 217.466C421.779 215.01 421.46 213.583 421.132 212.859C420.692 211.884 420.371 211.655 420.372 211.653L420.206 211.558L420.04 211.439C419.729 211.215 419.53 211.18 419.36 211.18H405.899L401.145 233.89H413.917C414.209 233.89 414.774 233.794 415.673 233.252C416.461 232.776 417.369 231.963 418.352 230.646L418.366 230.626ZM396.176 237.946L402.627 207.125H419.36C420.435 207.125 421.443 207.463 422.384 208.139C423.324 208.68 424.131 209.693 424.803 211.18C425.475 212.667 425.811 214.763 425.811 217.466C425.811 220.981 425.408 224.022 424.601 226.591C423.929 229.159 422.921 231.322 421.577 233.079C420.368 234.701 419.091 235.918 417.747 236.729C416.403 237.54 415.126 237.946 413.917 237.946H396.176Z' stroke='white' stroke-width='0.3' mask='url(%23path-6-outside-1_873_174)'/%3E%3C/g%3E%3Cdefs%3E%3CradialGradient id='paint0_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(-62.8 -86.4) rotate(70.436) scale(686.854 394.059)'%3E%3Cstop stop-color='%236335EC'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='paint1_radial_873_174' cx='0' cy='0' r='1' gradientUnits='userSpaceOnUse' gradientTransform='translate(640.4 677.6) rotate(-116.448) scale(1055.25 662.094)'%3E%3Cstop stop-color='%23E6007A'/%3E%3Cstop offset='1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CclipPath id='clip0_873_174'%3E%3Crect width='512' height='512' rx='256' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A" /> Pop CLI Signing Portal - + `],K);d$=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}([RA("dc-connection-button")],d$);const f$={chains:{},wallets:[new class extends QE{constructor(e){super(),X(this,"options"),this.options=e}async getWallets(){return await lS,(()=>{const{injectedWeb3:e}=window;return e?Object.keys(e):[]})().map((e=>new aS(e,this.options)))}}]};function p$(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function h$(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function v$(...e){return t=>{let n=!1;const r=e.map((e=>{const r=h$(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t{const t=n.map((e=>qe.createContext(e)));return function(n){const r=(null==n?void 0:n[e])||t;return qe.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=qe.createContext(r),i=n.length;n=[...n,r];const s=t=>{var n;const{scope:r,children:s,...a}=t,l=(null==(n=null==r?void 0:r[e])?void 0:n[i])||o,c=qe.useMemo((()=>a),Object.values(a));return nt.jsx(l.Provider,{value:c,children:s})};return s.displayName=t+"Provider",[s,function(n,s){var a;const l=(null==(a=null==s?void 0:s[e])?void 0:a[i])||o,c=qe.useContext(l);if(c)return c;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},y$(r,...t)]}function y$(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return qe.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function b$(e){const t=qe.useRef(e);return qe.useEffect((()=>{t.current=e})),qe.useMemo((()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function w$({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=qe.useState(e),[r]=n,o=qe.useRef(r),i=b$(t);return qe.useEffect((()=>{o.current!==r&&(i(r),o.current=r)}),[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,s=i?e:r,a=b$(n);return[s,qe.useCallback((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&a(n)}else o(t)}),[i,e,o,a])]}!function(e){_A.next(e.wallets)}({wallets:f$.wallets});var x$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e,o=qe.Children.toArray(n),i=o.find(S$);if(i){const e=i.props.children,n=o.map((t=>t===i?qe.Children.count(e)>1?qe.Children.only(null):qe.isValidElement(e)?e.props.children:null:t));return nt.jsx(k$,{...r,ref:t,children:qe.isValidElement(e)?qe.cloneElement(e,void 0,n):null})}return nt.jsx(k$,{...r,ref:t,children:n})}));x$.displayName="Slot";var k$=qe.forwardRef(((e,t)=>{const{children:n,...r}=e;if(qe.isValidElement(n)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(n);return qe.cloneElement(n,{...C$(r,n.props),ref:t?v$(t,e):e})}return qe.Children.count(n)>1?qe.Children.only(null):null}));k$.displayName="SlotClone";var E$=({children:e})=>nt.jsx(nt.Fragment,{children:e});function S$(e){return qe.isValidElement(e)&&e.type===E$}function C$(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var _$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=qe.forwardRef(((e,n)=>{const{asChild:r,...o}=e,i=r?x$:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),nt.jsx(i,{...o,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function A$(e,t){e&&df.flushSync((()=>e.dispatchEvent(t)))}function N$(e){const t=e+"CollectionProvider",[n,r]=g$(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,r=Ke.useRef(null),i=Ke.useRef(new Map).current;return nt.jsx(o,{scope:t,itemMap:i,collectionRef:r,children:n})};s.displayName=t;const a=e+"CollectionSlot",l=Ke.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=m$(t,i(a,n).collectionRef);return nt.jsx(x$,{ref:o,children:r})}));l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=Ke.forwardRef(((e,t)=>{const{scope:n,children:r,...o}=e,s=Ke.useRef(null),a=m$(t,s),l=i(c,n);return Ke.useEffect((()=>(l.itemMap.set(s,{ref:s,...o}),()=>{l.itemMap.delete(s)}))),nt.jsx(x$,{[u]:"",ref:a,children:r})}));return d.displayName=c,[{Provider:s,Slot:l,ItemSlot:d},function(t){const n=i(e+"CollectionConsumer",t),r=Ke.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${u}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}var P$=qe.createContext(void 0);function $$(e){const t=qe.useContext(P$);return e||t||"ltr"}var j$,O$="dismissableLayer.update",R$="dismissableLayer.pointerDownOutside",M$="dismissableLayer.focusOutside",T$=qe.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),L$=qe.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=qe.useContext(T$),[u,d]=qe.useState(null),f=(null==u?void 0:u.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,p]=qe.useState({}),h=m$(t,(e=>d(e))),v=Array.from(c.layers),[m]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(m),y=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,w=y>=g,x=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=b$(e),r=qe.useRef(!1),o=qe.useRef((()=>{}));return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){I$(R$,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...c.branches].some((e=>e.contains(t)));w&&!n&&(null==o||o(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f),k=function(e,t=(null==globalThis?void 0:globalThis.document)){const n=b$(e),r=qe.useRef(!1);return qe.useEffect((()=>{const e=e=>{if(e.target&&!r.current){I$(M$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...c.branches].some((e=>e.contains(t)))||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==a||a())}),f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const n=b$(e);qe.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{y===c.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&a&&(e.preventDefault(),a()))}),f),qe.useEffect((()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(j$=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),z$(),()=>{n&&1===c.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=j$)}}),[u,f,n,c]),qe.useEffect((()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),z$())}),[u,c]),qe.useEffect((()=>{const e=()=>p({});return document.addEventListener(O$,e),()=>document.removeEventListener(O$,e)}),[]),nt.jsx(_$.div,{...l,ref:h,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:p$(e.onFocusCapture,k.onFocusCapture),onBlurCapture:p$(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:p$(e.onPointerDownCapture,x.onPointerDownCapture)})}));L$.displayName="DismissableLayer";function z$(){const e=new CustomEvent(O$);document.dispatchEvent(e)}function I$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?A$(o,i):o.dispatchEvent(i)}qe.forwardRef(((e,t)=>{const n=qe.useContext(T$),r=qe.useRef(null),o=m$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),nt.jsx(_$.div,{...e,ref:o})})).displayName="DismissableLayerBranch";var D$=0;function B$(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var U$="focusScope.autoFocusOnMount",F$="focusScope.autoFocusOnUnmount",H$={bubbles:!1,cancelable:!0},V$=qe.forwardRef(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=qe.useState(null),c=b$(o),u=b$(i),d=qe.useRef(null),f=m$(t,(e=>l(e))),p=qe.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;qe.useEffect((()=>{if(r){let e=function(e){if(p.paused||!a)return;const t=e.target;a.contains(t)?d.current=t:Q$(d.current,{select:!0})},t=function(e){if(p.paused||!a)return;const t=e.relatedTarget;null!==t&&(a.contains(t)||Q$(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Q$(a)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,a,p.paused]),qe.useEffect((()=>{if(a){Y$.add(p);const t=document.activeElement;if(!a.contains(t)){const n=new CustomEvent(U$,H$);a.addEventListener(U$,c),a.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Q$(r,{select:t}),document.activeElement!==n)return}((e=W$(a),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&Q$(a))}return()=>{a.removeEventListener(U$,c),setTimeout((()=>{const e=new CustomEvent(F$,H$);a.addEventListener(F$,u),a.dispatchEvent(e),e.defaultPrevented||Q$(t??document.body,{select:!0}),a.removeEventListener(F$,u),Y$.remove(p)}),0)}}var e}),[a,c,u,p]);const h=qe.useCallback((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=W$(e),n=q$(t,e),r=q$(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&Q$(i,{select:!0})):(e.preventDefault(),n&&Q$(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,p.paused]);return nt.jsx(_$.div,{tabIndex:-1,...s,ref:f,onKeyDown:h})}));function W$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function q$(e,t){for(const n of e)if(!K$(n,{upTo:t}))return n}function K$(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Q$(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}V$.displayName="FocusScope";var Y$=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=G$(e,t),e.unshift(t)},remove(t){var n;e=G$(e,t),null==(n=e[0])||n.resume()}}}();function G$(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var J$=Boolean(null==globalThis?void 0:globalThis.document)?qe.useLayoutEffect:()=>{},X$=Qe["useId".toString()]||(()=>{}),Z$=0;function ej(e){const[t,n]=qe.useState(X$());return J$((()=>{n((e=>e??String(Z$++)))}),[e]),t?`radix-${t}`:""}const tj=["top","right","bottom","left"],nj=Math.min,rj=Math.max,oj=Math.round,ij=Math.floor,sj=e=>({x:e,y:e}),aj={left:"right",right:"left",bottom:"top",top:"bottom"},lj={start:"end",end:"start"};function cj(e,t,n){return rj(e,nj(t,n))}function uj(e,t){return"function"==typeof e?e(t):e}function dj(e){return e.split("-")[0]}function fj(e){return e.split("-")[1]}function pj(e){return"x"===e?"y":"x"}function hj(e){return"y"===e?"height":"width"}function vj(e){return["top","bottom"].includes(dj(e))?"y":"x"}function mj(e){return pj(vj(e))}function gj(e){return e.replace(/start|end/g,(e=>lj[e]))}function yj(e){return e.replace(/left|right|bottom|top/g,(e=>aj[e]))}function bj(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function wj(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xj(e,t,n){let{reference:r,floating:o}=e;const i=vj(t),s=mj(t),a=hj(s),l=dj(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(fj(t)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1)}return p}async function kj(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=uj(t,e),h=bj(p),v=a[f?"floating"===d?"reference":"floating":d],m=wj(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=wj(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:l}):g);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}function Ej(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sj(e){return tj.some((t=>e[t]>=0))}function Cj(){return"undefined"!=typeof window}function _j(e){return Pj(e)?(e.nodeName||"").toLowerCase():"#document"}function Aj(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Nj(e){var t;return null==(t=(Pj(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Pj(e){return!!Cj()&&(e instanceof Node||e instanceof Aj(e).Node)}function $j(e){return!!Cj()&&(e instanceof Element||e instanceof Aj(e).Element)}function jj(e){return!!Cj()&&(e instanceof HTMLElement||e instanceof Aj(e).HTMLElement)}function Oj(e){return!(!Cj()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Aj(e).ShadowRoot)}function Rj(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Dj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Mj(e){return["table","td","th"].includes(_j(e))}function Tj(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(n){return!1}}))}function Lj(e){const t=zj(),n=$j(e)?Dj(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function zj(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ij(e){return["html","body","#document"].includes(_j(e))}function Dj(e){return Aj(e).getComputedStyle(e)}function Bj(e){return $j(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uj(e){if("html"===_j(e))return e;const t=e.assignedSlot||e.parentNode||Oj(e)&&e.host||Nj(e);return Oj(t)?t.host:t}function Fj(e){const t=Uj(e);return Ij(t)?e.ownerDocument?e.ownerDocument.body:e.body:jj(t)&&Rj(t)?t:Fj(t)}function Hj(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Fj(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=Aj(o);if(i){const e=Vj(s);return t.concat(s,s.visualViewport||[],Rj(o)?o:[],e&&n?Hj(e):[])}return t.concat(o,Hj(o,[],n))}function Vj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wj(e){const t=Dj(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=jj(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=oj(n)!==i||oj(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function qj(e){return $j(e)?e:e.contextElement}function Kj(e){const t=qj(e);if(!jj(t))return sj(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Wj(t);let s=(i?oj(n.width):n.width)/r,a=(i?oj(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Qj=sj(0);function Yj(e){const t=Aj(e);return zj()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Qj}function Gj(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=qj(e);let s=sj(1);t&&(r?$j(r)&&(s=Kj(r)):s=Kj(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Aj(e))&&t}(i,n,r)?Yj(i):sj(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=Aj(i),t=r&&$j(r)?Aj(r):r;let n=e,o=Vj(n);for(;o&&r&&t!==n;){const e=Kj(o),t=o.getBoundingClientRect(),r=Dj(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=Aj(o),o=Vj(n)}}return wj({width:u,height:d,x:l,y:c})}function Jj(e,t){const n=Bj(e).scrollLeft;return t?t.left+n:Gj(Nj(e)).left+n}function Xj(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Jj(e,r)),y:r.top+t.scrollTop}}function Zj(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Aj(e),r=Nj(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=zj();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=Nj(e),n=Bj(e),r=e.ownerDocument.body,o=rj(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=rj(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Jj(e);const a=-n.scrollTop;return"rtl"===Dj(r).direction&&(s+=rj(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(Nj(e));else if($j(t))r=function(e,t){const n=Gj(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=jj(e)?Kj(e):sj(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Yj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wj(r)}function eO(e,t){const n=Uj(e);return!(n===t||!$j(n)||Ij(n))&&("fixed"===Dj(n).position||eO(n,t))}function tO(e,t,n){const r=jj(t),o=Nj(t),i="fixed"===n,s=Gj(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=sj(0);if(r||!r&&!i)if(("body"!==_j(t)||Rj(o))&&(a=Bj(t)),r){const e=Gj(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Jj(o));const c=!o||r||i?sj(0):Xj(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function nO(e){return"static"===Dj(e).position}function rO(e,t){if(!jj(e)||"fixed"===Dj(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Nj(e)===n&&(n=n.ownerDocument.body),n}function oO(e,t){const n=Aj(e);if(Tj(e))return n;if(!jj(e)){let t=Uj(e);for(;t&&!Ij(t);){if($j(t)&&!nO(t))return t;t=Uj(t)}return n}let r=rO(e,t);for(;r&&Mj(r)&&nO(r);)r=rO(r,t);return r&&Ij(r)&&nO(r)&&!Lj(r)?n:r||function(e){let t=Uj(e);for(;jj(t)&&!Ij(t);){if(Lj(t))return t;if(Tj(t))return null;t=Uj(t)}return null}(e)||n}const iO={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=Nj(r),a=!!t&&Tj(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=sj(1);const u=sj(0),d=jj(r);if((d||!d&&!i)&&(("body"!==_j(r)||Rj(s))&&(l=Bj(r)),jj(r))){const e=Gj(r);c=Kj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!s||d||i?sj(0):Xj(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Nj,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Tj(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Hj(e,[],!1).filter((e=>$j(e)&&"body"!==_j(e))),o=null;const i="fixed"===Dj(e).position;let s=i?Uj(e):e;for(;$j(s)&&!Ij(s);){const t=Dj(s),n=Lj(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Rj(s)&&!n&&eO(e,s))?r=r.filter((e=>e!==s)):o=t,s=Uj(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Zj(t,n,o);return e.top=rj(r.top,e.top),e.right=nj(r.right,e.right),e.bottom=nj(r.bottom,e.bottom),e.left=rj(r.left,e.left),e}),Zj(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:oO,getElementRects:async function(e){const t=this.getOffsetParent||oO,n=this.getDimensions,r=await n(e.floating);return{reference:tO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Wj(e);return{width:t,height:n}},getScale:Kj,isElement:$j,isRTL:function(e){return"rtl"===Dj(e).direction}};function sO(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=qj(e),u=o||i?[...c?Hj(c):[],...Hj(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=Nj(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const p={rootMargin:-ij(u)+"px "+-ij(o.clientWidth-(c+d))+"px "+-ij(o.clientHeight-(u+f))+"px "+-ij(c)+"px",threshold:rj(0,nj(1,l))||1};let h=!0;function v(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(m){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let v=l?Gj(e):null;return l&&function t(){const r=Gj(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const aO=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=dj(n),a=fj(n),l="y"===vj(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=uj(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},lO=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=uj(e,t),c={x:n,y:r},u=await kj(t,l),d=vj(dj(o)),f=pj(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=cj(p+u["y"===f?"top":"left"],p,p-u[e])}if(s){const e="y"===d?"bottom":"right";h=cj(h+u["y"===d?"top":"left"],h,h-u[e])}const v=a.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[d]:s}}}}}},cO=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...m}=uj(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=dj(o),y=vj(a),b=dj(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!v?[yj(a)]:function(e){const t=yj(e);return[gj(e),t,gj(t)]}(a)),k="none"!==h;!f&&k&&x.push(...function(e,t,n,r){const o=fj(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(dj(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(gj)))),i}(a,v,h,w));const E=[a,...x],S=await kj(t,m),C=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(S[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=fj(e),o=mj(e),i=hj(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=yj(s)),[s,yj(s)]}(o,s,w);C.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:o,overflows:C}],!C.every((e=>e<=0))){var A,N;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(N=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:N.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=_.filter((e=>{if(k){const t=vj(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},uO=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=uj(e,t),u=await kj(t,c),d=dj(o),f=fj(o),p="y"===vj(o),{width:h,height:v}=i.floating;let m,g;"top"===d||"bottom"===d?(m=d,g=f===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,m="end"===f?"top":"bottom");const y=v-u.top-u.bottom,b=h-u.left-u.right,w=nj(v-u[m],y),x=nj(h-u[g],b),k=!t.middlewareData.shift;let E=w,S=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),k&&!f){const e=rj(u.left,0),t=rj(u.right,0),n=rj(u.top,0),r=rj(u.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:rj(u.left,u.right)):E=v-2*(0!==n||0!==r?n+r:rj(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:E});const C=await s.getDimensions(a.floating);return h!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}},dO=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=uj(e,t);switch(r){case"referenceHidden":{const e=Ej(await kj(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Sj(e)}}}case"escaped":{const e=Ej(await kj(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Sj(e)}}}default:return{}}}}},fO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=uj(e,t)||{};if(null==c)return{};const d=bj(u),f={x:n,y:r},p=mj(o),h=hj(p),v=await s.getDimensions(c),m="y"===p,g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-f[p]-i.floating[h],x=f[p]-i.reference[p],k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=k?k[b]:0;E&&await(null==s.isElement?void 0:s.isElement(k))||(E=a.floating[b]||i.floating[h]);const S=w/2-x/2,C=E/2-v[h]/2-1,_=nj(d[g],C),A=nj(d[y],C),N=_,P=E-v[h]-A,$=E/2-v[h]/2+S,j=cj(N,$,P),O=!l.arrow&&null!=fj(o)&&$!==j&&i.reference[h]/2-($n&&(p=n)}if(c){var g,y;const e="y"===f?"width":"height",t=["top","left"].includes(dj(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=s.offset)?void 0:g[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);hr&&(h=r)}return{[f]:p,[d]:h}}}},hO=(e,t,n)=>{const r=new Map,o={platform:iO,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=xj(c,r,l),f=r,p={},h=0;for(let v=0;v{t.current=e})),t}const wO=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?fO({element:n.current,padding:r}).fn(t):{}:n?fO({element:n,padding:r}).fn(t):{};var o}}),xO=(e,t)=>({...aO(e),options:[e,t]}),kO=(e,t)=>({...lO(e),options:[e,t]}),EO=(e,t)=>({...pO(e),options:[e,t]}),SO=(e,t)=>({...cO(e),options:[e,t]}),CO=(e,t)=>({...uO(e),options:[e,t]}),_O=(e,t)=>({...dO(e),options:[e,t]}),AO=(e,t)=>({...wO(e),options:[e,t]});var NO=qe.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return nt.jsx(_$.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:nt.jsx("polygon",{points:"0,0 30,0 15,10"})})}));NO.displayName="Arrow";var PO=NO;var $O="Popper",[jO,OO]=g$($O),[RO,MO]=jO($O),TO=e=>{const{__scopePopper:t,children:n}=e,[r,o]=qe.useState(null);return nt.jsx(RO,{scope:t,anchor:r,onAnchorChange:o,children:n})};TO.displayName=$O;var LO="PopperAnchor",zO=qe.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=MO(LO,n),s=qe.useRef(null),a=m$(t,s);return qe.useEffect((()=>{i.onAnchorChange((null==r?void 0:r.current)||s.current)})),r?null:nt.jsx(_$.div,{...o,ref:a})}));zO.displayName=LO;var IO="PopperContent",[DO,BO]=jO(IO),UO=qe.forwardRef(((e,t)=>{var n,r,o,i,s,a;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:d="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:h=!0,collisionBoundary:v=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:w,...x}=e,k=MO(IO,l),[E,S]=qe.useState(null),C=m$(t,(e=>S(e))),[_,A]=qe.useState(null),N=function(e){const[t,n]=qe.useState(void 0);return J$((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(_),P=(null==N?void 0:N.width)??0,$=(null==N?void 0:N.height)??0,j=c+("center"!==d?"-"+d:""),O="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},R=Array.isArray(v)?v:[v],M=R.length>0,T={padding:O,boundary:R.filter(WO),altBoundary:M},{refs:L,floatingStyles:z,placement:I,isPositioned:D,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=qe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=qe.useState(r);mO(f,r)||p(r);const[h,v]=qe.useState(null),[m,g]=qe.useState(null),y=qe.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),b=qe.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),w=i||h,x=s||m,k=qe.useRef(null),E=qe.useRef(null),S=qe.useRef(u),C=null!=l,_=bO(l),A=bO(o),N=bO(c),P=qe.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:f};A.current&&(e.platform=A.current),hO(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};$.current&&!mO(S.current,t)&&(S.current=t,df.flushSync((()=>{d(t)})))}))}),[f,t,n,A,N]);vO((()=>{!1===c&&S.current.isPositioned&&(S.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const $=qe.useRef(!1);vO((()=>($.current=!0,()=>{$.current=!1})),[]),vO((()=>{if(w&&(k.current=w),x&&(E.current=x),w&&x){if(_.current)return _.current(w,x,P);P()}}),[w,x,P,_,C]);const j=qe.useMemo((()=>({reference:k,floating:E,setReference:y,setFloating:b})),[y,b]),O=qe.useMemo((()=>({reference:w,floating:x})),[w,x]),R=qe.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=yO(O.floating,u.x),r=yO(O.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...gO(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,O.floating,u.x,u.y]);return qe.useMemo((()=>({...u,update:P,refs:j,elements:O,floatingStyles:R})),[u,P,j,O,R])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>sO(...e,{animationFrame:"always"===b}),elements:{reference:k.anchor},middleware:[xO({mainAxis:u+$,alignmentAxis:f}),h&&kO({mainAxis:!0,crossAxis:!1,limiter:"partial"===g?EO():void 0,...T}),h&&SO({...T}),CO({...T,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),_&&AO({element:_,padding:p}),qO({arrowWidth:P,arrowHeight:$}),y&&_O({strategy:"referenceHidden",...T})]}),[U,F]=KO(I),H=b$(w);J$((()=>{D&&(null==H||H())}),[D,H]);const V=null==(n=B.arrow)?void 0:n.x,W=null==(r=B.arrow)?void 0:r.y,q=0!==(null==(o=B.arrow)?void 0:o.centerOffset),[K,Q]=qe.useState();return J$((()=>{E&&Q(window.getComputedStyle(E).zIndex)}),[E]),nt.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:D?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[null==(i=B.transformOrigin)?void 0:i.x,null==(s=B.transformOrigin)?void 0:s.y].join(" "),...(null==(a=B.hide)?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:nt.jsx(DO,{scope:l,placedSide:U,onArrowChange:A,arrowX:V,arrowY:W,shouldHideArrow:q,children:nt.jsx(_$.div,{"data-side":U,"data-align":F,...x,ref:C,style:{...x.style,animation:D?void 0:"none"}})})})}));UO.displayName=IO;var FO="PopperArrow",HO={top:"bottom",right:"left",bottom:"top",left:"right"},VO=qe.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=BO(FO,n),i=HO[o.placedSide];return nt.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:nt.jsx(PO,{...r,ref:t,style:{...r.style,display:"block"}})})}));function WO(e){return null!==e}VO.displayName=FO;var qO=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:s,middlewareData:a}=t,l=0!==(null==(n=a.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,f]=KO(i),p={start:"0%",center:"50%",end:"100%"}[f],h=((null==(r=a.arrow)?void 0:r.x)??0)+c/2,v=((null==(o=a.arrow)?void 0:o.y)??0)+u/2;let m="",g="";return"bottom"===d?(m=l?p:`${h}px`,g=-u+"px"):"top"===d?(m=l?p:`${h}px`,g=`${s.floating.height+u}px`):"right"===d?(m=-u+"px",g=l?p:`${v}px`):"left"===d&&(m=`${s.floating.width+u}px`,g=l?p:`${v}px`),{data:{x:m,y:g}}}});function KO(e){const[t,n="center"]=e.split("-");return[t,n]}var QO=TO,YO=zO,GO=UO,JO=VO,XO=qe.forwardRef(((e,t)=>{var n;const{container:r,...o}=e,[i,s]=qe.useState(!1);J$((()=>s(!0)),[]);const a=r||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return a?ff.createPortal(nt.jsx(_$.div,{...o,ref:t}),a):null}));XO.displayName="Portal";var ZO=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=qe.useState(),r=qe.useRef({}),o=qe.useRef(e),i=qe.useRef("none"),s=e?"mounted":"unmounted",[a,l]=function(e,t){return qe.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return qe.useEffect((()=>{const e=eR(r.current);i.current="mounted"===a?e:"none"}),[a]),J$((()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,s=eR(t);if(e)l("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==s?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,l]),J$((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,s=i=>{const s=eR(r.current).includes(i.animationName);if(i.target===t&&s&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(i.current=eR(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:qe.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):qe.Children.only(n),i=m$(r.ref,function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?qe.cloneElement(o,{ref:i}):null};function eR(e){return(null==e?void 0:e.animationName)||"none"}ZO.displayName="Presence";var tR="rovingFocusGroup.onEntryFocus",nR={bubbles:!1,cancelable:!0},rR="RovingFocusGroup",[oR,iR,sR]=N$(rR),[aR,lR]=g$(rR,[sR]),[cR,uR]=aR(rR),dR=qe.forwardRef(((e,t)=>nt.jsx(oR.Provider,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(oR.Slot,{scope:e.__scopeRovingFocusGroup,children:nt.jsx(fR,{...e,ref:t})})})));dR.displayName=rR;var fR=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=qe.useRef(null),p=m$(t,f),h=$$(i),[v=null,m]=w$({prop:s,defaultProp:a,onChange:l}),[g,y]=qe.useState(!1),b=b$(c),w=iR(n),x=qe.useRef(!1),[k,E]=qe.useState(0);return qe.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(tR,b),()=>e.removeEventListener(tR,b)}),[b]),nt.jsx(cR,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:v,onItemFocus:qe.useCallback((e=>m(e)),[m]),onItemShiftTab:qe.useCallback((()=>y(!0)),[]),onFocusableItemAdd:qe.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:qe.useCallback((()=>E((e=>e-1))),[]),children:nt.jsx(_$.div,{tabIndex:g||0===k?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:p$(e.onMouseDown,(()=>{x.current=!0})),onFocus:p$(e.onFocus,(e=>{const t=!x.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(tR,nR);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=w().filter((e=>e.focusable));mR([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}x.current=!1})),onBlur:p$(e.onBlur,(()=>y(!1)))})})})),pR="RovingFocusGroupItem",hR=qe.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=ej(),l=i||a,c=uR(pR,n),u=c.currentTabStopId===l,d=iR(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return qe.useEffect((()=>{if(r)return f(),()=>p()}),[r,f,p]),nt.jsx(oR.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:nt.jsx(_$.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:p$(e.onMouseDown,(e=>{r?c.onItemFocus(l):e.preventDefault()})),onFocus:p$(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:p$(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:vR[r]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=d().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=c.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>mR(o)))}var n,r}))})})}));hR.displayName=pR;var vR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mR(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var gR=dR,yR=hR,bR=new WeakMap,wR=new WeakMap,xR={},kR=0,ER=function(e){return e&&(e.host||ER(e.parentNode))},SR=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=ER(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);xR[n]||(xR[n]=new WeakMap);var i=xR[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(bR.get(e)||0)+1,c=(i.get(e)||0)+1;bR.set(e,l),i.set(e,c),s.push(e),1===l&&o&&wR.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",e,d)}}))};return u(t),a.clear(),kR++,function(){s.forEach((function(e){var t=bR.get(e)-1,o=i.get(e)-1;bR.set(e,t),i.set(e,o),t||(wR.has(e)||e.removeAttribute(r),wR.delete(e)),o||e.removeAttribute(n)})),--kR||(bR=new WeakMap,bR=new WeakMap,wR=new WeakMap,xR={})}},CR=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),SR(r,o,n,"aria-hidden")):function(){return null}},_R="right-scroll-bar-position",AR="width-before-scroll-bar";function NR(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var PR="undefined"!=typeof window?qe.useLayoutEffect:qe.useEffect,$R=new WeakMap;function jR(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach((function(e){return NR(e,t)}))},(o=qe.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return PR((function(){var t=$R.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach((function(e){r.has(e)||NR(e,null)})),r.forEach((function(e){n.has(e)||NR(e,o)}))}$R.set(i,e)}),[e]),i}function OR(e){return e}var RR=function(e){var t=e.sideCar,n=Qy(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return qe.createElement(r,Ky({},n))};RR.isSideCarExport=!0;var MR=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=OR);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=Ky({async:!0,ssr:!1},e),t}(),TR=function(){},LR=qe.forwardRef((function(e,t){var n=qe.useRef(null),r=qe.useState({onScrollCapture:TR,onWheelCapture:TR,onTouchMoveCapture:TR}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,h=e.inert,v=e.allowPinchZoom,m=e.as,g=void 0===m?"div":m,y=e.gapMode,b=Qy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,x=jR([n,t]),k=Ky(Ky({},b),o);return qe.createElement(qe.Fragment,null,u&&qe.createElement(w,{sideCar:MR,removeScrollBar:c,shards:d,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:y}),s?qe.cloneElement(qe.Children.only(a),Ky(Ky({},k),{ref:x})):qe.createElement(g,Ky({},k,{className:l,ref:x}),a))}));LR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},LR.classNames={fullWidth:AR,zeroRight:_R};function zR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var IR=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=zR())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},DR=function(){var e,t=(e=IR(),function(t,n){qe.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},BR={left:0,top:0,right:0,gap:0},UR=function(e){return parseInt(e||"",10)||0},FR=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return BR;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[UR(n),UR(r),UR(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},HR=DR(),VR="data-scroll-locked",WR=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(VR,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(_R," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(AR," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(_R," .").concat(_R," {\n right: 0 ").concat(r,";\n }\n \n .").concat(AR," .").concat(AR," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(VR,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},qR=function(){var e=parseInt(document.body.getAttribute(VR)||"0",10);return isFinite(e)?e:0},KR=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;qe.useEffect((function(){return document.body.setAttribute(VR,(qR()+1).toString()),function(){var e=qR()-1;e<=0?document.body.removeAttribute(VR):document.body.setAttribute(VR,e.toString())}}),[]);var i=qe.useMemo((function(){return FR(o)}),[o]);return qe.createElement(HR,{styles:WR(i,!t,o,n?"":"!important")})},QR=!1;if("undefined"!=typeof window)try{var YR=Object.defineProperty({},"passive",{get:function(){return QR=!0,!0}});window.addEventListener("test",YR,YR),window.removeEventListener("test",YR,YR)}catch(az){QR=!1}var GR=!!QR&&{passive:!1},JR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},XR=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),ZR(e,r)){var o=eM(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZR=function(e,t){return"v"===e?function(e){return JR(e,"overflowY")}(t):function(e){return JR(e,"overflowX")}(t)},eM=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},tM=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nM=function(e){return[e.deltaX,e.deltaY]},rM=function(e){return e&&"current"in e?e.current:e},oM=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},iM=0,sM=[];function aM(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lM=(cM=function(e){var t=qe.useRef([]),n=qe.useRef([0,0]),r=qe.useRef(),o=qe.useState(iM++)[0],i=qe.useState(DR)[0],s=qe.useRef(e);qe.useEffect((function(){s.current=e}),[e]),qe.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=Zy([e.lockRef.current],(e.shards||[]).map(rM),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var a=qe.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var o,i=tM(e),a=n.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=XR(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=XR(d,u)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=eM(e,a),h=p[0],v=p[1]-p[2]-i*h;(h||v)&&ZR(e,a)&&(d+=v,f+=h),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return u&&(Math.abs(d)<1||!o)?c=!0:u||!(Math.abs(f)<1)&&o||(c=!0),c}(p,t,e,"h"===p?l:c,!0)}),[]),l=qe.useCallback((function(e){var n=e;if(sM.length&&sM[sM.length-1]===i){var r="deltaY"in n?nM(n):tM(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(s.current.shards||[]).map(rM).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?a(n,l[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),c=qe.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:aM(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),u=qe.useCallback((function(e){n.current=tM(e),r.current=void 0}),[]),d=qe.useCallback((function(t){c(t.type,nM(t),t.target,a(t,e.lockRef.current))}),[]),f=qe.useCallback((function(t){c(t.type,tM(t),t.target,a(t,e.lockRef.current))}),[]);qe.useEffect((function(){return sM.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,GR),document.addEventListener("touchmove",l,GR),document.addEventListener("touchstart",u,GR),function(){sM=sM.filter((function(e){return e!==i})),document.removeEventListener("wheel",l,GR),document.removeEventListener("touchmove",l,GR),document.removeEventListener("touchstart",u,GR)}}),[]);var p=e.removeScrollBar,h=e.inert;return qe.createElement(qe.Fragment,null,h?qe.createElement(i,{styles:oM(o)}):null,p?qe.createElement(KR,{gapMode:e.gapMode}):null)},MR.useMedium(cM),RR);var cM,uM=qe.forwardRef((function(e,t){return qe.createElement(LR,Ky({},e,{ref:t,sideCar:lM}))}));uM.classNames=LR.classNames;var dM=["Enter"," "],fM=["ArrowUp","PageDown","End"],pM=["ArrowDown","PageUp","Home",...fM],hM={ltr:[...dM,"ArrowRight"],rtl:[...dM,"ArrowLeft"]},vM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mM="Menu",[gM,yM,bM]=N$(mM),[wM,xM]=g$(mM,[bM,OO,lR]),kM=OO(),EM=lR(),[SM,CM]=wM(mM),[_M,AM]=wM(mM),NM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=kM(t),[l,c]=qe.useState(null),u=qe.useRef(!1),d=b$(i),f=$$(o);return qe.useEffect((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),nt.jsx(QO,{...a,children:nt.jsx(SM,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:nt.jsx(_M,{scope:t,onClose:qe.useCallback((()=>d(!1)),[d]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};NM.displayName=mM;var PM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=kM(n);return nt.jsx(YO,{...o,...r,ref:t})}));PM.displayName="MenuAnchor";var $M="MenuPortal",[jM,OM]=wM($M,{forceMount:void 0}),RM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=CM($M,t);return nt.jsx(jM,{scope:t,forceMount:n,children:nt.jsx(ZO,{present:n||i.open,children:nt.jsx(XO,{asChild:!0,container:o,children:r})})})};RM.displayName=$M;var MM="MenuContent",[TM,LM]=wM(MM),zM=qe.forwardRef(((e,t)=>{const n=OM(MM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=CM(MM,e.__scopeMenu),s=AM(MM,e.__scopeMenu);return nt.jsx(gM.Provider,{scope:e.__scopeMenu,children:nt.jsx(ZO,{present:r||i.open,children:nt.jsx(gM.Slot,{scope:e.__scopeMenu,children:s.modal?nt.jsx(IM,{...o,ref:t}):nt.jsx(DM,{...o,ref:t})})})})})),IM=qe.forwardRef(((e,t)=>{const n=CM(MM,e.__scopeMenu),r=qe.useRef(null),o=m$(t,r);return qe.useEffect((()=>{const e=r.current;if(e)return CR(e)}),[]),nt.jsx(BM,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:p$(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),DM=qe.forwardRef(((e,t)=>{const n=CM(MM,e.__scopeMenu);return nt.jsx(BM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),BM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...v}=e,m=CM(MM,n),g=AM(MM,n),y=kM(n),b=EM(n),w=yM(n),[x,k]=qe.useState(null),E=qe.useRef(null),S=m$(t,E,m.onContentChange),C=qe.useRef(0),_=qe.useRef(""),A=qe.useRef(0),N=qe.useRef(null),P=qe.useRef("right"),$=qe.useRef(0),j=h?uM:qe.Fragment,O=h?{as:x$,allowPinchZoom:!0}:void 0,R=e=>{var t,n;const r=_.current+e,o=w().filter((e=>!e.disabled)),i=document.activeElement,s=null==(t=o.find((e=>e.ref.current===i)))?void 0:t.textValue,a=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(o.map((e=>e.textValue)),r,s),l=null==(n=o.find((e=>e.textValue===a)))?void 0:n.ref.current;!function e(t){_.current=t,window.clearTimeout(C.current),""!==t&&(C.current=window.setTimeout((()=>e("")),1e3))}(r),l&&setTimeout((()=>l.focus()))};qe.useEffect((()=>()=>window.clearTimeout(C.current)),[]),qe.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??B$()),document.body.insertAdjacentElement("beforeend",e[1]??B$()),D$++,()=>{1===D$&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),D$--}}),[]);const M=qe.useCallback((e=>{var t,n;return P.current===(null==(t=N.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=c>r&&n<(l-e)*(r-a)/(c-a)+e&&(o=!o)}return o}(n,t)}(e,null==(n=N.current)?void 0:n.area)}),[]);return nt.jsx(TM,{scope:n,searchRef:_,onItemEnter:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),onItemLeave:qe.useCallback((e=>{var t;M(e)||(null==(t=E.current)||t.focus(),k(null))}),[M]),onTriggerLeave:qe.useCallback((e=>{M(e)&&e.preventDefault()}),[M]),pointerGraceTimerRef:A,onPointerGraceIntentChange:qe.useCallback((e=>{N.current=e}),[]),children:nt.jsx(j,{...O,children:nt.jsx(V$,{asChild:!0,trapped:o,onMountAutoFocus:p$(i,(e=>{var t;e.preventDefault(),null==(t=E.current)||t.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:nt.jsx(L$,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:nt.jsx(gR,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:x,onCurrentTabStopIdChange:k,onEntryFocus:p$(l,(e=>{g.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:nt.jsx(GO,{role:"menu","aria-orientation":"vertical","data-state":fT(m.open),"data-radix-menu-content":"",dir:g.dir,...y,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:p$(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&R(e.key));const o=E.current;if(e.target!==o)return;if(!pM.includes(e.key))return;e.preventDefault();const i=w().filter((e=>!e.disabled)).map((e=>e.ref.current));fM.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:p$(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),_.current="")})),onPointerMove:p$(e.onPointerMove,vT((e=>{const t=e.target,n=$.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>$.current?"right":"left";P.current=t,$.current=e.clientX}})))})})})})})})}));zM.displayName=MM;var UM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(_$.div,{role:"group",...r,ref:t})}));UM.displayName="MenuGroup";var FM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(_$.div,{...r,ref:t})}));FM.displayName="MenuLabel";var HM="MenuItem",VM="menu.itemSelect",WM=qe.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=qe.useRef(null),s=AM(HM,e.__scopeMenu),a=LM(HM,e.__scopeMenu),l=m$(t,i),c=qe.useRef(!1);return nt.jsx(qM,{...o,ref:l,disabled:n,onClick:p$(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(VM,{bubbles:!0,cancelable:!0});e.addEventListener(VM,(e=>null==r?void 0:r(e)),{once:!0}),A$(e,t),t.defaultPrevented?c.current=!1:s.onClose()}})),onPointerDown:t=>{var n;null==(n=e.onPointerDown)||n.call(e,t),c.current=!0},onPointerUp:p$(e.onPointerUp,(e=>{var t;c.current||null==(t=e.currentTarget)||t.click()})),onKeyDown:p$(e.onKeyDown,(e=>{const t=""!==a.searchRef.current;n||t&&" "===e.key||dM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));WM.displayName=HM;var qM=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=LM(HM,n),a=EM(n),l=qe.useRef(null),c=m$(t,l),[u,d]=qe.useState(!1),[f,p]=qe.useState("");return qe.useEffect((()=>{const e=l.current;e&&p((e.textContent??"").trim())}),[i.children]),nt.jsx(gM.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:nt.jsx(yR,{asChild:!0,...a,focusable:!r,children:nt.jsx(_$.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:p$(e.onPointerMove,vT((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:p$(e.onPointerLeave,vT((e=>s.onItemLeave(e)))),onFocus:p$(e.onFocus,(()=>d(!0))),onBlur:p$(e.onBlur,(()=>d(!1)))})})})})),KM=qe.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return nt.jsx(tT,{scope:e.__scopeMenu,checked:n,children:nt.jsx(WM,{role:"menuitemcheckbox","aria-checked":pT(n)?"mixed":n,...o,ref:t,"data-state":hT(n),onSelect:p$(o.onSelect,(()=>null==r?void 0:r(!!pT(n)||!n)),{checkForDefaultPrevented:!1})})})}));KM.displayName="MenuCheckboxItem";var QM="MenuRadioGroup",[YM,GM]=wM(QM,{value:void 0,onValueChange:()=>{}}),JM=qe.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=b$(r);return nt.jsx(YM,{scope:e.__scopeMenu,value:n,onValueChange:i,children:nt.jsx(UM,{...o,ref:t})})}));JM.displayName=QM;var XM="MenuRadioItem",ZM=qe.forwardRef(((e,t)=>{const{value:n,...r}=e,o=GM(XM,e.__scopeMenu),i=n===o.value;return nt.jsx(tT,{scope:e.__scopeMenu,checked:i,children:nt.jsx(WM,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":hT(i),onSelect:p$(r.onSelect,(()=>{var e;return null==(e=o.onValueChange)?void 0:e.call(o,n)}),{checkForDefaultPrevented:!1})})})}));ZM.displayName=XM;var eT="MenuItemIndicator",[tT,nT]=wM(eT,{checked:!1}),rT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=nT(eT,n);return nt.jsx(ZO,{present:r||pT(i.checked)||!0===i.checked,children:nt.jsx(_$.span,{...o,ref:t,"data-state":hT(i.checked)})})}));rT.displayName=eT;var oT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return nt.jsx(_$.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));oT.displayName="MenuSeparator";var iT=qe.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=kM(n);return nt.jsx(JO,{...o,...r,ref:t})}));iT.displayName="MenuArrow";var[sT,aT]=wM("MenuSub"),lT="MenuSubTrigger",cT=qe.forwardRef(((e,t)=>{const n=CM(lT,e.__scopeMenu),r=AM(lT,e.__scopeMenu),o=aT(lT,e.__scopeMenu),i=LM(lT,e.__scopeMenu),s=qe.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=qe.useCallback((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return qe.useEffect((()=>u),[u]),qe.useEffect((()=>{const e=a.current;return()=>{window.clearTimeout(e),l(null)}}),[a,l]),nt.jsx(PM,{asChild:!0,...c,children:nt.jsx(qM,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":fT(n.open),...e,ref:v$(t,o.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:p$(e.onPointerMove,vT((t=>{i.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(i.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),u()}),100))}))),onPointerLeave:p$(e.onPointerLeave,vT((e=>{var t,r;u();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,s="right"===t,l=s?-5:5,c=o[s?"left":"right"],u=o[s?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+l,y:e.clientY},{x:c,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:c,y:o.bottom}],side:t}),window.clearTimeout(a.current),a.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:p$(e.onKeyDown,(t=>{var o;const s=""!==i.searchRef.current;e.disabled||s&&" "===t.key||hM[r.dir].includes(t.key)&&(n.onOpenChange(!0),null==(o=n.content)||o.focus(),t.preventDefault())}))})})}));cT.displayName=lT;var uT="MenuSubContent",dT=qe.forwardRef(((e,t)=>{const n=OM(MM,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=CM(MM,e.__scopeMenu),s=AM(MM,e.__scopeMenu),a=aT(uT,e.__scopeMenu),l=qe.useRef(null),c=m$(t,l);return nt.jsx(gM.Provider,{scope:e.__scopeMenu,children:nt.jsx(ZO,{present:r||i.open,children:nt.jsx(gM.Slot,{scope:e.__scopeMenu,children:nt.jsx(BM,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;s.isUsingKeyboardRef.current&&(null==(t=l.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:p$(e.onFocusOutside,(e=>{e.target!==a.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:p$(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:p$(e.onKeyDown,(e=>{var t;const n=e.currentTarget.contains(e.target),r=vM[s.dir].includes(e.key);n&&r&&(i.onOpenChange(!1),null==(t=a.trigger)||t.focus(),e.preventDefault())}))})})})})}));function fT(e){return e?"open":"closed"}function pT(e){return"indeterminate"===e}function hT(e){return pT(e)?"indeterminate":e?"checked":"unchecked"}function vT(e){return t=>"mouse"===t.pointerType?e(t):void 0}dT.displayName=uT;var mT=NM,gT=PM,yT=RM,bT=zM,wT=UM,xT=FM,kT=WM,ET=KM,ST=JM,CT=ZM,_T=rT,AT=oT,NT=iT,PT=cT,$T=dT,jT="DropdownMenu",[OT,RT]=g$(jT,[xM]),MT=xM(),[TT,LT]=OT(jT),zT=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=MT(t),c=qe.useRef(null),[u=!1,d]=w$({prop:o,defaultProp:i,onChange:s});return nt.jsx(TT,{scope:t,triggerId:ej(),triggerRef:c,contentId:ej(),open:u,onOpenChange:d,onOpenToggle:qe.useCallback((()=>d((e=>!e))),[d]),modal:a,children:nt.jsx(mT,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};zT.displayName=jT;var IT="DropdownMenuTrigger",DT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=LT(IT,n),s=MT(n);return nt.jsx(gT,{asChild:!0,...s,children:nt.jsx(_$.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:v$(t,i.triggerRef),onPointerDown:p$(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:p$(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));DT.displayName=IT;var BT=e=>{const{__scopeDropdownMenu:t,...n}=e,r=MT(t);return nt.jsx(yT,{...r,...n})};BT.displayName="DropdownMenuPortal";var UT="DropdownMenuContent",FT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=LT(UT,n),i=MT(n),s=qe.useRef(!1);return nt.jsx(bT,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:p$(e.onCloseAutoFocus,(e=>{var t;s.current||null==(t=o.triggerRef.current)||t.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:p$(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;o.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));FT.displayName=UT;qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(wT,{...o,...r,ref:t})})).displayName="DropdownMenuGroup";var HT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(xT,{...o,...r,ref:t})}));HT.displayName="DropdownMenuLabel";var VT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(kT,{...o,...r,ref:t})}));VT.displayName="DropdownMenuItem";var WT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(ET,{...o,...r,ref:t})}));WT.displayName="DropdownMenuCheckboxItem";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(ST,{...o,...r,ref:t})})).displayName="DropdownMenuRadioGroup";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(CT,{...o,...r,ref:t})})).displayName="DropdownMenuRadioItem";var qT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(_T,{...o,...r,ref:t})}));qT.displayName="DropdownMenuItemIndicator";var KT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(AT,{...o,...r,ref:t})}));KT.displayName="DropdownMenuSeparator";qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(NT,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var QT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx(PT,{...o,...r,ref:t})}));QT.displayName="DropdownMenuSubTrigger";var YT=qe.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=MT(n);return nt.jsx($T,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));YT.displayName="DropdownMenuSubContent";var GT=zT,JT=DT,XT=BT,ZT=FT,eL=HT,tL=VT,nL=WT,rL=qT,oL=KT,iL=QT,sL=YT;const aL=(...e)=>e.filter(((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t)).join(" ").trim();var lL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const cL=qe.forwardRef((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>qe.createElement("svg",{ref:l,...lL,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:aL("lucide",o),...a},[...s.map((([e,t])=>qe.createElement(e,t))),...Array.isArray(i)?i:[i]]))),uL=(e,t)=>{const n=qe.forwardRef((({className:n,...r},o)=>{return qe.createElement(cL,{ref:o,iconNode:t,className:aL(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},dL=uL("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),fL=uL("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),pL=GT,hL=JT;qe.forwardRef((({className:e,inset:t,children:n,...r},o)=>nt.jsxs(iL,{ref:o,className:ap("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,nt.jsx(fL,{className:"ml-auto h-4 w-4"})]}))).displayName=iL.displayName;qe.forwardRef((({className:e,...t},n)=>nt.jsx(sL,{ref:n,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}))).displayName=sL.displayName;const vL=qe.forwardRef((({className:e,sideOffset:t=4,...n},r)=>nt.jsx(XT,{children:nt.jsx(ZT,{ref:r,sideOffset:t,className:ap("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})));vL.displayName=ZT.displayName;const mL=qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(tL,{ref:r,className:ap("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n})));mL.displayName=tL.displayName;qe.forwardRef((({className:e,children:t,checked:n,...r},o)=>nt.jsxs(nL,{ref:o,className:ap("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[nt.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:nt.jsx(rL,{children:nt.jsx(dL,{className:"h-4 w-4"})})}),t]}))).displayName=nL.displayName;qe.forwardRef((({className:e,inset:t,...n},r)=>nt.jsx(eL,{ref:r,className:ap("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}))).displayName=eL.displayName;const gL=qe.forwardRef((({className:e,...t},n)=>nt.jsx(oL,{ref:n,className:ap("-mx-1 my-1 h-px bg-muted",e),...t})));gL.displayName=oL.displayName;const yL=new Set(["children","localName","ref","style","className"]),bL=new WeakMap,wL=(e,t,n,r,o)=>{const i=null==o?void 0:o[t];void 0===i?(e[t]=n,null==n&&t in HTMLElement.prototype&&e.removeAttribute(t)):n!==r&&((e,t,n)=>{let r=bL.get(e);void 0===r&&bL.set(e,r=new Map);let o=r.get(t);void 0!==n?void 0===o?(r.set(t,o={handleEvent:n}),e.addEventListener(t,o)):o.handleEvent=n:void 0!==o&&(r.delete(t),e.removeEventListener(t,o))})(e,i,n)},xL=({react:e,tagName:t,elementClass:n,events:r,displayName:o})=>{const i=new Set(Object.keys(r??{})),s=e.forwardRef(((o,s)=>{const a=e.useRef(new Map),l=e.useRef(null),c={},u={};for(const[e,t]of Object.entries(o))yL.has(e)?c["className"===e?"class":e]=t:i.has(e)||e in n.prototype?u[e]=t:c[e]=t;return e.useLayoutEffect((()=>{if(null===l.current)return;const e=new Map;for(const t in u)wL(l.current,t,o[t],a.current.get(t),r),a.current.delete(t),e.set(t,o[t]);for(const[t,n]of a.current)wL(l.current,t,void 0,n,r);a.current=e})),e.useLayoutEffect((()=>{var e;null==(e=l.current)||e.removeAttribute("defer-hydration")}),[]),c.suppressHydrationWarning=!0,e.createElement(t,{...c,ref:e.useCallback((e=>{l.current=e,"function"==typeof s?s(e):null!==s&&(s.current=e)}),[s])})}));return s.displayName=o??n.name,s};xL({tagName:"dc-connection-button",elementClass:d$,react:Ke});const kL=xL({tagName:"dc-connection-dialog",elementClass:o$,react:Ke,events:{onClose:"close"}});function EL(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}function SL(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}}function CL(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function _L(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let r=0;const o=[],i=Array.from(e);for(i.forEach((e=>{if(e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,s=!0;for(let o=r;o{if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(t))throw new Error("radix.encode input should be Uint8Array");return _L(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(_L(t,e,256))}}}const NL=(e=>EL(AL(58),SL(e),CL("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function PL(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function $L(e,...t){if(!function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function jL(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const OL=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),RL=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],ML=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,TL=RL?e=>e:e=>ML(e);function LL(e){for(let t=0;te(n).update(zL(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}const BL=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class UL extends IL{constructor(e,t,n={},r,o,i){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,PL(e),PL(t),PL(r),t<0||t>r)throw new Error("outputLen bigger than keyLen");if(void 0!==n.key&&(n.key.length<1||n.key.length>r))throw new Error(`key must be up 1..${r} byte long or undefined`);if(void 0!==n.salt&&n.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(void 0!==n.personalization&&n.personalization.length!==i)throw new Error(`personalization must be ${i} byte long or undefined`);this.buffer32=OL(this.buffer=new Uint8Array(e))}update(e){jL(this);const{blockLen:t,buffer:n,buffer32:r}=this,o=(e=zL(e)).length,i=e.byteOffset,s=e.buffer;for(let a=0;ar[t]=TL(e)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){const{buffer:t,length:n,finished:r,destroyed:o,outputLen:i,pos:s}=this;return e||(e=new this.constructor({dkLen:i})),e.set(...this.get()),e.length=n,e.finished=r,e.destroyed=o,e.outputLen=i,e.buffer.set(t),e.pos=s,e}}const FL=BigInt(2**32-1),HL=BigInt(32);function VL(e,t=!1){return t?{h:Number(e&FL),l:Number(e>>HL&FL)}:{h:0|Number(e>>HL&FL),l:0|Number(e&FL)}}const WL={fromBig:VL,split:function(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0),shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<>>32-n,rotlSL:(e,t,n)=>t<>>32-n,rotlBH:(e,t,n)=>t<>>64-n,rotlBL:(e,t,n)=>e<>>64-n,add:function(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}},add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,add5H:(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,add5L:(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0)},qL=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),KL=new Uint32Array(32);function QL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=KL[2*e],c=KL[2*e+1],u=KL[2*t],d=KL[2*t+1],f=KL[2*n],p=KL[2*n+1],h=KL[2*r],v=KL[2*r+1],m=WL.add3L(l,u,s);c=WL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:WL.rotr32H(v,h),Dl:WL.rotr32L(v,h)}),({h:p,l:f}=WL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:WL.rotrSH(d,u,24),Bl:WL.rotrSL(d,u,24)}),KL[2*e]=l,KL[2*e+1]=c,KL[2*t]=u,KL[2*t+1]=d,KL[2*n]=f,KL[2*n+1]=p,KL[2*r]=h,KL[2*r+1]=v}function YL(e,t,n,r,o,i){const s=o[i],a=o[i+1];let l=KL[2*e],c=KL[2*e+1],u=KL[2*t],d=KL[2*t+1],f=KL[2*n],p=KL[2*n+1],h=KL[2*r],v=KL[2*r+1],m=WL.add3L(l,u,s);c=WL.add3H(m,c,d,a),l=0|m,({Dh:v,Dl:h}={Dh:v^c,Dl:h^l}),({Dh:v,Dl:h}={Dh:WL.rotrSH(v,h,16),Dl:WL.rotrSL(v,h,16)}),({h:p,l:f}=WL.add(p,f,v,h)),({Bh:d,Bl:u}={Bh:d^p,Bl:u^f}),({Bh:d,Bl:u}={Bh:WL.rotrBH(d,u,63),Bl:WL.rotrBL(d,u,63)}),KL[2*e]=l,KL[2*e+1]=c,KL[2*t]=u,KL[2*t+1]=d,KL[2*n]=f,KL[2*n+1]=p,KL[2*r]=h,KL[2*r+1]=v}class GL extends UL{constructor(e={}){super(128,void 0===e.dkLen?64:e.dkLen,e,64,16,16),this.v0l=0|qL[0],this.v0h=0|qL[1],this.v1l=0|qL[2],this.v1h=0|qL[3],this.v2l=0|qL[4],this.v2h=0|qL[5],this.v3l=0|qL[6],this.v3h=0|qL[7],this.v4l=0|qL[8],this.v4h=0|qL[9],this.v5l=0|qL[10],this.v5h=0|qL[11],this.v6l=0|qL[12],this.v6h=0|qL[13],this.v7l=0|qL[14],this.v7h=0|qL[15];const t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|65536|1<<24,e.salt){const t=OL(zL(e.salt));this.v4l^=TL(t[0]),this.v4h^=TL(t[1]),this.v5l^=TL(t[2]),this.v5h^=TL(t[3])}if(e.personalization){const t=OL(zL(e.personalization));this.v6l^=TL(t[0]),this.v6h^=TL(t[1]),this.v7l^=TL(t[2]),this.v7h^=TL(t[3])}if(e.key){const t=new Uint8Array(this.blockLen);t.set(zL(e.key)),this.update(t)}}get(){let{v0l:e,v0h:t,v1l:n,v1h:r,v2l:o,v2h:i,v3l:s,v3h:a,v4l:l,v4h:c,v5l:u,v5h:d,v6l:f,v6h:p,v7l:h,v7h:v}=this;return[e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v]}set(e,t,n,r,o,i,s,a,l,c,u,d,f,p,h,v){this.v0l=0|e,this.v0h=0|t,this.v1l=0|n,this.v1h=0|r,this.v2l=0|o,this.v2h=0|i,this.v3l=0|s,this.v3h=0|a,this.v4l=0|l,this.v4h=0|c,this.v5l=0|u,this.v5h=0|d,this.v6l=0|f,this.v6h=0|p,this.v7l=0|h,this.v7h=0|v}compress(e,t,n){this.get().forEach(((e,t)=>KL[t]=e)),KL.set(qL,16);let{h:r,l:o}=WL.fromBig(BigInt(this.length));KL[24]=qL[8]^o,KL[25]=qL[9]^r,n&&(KL[28]=~KL[28],KL[29]=~KL[29]);let i=0;const s=BL;for(let a=0;a<12;a++)QL(0,4,8,12,e,t+2*s[i++]),YL(0,4,8,12,e,t+2*s[i++]),QL(1,5,9,13,e,t+2*s[i++]),YL(1,5,9,13,e,t+2*s[i++]),QL(2,6,10,14,e,t+2*s[i++]),YL(2,6,10,14,e,t+2*s[i++]),QL(3,7,11,15,e,t+2*s[i++]),YL(3,7,11,15,e,t+2*s[i++]),QL(0,5,10,15,e,t+2*s[i++]),YL(0,5,10,15,e,t+2*s[i++]),QL(1,6,11,12,e,t+2*s[i++]),YL(1,6,11,12,e,t+2*s[i++]),QL(2,7,8,13,e,t+2*s[i++]),YL(2,7,8,13,e,t+2*s[i++]),QL(3,4,9,14,e,t+2*s[i++]),YL(3,4,9,14,e,t+2*s[i++]);this.v0l^=KL[0]^KL[16],this.v0h^=KL[1]^KL[17],this.v1l^=KL[2]^KL[18],this.v1h^=KL[3]^KL[19],this.v2l^=KL[4]^KL[20],this.v2h^=KL[5]^KL[21],this.v3l^=KL[6]^KL[22],this.v3h^=KL[7]^KL[23],this.v4l^=KL[8]^KL[24],this.v4h^=KL[9]^KL[25],this.v5l^=KL[10]^KL[26],this.v5h^=KL[11]^KL[27],this.v6l^=KL[12]^KL[28],this.v6h^=KL[13]^KL[29],this.v7l^=KL[14]^KL[30],this.v7h^=KL[15]^KL[31],KL.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const JL=DL((e=>new GL(e))),XL=(new TextEncoder).encode("SS58PRE"),ZL=e=>{try{const t=NL.decode(e),n=t.subarray(0,64&t[0]?2:1),r=t.subarray(n.length,t.length-2),o=t.subarray(n.length+r.length),i=JL(Uint8Array.of(...XL,...n,...r),{dkLen:64}).subarray(0,2);return o[0]===i[0]&&o[1]===i[1]?{isValid:!0,ss58Format:ez(n),publicKey:r.slice()}:{isValid:!1}}catch{return{isValid:!1}}},ez=e=>{const t=new DataView(e.buffer,e.byteOffset,e.byteLength);return 1===t.byteLength?t.getUint8(0):t.getUint16(0)},tz={target:{colors:[0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,0,28,0,1],freq:1},cube:{colors:[0,1,3,2,4,3,0,1,3,2,4,3,0,1,3,2,4,3,5],freq:20},quazar:{colors:[1,2,3,1,2,4,5,5,4,1,2,3,1,2,4,5,5,4,0],freq:16},flower:{colors:[0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,3],freq:32},cyclic:{colors:[0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,6],freq:32},vmirror:{colors:[0,1,2,3,4,5,3,4,2,0,1,6,7,8,9,7,8,6,10],freq:128},hmirror:{colors:[0,1,2,3,4,5,6,7,8,9,10,8,6,7,5,3,4,2,11],freq:128}},nz=e=>{let t=0;const n=Object.values(tz).find((n=>(t+=n.freq,e{var l;const[c,u]=qe.useState(!1),[d,f]=qe.useState(i),[p,h]=qe.useState(),[v,m]=qe.useState(),[g,y]=qe.useState();qe.useEffect((()=>{if("string"==typeof e&&!e.includes("px")&&!e.includes("rem"))throw new Error("Providing a string for 'size' in Polkicon should be expressed either in 'px', 'rem' or 'em'");let t,n;if("string"==typeof e)switch(n=e.replace(/[0-9.]/g,""),n){case"px":t=parseFloat(e);break;case"rem":t=10*parseFloat(e)}else"number"==typeof e&&(t=e);var r,o;h(n?""+("px"===n?t+"px":t/10+"rem"):t),t<12&&(r=n||"number",o="px"===n?"12px":"rem"===n?"1.2rem":12,console.warn(`Polkicon: 'Size' expressed in '${r}' cannot be less than ${o}. Will be resized to minimum size.`)),t<32?(y("0rem 0.5rem"),m("0.5rem")):t>=32&&t<64?(y("1rem 0.5rem"),m("1rem")):t>=64&&t<100?(y("2rem 1rem"),m("1.5rem")):t>=100&&(y("3rem 1rem"),m("2rem"))}),[e]);const b=qe.useCallback((()=>{n&&(async e=>{try{await navigator.clipboard.writeText(e),u(!0),f(i)}catch{u(!0),f("Failed!")}})(t)}),[n,t,i]);qe.useEffect((()=>{n&&c&&setTimeout((()=>{u(!1)}),o)}),[n,c,o]);const{c:w,r:x,rroot3o2:k,ro2:E,rroot3o4:S,ro4:C,r3o4:_,z:A,rot:N,scheme:P,palette:$}=(e=>{const t=JL(new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),n=ZL(e);let r=n.isValid?n.publicKey:e;if(!("object"==typeof r&&r&&r instanceof Uint8Array&&32==r.length))return{};r=Uint8Array.from(JL(r)).map(((e,n)=>(e+256-t[n])%256));const o=22.4,i=o*Math.sqrt(3)/2,s=o*Math.sqrt(3)/4,a=3*o/4,l=Object.keys(tz).map((e=>tz[e].freq)).reduce(((e,t)=>e+t)),c=Math.floor(70*r[29]/256+26)%80+30,u=Math.floor((r[30]+256*r[31])%l),d=nz(u),f=Array.from(r).map(((e,t)=>{const n=(e+t%28*58)%256;if(0==n)return"#444";if(255==n)return"transparent";const r=Math.floor(n%64*360/64),o=[53,15,35,75][Math.floor(n/64)];return`hsl(${r}, ${c}%, ${o}%)`}));return{c:32,r:o,rroot3o2:i,ro2:11.2,rroot3o4:s,ro4:5.6,r3o4:a,z:5,rot:r[28]%6*3,scheme:d,palette:f}})(t),j=ZL(t).isValid?null==(l=null==P?void 0:P.colors)?void 0:l.map(((e,t)=>$[null==P?void 0:P.colors[t<18?(t+N)%18:18]])):[];let O=0;return j?nt.jsxs("div",{onClick:n?b:void 0,style:n?{cursor:c?"none":"copy",position:"relative",display:"flex",justifyContent:"center",alignItems:"center"}:{display:"flex",justifyContent:"center",alignItems:"center"},children:[nt.jsxs("svg",{id:Math.random().toString(36).substring(2,9),className:a,style:s,width:p,height:p,viewBox:"0 0 64 64",children:[nt.jsx("circle",{cx:32,cy:32,r:32,fill:r}),nt.jsx("circle",{cx:w,cy:w-x,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w,cy:w-E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-S,cy:w-_,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-k,cy:w-E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-S,cy:w-C,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-k,cy:w,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-k,cy:w+E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-S,cy:w+C,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w-S,cy:w+_,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w,cy:w+x,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w,cy:w+E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+S,cy:w+_,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+k,cy:w+E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+S,cy:w+C,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+k,cy:w,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+k,cy:w-E,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+S,cy:w-C,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w+S,cy:w-_,r:A,fill:j[O++]}),nt.jsx("circle",{cx:w,cy:w,r:A,fill:j[O++]})]}),n&&c&&nt.jsx("p",{style:{fontSize:v,fontWeight:"bold",padding:g,width:p,height:p,position:"absolute",borderRadius:"55rem",color:"white",background:"green",opacity:"80%",alignItems:"center",justifyContent:"center",display:"flex"},children:d})]}):null},oz=()=>{const{accounts:e,selectAccount:t,selectedAccount:n}=QS(),[,r]=DS(),[o,i]=qe.useState(!1);return qe.useEffect((()=>{!(null==n?void 0:n.address)&&e.length>0&&(t(e[0]),i(!1))}),[e,t,null==n?void 0:n.address]),nt.jsxs(nt.Fragment,{children:[nt.jsx("div",{className:"flex w-full justify-center",children:nt.jsxs("div",{className:"flex w-full",children:[!e.length&&nt.jsx(aC,{onClick:()=>i(!0),className:"w-full text-lg font-bold bg-pink-700 hover:bg-blue-600",children:"Connect Wallet"}),!!e.length&&nt.jsxs(pL,{children:[nt.jsx(hL,{asChild:!0,children:nt.jsxs(aC,{variant:"outline",size:"default",className:"cursor-pointer overflow-hidden w-full flex items-center justify-center gap-2",children:[nt.jsx(rz,{size:36,address:(null==n?void 0:n.address)||"",className:"mr-2",outerColor:"transparent"}),null==n?void 0:n.name,nt.jsx(cC,{className:"ml-2 h-4 w-4",isOpen:!1})]})}),nt.jsxs(vL,{className:"max-h-[calc(100vh-5rem)] overflow-auto",children:[e.map(((n,r)=>nt.jsxs(qe.Fragment,{children:[nt.jsxs(mL,{className:"cursor-pointer",onClick:()=>t(n),children:[nt.jsx(rz,{size:28,address:n.address||"",className:"mr-2",outerColor:"transparent"}),n.name]},n.address),r!==e.length-1&&nt.jsx(gL,{})]},n.address))),nt.jsx(mL,{className:"cursor-pointer",onClick:()=>{i(!0)},children:"Show wallets"},"show"),nt.jsx(mL,{className:"cursor-pointer",onClick:()=>{r(),t(void 0)},children:"Disconnect"},"logout")]})]})]})}),nt.jsx(kL,{open:o,onClose:()=>i(!1)})]})};function iz(){return nt.jsx("div",{className:"flex items-center justify-center mt-6",children:nt.jsxs(up,{className:"w-full max-w-xl",children:[nt.jsx(dp,{children:nt.jsxs(fp,{className:"text-4xl text-center flex items-center justify-center gap-2",children:[nt.jsx(sz,{}),nt.jsxs("span",{children:["CLI: ",nt.jsx("span",{className:"font-light",children:"Signing Portal"})]})]})}),nt.jsx(pp,{className:"grid gap-4",children:nt.jsx(PS,{config:f$,children:nt.jsx(KS,{children:nt.jsxs("div",{className:"overflow-auto break-words whitespace-pre-wrap",children:[nt.jsx(oz,{}),nt.jsx(yC,{})]})})})})]})})}const sz=()=>nt.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100",height:"100",fill:"none",viewBox:"0 0 512 512",children:[nt.jsxs("g",{clipPath:"url(#clip0_873_174)",children:[nt.jsx("rect",{width:"512",height:"512",fill:"#1C0533",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint0_radial_873_174)",fillOpacity:"0.8",rx:"256"}),nt.jsx("rect",{width:"512",height:"512",fill:"url(#paint1_radial_873_174)",fillOpacity:"0.6",rx:"256"}),nt.jsx("mask",{id:"mask0_873_174",width:"1428",height:"1351",x:"-429",y:"-502",maskUnits:"userSpaceOnUse",style:{maskType:"alpha"},children:nt.jsx("path",{fill:"#D9D9D9",d:"m127.637-501.289 871.274 824.192-14.25 13.48-871.273-824.192zM88.96-464.701l871.272 824.192-14.249 13.48L74.71-451.221zM50.281-428.113l871.273 824.192-14.249 13.48L36.032-414.633zM11.603-391.525l871.273 824.192-14.249 13.48L-2.646-378.045zM-27.075-354.937l871.273 824.192-14.249 13.48-871.273-824.192zM-65.753-318.349 805.52 505.843l-14.249 13.48-871.273-824.192zM-104.431-281.761l871.273 824.192-14.249 13.48-871.273-824.192zM-143.109-245.173l871.273 824.192-14.249 13.48-871.273-824.192zM-181.787-208.585l871.273 824.192-14.249 13.48-871.273-824.192zM-220.465-171.997l871.273 824.192-14.249 13.48-871.273-824.192zM-259.143-135.409 612.13 688.783l-14.249 13.48-871.273-824.192zM-297.821-98.821 573.452 725.37l-14.249 13.48L-312.07-85.341zM-336.499-62.233l871.273 824.192-14.249 13.48-871.273-824.192zM-375.177-25.645l871.273 824.192-14.249 13.479-871.273-824.191zM-413.855 10.943l871.273 824.192-14.249 13.48-871.273-824.192z"})}),nt.jsx("g",{mask:"url(#mask0_873_174)",children:nt.jsx("path",{fill:"#E6007A",d:"M511.169 254.929C511.169 396.905 396.739 512 255.584 512 114.428 512-.001 396.905-.001 254.929S114.428-2.142 255.584-2.142c141.155 0 255.585 115.095 255.585 257.071"})}),nt.jsx("path",{fill:"#2B0532",d:"M183.804 160.44c-12.752-9.296-27.346-13.272-41.94-13.272h-89.63L5.63 367.567h117.053l9.399-44.802a86.4 86.4 0 0 0 28.32-8.371 104 104 0 0 0 4.133-2.155 97.7 97.7 0 0 0 14.779 24.342c8.258 9.967 18.342 17.785 29.802 23.435l.003.002.397.195.4.186c12.688 5.89 26.181 8.385 39.713 8.385 13.588 0 26.877-2.295 39.662-6.916a127 127 0 0 0 17.54-7.88l-2.871 13.579h117.052l9.4-44.802a86.4 86.4 0 0 0 28.32-8.371 101.4 101.4 0 0 0 28.939-21.348l.01-.011.159-.168.154-.167.003-.003c8.092-8.766 14.613-18.702 19.34-29.722 4.865-11.344 7.542-23.439 7.542-36.022 0-12.506-2.649-24.626-7.879-35.976-5.493-12.224-13.86-22.642-24.867-30.537-12.752-9.296-27.346-13.272-41.94-13.272h-89.631l-5.24 24.781c-7.026-6.908-15.096-12.504-24.009-16.758-12.764-6.233-26.404-8.834-40.034-8.834-13.589 0-26.878 2.295-39.662 6.916-12.145 4.39-23.444 10.507-33.804 18.268a133 133 0 0 0-7.099 5.68 74.6 74.6 0 0 0-16.911-16.781"}),nt.jsx("path",{fill:"#E6007A",fillRule:"evenodd",d:"m229.569 331.163.063.031.064.03c7.896 3.665 16.711 5.426 26.323 5.426 9.96 0 19.59-1.672 28.858-5.022a94.6 94.6 0 0 0 25.4-13.857c7.69-5.873 14.403-12.621 20.12-20.24l.016-.022.016-.022c5.708-7.75 10.156-16.036 13.319-24.849 3.326-9.027 5.005-18.25 5.005-27.639 0-8.458-1.303-16.601-3.928-24.399-2.514-8.002-6.373-15.177-11.585-21.468-5.277-6.369-11.756-11.363-19.365-14.972-7.797-3.835-16.58-5.669-26.205-5.669-9.961 0-19.591 1.673-28.858 5.022-9.165 3.313-17.687 7.924-25.551 13.819-7.719 5.752-14.51 12.512-20.362 20.265l-.01.014a97.4 97.4 0 0 0-13.544 24.867l-.015.04-.014.041c-3.181 9.016-4.784 18.219-4.784 27.583 0 8.482 1.311 16.702 3.94 24.634l.005.016.005.016c2.653 7.855 6.575 14.936 11.766 21.201 5.269 6.361 11.733 11.413 19.321 15.154m58.163-55.148.01-.015c2.998-4.343 5.197-8.955 6.622-13.852 1.467-5.04 2.176-9.872 2.176-14.513 0-4.335-.697-8.177-2.012-11.592l-.041-.109-.038-.11c-1.121-3.279-2.866-5.693-5.197-7.475-2.026-1.548-5.053-2.613-9.646-2.613-5.335 0-9.796 1.243-13.579 3.569l-.053.032-.053.031c-4.052 2.378-7.426 5.537-10.156 9.541a52.3 52.3 0 0 0-6.661 13.745c-1.454 5.016-2.157 9.826-2.157 14.447 0 4.358.638 8.321 1.862 11.932 1.246 3.306 3.081 5.852 5.484 7.803 2.047 1.543 5.008 2.569 9.387 2.569 5.495 0 10.017-1.255 13.78-3.568 4.107-2.524 7.515-5.779 10.262-9.808zM171.542 186.53c-6.663-4.89-14.525-7.228-23.288-7.228H84.491L51.478 335.434h51.685l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.864-14.652l.025-.027.025-.027c5.695-6.169 10.18-13.036 13.418-20.587 3.261-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.969-4.328l.037-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.013-.01h-11.5l-3.905 18.655h10.249c.063-.013.306-.078.757-.35.511-.309 1.235-.919 2.103-2.084zM469.872 186.53c-6.663-4.89-14.525-7.228-23.289-7.228h-63.762l-33.014 156.132h51.686l9.273-44.204h15.658c8.698 0 16.935-1.893 24.636-5.69a69.4 69.4 0 0 0 19.863-14.652l.026-.027.024-.027c5.696-6.169 10.18-13.036 13.419-20.587 3.26-7.602 4.93-15.381 4.93-23.294 0-7.901-1.665-15.457-4.983-22.605-3.247-7.286-8.082-13.265-14.467-17.818m-35.967 55.601.023-.03c.765-1.001 1.462-2.391 1.968-4.328l.038-.142.044-.141c.574-1.827.929-4.221.929-7.293 0-2.333-.311-3.426-.466-3.769a4 4 0 0 0-.222-.434l-.027-.045-.014-.01h-11.5l-3.904 18.655h10.249c.063-.013.306-.078.756-.35.511-.309 1.235-.919 2.104-2.084z",clipRule:"evenodd"}),nt.jsxs("mask",{id:"path-6-outside-1_873_174",width:"435",height:"156",x:"35.823",y:"166.788",fill:"#000",maskUnits:"userSpaceOnUse",children:[nt.jsx("path",{fill:"#fff",d:"M35.823 166.788h435v156h-435z"}),nt.jsx("path",{fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"})]}),nt.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318m-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391m-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852m133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd"}),nt.jsx("path",{stroke:"#fff",strokeWidth:"0.3",d:"M68.98 168.599h62.13c8.395 0 15.832 2.234 22.11 6.846 6.094 4.342 10.707 10.041 13.812 17.016 3.197 6.883 4.8 14.151 4.8 21.761 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.016.018-.017.017a67.4 67.4 0 0 1-19.29 14.23c-7.419 3.657-15.352 5.483-23.749 5.483H93.657l-9.273 44.203h-47.56zm21.407 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.144-13.383q7.862-8.516 12.297-18.857t4.435-20.885-4.435-20.074q-4.233-9.53-12.499-15.41-8.265-6.084-19.756-6.083H72.244L41.803 316.62h39.31zm29.65-41.79.015-.019c.958-1.253 1.758-2.901 2.32-5.048l.025-.096.03-.093c.651-2.074 1.022-4.685 1.022-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.697-1.289 2.679-2.606zm-22.19 7.32 6.45-30.821h16.733q1.612 0 3.024 1.014 1.411.811 2.419 3.041t1.008 6.286q0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217zm115.507 78.686-.042-.021c-7.343-3.62-13.579-8.498-18.66-14.63-5.028-6.07-8.83-12.931-11.405-20.555l-.007-.022c-2.559-7.721-3.836-15.725-3.836-23.993 0-9.126 1.562-18.1 4.668-26.904l.009-.028.01-.027a95.4 95.4 0 0 1 13.263-24.351l.007-.009c5.738-7.601 12.392-14.225 19.957-19.863 7.707-5.777 16.054-10.293 25.032-13.538 9.045-3.27 18.444-4.903 28.176-4.903 9.373 0 17.85 1.786 25.332 5.469 7.357 3.487 13.603 8.304 18.689 14.442 5.043 6.087 8.78 13.033 11.217 20.801 2.557 7.586 3.829 15.516 3.829 23.768 0 9.144-1.635 18.132-4.883 26.944-3.094 8.623-7.448 16.738-13.045 24.337l-.01.015-.011.014c-5.604 7.468-12.184 14.085-19.73 19.847a92.6 92.6 0 0 1-24.863 13.564c-9.045 3.27-18.445 4.903-28.176 4.903-9.365 0-17.885-1.715-25.478-5.24zm107.57-58.815q4.638-12.571 4.637-25.549 0-11.76-3.629-22.507-3.427-10.95-10.483-19.466-7.055-8.516-17.337-13.382-10.281-5.07-23.586-5.07-13.91 0-26.813 4.664t-23.99 12.977q-10.886 8.111-19.151 19.06a91.3 91.3 0 0 0-12.701 23.319q-4.434 12.571-4.435 25.548 0 11.762 3.629 22.71 3.629 10.748 10.685 19.263 7.055 8.517 17.337 13.586 10.482 4.866 23.788 4.866 13.91 0 26.812-4.663a88.6 88.6 0 0 0 23.788-12.977q10.887-8.314 18.95-19.061 8.065-10.949 12.499-23.318Zm-48.684 6.628.014-.019c3.119-4.518 5.413-9.327 6.901-14.439 1.515-5.208 2.257-10.231 2.257-15.083 0-4.557-.734-8.65-2.148-12.324l-.027-.072-.025-.074c-1.24-3.628-3.21-6.386-5.885-8.43-2.47-1.889-5.966-3.026-10.865-3.026-5.662 0-10.495 1.324-14.63 3.866l-.036.021-.035.021c-4.314 2.531-7.907 5.899-10.802 10.146a54.3 54.3 0 0 0-6.928 14.3c-1.506 5.191-2.244 10.2-2.244 15.038 0 4.574.672 8.77 1.981 12.619 1.368 3.647 3.421 6.515 6.143 8.717 2.483 1.882 5.911 2.996 10.625 2.996 5.813 0 10.71-1.332 14.831-3.866 4.351-2.674 7.967-6.128 10.873-10.391Zm-38.808 14.46q-5.04-4.056-7.459-10.544-2.217-6.489-2.218-13.991 0-7.908 2.42-16.221a58.3 58.3 0 0 1 7.459-15.411q4.838-7.096 12.095-11.355 7.258-4.461 16.733-4.461 8.265 0 13.305 3.853 5.04 3.852 7.257 10.341 2.42 6.287 2.42 13.788 0 7.908-2.42 16.222-2.418 8.313-7.459 15.613-4.838 7.097-12.095 11.558t-16.934 4.46q-8.064 0-13.104-3.852Zm133.877-110.306h62.13c8.396 0 15.833 2.234 22.111 6.846 6.094 4.342 10.706 10.04 13.811 17.015 3.198 6.884 4.801 14.151 4.801 21.762 0 7.619-1.606 15.125-4.765 22.491-3.145 7.332-7.501 14.006-13.045 20.011l-.017.018-.016.017a67.4 67.4 0 0 1-19.291 14.23c-7.418 3.657-15.351 5.483-23.748 5.483h-17.293l-9.273 44.203h-47.561zm21.408 103.817h20.563q11.693 0 21.974-5.069a63.3 63.3 0 0 0 18.143-13.383q7.863-8.516 12.298-18.857t4.435-20.885-4.435-20.074q-4.234-9.53-12.499-15.41-8.265-6.084-19.757-6.083h-58.865L340.133 316.62h39.311zm29.649-41.79.015-.019c.959-1.253 1.759-2.901 2.321-5.048l.025-.096.029-.093c.652-2.074 1.023-4.685 1.023-7.904 0-2.456-.319-3.883-.647-4.607-.44-.975-.761-1.204-.76-1.206l-.166-.095-.166-.119c-.311-.224-.51-.259-.68-.259h-13.461l-4.754 22.71h12.772c.292 0 .857-.096 1.756-.638.788-.476 1.696-1.289 2.679-2.606zm-22.19 7.32 6.451-30.821h16.733q1.613 0 3.024 1.014 1.41.811 2.419 3.041 1.008 2.231 1.008 6.286 0 5.272-1.21 9.125-1.008 3.852-3.024 6.488-1.814 2.433-3.83 3.65t-3.83 1.217z",clipRule:"evenodd",mask:"url(#path-6-outside-1_873_174)"})]}),nt.jsxs("defs",{children:[nt.jsxs("radialGradient",{id:"paint0_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"matrix(229.99965 647.20057 -371.3092 131.95444 -62.8 -86.4)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#6335EC"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsxs("radialGradient",{id:"paint1_radial_873_174",cx:"0",cy:"0",r:"1",gradientTransform:"rotate(-116.448 530.068 140.453)scale(1055.25 662.094)",gradientUnits:"userSpaceOnUse",children:[nt.jsx("stop",{stopColor:"#E6007A"}),nt.jsx("stop",{offset:"1",stopOpacity:"0"})]}),nt.jsx("clipPath",{id:"clip0_873_174",children:nt.jsx("rect",{width:"512",height:"512",fill:"#fff",rx:"256"})})]})]});rt.createRoot(document.getElementById("root")).render(nt.jsx(Ke.StrictMode,{children:nt.jsx(iz,{})})); From 52fdf6b5316ab35785081509f380c3bc8df9c91b Mon Sep 17 00:00:00 2001 From: Peter White Date: Wed, 18 Dec 2024 15:01:44 -0700 Subject: [PATCH 24/25] chore: improve uploading / calling contract message to wait for finalization --- crates/pop-cli/src/commands/call/contract.rs | 3 ++- crates/pop-cli/src/commands/up/contract.rs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/pop-cli/src/commands/call/contract.rs b/crates/pop-cli/src/commands/call/contract.rs index 45ba0a094..ab7a826fd 100644 --- a/crates/pop-cli/src/commands/call/contract.rs +++ b/crates/pop-cli/src/commands/call/contract.rs @@ -495,7 +495,8 @@ impl CallContractCommand { if let Some(payload) = maybe_payload { cli.success("Signed payload received.")?; let spinner = spinner(); - spinner.start("Calling the contract..."); + spinner + .start("Calling the contract and waiting for finalization, please be patient..."); let call_result = call_smart_contract_from_signed_payload(call_exec, payload, &self.url) diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index fed9c2068..1a76911fa 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -191,7 +191,9 @@ impl UpContractCommand { if let Some(payload) = maybe_payload { log::success("Signed payload received.")?; let spinner = spinner(); - spinner.start("Uploading contract..."); + spinner.start( + "Uploading the contract and waiting for finalization, please be patient...", + ); if self.upload_only { let upload_result = match upload_contract_signed(self.url.as_str(), payload) From ae7b3a2ea685ff2a37b08f3d26a41e016aa6cd43 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez <11448715+al3mart@users.noreply.github.com> Date: Wed, 18 Dec 2024 23:18:35 +0100 Subject: [PATCH 25/25] test: improve `crates/pop-cli/src/common/contracts.rs` coverage (#391) * test: improve common/contracts coverage * style: fmt * refactor: include Cli in methods * style: typo * fix: improve tests * style: better comment * refactor: include cache path as param in check_contracts_node_and_prompt * docs: improve function docs * remove typo in comment --- crates/pop-cli/src/commands/test/contract.rs | 8 ++- crates/pop-cli/src/commands/up/contract.rs | 26 ++++--- crates/pop-cli/src/common/contracts.rs | 74 +++++++++++++++++--- 3 files changed, 86 insertions(+), 22 deletions(-) diff --git a/crates/pop-cli/src/commands/test/contract.rs b/crates/pop-cli/src/commands/test/contract.rs index 190d9ac64..05e842eca 100644 --- a/crates/pop-cli/src/commands/test/contract.rs +++ b/crates/pop-cli/src/commands/test/contract.rs @@ -48,7 +48,13 @@ impl TestContractCommand { sleep(Duration::from_secs(3)).await; } - self.node = match check_contracts_node_and_prompt(self.skip_confirm).await { + self.node = match check_contracts_node_and_prompt( + &mut Cli, + &crate::cache()?, + self.skip_confirm, + ) + .await + { Ok(binary_path) => Some(binary_path), Err(_) => { warning("🚫 substrate-contracts-node is necessary to run e2e tests. Will try to run tests anyway...")?; diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index 1a76911fa..f46c0776f 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -139,7 +139,13 @@ impl UpContractCommand { let log = NamedTempFile::new()?; // uses the cache location - let binary_path = match check_contracts_node_and_prompt(self.skip_confirm).await { + let binary_path = match check_contracts_node_and_prompt( + &mut Cli, + &crate::cache()?, + self.skip_confirm, + ) + .await + { Ok(binary_path) => binary_path, Err(_) => { Cli.outro_cancel( @@ -181,7 +187,7 @@ impl UpContractCommand { Ok(data) => data, Err(e) => { error(format!("An error occurred getting the call data: {e}"))?; - terminate_node(process)?; + terminate_node(&mut Cli, process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -202,7 +208,7 @@ impl UpContractCommand { Err(e) => { spinner .error(format!("An error occurred uploading your contract: {e}")); - terminate_node(process)?; + terminate_node(&mut Cli, process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -225,7 +231,7 @@ impl UpContractCommand { spinner.error(format!( "An error occurred uploading your contract: {e}" )); - terminate_node(process)?; + terminate_node(&mut Cli, process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -245,11 +251,11 @@ impl UpContractCommand { } } else { Cli.outro_cancel("Signed payload doesn't exist.")?; - terminate_node(process)?; + terminate_node(&mut Cli, process)?; return Ok(()); } - terminate_node(process)?; + terminate_node(&mut Cli, process)?; Cli.outro(COMPLETE)?; return Ok(()); } @@ -257,7 +263,7 @@ impl UpContractCommand { // Check for upload only. if self.upload_only { let result = self.upload_contract().await; - terminate_node(process)?; + terminate_node(&mut Cli, process)?; match result { Ok(_) => { Cli.outro(COMPLETE)?; @@ -274,7 +280,7 @@ impl UpContractCommand { Ok(i) => i, Err(e) => { error(format!("An error occurred instantiating the contract: {e}"))?; - terminate_node(process)?; + terminate_node(&mut Cli, process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -292,7 +298,7 @@ impl UpContractCommand { }, Err(e) => { spinner.error(format!("{e}")); - terminate_node(process)?; + terminate_node(&mut Cli, process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -310,7 +316,7 @@ impl UpContractCommand { contract_info.code_hash, ); - terminate_node(process)?; + terminate_node(&mut Cli, process)?; Cli.outro(COMPLETE)?; } diff --git a/crates/pop-cli/src/common/contracts.rs b/crates/pop-cli/src/common/contracts.rs index c353d196e..a3b8f878c 100644 --- a/crates/pop-cli/src/common/contracts.rs +++ b/crates/pop-cli/src/common/contracts.rs @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 -use cliclack::{confirm, log::warning, spinner}; +use crate::cli::traits::*; +use cliclack::spinner; use pop_common::{manifest::from_path, sourcing::set_executable_permission}; use pop_contracts::contracts_node_generator; use std::{ @@ -13,14 +14,20 @@ use tempfile::NamedTempFile; /// prompts the user to update it if the existing binary is not the latest version. /// /// # Arguments +/// * `cli`: Command line interface. +/// * `cache_path`: The cache directory path. /// * `skip_confirm`: A boolean indicating whether to skip confirmation prompts. -pub async fn check_contracts_node_and_prompt(skip_confirm: bool) -> anyhow::Result { - let cache_path: PathBuf = crate::cache()?; - let mut binary = contracts_node_generator(cache_path, None).await?; +pub async fn check_contracts_node_and_prompt( + cli: &mut impl Cli, + cache_path: &Path, + skip_confirm: bool, +) -> anyhow::Result { + let mut binary = contracts_node_generator(PathBuf::from(cache_path), None).await?; let mut node_path = binary.path(); if !binary.exists() { - warning("⚠️ The substrate-contracts-node binary is not found.")?; - if confirm("📦 Would you like to source it automatically now?") + cli.warning("⚠️ The substrate-contracts-node binary is not found.")?; + if cli + .confirm("📦 Would you like to source it automatically now?") .initial_value(true) .interact()? { @@ -37,14 +44,14 @@ pub async fn check_contracts_node_and_prompt(skip_confirm: bool) -> anyhow::Resu } } if binary.stale() { - warning(format!( + cli.warning(format!( "ℹ️ There is a newer version of {} available:\n {} -> {}", binary.name(), binary.version().unwrap_or("None"), binary.latest().unwrap_or("None") ))?; let latest = if !skip_confirm { - confirm( + cli.confirm( "📦 Would you like to source it automatically now? It may take some time..." .to_string(), ) @@ -73,12 +80,19 @@ pub async fn check_contracts_node_and_prompt(skip_confirm: bool) -> anyhow::Resu } /// Handles the optional termination of a local running node. -pub fn terminate_node(process: Option<(Child, NamedTempFile)>) -> anyhow::Result<()> { +/// # Arguments +/// * `cli`: Command line interface. +/// * `process`: Tuple identifying the child process to terminate and its log file. +pub fn terminate_node( + cli: &mut impl Cli, + process: Option<(Child, NamedTempFile)>, +) -> anyhow::Result<()> { // Prompt to close any launched node let Some((process, log)) = process else { return Ok(()); }; - if confirm("Would you like to terminate the local node?") + if cli + .confirm("Would you like to terminate the local node?") .initial_value(true) .interact()? { @@ -89,7 +103,7 @@ pub fn terminate_node(process: Option<(Child, NamedTempFile)>) -> anyhow::Result .wait()?; } else { log.keep()?; - warning(format!("NOTE: The node is running in the background with process ID {}. Please terminate it manually when done.", process.id()))?; + cli.warning(format!("NOTE: The node is running in the background with process ID {}. Please terminate it manually when done.", process.id()))?; } Ok(()) @@ -115,8 +129,12 @@ pub fn has_contract_been_built(path: Option<&Path>) -> bool { #[cfg(test)] mod tests { use super::*; + use crate::cli::MockCli; use duct::cmd; + use pop_common::find_free_port; + use pop_contracts::{is_chain_alive, run_contracts_node}; use std::fs::{self, File}; + use url::Url; #[test] fn has_contract_been_built_works() -> anyhow::Result<()> { @@ -138,4 +156,38 @@ mod tests { assert!(has_contract_been_built(Some(&path.join(name)))); Ok(()) } + + #[tokio::test] + async fn check_contracts_node_and_prompt_works() -> anyhow::Result<()> { + let cache_path = tempfile::tempdir().expect("Could create temp dir"); + let mut cli = MockCli::new() + .expect_warning("⚠️ The substrate-contracts-node binary is not found.") + .expect_confirm("📦 Would you like to source it automatically now?", true) + .expect_warning("⚠️ The substrate-contracts-node binary is not found."); + + let node_path = check_contracts_node_and_prompt(&mut cli, cache_path.path(), false).await?; + // Binary path is at least equal to the cache path + "substrate-contracts-node". + assert!(node_path + .to_str() + .unwrap() + .starts_with(&cache_path.path().join("substrate-contracts-node").to_str().unwrap())); + cli.verify() + } + + #[tokio::test] + async fn node_is_terminated() -> anyhow::Result<()> { + let cache = tempfile::tempdir().expect("Could not create temp dir"); + let binary = contracts_node_generator(PathBuf::from(cache.path()), None).await?; + binary.source(false, &(), true).await?; + set_executable_permission(binary.path())?; + let port = find_free_port(None); + let process = run_contracts_node(binary.path(), None, port).await?; + let log = NamedTempFile::new()?; + // Terminate the process. + let mut cli = + MockCli::new().expect_confirm("Would you like to terminate the local node?", true); + assert!(terminate_node(&mut cli, Some((process, log))).is_ok()); + assert_eq!(is_chain_alive(Url::parse(&format!("ws://localhost:{}", port))?).await?, false); + cli.verify() + } }